• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Error creating bean

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.



 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic