starting persevere in the new beta with a custom jetty.xml file

0 views
Skip to first unread message

Dustin M

unread,
Feb 3, 2009, 10:00:56 PM2/3/09
to Persevere
prior to the beta release, I was starting jetty with this command:
java -Djetty.class.path=\"$CLASSPATH\" -jar $PERSVR_HOME/start.jar

I've altered my etc/jetty.xml file to include a few additional
handlers in addition to the persevere servlet. For example, this one:
<Call name="addHandler">
<Arg>
<New class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="resourceBase"><SystemProperty
name="LUNA"/>/server</Set>
<Set name="contextPath">/l</Set>
</New>
</Arg>
</Call>

This was working under 9.29, but now if I do the same thing with the
beta release OR the nightly, it doesn't look like my classpath gets
recognized and I end up with this error:

java.lang.ClassNotFoundException:
org.persvr.util.PersevereDefaultServlet
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)


If I remove my added handlers, the default persevere instance starts
up ok.

Any suggestions on how to proceed? I can't tell if this is new, but I
noticed the installation instructions now reference a startup script
bin/persvr. I tried using the JettyStart class referenced in there to
start things up, but then I seem to lose the ability to edit the
resource paths in the server config file.

Kris Zyp

unread,
Feb 3, 2009, 10:23:01 PM2/3/09
to persevere...@googlegroups.com
I believe the problem is because I added PersevereDefaultServlet (to
handle the inherited webapp scheme that Persevere supports now) to the
webdefault.xml and therefore Jetty attempts to load it for every webapp,
but it isn't available in other webapps classpath (because it comes from
the WEB-INF/lib in Persevere). One way I believe you could immediately
correct this in your installation is to edit the webdefault.xml that is
inside lib/jetty-6.1.14.jar in /org/mortbay/jetty/webapp/ (yeah, I know
it's a pain to edit files inside jars) and revert the first servlet's
servlet-class back to Jetty's DefaultServlet handler:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
<init-param>
...

I think to correct this issue long term, I need to move the
PersevereDefaultServlet class into a jar that would live in /lib.
Kris

Kris Zyp

unread,
Feb 4, 2009, 12:16:33 AM2/4/09
to persevere...@googlegroups.com
I just checked in a fix that should correct this for the next nightly.
Let me know if it doesn't.
Kris

Dustin M

unread,
Feb 4, 2009, 2:45:59 AM2/4/09
to Persevere
Ah great, fixing the webdefault file did the trick. I'll check out the
nightly tomorrow but I'm sure it's good. Thanks!
Reply all
Reply to author
Forward
0 new messages