• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error creating bean

 
iamiqbal.m Mohiuddin
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
iamiqbal.m Mohiuddin
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic