activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Posta (JIRA)" <>
Subject [jira] [Commented] (AMQ-3853) Missing import in activemq-web-console
Date Wed, 23 May 2012 00:38:41 GMT


Christian Posta commented on AMQ-3853:

Here's my research:

Indeed there were multiple changes in the maven-bundle-plugin to take advantage of the newer
versions of the bnd tool that underlies the maven-bundle-plugin, but none of those changes
were what cause this error. 

The bnd tool will not add imports for packages it sees within the bundle. To make it a short
story, some transitive dependencies of the 5.6.0 activemq-core were including the servlet-api
(and thus were part of the bundle) which explains why the bundle plugin wasn't adding the
javax.servlet and javax.servlet.http packages.

In the activemq-web-console's pom.xml file, you see the following:


And if you follow the dependency tree for 


you'll see the two instances of the servlet spec within the transitive deps:

mvn dependency:tree | grep servlet

You'll see that although the geronimo servlet spec has "provided" scope, the other two (transitives
from fusemq-leveldb->hadoop-core) have "compile" scope and will be included in the WEB-INF/lib
directory of the bundle. Thus when bnd tries to determine whether to add the appropriate packages,
it decides not to since they're already on the class path.

There are two options to fix:
1) add the javax.servlet and javax.servlet.http to the <Import-Package> instructions
to the bundle plugin. This just kinda glosses over the fact that the servlet api is being
2) exclude the servlet api from the activemq-core transitive dependencies.

I would suggest the second approach. I've added this patch.
Let me know if I didn't explain something clear.

Patch is attached.
> Missing import in activemq-web-console
> --------------------------------------
>                 Key: AMQ-3853
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.6.0
>            Reporter: Chris Geer
> Running activemq-web-console in Karaf generates these errors:
> Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener not
found by org.apache.activemq.activemq-web-console [118]
> Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter not found by org.apache.activemq.activemq-web-console
> Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet not found
by org.apache.activemq.activemq-web-console [118]
> It looks like activemq-web-console imports the following servlet packages:
>         javax.servlet.jsp;version="[2.1,3)",
> 	javax.servlet.jsp.el;version="[2.1,3)",
> 	javax.servlet.jsp.tagext;version="[2.1,3)",
> So it seems to be missing imports for:
> javax.servlet
> javax.servlet.http

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message