Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » war deployment fails with CNF exception
war deployment fails with CNF exception [message #661750] Sun, 27 March 2011 08:53 Go to next message
Jacob Hameiri is currently offline Jacob Hameiri
Messages: 43
Registered: December 2010
Member
Hi,
I am trying to deploy a war file to VWS, this is the activemq-fileserver war and although I added all of the proper dependency bundles to my respository I am gettting a CNF exception when attempting to access the web app.

10:39:09.995 [http-8080-1] ERROR System.err - SEVERE: Allocate exception for servlet DefaultServlet
10:39:09.996 [http-8080-1] ERROR System.err - java.lang.ClassNotFoundException: org.eclipse.jetty.servlet.DefaultServlet
10:39:09.997 [http-8080-1] ERROR System.err - at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappC lassLoader.loadClass(BundleWebappClassLoader.java:286)
10:39:09.998 [http-8080-1] ERROR System.err - at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
10:39:09.999 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardWrapper.loadServlet(Standar dWrapper.java:1095)
10:39:09.999 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardWrapper.allocate(StandardWr apper.java:809)
10:39:10.000 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:129)
10:39:10.001 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:191)
10:39:10.001 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:127)
10:39:10.002 [http-8080-1] ERROR System.err - at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:102)
10:39:10.003 [http-8080-1] ERROR System.err - at org.eclipse.virgo.web.tomcat.ApplicationNameTrackingValve.in voke(ApplicationNameTrackingValve.java:29)
10:39:10.003 [http-8080-1] ERROR System.err - at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:555)
10:39:10.004 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
10:39:10.005 [http-8080-1] ERROR System.err - at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:298)
10:39:10.005 [http-8080-1] ERROR System.err - at org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:857)
10:39:10.005 [http-8080-1] ERROR System.err - at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:588)
10:39:10.005 [http-8080-1] ERROR System.err - at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:489)
10:39:10.006 [http-8080-1] ERROR System.err - at java.lang.Thread.run(Thread.java:662)

After looking at the packages that are imported by the deployed bundle I can see that the CNE package is not imported.
My question is how does virgo decide which packages should be imported by the war bundle ?
How can I explicitly tell him to import the missing package ?
Re: war deployment fails with CNF exception [message #661855 is a reply to message #661750] Mon, 28 March 2011 10:01 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Jacob wrote on Sun, 27 March 2011 09:53
Hi,
I am trying to deploy a war file to VWS, this is the activemq-fileserver war and although I added all of the proper dependency bundles to my respository I am gettting a CNF exception when attempting to access the web app.

10:39:09.995 [http-8080-1] ERROR System.err - SEVERE: Allocate exception for servlet DefaultServlet
10:39:09.996 [http-8080-1] ERROR System.err - java.lang.ClassNotFoundException: org.eclipse.jetty.servlet.DefaultServlet
10:39:09.997 [http-8080-1] ERROR System.err - at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappC lassLoader.loadClass(BundleWebappClassLoader.java:286)
10:39:09.998 [http-8080-1] ERROR System.err - at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
10:39:09.999 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardWrapper.loadServlet(Standar dWrapper.java:1095)
10:39:09.999 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardWrapper.allocate(StandardWr apper.java:809)
10:39:10.000 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:129)
10:39:10.001 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:191)
10:39:10.001 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:127)
10:39:10.002 [http-8080-1] ERROR System.err - at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo rtValve.java:102)
10:39:10.003 [http-8080-1] ERROR System.err - at org.eclipse.virgo.web.tomcat.ApplicationNameTrackingValve.in voke(ApplicationNameTrackingValve.java:29)
10:39:10.003 [http-8080-1] ERROR System.err - at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa lve.java:555)
10:39:10.004 [http-8080-1] ERROR System.err - at org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:109)
10:39:10.005 [http-8080-1] ERROR System.err - at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd apter.java:298)
10:39:10.005 [http-8080-1] ERROR System.err - at org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:857)
10:39:10.005 [http-8080-1] ERROR System.err - at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.process(Http11Protocol.java:588)
10:39:10.005 [http-8080-1] ERROR System.err - at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoin t.java:489)
10:39:10.006 [http-8080-1] ERROR System.err - at java.lang.Thread.run(Thread.java:662)

After looking at the packages that are imported by the deployed bundle I can see that the CNE package is not imported.
My question is how does virgo decide which packages should be imported by the war bundle ?

When processing a WAR, Virgo 2.1.0 automatically imports all the packages exported by the system bundle plus the packages javax.servlet v2.5, javax.servlet.http v2.5, javax.servlet.jsp v2.1, javax.servlet.jsp.el v2.1, javax.servlet.jsp.tagext v2.1, and javax.el v1.0.
Quote:

How can I explicitly tell him to import the missing package ?

Add a META-INF/MANIFEST/MF to the WAR and use an Import-Package header.

However, would you expect to use "org.eclipse.jetty.servlet.DefaultServlet" with VWS which is based on Tomcat?
Re: war deployment fails with CNF exception [message #661862 is a reply to message #661855] Mon, 28 March 2011 10:28 Go to previous messageGo to next message
Jacob Hameiri is currently offline Jacob Hameiri
Messages: 43
Registered: December 2010
Member
I cannot change the war, it is added by maven from the apache activemq repository ?
I there a way to fix the problem without changing the war file ?
Re: war deployment fails with CNF exception [message #661872 is a reply to message #661862] Mon, 28 March 2011 11:28 Go to previous message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Not really, unless you can attach a fragment as described in this blog. You'll have to specify the symbolic name that Virgo generates, typically the name of the file minus ".war".
Previous Topic:how to partition system to build bundle?
Next Topic:LogReaderService for Virgo
Goto Forum:
  


Current Time: Thu Oct 23 16:03:37 GMT 2014

Powered by FUDForum. Page generated in 0.02645 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software