aspose file tools*
The moose likes Spring and the fly likes Error creating bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Error creating bean" Watch "Error creating bean" New topic
Author

Error creating bean

iamiqbal.m Mohiuddin
Greenhorn

Joined: May 11, 2006
Posts: 12
Hello All:

I am running into strange problem.






I am getting the above exception. I see i am able to get batchInitializer bean but not the sourceBean.
Any help is highly appreciated.



Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Could not instantiate class [com.mst.batch.jdbc.MSTDataExtractThread]; constructor threw exception; nested exception is java.lang.NullPointerException: null

That is your error.

The funny thing about Spring exceptions is that unlike other exception reading. It is best to start at the bottom and get the root exception, and that will tell you what is wrong

So in the constructor of MSTDataExtractThread class you are getting a NullPointerException.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
iamiqbal.m Mohiuddin
Greenhorn

Joined: May 11, 2006
Posts: 12
Thanks for the reply.

I am not sure why its an issue in the constructor of MSTDatExtrachThread class.

If i change tthe spring beans configuration by removing sourceBean as reference proprty and put it as an isolated bean and get that bean through Bean factory
it works without any error.

<bean id="batchProcessor" class="com.mst.batch.BatchProcessor" singleton="false">
<property name="batchInitializer"><ref bean="batchInitializer" /></property>
<property name="sourceBean"><ref bean="sourceBean" /></property> </bean>

and in code:

This works but not the original one which i have posted.

Appreciate if anyone can put some light on this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error creating bean