Jon Pearson | 2 Nov 12:38 2009

[jetty-user] Default QueuedThreadPool configuration


I was experimenting with the default QueuedThreadPool configuration in 
jetty.xml in particular the behaviour of SpawnOrShrink

  <Set name="SpawnOrShrinkAt">2</Set>

What I found was that with a default > 0 and a single browser loading 
multiple files I would experience occasional pauses of upto 30 seconds.

Using jconsole and the mbean interface to jetty I tracked this back to 
the behaviour/configuration of the ThreadPool. 

When all the currently created threads in the ThreadPool where allocated 
(or waiting for the idle period to expire) a new request would be queued 
until a new thread becomes available even if the ThreadPool was nowhere 
near its maxThreads ie it could create more threads. 

Can somebody explain the rational here for setting SpawnOrShrink and 
maxIdleTimeMs and suggest a better set of defaults.

Thanks
Jon

--

-- 
Emnico Developing EmNOC for Managing IT Networks - www.emnico.com

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

    http://xircles.codehaus.org/manage_email
(Continue reading)

Jan Bartel | 3 Nov 01:40 2009

Re: [jetty-user] Has the following deadlock been fixed since 6.1.9?

I don't recall ever seeing a bug report like this for the acceptors. 

The most recent Jetty is 6.1.22, so you could try that and see if you can
reproduce.

If you can, please raise a JIRA for it, including your OS, java version
and full thread dumps so we can track it down.

thanks
Jan

Robert Nicholson wrote:
> So I suppose we could try the highest version of 6.x and expect this to 
> be fixed or do we have to go to 7?
> 
> I've checked the JIRA and I don't see anything that matches this problem 
> exactly.
> 
> On Oct 28, 2009, at 8:53 PM, Jesse McConnell wrote:
> 
>> pretty sure, that was 12 versions ago and I haven't seen a report like
>> that in ages
>>
>> jesse
>>
>> -- 
>> jesse mcconnell
>> jesse.mcconnell <at> gmail.com
>>
>>
(Continue reading)

Jan Bartel | 3 Nov 02:00 2009

Re: [jetty-user] Deploying more than one war with jetty maven plugin

Stevo,

I could have sworn that I wrote documentation on all of this, but I can't
find it at Eclipse for jetty7 (http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin)
nor at Codehaus!

The way to configure the webapp now is via the <webAppConfig> element.
So, do <webAppConfig><tempDirectory>/foo</tempDirectory></webAppConfig>
instead. We had actually said that nearly all of the other configuration 
properties were deprecated once we introduced the <webAppConfig> element in jetty6, 
and in jetty7 we've just removed them.

I realise its a pain if you're transitioning from 6->7, but its simple to
update. Plus, like I said, I thought I had documented that to make it easier,
but it seems to have disappeared!  

I shall have to write it again :(

Jan

Stevo Slavić wrote:
> Why is tmpDirectory  <at> readonly? IMO it should be configurable. Javadoc 
> for tmpDirectory parameter is wrong too, it says "Defaults to 
> target/jetty-tmp" and in next line it is configured to " <at> parameter 
> expression="${project.build.directory}/tmp""
> 
> Regards,
> Stevo.
> 
> 2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>
(Continue reading)

Stevo Slavić | 3 Nov 08:24 2009
Picon

Re: [jetty-user] Deploying more than one war with jetty maven plugin

Thanks Jan,

I'll give it a try. In the meantime I've found this just recently created related issue in Jetty's issue tracker.

Regards,
Stevo.

2009/11/3 Jan Bartel <janb <at> webtide.com>
Stevo,

I could have sworn that I wrote documentation on all of this, but I can't
find it at Eclipse for jetty7 (http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin)
nor at Codehaus!

The way to configure the webapp now is via the <webAppConfig> element.
So, do <webAppConfig><tempDirectory>/foo</tempDirectory></webAppConfig>
instead. We had actually said that nearly all of the other configuration properties were deprecated once we introduced the <webAppConfig> element in jetty6, and in jetty7 we've just removed them.

I realise its a pain if you're transitioning from 6->7, but its simple to
update. Plus, like I said, I thought I had documented that to make it easier,
but it seems to have disappeared!  
I shall have to write it again :(

Jan

Stevo Slavić wrote:
Why is tmpDirectory <at> readonly? IMO it should be configurable. Javadoc for tmpDirectory parameter is wrong too, it says "Defaults to target/jetty-tmp" and in next line it is configured to " <at> parameter expression="${project.build.directory}/tmp""

Regards,
Stevo.

2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


   Debugging jetty-maven-plugin:7.0.0.v20091005, there seems to be a
   bug in AbstractJettyMojo's startJetty method: connectors are defined
   in jetty.xml and server instance gets initialized with them via
   applyJettyXml() call, but right after that call without any checks
   server connectors get cleared and reinitialized to some default
   connector because no connectors weren't defined in plugin's pom
   configuration. IMO plugin should do this clear and initialize
   connectors only if connectors were defined in pom, or if connectors
   weren't initialized in jetty.xml and no connectors were defined in pom.

   Regards,
   Stevo.

   2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


       Can't get this to work with
       jetty-maven-plugin:7.0.0.v20091005... All the packages are
       adjusted; build log prints that server is being configured with
       jetty.xml and that it is started, but webapp(s) don't start.
       Hope it is not that issue from 6.1.20
       <http://jira.codehaus.org/browse/JETTY-1091> again. If I

       configure all webapps in jetty.xml, which plugin goal should be
       used to start server? Would like to start it in
       pre-integration-test phase, and stop in post-integration-test phase.

       Regards,
       Stevo.

       2009/10/6 Stevo Slavić <sslavic <at> gmail.com
       <mailto:sslavic <at> gmail.com>>


           Joe,

           Thank you very much!

           I assume adding another war will basically come down to
           adding new item in handler collection and configuring it via
           another ref.

           Wish this example was part of Maven Jetty Plugin
           Configuration Guide
           <http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin>.

           Even more I wish it was possible to configure plugin in pom
           only, so that Maven knows given module depends on referenced
           war(s) even if only in test scope so if they were part of
           same project Maven reactor could appropriately reorder build.

           Regards,
           Stevo.

           2009/10/6 Caristi, Joe <jcaristi <at> whisolutions.com
           <mailto:jcaristi <at> whisolutions.com>>


               Add a Jetty configuration to the Jetty plugin like this:

               
               <plugin>

                     <groupId>org.mortbay.jetty</groupId>

                     <artifactId>_maven_-_jetty_-_plugin_</artifactId>

                     <configuration>

                                         <jettyConfig>_src_/test/resources/jetty.xml</jettyConfig>

                     </configuration>

               </plugin>

               
               In the configuration, create a handler for the dependent
               WAR:

               
               <Configure id=/"Server"/ class=/"org.mortbay.jetty.Server"/>

                   <!--
               ===========================================================
               -->

                   <!-- Set handler Collection
               Structure                            -->

                   <!--
               ===========================================================
               -->

                   <Set name=/"handler"/>

                       <!-- the collection of handlers that will handle
               the request -->

                       <New id=/"Handlers"/

                                         class=/"org.mortbay.jetty.handler.HandlerCollection"/>

                           <Set name=/"handlers"/>

                               <Array type=/"org.mortbay.jetty.Handler"/>

                                   <Item>

                                       <New id=/"WebHandler"/

                                                         class=/"org.mortbay.jetty.webapp.WebAppContext"/ />

                                   </Item>

                               </Array>

                           </Set>

                       </New>

                   </Set>

                       <Ref id=/"WebHandler"/>

                       <Set name=/"contextPath"/>/dependency-app</Set>

                       <Set
               name=/"war"/>../dependency-app/target/dependency-app-0.0.1-SNAPSHOT.war</Set>

                   </Ref>

                </Configure>

               
               ------------------------------------------------------------------------

               *From:* Stevo Slavić [mailto:sslavic <at> gmail.com
               <mailto:sslavic <at> gmail.com>]
               *Sent:* Tuesday, October 06, 2009 8:02 AM
               *To:* Jetty Users List
               *Subject:* [jetty-user] Deploying more than one war with
               jetty maven plugin

               
               Hello Jetty users,

               Is there a way to deploy/run more than one war using
               jetty maven plugin?

               Thanks in advance!

               Regards,
               Stevo.


               ------------------------------------------------------------------------
               STATEMENT OF CONFIDENTIALITY:



               The information contained in this electronic message and
               any attachments to
               this message are intended for the exclusive use of the
               addressee(s) and may
               contain confidential or privileged information. If you
               are not the intended
               recipient, please notify WHI Solutions immediately at
               gc <at> whisolutions.com <mailto:gc <at> whisolutions.com>,

               and destroy all copies of this message and any attachments.







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

  http://xircles.codehaus.org/manage_email



Tasso Angelidis | 3 Nov 20:00 2009
Picon

[jetty-user] Hash realm refresh doesn't refresh.

Hi I'm having trouble getting the refresh working.

The realm works absolutely fine, but I can't seem to make new entries without having to stop the server and
the refresh doesn't seem to kick in.

1- I start the server, I open browser and authenticate no problem
2- Close browser instance completely
3- Add new user to properties file
4- Restart browser, try to authenticate new user, but to no avail.

    <Set name="UserRealms">
      <Array type="org.mortbay.jetty.security.UserRealm">
        <Item>
          <New class="org.mortbay.jetty.security.HashUserRealm">
            <Set name="name">My Realm</Set>
            <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/myrealm.properties</Set>
            <Set name="refreshInterval">5</Set>
	<Call name="start"></Call>
          </New>
        </Item>
      </Array>
    </Set>

myrealm.properties
someuser: somevalue,somerole

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

    http://xircles.codehaus.org/manage_email

Stevo Slavić | 4 Nov 01:10 2009
Picon

Re: [jetty-user] Deploying more than one war with jetty maven plugin

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.mortbay.jetty:jetty-maven-plugin:7.0.0.v20091005



Cause: Setter org.mortbay.jetty.plugin.JettyWebAppContext.setTempDirectory( java.lang.Class ) threw exception when called with parameter 'D:\workspace\project\target\jetty\tmp': Bad temp directory: D:\workspace\project\target\jetty\tmp


What's so bad about ${project.build.directory}/jetty/tmp as tempDirectory? Neither jetty nor tmp directories exist but I'd expect plugin to create them. WebAppContext has a bug, its "public void setTempDirectory(File dir)" instead of

...
        if (dir!=null && !dir.exists())
        {
            dir.mkdir();
            dir.deleteOnExit();
        }
...

should have

...
        if (dir!=null && !dir.exists())
        {
            dir.mkdirs();
            dir.deleteOnExit();
        }
...



Regards,
Stevo.



2009/11/3 Stevo Slavić <sslavic <at> gmail.com>
Thanks Jan,

I'll give it a try. In the meantime I've found this just recently created related issue in Jetty's issue tracker.

Regards,
Stevo.

2009/11/3 Jan Bartel <janb <at> webtide.com>

Stevo,

I could have sworn that I wrote documentation on all of this, but I can't
find it at Eclipse for jetty7 (http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin)
nor at Codehaus!

The way to configure the webapp now is via the <webAppConfig> element.
So, do <webAppConfig><tempDirectory>/foo</tempDirectory></webAppConfig>
instead. We had actually said that nearly all of the other configuration properties were deprecated once we introduced the <webAppConfig> element in jetty6, and in jetty7 we've just removed them.

I realise its a pain if you're transitioning from 6->7, but its simple to
update. Plus, like I said, I thought I had documented that to make it easier,
but it seems to have disappeared!  
I shall have to write it again :(

Jan

Stevo Slavić wrote:
Why is tmpDirectory <at> readonly? IMO it should be configurable. Javadoc for tmpDirectory parameter is wrong too, it says "Defaults to target/jetty-tmp" and in next line it is configured to " <at> parameter expression="${project.build.directory}/tmp""

Regards,
Stevo.

2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


   Debugging jetty-maven-plugin:7.0.0.v20091005, there seems to be a
   bug in AbstractJettyMojo's startJetty method: connectors are defined
   in jetty.xml and server instance gets initialized with them via
   applyJettyXml() call, but right after that call without any checks
   server connectors get cleared and reinitialized to some default
   connector because no connectors weren't defined in plugin's pom
   configuration. IMO plugin should do this clear and initialize
   connectors only if connectors were defined in pom, or if connectors
   weren't initialized in jetty.xml and no connectors were defined in pom.

   Regards,
   Stevo.

   2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


       Can't get this to work with
       jetty-maven-plugin:7.0.0.v20091005... All the packages are
       adjusted; build log prints that server is being configured with
       jetty.xml and that it is started, but webapp(s) don't start.
       Hope it is not that issue from 6.1.20
       <http://jira.codehaus.org/browse/JETTY-1091> again. If I

       configure all webapps in jetty.xml, which plugin goal should be
       used to start server? Would like to start it in
       pre-integration-test phase, and stop in post-integration-test phase.

       Regards,
       Stevo.

       2009/10/6 Stevo Slavić <sslavic <at> gmail.com
       <mailto:sslavic <at> gmail.com>>


           Joe,

           Thank you very much!

           I assume adding another war will basically come down to
           adding new item in handler collection and configuring it via
           another ref.

           Wish this example was part of Maven Jetty Plugin
           Configuration Guide
           <http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin>.

           Even more I wish it was possible to configure plugin in pom
           only, so that Maven knows given module depends on referenced
           war(s) even if only in test scope so if they were part of
           same project Maven reactor could appropriately reorder build.

           Regards,
           Stevo.

           2009/10/6 Caristi, Joe <jcaristi <at> whisolutions.com
           <mailto:jcaristi <at> whisolutions.com>>


               Add a Jetty configuration to the Jetty plugin like this:

               
               <plugin>

                     <groupId>org.mortbay.jetty</groupId>

                     <artifactId>_maven_-_jetty_-_plugin_</artifactId>

                     <configuration>

                                         <jettyConfig>_src_/test/resources/jetty.xml</jettyConfig>

                     </configuration>

               </plugin>

               
               In the configuration, create a handler for the dependent
               WAR:

               
               <Configure id=/"Server"/ class=/"org.mortbay.jetty.Server"/>

                   <!--
               ===========================================================
               -->

                   <!-- Set handler Collection
               Structure                            -->

                   <!--
               ===========================================================
               -->

                   <Set name=/"handler"/>

                       <!-- the collection of handlers that will handle
               the request -->

                       <New id=/"Handlers"/

                                         class=/"org.mortbay.jetty.handler.HandlerCollection"/>

                           <Set name=/"handlers"/>

                               <Array type=/"org.mortbay.jetty.Handler"/>

                                   <Item>

                                       <New id=/"WebHandler"/

                                                         class=/"org.mortbay.jetty.webapp.WebAppContext"/ />

                                   </Item>

                               </Array>

                           </Set>

                       </New>

                   </Set>

                       <Ref id=/"WebHandler"/>

                       <Set name=/"contextPath"/>/dependency-app</Set>

                       <Set
               name=/"war"/>../dependency-app/target/dependency-app-0.0.1-SNAPSHOT.war</Set>

                   </Ref>

                </Configure>

               
               ------------------------------------------------------------------------

               *From:* Stevo Slavić [mailto:sslavic <at> gmail.com
               <mailto:sslavic <at> gmail.com>]
               *Sent:* Tuesday, October 06, 2009 8:02 AM
               *To:* Jetty Users List
               *Subject:* [jetty-user] Deploying more than one war with
               jetty maven plugin

               
               Hello Jetty users,

               Is there a way to deploy/run more than one war using
               jetty maven plugin?

               Thanks in advance!

               Regards,
               Stevo.


               ------------------------------------------------------------------------
               STATEMENT OF CONFIDENTIALITY:



               The information contained in this electronic message and
               any attachments to
               this message are intended for the exclusive use of the
               addressee(s) and may
               contain confidential or privileged information. If you
               are not the intended
               recipient, please notify WHI Solutions immediately at
               gc <at> whisolutions.com <mailto:gc <at> whisolutions.com>,

               and destroy all copies of this message and any attachments.







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

  http://xircles.codehaus.org/manage_email




Stevo Slavić | 4 Nov 02:14 2009
Picon

Re: [jetty-user] Deploying more than one war with jetty maven plugin

Yet another issue, now class loading related: when I try to "mvn clean verify" example project from this Jetty issue adjusted to use jetty-maven-plugin 7.0.0.v20091005 instead of 6.1.x, Jetty fails to start because of spaces in classpath (see [1]). Could this be caused by this maven issue, or is it Jetty classloader issue?

Regards,
Stevo.


[1] build log stack trace snippet

[INFO] [jetty:deploy-war {execution: start-jetty}]
[INFO] Configuring Jetty for project: Unnamed - foo.bar:jetty:war:0.0.1-SNAPSHOT

2009-11-04 01:54:34.516:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog
[INFO] Context path = /jetty
[INFO] Tmp directory = D:\temp\jetty\foo.bar.jetty\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] Starting jetty 7.0.0.v20091005 ...
2009-11-04 01:54:34.594:INFO::jetty-7.0.0.v20091005
2009-11-04 01:55:05.451:INFO::Extract jar:file:/D:/temp/jetty/foo.bar.jetty/target/jetty-0.0.1-SNAPSHOT.war!/ to D:\temp\jetty\foo.bar.jetty\target\tmp\webapp
2009-11-04 02:03:47.109:WARN::Failed startup of context JettyWebAppContext <at> 9a33c3 <at> 9a33c3/jetty,file:/D:/temp/jetty/foo.bar.jetty/target/tmp/webapp/,D:\temp\jetty\foo.bar.jetty\target\jetty-0.0.1-SNAPSHOT.war
java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/s.slavic/.m2/repository/org/mortbay/jetty/jetty-maven-plugin/7.0.0.v20091005/jetty-maven-plugin-7.0.0.v20091005.jar
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parseHierarchical(URI.java:3066)
        at java.net.URI$Parser.parse(URI.java:3014)
        at java.net.URI.<init>(URI.java:578)
        at java.net.URL.toURI(URL.java:918)
        at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:81)
        at org.mortbay.jetty.plugin.MavenWebInfConfiguration.preConfigure(MavenWebInfConfiguration.java:117)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:339)
        at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:102)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
Listening for transport dt_socket at address: 8000
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
        at org.eclipse.jetty.server.Server.doStart(Server.java:232)
        at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:69)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:433)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:377)
        at org.mortbay.jetty.plugin.JettyRunWarMojo.execute(JettyRunWarMojo.java:68)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
2009-11-04 02:03:47.265:INFO::Started SelectChannelConnector <at> 0.0.0.0:8181
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.
[INFO] [jetty:stop {execution: stop-jetty}]
[INFO] Stopping server 0



2009/11/4 Stevo Slavić <sslavic <at> gmail.com>
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.mortbay.jetty:jetty-maven-plugin:7.0.0.v20091005



Cause: Setter org.mortbay.jetty.plugin.JettyWebAppContext.setTempDirectory( java.lang.Class ) threw exception when called with parameter 'D:\workspace\project\target\jetty\tmp': Bad temp directory: D:\workspace\project\target\jetty\tmp


What's so bad about ${project.build.directory}/jetty/tmp as tempDirectory? Neither jetty nor tmp directories exist but I'd expect plugin to create them. WebAppContext has a bug, its "public void setTempDirectory(File dir)" instead of

...
        if (dir!=null && !dir.exists())
        {
            dir.mkdir();
            dir.deleteOnExit();
        }
...

should have

...
        if (dir!=null && !dir.exists())
        {
            dir.mkdirs();
            dir.deleteOnExit();
        }
...



Regards,
Stevo.



2009/11/3 Stevo Slavić <sslavic <at> gmail.com>

Thanks Jan,

I'll give it a try. In the meantime I've found this just recently created related issue in Jetty's issue tracker.

Regards,
Stevo.

2009/11/3 Jan Bartel <janb <at> webtide.com>

Stevo,

I could have sworn that I wrote documentation on all of this, but I can't
find it at Eclipse for jetty7 (http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin)
nor at Codehaus!

The way to configure the webapp now is via the <webAppConfig> element.
So, do <webAppConfig><tempDirectory>/foo</tempDirectory></webAppConfig>
instead. We had actually said that nearly all of the other configuration properties were deprecated once we introduced the <webAppConfig> element in jetty6, and in jetty7 we've just removed them.

I realise its a pain if you're transitioning from 6->7, but its simple to
update. Plus, like I said, I thought I had documented that to make it easier,
but it seems to have disappeared!  
I shall have to write it again :(

Jan

Stevo Slavić wrote:
Why is tmpDirectory <at> readonly? IMO it should be configurable. Javadoc for tmpDirectory parameter is wrong too, it says "Defaults to target/jetty-tmp" and in next line it is configured to " <at> parameter expression="${project.build.directory}/tmp""

Regards,
Stevo.

2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


   Debugging jetty-maven-plugin:7.0.0.v20091005, there seems to be a
   bug in AbstractJettyMojo's startJetty method: connectors are defined
   in jetty.xml and server instance gets initialized with them via
   applyJettyXml() call, but right after that call without any checks
   server connectors get cleared and reinitialized to some default
   connector because no connectors weren't defined in plugin's pom
   configuration. IMO plugin should do this clear and initialize
   connectors only if connectors were defined in pom, or if connectors
   weren't initialized in jetty.xml and no connectors were defined in pom.

   Regards,
   Stevo.

   2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


       Can't get this to work with
       jetty-maven-plugin:7.0.0.v20091005... All the packages are
       adjusted; build log prints that server is being configured with
       jetty.xml and that it is started, but webapp(s) don't start.
       Hope it is not that issue from 6.1.20
       <http://jira.codehaus.org/browse/JETTY-1091> again. If I

       configure all webapps in jetty.xml, which plugin goal should be
       used to start server? Would like to start it in
       pre-integration-test phase, and stop in post-integration-test phase.

       Regards,
       Stevo.

       2009/10/6 Stevo Slavić <sslavic <at> gmail.com
       <mailto:sslavic <at> gmail.com>>


           Joe,

           Thank you very much!

           I assume adding another war will basically come down to
           adding new item in handler collection and configuring it via
           another ref.

           Wish this example was part of Maven Jetty Plugin
           Configuration Guide
           <http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin>.

           Even more I wish it was possible to configure plugin in pom
           only, so that Maven knows given module depends on referenced
           war(s) even if only in test scope so if they were part of
           same project Maven reactor could appropriately reorder build.

           Regards,
           Stevo.

           2009/10/6 Caristi, Joe <jcaristi <at> whisolutions.com
           <mailto:jcaristi <at> whisolutions.com>>


               Add a Jetty configuration to the Jetty plugin like this:

               
               <plugin>

                     <groupId>org.mortbay.jetty</groupId>

                     <artifactId>_maven_-_jetty_-_plugin_</artifactId>

                     <configuration>

                                         <jettyConfig>_src_/test/resources/jetty.xml</jettyConfig>

                     </configuration>

               </plugin>

               
               In the configuration, create a handler for the dependent
               WAR:

               
               <Configure id=/"Server"/ class=/"org.mortbay.jetty.Server"/>

                   <!--
               ===========================================================
               -->

                   <!-- Set handler Collection
               Structure                            -->

                   <!--
               ===========================================================
               -->

                   <Set name=/"handler"/>

                       <!-- the collection of handlers that will handle
               the request -->

                       <New id=/"Handlers"/

                                         class=/"org.mortbay.jetty.handler.HandlerCollection"/>

                           <Set name=/"handlers"/>

                               <Array type=/"org.mortbay.jetty.Handler"/>

                                   <Item>

                                       <New id=/"WebHandler"/

                                                         class=/"org.mortbay.jetty.webapp.WebAppContext"/ />

                                   </Item>

                               </Array>

                           </Set>

                       </New>

                   </Set>

                       <Ref id=/"WebHandler"/>

                       <Set name=/"contextPath"/>/dependency-app</Set>

                       <Set
               name=/"war"/>../dependency-app/target/dependency-app-0.0.1-SNAPSHOT.war</Set>

                   </Ref>

                </Configure>

               
               ------------------------------------------------------------------------

               *From:* Stevo Slavić [mailto:sslavic <at> gmail.com
               <mailto:sslavic <at> gmail.com>]
               *Sent:* Tuesday, October 06, 2009 8:02 AM
               *To:* Jetty Users List
               *Subject:* [jetty-user] Deploying more than one war with
               jetty maven plugin

               
               Hello Jetty users,

               Is there a way to deploy/run more than one war using
               jetty maven plugin?

               Thanks in advance!

               Regards,
               Stevo.


               ------------------------------------------------------------------------
               STATEMENT OF CONFIDENTIALITY:



               The information contained in this electronic message and
               any attachments to
               this message are intended for the exclusive use of the
               addressee(s) and may
               contain confidential or privileged information. If you
               are not the intended
               recipient, please notify WHI Solutions immediately at
               gc <at> whisolutions.com <mailto:gc <at> whisolutions.com>,

               and destroy all copies of this message and any attachments.







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

  http://xircles.codehaus.org/manage_email





Stevo Slavić | 4 Nov 10:02 2009
Picon

Re: [jetty-user] Deploying more than one war with jetty maven plugin

Since this works in maven-jetty-plugin, then I guess this classpath URLs with spaces issue is not maven related but in jetty and/or jetty-maven-plugin v7.

Regards,
Stevo.

2009/11/4 Stevo Slavić <sslavic <at> gmail.com>
Yet another issue, now class loading related: when I try to "mvn clean verify" example project from this Jetty issue adjusted to use jetty-maven-plugin 7.0.0.v20091005 instead of 6.1.x, Jetty fails to start because of spaces in classpath (see [1]). Could this be caused by this maven issue, or is it Jetty classloader issue?

Regards,
Stevo.


[1] build log stack trace snippet

[INFO] [jetty:deploy-war {execution: start-jetty}]
[INFO] Configuring Jetty for project: Unnamed - foo.bar:jetty:war:0.0.1-SNAPSHOT

2009-11-04 01:54:34.516:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog
[INFO] Context path = /jetty
[INFO] Tmp directory = D:\temp\jetty\foo.bar.jetty\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] Starting jetty 7.0.0.v20091005 ...
2009-11-04 01:54:34.594:INFO::jetty-7.0.0.v20091005
2009-11-04 01:55:05.451:INFO::Extract jar:file:/D:/temp/jetty/foo.bar.jetty/target/jetty-0.0.1-SNAPSHOT.war!/ to D:\temp\jetty\foo.bar.jetty\target\tmp\webapp
2009-11-04 02:03:47.109:WARN::Failed startup of context JettyWebAppContext <at> 9a33c3 <at> 9a33c3/jetty,file:/D:/temp/jetty/foo.bar.jetty/target/tmp/webapp/,D:\temp\jetty\foo.bar.jetty\target\jetty-0.0.1-SNAPSHOT.war
java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/s.slavic/.m2/repository/org/mortbay/jetty/jetty-maven-plugin/7.0.0.v20091005/jetty-maven-plugin-7.0.0.v20091005.jar
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parseHierarchical(URI.java:3066)
        at java.net.URI$Parser.parse(URI.java:3014)
        at java.net.URI.<init>(URI.java:578)
        at java.net.URL.toURI(URL.java:918)
        at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:81)
        at org.mortbay.jetty.plugin.MavenWebInfConfiguration.preConfigure(MavenWebInfConfiguration.java:117)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:339)
        at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:102)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
Listening for transport dt_socket at address: 8000
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
        at org.eclipse.jetty.server.Server.doStart(Server.java:232)
        at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:69)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:433)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:377)
        at org.mortbay.jetty.plugin.JettyRunWarMojo.execute(JettyRunWarMojo.java:68)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
2009-11-04 02:03:47.265:INFO::Started SelectChannelConnector <at> 0.0.0.0:8181
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.
[INFO] [jetty:stop {execution: stop-jetty}]
[INFO] Stopping server 0



2009/11/4 Stevo Slavić <sslavic <at> gmail.com>

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.mortbay.jetty:jetty-maven-plugin:7.0.0.v20091005



Cause: Setter org.mortbay.jetty.plugin.JettyWebAppContext.setTempDirectory( java.lang.Class ) threw exception when called with parameter 'D:\workspace\project\target\jetty\tmp': Bad temp directory: D:\workspace\project\target\jetty\tmp


What's so bad about ${project.build.directory}/jetty/tmp as tempDirectory? Neither jetty nor tmp directories exist but I'd expect plugin to create them. WebAppContext has a bug, its "public void setTempDirectory(File dir)" instead of

...
        if (dir!=null && !dir.exists())
        {
            dir.mkdir();
            dir.deleteOnExit();
        }
...

should have

...
        if (dir!=null && !dir.exists())
        {
            dir.mkdirs();
            dir.deleteOnExit();
        }
...



Regards,
Stevo.



2009/11/3 Stevo Slavić <sslavic <at> gmail.com>

Thanks Jan,

I'll give it a try. In the meantime I've found this just recently created related issue in Jetty's issue tracker.

Regards,
Stevo.

2009/11/3 Jan Bartel <janb <at> webtide.com>

Stevo,

I could have sworn that I wrote documentation on all of this, but I can't
find it at Eclipse for jetty7 (http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin)
nor at Codehaus!

The way to configure the webapp now is via the <webAppConfig> element.
So, do <webAppConfig><tempDirectory>/foo</tempDirectory></webAppConfig>
instead. We had actually said that nearly all of the other configuration properties were deprecated once we introduced the <webAppConfig> element in jetty6, and in jetty7 we've just removed them.

I realise its a pain if you're transitioning from 6->7, but its simple to
update. Plus, like I said, I thought I had documented that to make it easier,
but it seems to have disappeared!  
I shall have to write it again :(

Jan

Stevo Slavić wrote:
Why is tmpDirectory <at> readonly? IMO it should be configurable. Javadoc for tmpDirectory parameter is wrong too, it says "Defaults to target/jetty-tmp" and in next line it is configured to " <at> parameter expression="${project.build.directory}/tmp""

Regards,
Stevo.

2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


   Debugging jetty-maven-plugin:7.0.0.v20091005, there seems to be a
   bug in AbstractJettyMojo's startJetty method: connectors are defined
   in jetty.xml and server instance gets initialized with them via
   applyJettyXml() call, but right after that call without any checks
   server connectors get cleared and reinitialized to some default
   connector because no connectors weren't defined in plugin's pom
   configuration. IMO plugin should do this clear and initialize
   connectors only if connectors were defined in pom, or if connectors
   weren't initialized in jetty.xml and no connectors were defined in pom.

   Regards,
   Stevo.

   2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


       Can't get this to work with
       jetty-maven-plugin:7.0.0.v20091005... All the packages are
       adjusted; build log prints that server is being configured with
       jetty.xml and that it is started, but webapp(s) don't start.
       Hope it is not that issue from 6.1.20
       <http://jira.codehaus.org/browse/JETTY-1091> again. If I

       configure all webapps in jetty.xml, which plugin goal should be
       used to start server? Would like to start it in
       pre-integration-test phase, and stop in post-integration-test phase.

       Regards,
       Stevo.

       2009/10/6 Stevo Slavić <sslavic <at> gmail.com
       <mailto:sslavic <at> gmail.com>>


           Joe,

           Thank you very much!

           I assume adding another war will basically come down to
           adding new item in handler collection and configuring it via
           another ref.

           Wish this example was part of Maven Jetty Plugin
           Configuration Guide
           <http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin>.

           Even more I wish it was possible to configure plugin in pom
           only, so that Maven knows given module depends on referenced
           war(s) even if only in test scope so if they were part of
           same project Maven reactor could appropriately reorder build.

           Regards,
           Stevo.

           2009/10/6 Caristi, Joe <jcaristi <at> whisolutions.com
           <mailto:jcaristi <at> whisolutions.com>>


               Add a Jetty configuration to the Jetty plugin like this:

               
               <plugin>

                     <groupId>org.mortbay.jetty</groupId>

                     <artifactId>_maven_-_jetty_-_plugin_</artifactId>

                     <configuration>

                                         <jettyConfig>_src_/test/resources/jetty.xml</jettyConfig>

                     </configuration>

               </plugin>

               
               In the configuration, create a handler for the dependent
               WAR:

               
               <Configure id=/"Server"/ class=/"org.mortbay.jetty.Server"/>

                   <!--
               ===========================================================
               -->

                   <!-- Set handler Collection
               Structure                            -->

                   <!--
               ===========================================================
               -->

                   <Set name=/"handler"/>

                       <!-- the collection of handlers that will handle
               the request -->

                       <New id=/"Handlers"/

                                         class=/"org.mortbay.jetty.handler.HandlerCollection"/>

                           <Set name=/"handlers"/>

                               <Array type=/"org.mortbay.jetty.Handler"/>

                                   <Item>

                                       <New id=/"WebHandler"/

                                                         class=/"org.mortbay.jetty.webapp.WebAppContext"/ />

                                   </Item>

                               </Array>

                           </Set>

                       </New>

                   </Set>

                       <Ref id=/"WebHandler"/>

                       <Set name=/"contextPath"/>/dependency-app</Set>

                       <Set
               name=/"war"/>../dependency-app/target/dependency-app-0.0.1-SNAPSHOT.war</Set>

                   </Ref>

                </Configure>

               
               ------------------------------------------------------------------------

               *From:* Stevo Slavić [mailto:sslavic <at> gmail.com
               <mailto:sslavic <at> gmail.com>]
               *Sent:* Tuesday, October 06, 2009 8:02 AM
               *To:* Jetty Users List
               *Subject:* [jetty-user] Deploying more than one war with
               jetty maven plugin

               
               Hello Jetty users,

               Is there a way to deploy/run more than one war using
               jetty maven plugin?

               Thanks in advance!

               Regards,
               Stevo.


               ------------------------------------------------------------------------
               STATEMENT OF CONFIDENTIALITY:



               The information contained in this electronic message and
               any attachments to
               this message are intended for the exclusive use of the
               addressee(s) and may
               contain confidential or privileged information. If you
               are not the intended
               recipient, please notify WHI Solutions immediately at
               gc <at> whisolutions.com <mailto:gc <at> whisolutions.com>,

               and destroy all copies of this message and any attachments.







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

  http://xircles.codehaus.org/manage_email






Stevo Slavić | 4 Nov 10:07 2009
Picon

Re: [jetty-user] Deploying more than one war with jetty maven plugin

Was having deja vu, this one was closed as won't fix, but how come old jetty maven plugin works well and new one doesn't. I guess new one relies on maven where old one didn't.

Regards,
Stevo.

2009/11/4 Stevo Slavić <sslavic <at> gmail.com>
Since this works in maven-jetty-plugin, then I guess this classpath URLs with spaces issue is not maven related but in jetty and/or jetty-maven-plugin v7.

Regards,
Stevo.


2009/11/4 Stevo Slavić <sslavic <at> gmail.com>
Yet another issue, now class loading related: when I try to "mvn clean verify" example project from this Jetty issue adjusted to use jetty-maven-plugin 7.0.0.v20091005 instead of 6.1.x, Jetty fails to start because of spaces in classpath (see [1]). Could this be caused by this maven issue, or is it Jetty classloader issue?

Regards,
Stevo.


[1] build log stack trace snippet

[INFO] [jetty:deploy-war {execution: start-jetty}]
[INFO] Configuring Jetty for project: Unnamed - foo.bar:jetty:war:0.0.1-SNAPSHOT

2009-11-04 01:54:34.516:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog
[INFO] Context path = /jetty
[INFO] Tmp directory = D:\temp\jetty\foo.bar.jetty\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] Starting jetty 7.0.0.v20091005 ...
2009-11-04 01:54:34.594:INFO::jetty-7.0.0.v20091005
2009-11-04 01:55:05.451:INFO::Extract jar:file:/D:/temp/jetty/foo.bar.jetty/target/jetty-0.0.1-SNAPSHOT.war!/ to D:\temp\jetty\foo.bar.jetty\target\tmp\webapp
2009-11-04 02:03:47.109:WARN::Failed startup of context JettyWebAppContext <at> 9a33c3 <at> 9a33c3/jetty,file:/D:/temp/jetty/foo.bar.jetty/target/tmp/webapp/,D:\temp\jetty\foo.bar.jetty\target\jetty-0.0.1-SNAPSHOT.war
java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/s.slavic/.m2/repository/org/mortbay/jetty/jetty-maven-plugin/7.0.0.v20091005/jetty-maven-plugin-7.0.0.v20091005.jar
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parseHierarchical(URI.java:3066)
        at java.net.URI$Parser.parse(URI.java:3014)
        at java.net.URI.<init>(URI.java:578)
        at java.net.URL.toURI(URL.java:918)
        at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:81)
        at org.mortbay.jetty.plugin.MavenWebInfConfiguration.preConfigure(MavenWebInfConfiguration.java:117)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:339)
        at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:102)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
Listening for transport dt_socket at address: 8000
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
        at org.eclipse.jetty.server.Server.doStart(Server.java:232)
        at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:69)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:433)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:377)
        at org.mortbay.jetty.plugin.JettyRunWarMojo.execute(JettyRunWarMojo.java:68)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
2009-11-04 02:03:47.265:INFO::Started SelectChannelConnector <at> 0.0.0.0:8181
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.
[INFO] [jetty:stop {execution: stop-jetty}]
[INFO] Stopping server 0



2009/11/4 Stevo Slavić <sslavic <at> gmail.com>

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.mortbay.jetty:jetty-maven-plugin:7.0.0.v20091005



Cause: Setter org.mortbay.jetty.plugin.JettyWebAppContext.setTempDirectory( java.lang.Class ) threw exception when called with parameter 'D:\workspace\project\target\jetty\tmp': Bad temp directory: D:\workspace\project\target\jetty\tmp


What's so bad about ${project.build.directory}/jetty/tmp as tempDirectory? Neither jetty nor tmp directories exist but I'd expect plugin to create them. WebAppContext has a bug, its "public void setTempDirectory(File dir)" instead of

...
        if (dir!=null && !dir.exists())
        {
            dir.mkdir();
            dir.deleteOnExit();
        }
...

should have

...
        if (dir!=null && !dir.exists())
        {
            dir.mkdirs();
            dir.deleteOnExit();
        }
...



Regards,
Stevo.



2009/11/3 Stevo Slavić <sslavic <at> gmail.com>

Thanks Jan,

I'll give it a try. In the meantime I've found this just recently created related issue in Jetty's issue tracker.

Regards,
Stevo.

2009/11/3 Jan Bartel <janb <at> webtide.com>

Stevo,

I could have sworn that I wrote documentation on all of this, but I can't
find it at Eclipse for jetty7 (http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin)
nor at Codehaus!

The way to configure the webapp now is via the <webAppConfig> element.
So, do <webAppConfig><tempDirectory>/foo</tempDirectory></webAppConfig>
instead. We had actually said that nearly all of the other configuration properties were deprecated once we introduced the <webAppConfig> element in jetty6, and in jetty7 we've just removed them.

I realise its a pain if you're transitioning from 6->7, but its simple to
update. Plus, like I said, I thought I had documented that to make it easier,
but it seems to have disappeared!  
I shall have to write it again :(

Jan

Stevo Slavić wrote:
Why is tmpDirectory <at> readonly? IMO it should be configurable. Javadoc for tmpDirectory parameter is wrong too, it says "Defaults to target/jetty-tmp" and in next line it is configured to " <at> parameter expression="${project.build.directory}/tmp""

Regards,
Stevo.

2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


   Debugging jetty-maven-plugin:7.0.0.v20091005, there seems to be a
   bug in AbstractJettyMojo's startJetty method: connectors are defined
   in jetty.xml and server instance gets initialized with them via
   applyJettyXml() call, but right after that call without any checks
   server connectors get cleared and reinitialized to some default
   connector because no connectors weren't defined in plugin's pom
   configuration. IMO plugin should do this clear and initialize
   connectors only if connectors were defined in pom, or if connectors
   weren't initialized in jetty.xml and no connectors were defined in pom.

   Regards,
   Stevo.

   2009/10/29 Stevo Slavić <sslavic <at> gmail.com <mailto:sslavic <at> gmail.com>>


       Can't get this to work with
       jetty-maven-plugin:7.0.0.v20091005... All the packages are
       adjusted; build log prints that server is being configured with
       jetty.xml and that it is started, but webapp(s) don't start.
       Hope it is not that issue from 6.1.20
       <http://jira.codehaus.org/browse/JETTY-1091> again. If I

       configure all webapps in jetty.xml, which plugin goal should be
       used to start server? Would like to start it in
       pre-integration-test phase, and stop in post-integration-test phase.

       Regards,
       Stevo.

       2009/10/6 Stevo Slavić <sslavic <at> gmail.com
       <mailto:sslavic <at> gmail.com>>


           Joe,

           Thank you very much!

           I assume adding another war will basically come down to
           adding new item in handler collection and configuring it via
           another ref.

           Wish this example was part of Maven Jetty Plugin
           Configuration Guide
           <http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin>.

           Even more I wish it was possible to configure plugin in pom
           only, so that Maven knows given module depends on referenced
           war(s) even if only in test scope so if they were part of
           same project Maven reactor could appropriately reorder build.

           Regards,
           Stevo.

           2009/10/6 Caristi, Joe <jcaristi <at> whisolutions.com
           <mailto:jcaristi <at> whisolutions.com>>


               Add a Jetty configuration to the Jetty plugin like this:

               
               <plugin>

                     <groupId>org.mortbay.jetty</groupId>

                     <artifactId>_maven_-_jetty_-_plugin_</artifactId>

                     <configuration>

                                         <jettyConfig>_src_/test/resources/jetty.xml</jettyConfig>

                     </configuration>

               </plugin>

               
               In the configuration, create a handler for the dependent
               WAR:

               
               <Configure id=/"Server"/ class=/"org.mortbay.jetty.Server"/>

                   <!--
               ===========================================================
               -->

                   <!-- Set handler Collection
               Structure                            -->

                   <!--
               ===========================================================
               -->

                   <Set name=/"handler"/>

                       <!-- the collection of handlers that will handle
               the request -->

                       <New id=/"Handlers"/

                                         class=/"org.mortbay.jetty.handler.HandlerCollection"/>

                           <Set name=/"handlers"/>

                               <Array type=/"org.mortbay.jetty.Handler"/>

                                   <Item>

                                       <New id=/"WebHandler"/

                                                         class=/"org.mortbay.jetty.webapp.WebAppContext"/ />

                                   </Item>

                               </Array>

                           </Set>

                       </New>

                   </Set>

                       <Ref id=/"WebHandler"/>

                       <Set name=/"contextPath"/>/dependency-app</Set>

                       <Set
               name=/"war"/>../dependency-app/target/dependency-app-0.0.1-SNAPSHOT.war</Set>

                   </Ref>

                </Configure>

               
               ------------------------------------------------------------------------

               *From:* Stevo Slavić [mailto:sslavic <at> gmail.com
               <mailto:sslavic <at> gmail.com>]
               *Sent:* Tuesday, October 06, 2009 8:02 AM
               *To:* Jetty Users List
               *Subject:* [jetty-user] Deploying more than one war with
               jetty maven plugin

               
               Hello Jetty users,

               Is there a way to deploy/run more than one war using
               jetty maven plugin?

               Thanks in advance!

               Regards,
               Stevo.


               ------------------------------------------------------------------------
               STATEMENT OF CONFIDENTIALITY:



               The information contained in this electronic message and
               any attachments to
               this message are intended for the exclusive use of the
               addressee(s) and may
               contain confidential or privileged information. If you
               are not the intended
               recipient, please notify WHI Solutions immediately at
               gc <at> whisolutions.com <mailto:gc <at> whisolutions.com>,

               and destroy all copies of this message and any attachments.







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

  http://xircles.codehaus.org/manage_email







Tasso Angelidis | 4 Nov 18:07 2009
Picon

RE: [jetty-user] Hash realm refresh doesn't refresh.

Does any one have any ideas!? I'm using Jetty 6.1.21

http://docs.codehaus.org/display/JETTY/Realms specified reloadInterval, but this is wrong also.

-----Original Message-----
From: Tasso Angelidis [mailto:tassoa <at> rbsworldpay.ca]
Sent: Tuesday, November 03, 2009 2:01 PM
To: user <at> jetty.codehaus.org
Subject: [jetty-user] Hash realm refresh doesn't refresh.

Hi I'm having trouble getting the refresh working.

The realm works absolutely fine, but I can't seem to make new entries without having to stop the server and
the refresh doesn't seem to kick in.

1- I start the server, I open browser and authenticate no problem
2- Close browser instance completely
3- Add new user to properties file
4- Restart browser, try to authenticate new user, but to no avail.

    <Set name="UserRealms">
      <Array type="org.mortbay.jetty.security.UserRealm">
        <Item>
          <New class="org.mortbay.jetty.security.HashUserRealm">
            <Set name="name">My Realm</Set>
            <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/myrealm.properties</Set>
            <Set name="refreshInterval">5</Set>
	<Call name="start"></Call>
          </New>
        </Item>
      </Array>
    </Set>

myrealm.properties
someuser: somevalue,somerole

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

    http://xircles.codehaus.org/manage_email

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

    http://xircles.codehaus.org/manage_email


Gmane