felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quecas <jms.cer...@gmail.com>
Subject Embedding Tomcat 7 with webservices
Date Mon, 13 Feb 2012 16:43:14 GMT

Hello everyone,

Is it possible to embed tomcat 7 + metro as an OSGi bundle?

I am trying to embed tomcat 7 in my OSGi project using Felix. I have created
a bundle and included the three jars that are required:
- tomcat-embedded-core.jar
- tomcat-embedded-logging-juli.jar
- webservices-rt.jar (metro)

I am programatically defining an application listener:
 Context ctx = tomcat.addContext("/", Paths.get("webroot/webapps",
"ws1").toAbsolutePath().toString());
 Tomcat.addServlet(ctx, JAXWS_SERVLET_NAME, WSServlet.class.getName());
 ctx.addApplicationListener(WSServletContextListener.class.getName());
 ctx.addServletMapping("/ws1", JAXWS_SERVLET_NAME);

When I startup Felix a class not found exception is thrown:
SEVERE: Error configuring application listener of class
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
java.lang.ClassNotFoundException:
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
	at
org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525)
	at
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507)
	at
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:124)
	at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4715)
	at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
	at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	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)


Seems to be related to tomcat's class loading policy.

Thanks,
Jorge
-- 
View this message in context: http://old.nabble.com/Embedding-Tomcat-7-with-webservices-tp33316197p33316197.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message