Stax Developer Community

Developer Community

Dear Stax'd,

Locally, my app (a JRuby app) runs perfectly under webbrick.
When i use warble to package it up as a war and deploy it to one of my local servers under jetty as a(n exploded) war file it also works perfectly.
When i deploy that same war to stax the app appears to work, but then when i take the main action of the app i get a NoClassDefnFound exception. i've verified 
  1. that the class mentioned (and all of the classes in the surrounding call stack actually) is in fact in the expected jar
  2. the jar is in the war -- in the expected place (WEB-INF/lib)
  3. no other jar contains the class
The exception is thrown miles deep in 3rd party code that i cannot add logging statements to without perturbing all kinds of behavior (and tearing my hair out trying to get a build environment to rebuild the 3rd party code).

i've been attempting to get the app deployed locally under tomcat to see if i can closer mimic the stax environment locally. This has been astonishingly difficult. If the app is deployed in its own directory under webapps, it fails to properly handle the relative path correctly. If the app is deployed as ROOT under webapps it fails to launch properly -- getting only partway through. This is suggestive that the tomcat/JRuby combo is at the heart of the stax deployment problem, but not precise enough to help me solve the problem.

This leads me to the following questions
  1. is it possible to use jetty instead of tomcat on stax?
  2. is there anyway to get a shell or scala repl or some finer grain visibility to stax deployed apps?

Best wishes,

--greg

Views: 0

Reply to This

Replies to This Discussion

Can you private message me an example URL in your app that triggers this no class def error?

If you want to try to more closely mimic this error locally by running the exploded WAR via the Stax SDK, you can use the following command:
stax runwar -f -d temp -w PATH_TO_EXPLODED_WAR
Here is a code snippet I often use to debug classpath problems. This will print out the location in disk that the specific class was loaded from. I usually throw this in a JSP and update the classname variable to the fully qualified classname I am trying to discover.

String className = "org.slf4j.helpers.MessageFormatter";
java.net.URL url = getClass().getClassLoader().getResource(className.replace(".", "/") + ".class");
out.println("Class location: " + url);

RSS

Quick Links

Send Feedback

If you have any questions or feedback about Stax, please drop us a note.

© 2012   Created by Spike Washburn.

Badges  |  Report an Issue  |  Terms of Service