Quantcast

jetty:run didn't work with overlay

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

jetty:run didn't work with overlay

Alfred Chan
Hi,

I have a projecte with artifact WAR A, then another project B adds a dependency on WAR A. (i.e. Overlay)

Environment :
Jetty : 6.1.14
maven : 2.0.9
OS : Windows XP
Java : 1.6.0_04-b12

When I run > mvn jetty:run. It shows the following error.

It seems that it cannot find the resource of projectA-1.0.war.

Do anyone have any idea what is happening?

Regards,
Alfred

P.S. The webapp works properly when using > mvn jetty:run-exploded.

2008-12-22 12:11:21.146::INFO:  jetty-6.1.14
2008-12-22 12:11:21.349::WARN:  Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebAp
pContext@4c585f{/projectB,file:/d:/java/workspace/projectB/src/main/webapp/;jar:file:/d:/reposit
ory/projectA-1.0.war!/;}
java.lang.IllegalArgumentException: name
        at sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:458)
        at sun.misc.URLClassPath.findResource(URLClassPath.java:145)
        at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
        at org.mortbay.jetty.webapp.WebAppClassLoader.getResource(WebAppClassLoader.java:249)
        at org.mortbay.resource.Resource.newSystemResource(Resource.java:202)
        at org.mortbay.jetty.webapp.WebXmlConfiguration.configureDefaults(WebXmlConfiguration.java:1
59)
        at org.mortbay.jetty.plus.webapp.AbstractConfiguration.configureDefaults(AbstractConfigurati
on.java:90)
        at org.mortbay.jetty.plus.webapp.Configuration.configureDefaults(Configuration.java:142)
        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1214)
        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
        at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java
:124)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jetty:run didn't work with overlay

David Yu-3
The error seems to be coming from the defaults descriptor?
I assume you have provided a custom webDefaultXml.
Can you post the pom.xml of projectB?

Cheers,
dyu

On Mon, Dec 22, 2008 at 12:25 PM, Alfred Chan <[hidden email]> wrote:

Hi,

I have a projecte with artifact WAR A, then another project B adds a
dependency on WAR A. (i.e. Overlay)

Environment :
Jetty : 6.1.14
maven : 2.0.9
OS : Windows XP
Java : 1.6.0_04-b12

When I run > mvn jetty:run. It shows the following error.

It seems that it cannot find the resource of projectA-1.0.war.

Do anyone have any idea what is happening?

Regards,
Alfred

P.S. The webapp works properly when using > mvn jetty:run-exploded.

2008-12-22 12:11:21.146::INFO:  jetty-6.1.14
2008-12-22 12:11:21.349::WARN:  Failed startup of context
org.mortbay.jetty.plugin.Jetty6PluginWebAp
pContext@4c585f{/projectB,file:/d:/java/workspace/projectB/src/main/webapp/;jar:file:/d:/reposit
ory/projectA-1.0.war!/;}
java.lang.IllegalArgumentException: name
       at sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:458)
       at sun.misc.URLClassPath.findResource(URLClassPath.java:145)
       at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
       at
org.mortbay.jetty.webapp.WebAppClassLoader.getResource(WebAppClassLoader.java:249)
       at
org.mortbay.resource.Resource.newSystemResource(Resource.java:202)
       at
org.mortbay.jetty.webapp.WebXmlConfiguration.configureDefaults(WebXmlConfiguration.java:1
59)
       at
org.mortbay.jetty.plus.webapp.AbstractConfiguration.configureDefaults(AbstractConfigurati
on.java:90)
       at
org.mortbay.jetty.plus.webapp.Configuration.configureDefaults(Configuration.java:142)
       at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1214)
       at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
       at
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
       at
org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java
:124)


--
View this message in context: http://www.nabble.com/jetty%3Arun-didn%27t-work-with-overlay-tp21122671p21122671.html
Sent from the Jetty Discuss mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jetty:run didn't work with overlay

Alfred Chan
Hi David,

Yes, I have provided a custom webDefault.xml.
Do you suspect there is an invalid item in webDefault.xml or it cannot be read in jetty:run environment?

Here is the pom.xml of project B:

<?xml version="1.0" encoding="UTF-8"?>
<project
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
        <modelVersion>4.0.0</modelVersion>
        <groupId>test</groupId>
        <artifactId>projectB</artifactId>
        <packaging>war</packaging>
        <version>1.0-SNAPSHOT</version>
        <description>testing package</description>
        <build>
                <plugins>
                        <plugin>
                               
                                <groupId>org.mortbay.jetty</groupId>
                                <artifactId>maven-jetty-plugin</artifactId>
                                <version>6.1.14</version>
                                <configuration>
                                       
                                        <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
                                        <scanIntervalSeconds>5</scanIntervalSeconds>
                                </configuration>
                        </plugin>
                       
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-war-plugin</artifactId>
                                <configuration>
                                        <overlays>
                                                <overlay>
                                                        <groupId>test</groupId>
                                                        <artifactId>projectA</artifactId>
                                                        <includes>
                                                                <include>WEB-INF/classes/**/*</include>
                                                                <include>js/jquery*.js</include>
                                                        </includes>
                                                </overlay>
                                        </overlays>
                                </configuration>
                        </plugin>
                </plugins>
        </build>

       
        <dependencies>
               
                <dependency>
                        <groupId>test</groupId>
                        <artifactId>projectA</artifactId>
                        <version>1.0-SNAPSHOT</version>
                        <type>war</type>
                        <classifier>${jdkClassifier}</classifier>
                </dependency>
  </dependencies>

</project>



Thanks,
Alfred


David Yu-3 wrote
The error seems to be coming from the defaults descriptor?
I assume you have provided a custom webDefaultXml.
Can you post the pom.xml of projectB?

Cheers,
dyu

On Mon, Dec 22, 2008 at 12:25 PM, Alfred Chan <alfred.ckchan@gmail.com>wrote:

>
> Hi,
>
> I have a projecte with artifact WAR A, then another project B adds a
> dependency on WAR A. (i.e. Overlay)
>
> Environment :
> Jetty : 6.1.14
> maven : 2.0.9
> OS : Windows XP
> Java : 1.6.0_04-b12
>
> When I run > mvn jetty:run. It shows the following error.
>
> It seems that it cannot find the resource of projectA-1.0.war.
>
> Do anyone have any idea what is happening?
>
> Regards,
> Alfred
>
> P.S. The webapp works properly when using > mvn jetty:run-exploded.
>
> 2008-12-22 12:11:21.146::INFO:  jetty-6.1.14
> 2008-12-22 12:11:21.349::WARN:  Failed startup of context
> org.mortbay.jetty.plugin.Jetty6PluginWebAp
> pContext@4c585f
> {/projectB,file:/d:/java/workspace/projectB/src/main/webapp/;jar:file:/d:/reposit
> ory/projectA-1.0.war!/;}
> java.lang.IllegalArgumentException: name
>        at sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:458)
>        at sun.misc.URLClassPath.findResource(URLClassPath.java:145)
>        at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
>        at
>
> org.mortbay.jetty.webapp.WebAppClassLoader.getResource(WebAppClassLoader.java:249)
>        at
> org.mortbay.resource.Resource.newSystemResource(Resource.java:202)
>        at
>
> org.mortbay.jetty.webapp.WebXmlConfiguration.configureDefaults(WebXmlConfiguration.java:1
> 59)
>        at
>
> org.mortbay.jetty.plus.webapp.AbstractConfiguration.configureDefaults(AbstractConfigurati
> on.java:90)
>        at
>
> org.mortbay.jetty.plus.webapp.Configuration.configureDefaults(Configuration.java:142)
>        at
>
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1214)
>        at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
>        at
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
>        at
>
> org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java
> :124)
>
>
> --
> View this message in context:
> http://www.nabble.com/jetty%3Arun-didn%27t-work-with-overlay-tp21122671p21122671.html
> Sent from the Jetty Discuss mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jetty:run didn't work with overlay

David Yu-3
Just tried it myself and I got that exception too. 
It works fine if there are no war dependencies though. I'll investigate.
Meanwhile, as a workaround, do:

          <webAppConfig>
            <contextPath>/</contextPath>
            <defaultsDescriptor>webdefault.xml</defaultsDescriptor>
          </webAppConfig>

The lookup is from the classpath. (src/main/resources/webdefault.xml is available on the classpath)

Cheers,
dyu

On Tue, Dec 23, 2008 at 9:55 AM, Alfred Chan <[hidden email]> wrote:

Hi David,

Yes, I have provided a custom webDefault.xml.
Do you suspect there is an invalid item in webDefault.xml or it cannot read
it in jetty:run environment?

Here is the pom.xml of project B:

<?xml version="1.0" encoding="UTF-8"?>
<project
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0">
       <modelVersion>4.0.0</modelVersion>
       <groupId>test</groupId>
       <artifactId>projectB</artifactId>
       <packaging>war</packaging>
       <version>1.0-SNAPSHOT</version>
       <description>testing package</description>
       <build>
               <plugins>
                       <plugin>
                               <!--This plugin allows to run the example using mvn jetty:run -->
                               <groupId>org.mortbay.jetty</groupId>
                               <artifactId>maven-jetty-plugin</artifactId>
                               <version>6.1.14</version>
                               <configuration>
                                       <!-- For not to lock the files during jetty running -->
                                       <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
                                       <scanIntervalSeconds>5</scanIntervalSeconds>
                               </configuration>
                       </plugin>
                       <!-- Overlays with iweb-core -->
                       <plugin>
                               <groupId>org.apache.maven.plugins</groupId>
                               <artifactId>maven-war-plugin</artifactId>
                               <configuration>
                                       <overlays>
                                               <overlay>
                                                       <groupId>test</groupId>
                                                       <artifactId>projectA</artifactId>
                                                       <includes>
                                                               <include>WEB-INF/classes/**/*</include>
                                                               <include>js/jquery*.js</include>
                                                       </includes>
                                               </overlay>
                                       </overlays>
                               </configuration>
                       </plugin>
               </plugins>
       </build>

       <!-- Dependencies -->
       <dependencies>
               <!-- Overlay WAR -->
               <dependency>
                       <groupId>test</groupId>
                       <artifactId>projectA</artifactId>
                       <version>1.0-SNAPSHOT</version>
                       <type>war</type>
                       <classifier>${jdkClassifier}</classifier>
               </dependency>
 </dependencies>

</project>



Thanks,
Alfred



David Yu-3 wrote:
>
> The error seems to be coming from the defaults descriptor?
> I assume you have provided a custom webDefaultXml.
> Can you post the pom.xml of projectB?
>
> Cheers,
> dyu
>
> On Mon, Dec 22, 2008 at 12:25 PM, Alfred Chan
> <[hidden email]>wrote:
>
>>
>> Hi,
>>
>> I have a projecte with artifact WAR A, then another project B adds a
>> dependency on WAR A. (i.e. Overlay)
>>
>> Environment :
>> Jetty : 6.1.14
>> maven : 2.0.9
>> OS : Windows XP
>> Java : 1.6.0_04-b12
>>
>> When I run > mvn jetty:run. It shows the following error.
>>
>> It seems that it cannot find the resource of projectA-1.0.war.
>>
>> Do anyone have any idea what is happening?
>>
>> Regards,
>> Alfred
>>
>> P.S. The webapp works properly when using > mvn jetty:run-exploded.
>>
>> 2008-12-22 12:11:21.146::INFO:  jetty-6.1.14
>> 2008-12-22 12:11:21.349::WARN:  Failed startup of context
>> org.mortbay.jetty.plugin.Jetty6PluginWebAp
>> pContext@4c585f
>> {/projectB,file:/d:/java/workspace/projectB/src/main/webapp/;jar:file:/d:/reposit
>> ory/projectA-1.0.war!/;}
>> java.lang.IllegalArgumentException: name
>>        at
>> sun.misc.URLClassPath$Loader.findResource(URLClassPath.java:458)
>>        at sun.misc.URLClassPath.findResource(URLClassPath.java:145)
>>        at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
>>        at java.security.AccessController.doPrivileged(Native Method)
>>        at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
>>        at
>>
>> org.mortbay.jetty.webapp.WebAppClassLoader.getResource(WebAppClassLoader.java:249)
>>        at
>> org.mortbay.resource.Resource.newSystemResource(Resource.java:202)
>>        at
>>
>> org.mortbay.jetty.webapp.WebXmlConfiguration.configureDefaults(WebXmlConfiguration.java:1
>> 59)
>>        at
>>
>> org.mortbay.jetty.plus.webapp.AbstractConfiguration.configureDefaults(AbstractConfigurati
>> on.java:90)
>>        at
>>
>> org.mortbay.jetty.plus.webapp.Configuration.configureDefaults(Configuration.java:142)
>>        at
>>
>> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1214)
>>        at
>> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
>>        at
>> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
>>        at
>>
>> org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java
>> :124)
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/jetty%3Arun-didn%27t-work-with-overlay-tp21122671p21122671.html
>> Sent from the Jetty Discuss mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/jetty%3Arun-didn%27t-work-with-overlay-tp21122671p21138295.html
Sent from the Jetty Discuss mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jetty:run didn't work with overlay

Alfred Chan
Hi David,

Thanks a lot. The workaround works!!
But, I have another question about the resource exclusion during jetty:run.

For example, I've configured maven-war-plugin to include only part of projectA WAR. It seems that jetty:run doesn't take the following configuration into account. Can I configure jetty to support it?

Thanks,
Alfred

                       
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-war-plugin</artifactId>
                                <configuration>
                                        <overlays>
                                                <overlay>
                                                        <groupId>test</groupId>
                                                        <artifactId>projectA</artifactId>
                                                       
                                                        <includes>
                                                                <include>WEB-INF/classes/**/*</include>
                                                                <include>js/jquery*.js</include>
                                                        </includes>
                                                </overlay>
                                        </overlays>
                                </configuration>
                        </plugin>


David Yu-3 wrote
Just tried it myself and I got that exception too.
It works fine if there are no war dependencies though. I'll investigate.
Meanwhile, as a workaround, do:

          <webAppConfig>
            <contextPath>/</contextPath>
            <defaultsDescriptor>webdefault.xml</defaultsDescriptor>
          </webAppConfig>

The lookup is from the classpath. (src/main/resources/webdefault.xml is
available on the classpath)

Cheers,
dyu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jetty:run didn't work with overlay

David Yu-3
Currently there is no configuration for the jetty:run overlays.
It passively enables the overlay when there is a war dependency.
You can however create a new jira for this feature request.

Cheers


On Wed, Dec 24, 2008 at 10:30 AM, Alfred Chan <[hidden email]> wrote:

Hi David,

Thanks a lot. The workaround works!!
But, I have another question about the resource exclusion during jetty:run.

For example, I've configured maven-war-plugin to include only part of
projectA WAR. It seems that jetty:run doesn't take the following
configuration into account. Can I configure jetty to support it?

Thanks,
Alfred

                       <!-- Overlays with iweb-core -->
                       <plugin>
                               <groupId>org.apache.maven.plugins</groupId>
                               <artifactId>maven-war-plugin</artifactId>
                               <configuration>
                                       <overlays>
                                               <overlay>
                                                       <groupId>test</groupId>
                                                       <artifactId>projectA</artifactId>
                                                       <!-- Only needs a part of projectA  -->
                                                       <includes>
                                                               <include>WEB-INF/classes/**/*</include>
                                                               <include>js/jquery*.js</include>
                                                       </includes>
                                               </overlay>
                                       </overlays>
                               </configuration>
                       </plugin>



David Yu-3 wrote:
>
> Just tried it myself and I got that exception too.
> It works fine if there are no war dependencies though. I'll investigate.
> Meanwhile, as a workaround, do:
>
>           <webAppConfig>
>             <contextPath>/</contextPath>
>             <defaultsDescriptor>webdefault.xml</defaultsDescriptor>
>           </webAppConfig>
>
> The lookup is from the classpath. (src/main/resources/webdefault.xml is
> available on the classpath)
>
> Cheers,
> dyu
>
>
--
View this message in context: http://www.nabble.com/jetty%3Arun-didn%27t-work-with-overlay-tp21122671p21154409.html
Sent from the Jetty Discuss mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jetty:run didn't work with overlay

Alfred Chan
Hi David,

Thanks a lot!!

Regards,
Alfred

David Yu-3 wrote
Currently there is no configuration for the jetty:run overlays.
It passively enables the overlay when there is a war dependency.
You can however create a new jira for this feature request.

Cheers


On Wed, Dec 24, 2008 at 10:30 AM, Alfred Chan <alfred.ckchan@gmail.com>wrote:

>
> Hi David,
>
> Thanks a lot. The workaround works!!
> But, I have another question about the resource exclusion during jetty:run.
>
> For example, I've configured maven-war-plugin to include only part of
> projectA WAR. It seems that jetty:run doesn't take the following
> configuration into account. Can I configure jetty to support it?
>
> Thanks,
> Alfred
>
>                        
>                        <plugin>
>                                <groupId>org.apache.maven.plugins</groupId>
>                                <artifactId>maven-war-plugin</artifactId>
>                                <configuration>
>                                        <overlays>
>                                                <overlay>
>
>  <groupId>test</groupId>
>
>  <artifactId>projectA</artifactId>
>                                                        
>                                                         <includes>
>
>  <include>WEB-INF/classes/**/*</include>
>
>  <include>js/jquery*.js</include>
>                                                        </includes>
>                                                </overlay>
>                                        </overlays>
>                                </configuration>
>                        </plugin>
>
>
>
> David Yu-3 wrote:
> >
> > Just tried it myself and I got that exception too.
> > It works fine if there are no war dependencies though. I'll investigate.
> > Meanwhile, as a workaround, do:
> >
> >           <webAppConfig>
> >             <contextPath>/</contextPath>
> >             <defaultsDescriptor>webdefault.xml</defaultsDescriptor>
> >           </webAppConfig>
> >
> > The lookup is from the classpath. (src/main/resources/webdefault.xml is
> > available on the classpath)
> >
> > Cheers,
> > dyu
> >
> >
> --
> View this message in context:
> http://www.nabble.com/jetty%3Arun-didn%27t-work-with-overlay-tp21122671p21154409.html
> Sent from the Jetty Discuss mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jetty:run didn't work with overlay

LearnerDev
Hi,

I see that this work around is still required.

With this work-around, we seem to be hitting a problem while implementing
 ServletContext.getRealPath() method where getRealPath returns null value (which it didn't before).

The work-around was implemented by replacing the following
          <webDefaultXml>
            src/test/resources/jetty/webdefault.xml
          </webDefaultXml>


BY

          <webAppConfig>
             <contextPath>/</contextPath>
             <defaultsDescriptor>src/test/resources/jetty/webdefault.xml</defaultsDescriptor>
          </webAppConfig>


Any clue would be helpful.

AP

> > Meanwhile, as a workaround, do:
> >
> >           <webAppConfig>
> >             <contextPath>/</contextPath>
> >             <defaultsDescriptor>webdefault.xml</defaultsDescriptor>
> >           </webAppConfig>

&&

>> Currently there is no configuration for the jetty:run overlays.
>> It passively enables the overlay when there is a war dependency.
>> You can however create a new jira for this feature request.

>> Cheers
Loading...