cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Schutz" <alexa...@avaya.com>
Subject CXF as Windows Service using ProcRun: ClassNotFoundException: com/sun/xml/bind/v2/ContextFactory
Date Thu, 11 Feb 2010 10:11:16 GMT
Hi,

I implemented a basic web service (standalone, embedded into jetty, Java
1.6.0_18 , CXF 2.2.6) and now want to deploy it as a Windows service.
To this end I'm trying to use procrun/commons daemon to install and run
the windows service, which then calls out to a Java class that launches
the web service.

When I use the Windows service start button, or run the procrun/prunsrv
exectuable from the command line to start the Windows service, I can see
a bit logging for initialisation going on, but when the code enters the
line

  Endpoint.create(..)

 the process exits with 

  Exception in thread "pool-1-thread-1"
java.lang.ExceptionInInitializerError

 and

  Caused by: javax.xml.bind.JAXBException
   - with linked exception:
  [java.lang.ClassNotFoundException: com/sun/xml/bind/v2/ContextFactory]

 (see stack trace given further below)

I have put some additional logging to check the resources on the class
path, and just before 
  Endpoint.create(..)
 is called, ContextFactory _is_ found by the Class Loader (as are any
other possible CXF dependencies):

  Class clazz = Class.forName("com.sun.xml.bind.v2.ContextFactory");
  logger.log(Level.INFO, "##### " + clazzs + " found ##### " +
clazz.getPackage());

  INFO: ##### com.sun.xml.bind.v2.ContextFactory found ##### package
com.sun.xml.bind.v2, Java Architecture for XML Binding, version 2.1

When I start the application from the command line not using
procrun/prunsrv, by calling 
  java -jar ...
everything works fine.


The way the launcher class works is by invoking a
java.util.concurrent.ExecutorService which starts the Runnable that
starts the web service.

I had a look through the past 6 months of archives, and could only find
posts that were remotely - if at all - related to my problem.

Has anyone come across this?

Thanks,
Alex

Stack trace from above:

Exception in thread "pool-1-thread-1"
java.lang.ExceptionInInitializerError
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at javax.xml.ws.spi.FactoryFinder.safeLoadClass(Unknown Source)
	at javax.xml.ws.spi.FactoryFinder.newInstance(Unknown Source)
	at javax.xml.ws.spi.FactoryFinder.find(Unknown Source)
	at javax.xml.ws.spi.Provider.provider(Unknown Source)
	at javax.xml.ws.Endpoint.publish(Unknown Source)
	at
com.avaya.cc8.ebws.EbwsPortType_EbwsSOAPportHttp_Server.<init>(EbwsPortT
ype_EbwsSOAPportHttp_Server.java:101)
	at com.avaya.cc8.soawrapper.Starter.run(Starter.java:85)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext
for W3CEndpointReference. 
	at com.sun.xml.internal.ws.spi.ProviderImpl$2.run(Unknown
Source)
	at com.sun.xml.internal.ws.spi.ProviderImpl$2.run(Unknown
Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at
com.sun.xml.internal.ws.spi.ProviderImpl.getEPRJaxbContext(Unknown
Source)
	at com.sun.xml.internal.ws.spi.ProviderImpl.<clinit>(Unknown
Source)
	... 12 more
Caused by: javax.xml.bind.JAXBException
 - with linked exception:
[java.lang.ClassNotFoundException: com/sun/xml/bind/v2/ContextFactory]
	at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
	at javax.xml.bind.ContextFinder.find(Unknown Source)
	at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
	at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
	... 17 more
Caused by: java.lang.ClassNotFoundException:
com/sun/xml/bind/v2/ContextFactory
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at javax.xml.bind.ContextFinder.safeLoadClass(Unknown Source)
	... 21 more



----
Alexander Schutz | CCMS Reporting & Analytics | Avaya | 20-29 Mervue
Business Park, Mervue, Galway, Ireland | +353 (0) 91 733507 |
alexansc@avaya.com

www.avaya.com/emea/

[ Please consider the environment before printing this email ]

 

The author works for Avaya, Inc. ("Avaya") who is solely responsible for
this email and its contents. All enquiries regarding this email should
be addressed to Avaya, Inc. Nortel has provided the use of the Nortel
email messaging system to Avaya in connection with this email solely for
the purpose of connectivity and Nortel Networks Inc. has no liability
for the email or its contents. Avaya's web site is http://www.avaya.com

Mime
View raw message