Results 1 to 17 of 17
- 01-10-2012, 11:59 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 14
- Rep Power
- 0
What is this XmlBeanFactory depricated in java ?
Hello i am new to spring framework .. in the code
XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(
"application.xml"));*/
i am getting an error XmlBeanFactory depricated, so when this is depricated, by which we can load spring config ?
i tried ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml"); but still i am getting some exceptions and errors
So can anyone please help me how to overcome this issue :)
Tqqq
- 01-10-2012, 12:28 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: What is this XmlBeanFactory depricated in java ?
Look at the API.
Generally when something is deprecated the API will explain what you should be doing.
- 01-10-2012, 12:34 PM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: What is this XmlBeanFactory depricated in java ?
And the deprecation cannot be an error anyway. Your error must be related with something else you have done in your code. Deprecated stuff are still able to use. And also as Tolls said, Java API explains the available alternatives for those.
If you could post the error we can have a look at it.
- 01-11-2012, 01:37 PM #4
Member
- Join Date
- Jan 2012
- Posts
- 14
- Rep Power
- 0
Re: What is this XmlBeanFactory depricated in java ?
Tqqq,
using ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"META-INF/config.xml");
Splittermanager splittermanager = (Splittermanager) applicationContext
.getBean("splitter1");
the issue got resolved .. But while running the program i am getting an exception
Exception in thread "main" java.util.IllegalFormatConversionException: d != java.lang.String
at java.util.Formatter$FormatSpecifier.failConversion (Formatter.java:4045)
can anyone please tell me what this exception means ?
- 01-11-2012, 02:00 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: What is this XmlBeanFactory depricated in java ?
Where is that exception coming from in your code?
WHat line?
- 01-11-2012, 02:09 PM #6
Member
- Join Date
- Jan 2012
- Posts
- 14
- Rep Power
- 0
Re: What is this XmlBeanFactory depricated in java ?
Hello Tolls, i am sorry but that isue got resolved now, i found the place of exception n its resolved
Thank you very much
- 01-12-2012, 03:35 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: What is this XmlBeanFactory depricated in java ?
Java API explains all the exceptions as well. So keep the API as your reference all the time with you.
IllegalFormatConversionException (Java 2 Platform SE 5.0)
- 01-12-2012, 03:36 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: What is this XmlBeanFactory depricated in java ?
- 01-12-2012, 08:58 AM #9
Member
- Join Date
- Jan 2012
- Posts
- 14
- Rep Power
- 0
Re: What is this XmlBeanFactory depricated in java ?
@Eranga Tqqqqqqq
Sure, in my code i have used constructor injection with different data types, string n integer combination, then without using the getter methods i used only one method which has collection of all information
there i found this IllegalFormatConversionException, bcoz of different data types
- 01-12-2012, 09:10 AM #10
Member
- Join Date
- Jan 2012
- Posts
- 14
- Rep Power
- 0
Re: What is this XmlBeanFactory depricated in java ?
I have another query - My TL was saying that if your working on Maven project you dnt have to download and build log4j , so can u please help me how add n how to find the log files of my maven project ?
Thank you :)
- 01-12-2012, 11:06 AM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: What is this XmlBeanFactory depricated in java ?
There'll be a log4j.properties somewhere in your project defining where your log files go.
- 01-12-2012, 11:20 AM #12
Member
- Join Date
- Jan 2012
- Posts
- 14
- Rep Power
- 0
Re: What is this XmlBeanFactory depricated in java ?
I'm sorry, may be my q'n was nt so clear, let me rephrase .. i have a maven project, i want to have log file of that project, without adding externally log4j :)
i hope i am clear now :P
Thanks
- 01-12-2012, 12:33 PM #13
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: What is this XmlBeanFactory depricated in java ?
Ah, the jar.
Then you need to add log4j to your pom.
If you have another project that already has it then do what I do and copy the dependency over, changing the version if need be.
There are plugins for IDEs that'll search a repository for you and add it into the pom, but I tend to stick to the old-fashioned way...:)
- 01-13-2012, 06:53 AM #14
Member
- Join Date
- Jan 2012
- Posts
- 14
- Rep Power
- 0
Re: What is this XmlBeanFactory depricated in java ?
@Toll, i am afraid, i dont have any previous project, i am dng this first tym,
can you please tell me hwo to add this log4j in the pom and what all the dependancy code necessary to change ?
- 01-13-2012, 10:12 AM #15
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: What is this XmlBeanFactory depricated in java ?
Add it to the pom, as I said.
I'm sure there's plenty of Maven documentation you can look at to see the structure.
- 01-17-2012, 08:44 AM #16
Member
- Join Date
- Jan 2012
- Posts
- 14
- Rep Power
- 0
Re: What is this XmlBeanFactory depricated in java ?
Thank you @Toll
i have one more query,
I have a spring project, in which i am using .properties file to send the information to configuration xml file
<!-- Externalizing the configuration -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
<property name="location">
<value>connection.properties</value>
</property>
</bean>
now i have a class which does nt have any properties, which has only method which work on the properties of .properties file (information), so i have to add this class in my xml file
<bean id="works" class="com.manger.merit">
</bean></beans> -- is it enough to add this class in configuration xml or do i have to add anything else (Normally ve added properties name n value, since i dont have wht i have to do)
please help me
Thanks
- 01-17-2012, 10:17 AM #17
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks