java.lang.ClassNotFoundException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The following error sometimes occurs when starting FUSE ESB. {code} karaf@root> Exception in thread "SpringOsgiExtenderThread-18" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=155|bnd.sym=servicemix-cxf-se]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.RuntimeException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory] 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(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: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.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) 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:136) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.RuntimeException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory] 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) ... 18 more Caused by: java.lang.RuntimeException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory] at org.apache.cxf.wsdl.JAXBExtensionHelper.getJAXBContext(JAXBExtensionHelper.java:185) at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:168) at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:88) at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:239) at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:219) at org.apache.cxf.wsdl11.WSDLManagerImpl.<init>(WSDLManagerImpl.java:109) 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 org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) ... 20 more Caused by: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory] at javax.xml.bind.ContextFinder.loadSpi(ContextFinder.java:174) at javax.xml.bind.ContextFinder.find(ContextFinder.java:60) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:77) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:73) at org.apache.cxf.wsdl.JAXBExtensionHelper.createJAXBContext(JAXBExtensionHelper.java:196) at org.apache.cxf.wsdl.JAXBExtensionHelper.getJAXBContext(JAXBExtensionHelper.java:183) ... 30 more Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at javax.xml.bind.ContextFinder.loadSpi(ContextFinder.java:169) ... 35 more {code} It cannot be reproduced reliably. However, there was one ambiguity in the environment where it occured, namely: the java version used by Maven differs from that used by ServiceMix. {code} >set JAVA_HOME JAVA_HOME=C:\Apps\Java\JDK-1.6.0_14 >set PATH PATH=C:\WINDOWS\system32;C:\Apps\Java\JDK-1.6.0_14\bin;C:\apps\tools\apache-maven-2.0.9\bin >javac -version javac 1.6.0_14 >java -version java version "1.6.0_16" Java(TM) SE Runtime Environment (build 1.6.0_16-b01) Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing) >mvn --version Maven version: 2.0.9 Java version: 1.6.0_14 OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows" {code} In the above environment, "C:\WINDOWS\system32" comes first in the system path, and contains java.exe from JRE 1.6.0_16. JAVA_HOME is then set to point at the JDK, and Maven then picks up this setting and uses java.exe from JDK 1.6.0_14. The difference between java versions is very small, so it may not be causing the problem; but the problem was *never* reproduced in an environment where %JAVA_HOME%\bin was at the start of the system path. The steps taken to reproduce the problem were as follows: {code} > rd /s /q data > .\bin\servicemix.bat (then immediately after the shell starts...) karaf@root> os [tab] karaf@root> osgi:li [tab] karaf@root> osgi:list (then immediately after the bundles are listed...) karaf@root> [up arrow] karaf@root> osgi:list (repeat the above step every 1-2 seconds) {code} So the conditions for reproducing this error are... - set the environment as described above - delete the data directory before starting ServiceMix - invoke the shell while it is still loading its boot features Unfortunately, the error does not occur reliably; maybe once in every 3-5 tests.
    via by Paul Lowry,
  • I've seen this twice when starting from a clean install of the smx4 4.2 features snapshot: karaf@root> Exception in thread "SpringOsgiExtenderThread-35" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=174|bnd.sym=servicemix-cxf-se]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanIn stantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.RuntimeException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory] 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(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: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.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListable BeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplic ationContext.java:728) 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:136) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11 .WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.RuntimeException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory] 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) ... 18 more Caused by: java.lang.RuntimeException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory] at org.apache.cxf.wsdl.JAXBExtensionHelper.getJAXBContext(JAXBExtensionHelper.java:185) at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:168) at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:88) at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:263) at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:243) at org.apache.cxf.wsdl11.WSDLManagerImpl.<init>(WSDLManagerImpl.java:113) 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 org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) ... 20 more Caused by: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found - with linked exception: [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory] at javax.xml.bind.ContextFinder.loadSpi(ContextFinder.java:174) at javax.xml.bind.ContextFinder.find(ContextFinder.java:60) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:77) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:73) at org.apache.cxf.wsdl.JAXBExtensionHelper.createJAXBContext(JAXBExtensionHelper.java:196) at org.apache.cxf.wsdl.JAXBExtensionHelper.getJAXBContext(JAXBExtensionHelper.java:183) ... 30 more Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at javax.xml.bind.ContextFinder.loadSpi(ContextFinder.java:169) ... 35 more
    via by Greg Lucas,
  • I've just upgraded my 3.2 install to 3.3. I'm also using Crowd integration and properly followed the instructions. The upgrade process went smoothly, but after that, Confluence was failing to start, with the following error: 2010-07-08 07:10:29,839 ERROR [Spring executor 1] [plugin.osgi.factory.OsgiPlugin] onSpringContextFailed Unable to start the Spring context for plugin com.atlassian.confluence.plugins.confluence-sal-plugin org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationController' defined in URL [bundle://29.0:0/META-INF/spring/atlassian-plugins-components.xml]: Instantiation of bean failed; nested exc eption is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.sal.core.auth.SeraphAuthenticationController]: Constructor threw exception; nested exception is java.lang.RuntimeException: C ould not load security config 'seraph-config.xml': Exception configuring from 'seraph-config.xml : com.atlassian.seraph.config.ConfigurationException: Could not getRequest service: com.atlassian.confluence.user.ConfluenceLoginInterceptor : java.lang.ClassNotFoundException: com.atlassian.confluence.user.ConfluenceLoginInterceptor 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(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: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.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) 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.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) and many others. It took some time to figure out that I also needed to comment: <interceptor name="login-logger" class="com.atlassian.confluence.user.ConfluenceLoginInterceptor"/> in seraph-config.xml file.
    via by Matteo Beccati,
  • I've just upgraded my 3.2 install to 3.3. I'm also using Crowd integration and properly followed the instructions. The upgrade process went smoothly, but after that, Confluence was failing to start, with the following error: 2010-07-08 07:10:29,839 ERROR [Spring executor 1] [plugin.osgi.factory.OsgiPlugin] onSpringContextFailed Unable to start the Spring context for plugin com.atlassian.confluence.plugins.confluence-sal-plugin org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationController' defined in URL [bundle://29.0:0/META-INF/spring/atlassian-plugins-components.xml]: Instantiation of bean failed; nested exc eption is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.sal.core.auth.SeraphAuthenticationController]: Constructor threw exception; nested exception is java.lang.RuntimeException: C ould not load security config 'seraph-config.xml': Exception configuring from 'seraph-config.xml : com.atlassian.seraph.config.ConfigurationException: Could not getRequest service: com.atlassian.confluence.user.ConfluenceLoginInterceptor : java.lang.ClassNotFoundException: com.atlassian.confluence.user.ConfluenceLoginInterceptor 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(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: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.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) 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.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) and many others. It took some time to figure out that I also needed to comment: <interceptor name="login-logger" class="com.atlassian.confluence.user.ConfluenceLoginInterceptor"/> in seraph-config.xml file.
    via by Matteo Beccati,
    • java.lang.ClassNotFoundException: com.atlassian.confluence.user.ConfluenceLoginInterceptor at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
    No Bugmate found.