I don't know if this fixed the original problem, but I have the exact same exception. And I definitely am using the appropriate servicemix version of the jaxb-impl bundle.
osgi> packages com.sun.xml.bind.v2 Dec 14, 2009 2:49:42 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook lookupDiscoveryService INFO: lookup discovery service: interface: org.osgi.service.packageadmin.PackageAdmin filter: null OSGi Console INFO [org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook] - lookup discovery service: interface: org.osgi.service.packageadmin.PackageAdmin filter: null com.sun.xml.bind.v2; version="0.0.0"<org.apache.servicemix.bundles.jaxb-impl_2.1.6.1 [188]> osgi> Any other hints for this? Eoghan Glynn-3 wrote: > > > Leo, > > What version of JAXB have you installed in your OSGi runtime? > > Just the bare jar, or a bundlized version? > > You'll need to latter. Try > org.apache.servicemix.bundles.jaxb-impl-2.1.6_1.jar, which is the version > we use in distributed OSGi. > > Use a maven dependency: > > <dependency> > <groupId>org.apache.servicemix.specs</groupId> > <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId> > <version>2.1.6_1</version> > </dependency> > > or pull it down directly from: > > http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.jaxb-impl/2.1.6_1 > > Cheers, > Eoghan > > -----Original Message----- > From: Leo Bayer [mailto:lfba...@gmail.com] > Sent: Thu 12/02/2009 21:33 > To: users@cxf.apache.org > Subject: ClassNotFoundException com.sun.xml.bind.v2.ContextFactory in OSGi > > I'm trying to load an endpoint using the "simple:server" spring > configuration but I'm getting a ClassNotFoundException when it's trying to > load the JAXBContext. > > Because the CXF bundle does not have visibility to com.sun.xml.bind.v2 > through an import it fails when trying to class load. > > What am I missing? > > Thanks > - Leo > > > 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:494) > at > org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) > ... 17 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.newInstance(ContextFinder.java:152) > at javax.xml.bind.ContextFinder.find(ContextFinder.java:299) > at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372) > at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337) > at > org.apache.cxf.wsdl.JAXBExtensionHelper.createJAXBContext(JAXBExtensionHelper.java:196) > at > org.apache.cxf.wsdl.JAXBExtensionHelper.getJAXBContext(JAXBExtensionHelper.java:183) > ... 27 more > Caused by: java.lang.ClassNotFoundException: > com.sun.xml.bind.v2.ContextFactory > at > org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:481) > at > org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:397) > at > org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:385) > at > org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:117) > ... 32 more > > > -- View this message in context: http://old.nabble.com/ClassNotFoundException-com.sun.xml.bind.v2.ContextFactory-in-OSGi-tp21986766p26779958.html Sent from the cxf-user mailing list archive at Nabble.com.