permaculture playing cards*
The moose likes Spring and the fly likes Not Intializing Spring beans on Server start-up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Not Intializing Spring beans on Server start-up" Watch "Not Intializing Spring beans on Server start-up" New topic
Author

Not Intializing Spring beans on Server start-up

pnknaga Kumar
Greenhorn

Joined: Apr 11, 2012
Posts: 1
Hi ,

We are using MyEclipse Blue 10.1 IDE and Websphere 7 as a server to deploy our application. Our application contains Spring & Hibernate. I have configured the server into MyEclipse and running in Debug Mode. We are getting below ecxeptions while server start-up. It seems that its not able to initialize Spring beans.

But when I run the server in Running Mode application is working fine.

Exception:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rxCaregiverService' defined in ServletContext resource [/WEB-INF/context/service-provider-beans.xml]: Cannot resolve reference to bean 'rxMemberService' while setting bean property 'claimsMemberService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rxMemberService' defined in ServletContext resource [/WEB-INF/context/service-provider-beans.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.uhg.rxsol.services.rxclaim.service.RxMemberServiceImpl]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(AccessController.java:224)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 40 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rxMemberService' defined in ServletContext resource [/WEB-INF/context/service-provider-beans.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.uhg.rxsol.services.rxclaim.service.RxMemberServiceImpl]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(AccessController.java:224)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 53 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.uhg.rxsol.services.rxclaim.service.RxMemberServiceImpl]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 64 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:167)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:167)
at org.springframework.ws.client.core.support.WebServiceGatewaySupport.<init>(WebServiceGatewaySupport.java:65)
at com.uhg.rxsol.services.rxclaim.service.webservice.common.RxWebServiceClient.<init>(RxWebServiceClient.java:31)
at com.uhg.rxsol.services.rxclaim.service.webservice.common.RxSXCWebServiceClient.<init>(RxSXCWebServiceClient.java:31)
at com.uhg.rxsol.services.rxclaim.service.RxMemberServiceImpl.<init>(RxMemberServiceImpl.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:45)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:515)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
... 66 more
Caused by: java.lang.ClassCastException: com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl incompatible with javax.xml.transform.TransformerFactory
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at org.springframework.xml.transform.TransformerObjectSupport.<clinit>(TransformerObjectSupport.java:43)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
... 77 more
-------------------------------------------------------------------------------------
Is websphere uses different Jars in Debug mode ?

Can anyone please look into this issue and help me.

Thanks In Advance,
Nagendra
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Caused by: java.lang.ClassCastException: com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl incompatible with javax.xml.transform.TransformerFactory

Thats your root problem.

Bummer you ahve to use WebSphere, but that is what IBM does, it couples to all IBM and IBM doesn't ever want to play nice with anyone else. ;)

So it looks like they have a TransformerFactoryImpl that is implementing a TransformerFactory interface from a different version.

I mean a TransformerFactoryImpl looks like it should be implementing the TransformerFactory interface. And it probably does. But in your classpath you might have version xxx.x of the TransformerFactory interface, but ibm's Impl is implementing version yyy.y of the Transformer interface.

I can't help much more after that. Sorry, I avoid IBM especially WebSphere. I run far into the hills. ;)

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Ditto to what Mark said unfortunately I am unable to avoid IBM 100% of the time

Anyway you can try to change the classloader configuration in websphere to Parent last, otherwise you will start having to get a bit more creative if that does not work.


[How To Ask Questions][Read before you PM me]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Not Intializing Spring beans on Server start-up