-
Feb 2nd, 2013, 11:58 PM
#1
Issue with WAR + EAR deployment
Hi,
This is the first time i am trying to use spring annotation and i have issues with the deployment of my EAR in WAS8.0. Please find the details
EAR
/lib/serviceProject.jar
webProject.war [ STRUTS 2.3.1.2 , SPRING 3.1.1, SPRING Security 3.1.0 J2EE5.0 Spec]
ejbProject.jar [ EJB 3.0 J2EE5.0 Spec]
Class loading policy
WAS Class Loader policy - APPLICATION
EAR loader - mode = PARENT_LAST
WAR loader - mode = PARENT_FIRST
web.xml
<listener>
<description>Spring Context Listener </description>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>
<context-param>
<param-name>locatorFactorySelector</param-name>
<param-value>classpath:/spring/beanRefContext.xml</param-value>
</context-param>
<context-param>
<param-name>parentContextKey</param-name>
<param-value>ear.context</param-value>
</context-param>
I have an empty applicationContext.xml under WEB-INF project. The definition of the ear.context bean is present in the serviceProject.jar and i am loading all the jdbc, security and the service bean definition from the service project
Throughout the project i am using annotations to inject the beans.
<context:annotation-config />
<context:component-scan base-package="xxx.xxxx.xxx" />
Service class annotation @Service and @Qualifier
DAO class annotation @Repository and @Qualifier
When the project is deployed, i am getting the following exception. Not sure where the problem is. Please help!!! I tried change the class loading policy but still same issue.
[2/3/13 0:23:44:679 EST] 00000041 SystemOut O 2013-02-03 00:23:44,677 [SoapConnectorThreadPool : 0] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.access.Bootstrap Exception: Unable to initialize group definition. Group resource name [classpath:/spring/beanRefContext.xml], factory key [ear.context]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'ear.context' defined in class path resource [spring/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlAp plicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myServiceDAO' defined in URL [wsjar:file:/C:/WAS80/was_profile/installedApps/A1234Node02Cell/myEAR.ear/lib/serviceProject.jar!/xxx/xxxx/xxx/myServiceDAO.class]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Wrong type at constant pool index
at org.springframework.beans.factory.access.Singleton BeanFactoryLocator.useBeanFactory(SingletonBeanFac toryLocator.java:386)
at org.springframework.web.context.ContextLoader.load ParentContext(ContextLoader.java:536)
....
at com.ibm.ws.http.HttpConnection.run(HttpConnection. java:522)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1648)
Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'ear.context' defined in class path resource [spring/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlAp plicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myServiceDAO' defined in URL [wsjar:file:/C:/WAS80/was_profile/installedApps/A1234Node02Cell/myEAR.ear/lib/serviceProject.jar!/xxx/xxxx/xxx/myServiceDAO.class]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Wrong type at constant pool index
at org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:288)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:1035)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:939)
....
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:464)
at org.springframework.context.access.ContextSingleto nBeanFactoryLocator.initializeDefinition(ContextSi ngletonBeanFactoryLocator.java:143)
at org.springframework.beans.factory.access.Singleton BeanFactoryLocator.useBeanFactory(SingletonBeanFac toryLocator.java:381)
... 75 more
Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlAp plicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myServiceDAO' defined in URL [wsjar:file:/C:/WAS80/was_profile/installedApps/A1234Node02Cell/myEAR.ear/lib/serviceProject.jar!/xxx/xxxx/xxx/myServiceDAO.class]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Wrong type at constant pool index
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:162)
at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:110)
at org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:280)
... 88 more
Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myServiceDAO' defined in URL [wsjar:file:/C:/WAS80/was_profile/installedApps/A1234Node02Cell/myEAR.ear/lib/serviceProject.jar!/xxx/xxxx/xxx/myServiceDAO.class]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Wrong type at constant pool index
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
....
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:56)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:527)
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:147)
... 90 more
Caused by: java.lang.IllegalArgumentException: Wrong type at constant pool index
at com.ibm.oti.reflect.AnnotationParser.getUTF8At(Nat ive Method)
at com.ibm.oti.reflect.AnnotationParser.parseAnnotati on(AnnotationParser.java:122)
at com.ibm.oti.reflect.AnnotationParser.parseAnnotati ons(AnnotationParser.java:57)
at java.lang.Class.getDeclaredAnnotations(Class.java: 1652)
at java.lang.Class.getAnnotations(Class.java:1609)
at java.lang.Class.getAnnotation(Class.java:1589)
at org.springframework.core.annotation.AnnotationUtil s.findAnnotation(AnnotationUtils.java:200)
at org.springframework.security.access.prepost.PrePos tAnnotationSecurityMetadataSource.getAttributes(Pr ePostAnnotationSecurityMetadataSource.java:45)
at org.springframework.security.access.method.Delegat ingMethodSecurityMetadataSource.getAttributes(Dele gatingMethodSecurityMetadataSource.java:52)
at org.springframework.security.access.intercept.aopa lliance.MethodSecurityMetadataSourceAdvisor$Method SecurityMetadataSourcePointcut.matches(MethodSecur ityMetadataSourceAdvisor.java:117)
at org.springframework.aop.support.AopUtils.canApply( AopUtils.java:226)
at org.springframework.aop.support.AopUtils.canApply( AopUtils.java:263)
at org.springframework.aop.support.AopUtils.findAdvis orsThatCanApply(AopUtils.java:295)
at org.springframework.aop.framework.autoproxy.Abstra ctAdvisorAutoProxyCreator.findAdvisorsThatCanApply (AbstractAdvisorAutoProxyCreator.java:117)
at org.springframework.aop.framework.autoproxy.Abstra ctAdvisorAutoProxyCreator.findEligibleAdvisors(Abs tractAdvisorAutoProxyCreator.java:87)
at org.springframework.aop.framework.autoproxy.Abstra ctAdvisorAutoProxyCreator.getAdvicesAndAdvisorsFor Bean(AbstractAdvisorAutoProxyCreator.java:68)
at org.springframework.aop.framework.autoproxy.Abstra ctAutoProxyCreator.wrapIfNecessary(AbstractAutoPro xyCreator.java:359)
at org.springframework.aop.framework.autoproxy.Abstra ctAutoProxyCreator.postProcessAfterInitialization( AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyBeanPostProcessors AfterInitialization(AbstractAutowireCapableBeanFac tory.java:407)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1461)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
Thanks in Advance
Aravind
Last edited by aravicamp; Feb 3rd, 2013 at 12:09 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules