StackoverflowError in ServletWarEntity

50 views
Skip to first unread message

Josh Highley

unread,
Mar 4, 2015, 3:29:42 PM3/4/15
to jminix...@googlegroups.com
I'm having issues getting jminix working at all.  My war is a Spring application but I'm not using the Spring integration.  At the moment, I'm running Jetty via Maven in Eclipse.  I've tried jminix 1.0 and 1.1, same issues

web.xml config

<servlet>
  <servlet-name>
JmxMiniConsoleServlet</servlet-name>
  <servlet-class>org.jminix.console.servlet.MiniConsoleServlet</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>JmxMiniConsoleServlet</servlet-name>
  <url-pattern>/jmx/*</url-pattern>
</servlet-mapping>


When I go to http://localhost:9595/jmx/  I get a 500 server error from a StackoverflowError in ServletWarEntity when it's searching resources in the servlet context path. From what I can Google, it gets stuck on web.xml, but I never found a solution.



HTTP ERROR 500
Problem accessing /jmx/. Reason:
Server Error
Caused by:
java.lang.StackOverflowError
at org.eclipse.jetty.util.resource.Resource.<init>(Resource.java:46)
at org.eclipse.jetty.util.resource.URLResource.<init>(URLResource.java:49)
at org.eclipse.jetty.util.resource.FileResource.<init>(FileResource.java:82)
at org.eclipse.jetty.util.resource.Resource.newResource(Resource.java:109)
at org.eclipse.jetty.util.resource.Resource.newResource(Resource.java:89)
at org.eclipse.jetty.util.resource.Resource.newResource(Resource.java:204)
at org.eclipse.jetty.util.resource.Resource.newResource(Resource.java:140)
at org.eclipse.jetty.util.resource.FileResource.addPath(FileResource.java:163)
at org.eclipse.jetty.util.resource.ResourceCollection.addPath(ResourceCollection.java:207)
at org.eclipse.jetty.server.handler.ContextHandler.getResource(ContextHandler.java:1567)
at org.eclipse.jetty.webapp.WebAppContext.getResource(WebAppContext.java:358)
at org.mortbay.jetty.plugin.JettyWebAppContext.getResource(JettyWebAppContext.java:324)
at org.eclipse.jetty.server.handler.ContextHandler.getResourcePaths(ContextHandler.java:1622)
at org.mortbay.jetty.plugin.JettyWebAppContext.getResourcePaths(JettyWebAppContext.java:397)
at org.eclipse.jetty.server.handler.ContextHandler$Context.getResourcePaths(ContextHandler.java:1925)
at com.noelios.restlet.ext.servlet.ServletWarEntity.<init>(ServletWarEntity.java:102)
at com.noelios.restlet.ext.servlet.ServletWarEntity.<init>(ServletWarEntity.java:110)
at com.noelios.restlet.ext.servlet.ServletWarEntity.<init>(ServletWarEntity.java:110)
at com.noelios.restlet.ext.servlet.ServletWarEntity.<init>(ServletWarEntity.java:110)
at com.noelios.restlet.ext.servlet.ServletWarEntity.<init>(ServletWarEntity.java:110)
at com.noelios.restlet.ext.servlet.ServletWarEntity.<init>(ServletWarEntity.java:110)
...repeated...


I've tried removing all filters and other servlets from web.xml, but still get the same issue.

I assume I'm missing something but I've followed the jminix documentation I believe.

Very frustrating.

Josh Highley

unread,
Mar 4, 2015, 5:09:56 PM3/4/15
to jminix...@googlegroups.com
Debugging, I found that ServletWarEntity.java gets stuck in /WEB-INF/lib/ jar files.      getResourcePaths() for a jar file in WEB-INF/lib/ seems to return all the jars in the WEB-INF/lib/ as childpaths, so it thinks the jars are directories.  The ServletWarEntity 'path' parameter just alternates between the first and second jar lib /WEB-INF/lib/ as it recursively calls itself. 

} else {
    this.fullName = path;
    Set childPaths = getServletContext().getResourcePaths(path);

if (childPaths != null && !childPaths.isEmpty()) { this.directory = true; this.children = new ArrayList<Entity>(); for (Object childPath : childPaths) { if (!childPath.equals(this.path)) { this.children.add(new ServletWarEntity( this.servletContext, (String) childPath)); } } } else { this.directory = false; } }


I have no idea how to keep it from happening though, or why it's apparently not happening to others widespread.

Josh Highley

unread,
Mar 4, 2015, 5:24:35 PM3/4/15
to jminix...@googlegroups.com
I deployed my war to a JBoss server and it worked.  This seems to be a bug in Jetty's implementation of getResourcePaths()
Reply all
Reply to author
Forward
0 new messages