Question about deploying web application in jetty.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about deploying web application in jetty.xml

David Chen-6
Hi, there:
 
As a newbie to Jetty, currently I'm using Jetty-4.2.24, and running Jetty by using:
java -jar start.jar etc\jetty.xml; And to deploy some war files copied from Apache Struts, I added following in etc\jetty.xml:
 
  <Call name="addWebApplication">
    <Arg>/struts/struts-examples/*</Arg>
    <Arg><SystemProperty name="jetty.home" default="."/>/webapps/struts/struts-examples.war</Arg>
    <Arg><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Arg>
    <Arg type="boolean">true</Arg> <!-- if true, expand war in temp dir -->
 </Call>
 
However, I just noticed that if I set <Arg type="boolean"> as "true", everything works fine, however, if I set it as "false", Jetty failed to deploy it with exception like:
 
14:19:03.243 WARN!! Configuration error on jar:file:/C:/jetty-4.2.24/webapps/str
uts/struts-examples.war!/
java.lang.IllegalArgumentException: name
        at sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:450)
        at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
        at java.net.URLClassLoader$2.run(URLClassLoader.java:352)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findResource(URLClassLoader.java:349)
        at org.mortbay.http.ContextLoader.getResource(ContextLoader.java:234)
        at org.mortbay.util.Resource.newSystemResource(Resource.java:146)
        at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationC
ontext.java:380)
        at org.mortbay.http.HttpServer.start(HttpServer.java:663)
        at org.mortbay.jetty.Server.main(Server.java:429)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.mortbay.start.Main.invokeMain(Main.java:153)
        at org.mortbay.start.Main.start(Main.java:483)
        at org.mortbay.start.Main.main(Main.java:91)
 
 
So, what's the problem? anything wrong from what I did? what should I do?
 
Thanks a lot in advance
 
David

 
Reply | Threaded
Open this post in threaded view
|

Re: Question about deploying web application in jetty.xml

Greg Wilkins-5
David Chen wrote:
> As a newbie to Jetty, currently I'm using Jetty-4.2.24, and running

OK before I answer... riddle me this batman...

why do so many newbies use Jetty 4 instead of Jetty 5?   Jetty 4 is
very long in the tooth.... hell even Jetty 5 has a great big "soon to
be replaced" tattoo on it's bum!

Is there something on the website that pushes newbies towards Jetty 4?


Now for your specific question....  There is something that is not happy
trying to extract a resource from a jar directly.  looking at the stack
trace, this appears to be Jetty - in which case it is a bug - in which
case the simple (lazy) answer is try the latest version of Jetty 5 and
see if it is fixed.

For the real answer, you will have to wait until I'm near the source
code again (next week) before I can investigate.  Feel free to
investigate some more before then.

And finally, I think that running packed is a bad idea anyway unless
you really cannot modify the file system.  You are just eating memory
instead of diskspace.

cheers


> Jetty by using:
> java -jar start.jar etc\jetty.xml; And to deploy some war files copied
> from Apache Struts, I added following in etc\jetty.xml:
>  
>   <Call name="addWebApplication">
>     <Arg>/struts/struts-examples/*</Arg>
>     <Arg><SystemProperty name="jetty.home"
> default="."/>/webapps/struts/struts-examples.war</Arg>
>     <Arg><SystemProperty name="jetty.home"
> default="."/>/etc/webdefault.xml</Arg>
>     <Arg type="boolean">true</Arg> <!-- if true, expand war in temp dir -->
>  </Call>
>  
> However, I just noticed that if I set <Arg type="boolean"> as "true",
> everything works fine, however, if I set it as "false", Jetty failed
> to deploy it with exception like:
>  
> 14:19:03.243 WARN!! Configuration error on
> jar:file:/C:/jetty-4.2.24/webapps/str
> uts/struts-examples.war!/
> java.lang.IllegalArgumentException: name
>         at sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:450)
>         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
>         at java.net.URLClassLoader$2.run(URLClassLoader.java:352)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findResource(URLClassLoader.java:349)
>         at
> org.mortbay.http.ContextLoader.getResource(ContextLoader.java:234)
>         at org.mortbay.util.Resource.newSystemResource(Resource.java:146)
>         at
> org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationC
> ontext.java:380)
>         at org.mortbay.http.HttpServer.start(HttpServer.java:663)
>         at org.mortbay.jetty.Server.main(Server.java:429)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at org.mortbay.start.Main.invokeMain(Main.java:153)
>         at org.mortbay.start.Main.start(Main.java:483)
>         at org.mortbay.start.Main.main(Main.java:91)
>  
>  
> So, what's the problem? anything wrong from what I did? what should I do?
>  
> Thanks a lot in advance
>  
> David
>
>  



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Why Jetty 4? (Was: Question about deploying web application in jetty.xml)

sf-2
Greg Wilkins wrote:
...
> Is there something on the website that pushes newbies towards Jetty 4?

Maybe it's the new license?

Regards
        Stephan



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Why Jetty 4? (Was: Question about deploying web application in jetty.xml)

Ceki Gulcu-2
At 05:57 PM 8/4/2005, you wrote:
>Greg Wilkins wrote:
>...
>>Is there something on the website that pushes newbies towards Jetty 4?
>
>Maybe it's the new license?

Jetty 4 uses a jetty-specific license. Jetty 5 uses the popular ASF 2.0
license. As such, I can't imagine new users preferring Jetty 4 over Jetty 5
on account of licensing. If licensing were a factor, one would expect Jetty
5 to be more popular.

Just my 2c.

>Regards
>         Stephan

--
Ceki Gülcü




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Question about deploying web application in jetty.xml

Noel Bush-2
In reply to this post by Greg Wilkins-5
Greg Wilkins wrote:
> why do so many newbies use Jetty 4 instead of Jetty 5?   Jetty 4 is
> very long in the tooth.... hell even Jetty 5 has a great big "soon to
> be replaced" tattoo on it's bum!
>
> Is there something on the website that pushes newbies towards Jetty 4?

Yes.  Go to http://jetty.mortbay.org .  Click "Main Archive" under
"Downloads".  On the sf downloads page that shows up, Jetty 4.2 is the
first item in the list.  Doesn't matter that it says "Superceded" (this
is misspelled on that page, by the way).  People don't always read.
Being first in the list makes it look like "the right one".

IIWY, I would change the links on the main page to something like:

Downloads
   - Current Stable Version
   - New Experimental Version
   - Old (DEPRECATED) Version

and do that little trick with each where you make the sf download page
show only that particular package.  I predict you'll see a drop-off in
the number of people using Jetty 4.  :-)


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss