We are trying to substitute commons-logging + log4j by jcl-over-slf4j and logback (OK, at first we will try jcl-over-slf4j and log4j). Our application runs under WAS 8.0. Once the commons-logging jar has been erased and substituted by jcl-over-slf4j, slf4j and slf4j-log4j, we get this error message:
[21/11/14 16:12:08:430 CET] 0000006a webapp E com.ibm.ws.webcontainer.webapp.WebApp commonInitializationFinally SRVE0266E: Se ha producido un error al inicializar los servlets: {0}
javax.servlet.ServletException: SRVE0207E: No se ha detectado la excepción de inicialización creada por el servlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:404)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1366)
at com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:615)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:584)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:421)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:422)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:714)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1164)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1369)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:967)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:770)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1361)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2162)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:446)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:389)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:117)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:664)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5468)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5594)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:678)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:622)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1251)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:57)
at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260)
at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1141)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1135)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:988)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:835)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:771)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:247)
at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:360)
at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:602)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1819)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:558)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:608)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:985)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1074)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tareaIntegrationLectSolicitNuevasFacturas': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private es.nexus.facturaelectronica.service.interfaces.integrations.IIntegracionPersistirNuevasFacturas es.nexus.facturaelectronica.service.impl.integrations.IntegrationLectSolicitNuevasFacturas.integracionPersistirNuevasFacturas; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tareaIntegrationPersistirNuevasFacturas' defined in ServletContext resource [/WEB-INF/classes/bean-application-config.xml]: Initialization of bean failed; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:243)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)
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(Native Method)
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:221)
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.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1686)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
... 53 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private es.nexus.facturaelectronica.service.interfaces.integrations.IIntegracionPersistirNuevasFacturas es.nexus.facturaelectronica.service.impl.integrations.IntegrationLectSolicitNuevasFacturas.integracionPersistirNuevasFacturas; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tareaIntegrationPersistirNuevasFacturas' defined in ServletContext resource [/WEB-INF/classes/bean-application-config.xml]: Initialization of bean failed; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:435)
at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:105)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:240)
... 71 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tareaIntegrationPersistirNuevasFacturas' defined in ServletContext resource [/WEB-INF/classes/bean-application-config.xml]: Initialization of bean failed; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
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:221)
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.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:671)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:412)
... 73 more
Caused by: java.lang.ExceptionInInitializerError
at org.apache.axis.description.TypeDesc.<clinit>(TypeDesc.java:61)
at es.gob.face.webservice.SRCFFactura.<clinit>(SRCFFactura.java:196)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:171)
at com.sun.proxy.$Proxy450.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.reflect.Proxy.newInstance(Proxy.java:715)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:706)
at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:117)
at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:488)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:363)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:324)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1343)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
... 84 more
Caused by: org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.LogFactoryImpl does not implement org.apache.commons.logging.LogFactory
at org.apache.commons.discovery.tools.ClassUtils.verifyAncestory(ClassUtils.java:180)
at org.apache.commons.discovery.tools.SPInterface.verifyAncestory(SPInterface.java:201)
at org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:195)
at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378)
at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
... 103 more
It all end with the org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.LogFactoryImpl does not implement org.apache.commons.logging.LogFactory
error message.
Is there some kind of incompatibility between commons-logging and its jcl-over-slf4j substitute?
We've checked some other projects, and it seems a common pattern: axis 1.4 + jcl-over-slf4j = exception.
[Note 1]
Classloader policy: tests.
In order to get commons-logging working with log4j at application level, we have assigned those libraries to the application (first we declare them both as "shared libraries", and we do the same with commons-logging.properties and log4j.properties files, then We assign them all to the application, and then we set the application's classloader policy to "Parent Last". This way, we force the application to load and use it's own copy of commons-logging, with its own configuration file, thus overcoming the commons-logging.properties included within WAS. This said, we have tried some "stupid" configurations, like make all the application use a single application classloader, or setting the web modules classloader policy to Parent Last. Such changes made no difference, as expected.
This far, we have found some nasty scenarios:
Axis + WAS logging facility (write all to SystemOut): OK, it works,
but we do not want everything written down to SystemOut!
Axis + commons-logging + log4j + their configuration files assigned
to the application at application classloader level,policy=Parent
Last. Some applications work, some others don't (theyshow messages
like the one quoted before).
jcl-over-slf4j + log4j + configuration file for log4j: Same result
as in point 2 of this list.
The last application we are dealing with right now, the application that fails with the excetions in the code block quoted previously: we have discovered that it only fails when we use configuration 3 (in this list), but it does not fail with configuration 2, which is very surprising and unexpected: in previous test with other applications, if the configuration fails with configuration 2, then it also fails with configuration 3.
[End of Note 1]
Any help will be welcome.
We have exactly the same Setup here:
WAS 8.0.0.9
log4j for logging
EAR containing jcl-over-slf4j, slf4j and slf4j-log4j
Axis 1.4
Classloader policy Parent Last and WAR policy Single class loader for application
As soon as axis-classes are loaded, some static-initializer-block gets executed and we get this Exception:
DiscoveryException: Class org.apache.commons.logging.impl.LogFactoryImpl does not implement org.apache.commons.logging.LogFactory
It seems like org.apache.commons.logging.LogFactory is loaded from jcl-over-slf4j and org.apache.commons.logging.impl.LogFactoryImpl is provided by WebSphere.
The only way it works for us, is to remove jcl-over-slf4j.jar from our EAR. Of course this way we might lose some Logs or find them in WebSphere SystemOut.log but at least 'it works'...
We encountered the same issues. Our solution is to tell commons-logging to use the slf4j factory implementation in our classloading context (in our case an ejb.jar).
To achieve this we simply added a commons-logging.properties file to our ejb.jar root folder with following content:
priority=1
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.SLF4JLogFactory
This resolved the issue in our application.
Maybe this can help you. I was with a similar problem, and discovered a solution in SLF4J documentation.
http://slf4j.org/faq.html#excludingJCL
alternative 2) provided scope Commons-logging can be rather simply and
conveniently excluded as a dependency by declaring it in the provided
scope within the pom.xml file of your project. The actual
commons-logging classes would be provided by jcl-over-slf4j. This
translates into the following pom file snippet:
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.21</version>
</dependency>
The first dependency declaration essentially states that
commons-logging will be "somehow" provided by your environment. The
second declaration includes jcl-over-slf4j into your project. As
jcl-over-slf4j is a perfect binary-compatible replacement for
commons-logging, the first assertion becomes true. Unfortunately,
while declaring commons-logging in the provided scope gets the job
done, your IDE, e.g. Eclipse, will still place commons-logging.jar on
your project's class path as seen by your IDE. You would need to make
sure that jcl-over-slf4j.jar is visible before commons-logging.jar by
your IDE.
SLF4J documentation gives more alternatives, this worked for me.
Related
I'm getting following exception in a project using OpenFeign. Please suggest how to resolve this issue.
Exception is given below:
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.seamless.ers.links.kyc.client.CustomerDetailsClient': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.openfeign.FeignClientFactoryBean] from ClassLoader [sun.misc.Launcher$AppClassLoader#18b4aac2]
at
...
Caused by: java.lang.ClassNotFoundException: feign.Feign$Builder
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_301]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_301]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_301]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_301]
... 25 common frames omitted
Below are the dependencies added:
spring-cloud-starter
spring-cloud-openfeign-core
spring-boot-starter-test
spring-boot-starter-web
Most famous class loading exception and indicates that compiler have difficulties to detect proper dependent class i.e provided the dependency at runtime, following are most healer to issue
Check the version and probably duplication of your maven artifact for spring-cloud-starter - spring-cloud-openfeign-core if you are not using spring boot parent and if the artifacts imported properly from firtplace,
Check the scope of the dependencies, for the current case in hand the will be provided to compile <scope>provided</scope>
Exclude the duplicate dependencies that they provide spring feign as transparent dependency .
I am running my application in Apache Karaf and we are using Apache CXF 2.7.6, JAXB api version 2.2 and JDK is 1.7.0_80. And while installing our application in karaf, we get the following error:
Exception in thread "SpringOsgiExtenderThread-71" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myBean': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:539)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1608)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1549)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
... 14 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:338)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:446)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:548)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:204)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)
... 23 more
Caused by: javax.xml.bind.JAXBException
- with linked exception:
[javax.xml.bind.JAXBException: property "com.sun.xml.bind.defaultNamespaceRemap" is not supported]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:237)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:396)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:329)
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:327)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:327)
at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:228)
at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:479)
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:336)
... 33 more
Caused by: javax.xml.bind.JAXBException: property "com.sun.xml.bind.defaultNamespaceRemap" is not supported
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:222)
... 42 more
could you please let me know what could be done here to solve this issue? Any help in this regard is very much appreciated.
enter image description here
Try com.sun.xml.internal.bind.defaultNamespaceRemap instead.
You're probably using JAXB RI packaged with JDK, not standalone. That JAXB package gets "repackaged" from com.sun.xml.bind to com.sun.xml.internal.bind. Probably they also change the constant during repackaging. How cool.
Provided the centos user all the permissions for karaf directory and modified the .bash_profile file to contain JAVA_HOME and added karaf and maven to the PATH. Also, modified the run function in the karaf-client file located in karaf bin directory to contain the following:
JAVA_ENDORSED_DIRS="${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed"
exec "$JAVA" $JAVA_OPTS -Djava.endorsed.dirs="${JAVA_ENDORSED_DIRS}" -Djava.ext.dirs="${JAVA_EXT_DIRS}" -Dkaraf.instances="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.io.tmpdir="$KARAF_DATA/tmp" -Djava.util.logging.config.file="$KARAF_BASE/etc/java.util.logging.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" org.apache.karaf.client.Main "$#"
Important reference link for lib/endorsed approach:
https://jaxb.java.net/guide/Migrating_JAXB_2_0_applications_to_JavaSE_6.html
How to specify a particular JAXB implementation?
I have a batch application using Spring Batch, and I'm using Spring Boot as well. This application needs to do Remote EJB lookups to load some informations from the application server.
Until now we were using JBoss EAP 6.1. My pom.xml contains a profile specific for JBoss and I was using the following dependency:
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ejb-client-bom</artifactId>
<version>7.2.0.Final</version>
<type>pom</type>
</dependency>
Now we need to migrate this application to WebSphere 8.5.5. I've created a new maven profile in my pom.xml with the following dependencies for Remote EJB Lookup on WebSphere.
<dependency>
<groupId>com.ibm.ws</groupId>
<artifactId>com.ibm.ws.ejb.thinclient</artifactId>
<version>8.5.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.ibm.ws</groupId>
<artifactId>com.ibm.ws.orb</artifactId>
<version>8.5.0</version>
<type>pom</type>
</dependency>
Of course I've already installed this jars in my maven local repository.
Trying to execute the batch again, after configuring all the JNDI properties, Initial Context factory pointing to "com.ibm.websphere.naming.WsnInitialContextFactory" and Provider URL to "corbaloc:iiop:localhost:2817", I got the following exception:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [br.com.cpqd.components.security.api.user.SecurityUser]: Factory method 'securityUserEjb' threw exception; nested exception is javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 27 common frames omitted
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.init(InitialContext.java:242)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
at org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:136)
at org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:103)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:106)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:231)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:217)
at br.com.batch.common.BatchCommonConfig.securityUserEjb(BatchCommonConfig.java:101)
at br.com.batch.common.BatchCommonConfig$$EnhancerBySpringCGLIB$$e2167a67.CGLIB$securityUserEjb$4(<generated>)
at br.com.cpqd.saf.events.batch.common.BatchCommonConfig$$EnhancerBySpringCGLIB$$e2167a67$$FastClassBySpringCGLIB$$30b25502.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at br.com.batch.common.BatchCommonConfig$$EnhancerBySpringCGLIB$$e2167a67.securityUserEjb(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 28 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
... 51 common frames omitted
Ok, the class has not being found. Trying to figure out the problem, I've changed the dependency type of WebSphere libs from "pom" to "jar".
Now, I'm getting the following exception:
(Sorry about this Portuguese text, but the error code may help)
**NMSV0307E**: Um nome de URL java: foi utilizado, mas a Nomenclatura não foi configurada para manipular nomes de URL java:. A causa provável é um erro do usuário ao tentar especificar um nome de URL java: em um cliente não J2EE ou no ambiente do servidor. Emitindo ConfigurationException.
2016-06-06 14:43:18.952 WARN 18856 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is javax.validation.ValidationException: Could not create Configuration.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:199)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at br.com.cpqd.saf.events.batch.BatchProcessingBootstrap.main(BatchProcessingBootstrap.java:62)
Caused by: javax.validation.ValidationException: Could not create Configuration.
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:175)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$Jsr303ValidatorFactory.run(ConfigurationPropertiesBindingPostProcessor.java:381)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.afterPropertiesSet(ConfigurationPropertiesBindingPostProcessor.java:174)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 12 common frames omitted
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:173)
... 17 common frames omitted
Googling the error message and reading lots of sites, I think that for some reason Spring Boot is not allowing the embeddable EJB container provided by the com.ibm.ws.ejb.thinclient jar to start, but I'm not sure.
Does anyone already tried to do that?
The IndexOutOfBoundsException is the (poor) exception thrown by javax.validation.Validation when the API is available on the classpath (likely com.ibm.ws.ejb.thinclient JAR) but an implementation provider is not. According to the Spring documentation, the ConfigurationPropertiesBindingPostProcessor class attempts to use the javax.validation API when it is available on the classpath.
I don't know Spring Boot well enough to know if there's a way to disable your behavior, so my best suggestion would to also include a javax.validation implementation on your classpath. For example, you could also include the com.ibm.ws.jpa.thinclient JAR.
I am implementing Spring MVC Spring Security MySQL Integration
My Stack Trace will look like this.
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/web/context/request/async/CallableProcessingInterceptor
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/request/async/CallableProcessingInterceptor
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getDeclaredConstructors(Unknown Source)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:228)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:884)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:355)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:586)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:888)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:355)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
... 20 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.request.async.CallableProcessingInterceptor
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
... 49 more
With reference to Spring Docs
http://docs.spring.io/spring-framework/docs/3.2.0.RC2/api/org/springframework/web/context/request/async/CallableProcessingInterceptor.html
Intercepts concurrent request handling, where the concurrent result is obtained by executing a Callable on behalf of the application with an AsyncTaskExecutor.
A CallableProcessingInterceptor is invoked before and after the invocation of the Callable task in the asynchronous thread, as well as on timeout from a container thread, or after completing for any reason including a timeout or network error.
As a general rule exceptions raised by interceptor methods will cause async processing to resume by dispatching back to the container and using the Exception instance as the concurrent result. Such exceptions will then be processed through the HandlerExceptionResolver mechanism.
The afterTimeout method can select a value to be used to resume processing.
Can anyone please explain and help me out of this.
Trace clearly shows, your application is not able to find CallableProcessingInterceptor class. Edit your pom with below dependency and check if it is working:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
I have just verified. On a Spring 3.2.8 release, org/springframework/web/context/request/async/CallableProcessingInterceptor lies in spring-web-3.2.8.jar.
The error is :
...exception is java.lang.NoClassDefFoundError: org/springframework/web/context/request/async/CallableProcessingInterceptor
That proves that at run time spring-web.jar is not in classpath, or is not same version as other spring jars. A common cause for that when not using maven, is to declare the jars to the compiler or IDE, not include them in WEB-INF/lib in the war, and not to have them in Tomcat's classpath.
As you do not use maven, it looks like you are in a build and dependencies hell (name is mine). Either tomcat finds other jars (typically other versions of spring) in its classpath, or your build does not include (for any reason) spring-web-version.jar for correct version. This may be hard to fix, but you can try :
control is nothing looks wrong in your build process
control if the deployed application holds proper jars with proper version
strip down the application to remove parts until it works and re-add them one at a time in order to identify exactly what triggers the error
Or if you can do it, convert your application to use maven, and it will deal almost automatically with all those dependencies for you, warning you of incompatible versions.
But I'm afraid that I cannot do more for you here ...
This exception is caused due to Spring dependent jars missing or having conflict between versions of jars
Check whether you have spring-web-X.X.X (X.X.X is the required version depending on project) jar available on your build path/Maven dependency.
If there is any duplicate jar you need to remove it.
I wanted to use cron trigger for my app which has spring2.5
I followed http://www.a2ztechguide.com/2011/11/spring-quartz-scheduler-integration.html this link in creating a simple pgm.. But while trying to dpeloy it to my server(weblogic 10g)...Im getting the below exception....
<Aug 8, 2013 6:17:31 PM IST> <Warning> <HTTP> <BEA-101162> <User defined listener
org.springframework.web.context.ContextLoaderListener failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'printCurrentTimeJobDetail' defined in URL [file:/C:/bea/user_projects
/workspaces/One_CMS_Offline/Services/build/onecms-service.xml]: Initialization of
bean failed;
nested exception is java.lang.NoClassDefFoundError: org/quartz/JobDetail
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'printCurrentTimeJobDetail' defined in URL [file:/C:/bea/user_projects/workspaces/One_CMS_Offline/Services/build/onecms-service.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/quartz/JobDetail
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
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)
Truncated. see log file for complete stacktrace
java.lang.NoClassDefFoundError: org/quartz/JobDetail
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.beans.Introspector$1.run(Introspector.java:1272)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
Truncated. see log file for complete stacktrace
Can someone pls tell mw where Im going wrong? I included these 2 jars: spring-context-support-2.5.6.jar and com.springsource.org.quartz-1.6.2.jar
Can someone pls suggest some solution here..
I am not sure whether you have included the quartz related jars also .
Add the latest quartz jar to your server/lib from here .
Thanks
you have to include quartz related jar in your classpath, which version of quartz are you using?
according to the link you posted, you should add quartz dependency to your pom.xml
<dependency>
<groupId>quartz</groupId>
<artifactId>quartz</artifactId>
<version>1.5.1</version>
</dependency>
if you are not using maven, include quartz.jar in your classpath as you do with spring-context-support-2.5.6.jar
--edit--
seems odd, you don't happen to have multiple copies of the quartz in WEB-INF/lib? what is the com.springsource.org.quartz-1.6.2.jar for? try exclude it from WEB-INF/lib