Abhishek Singh | 5 Jan 2011 10:27
Picon

[jetty-user] Re: Query Regarding Open TCP Client connections in Jetty !


   1. Jetty version - 6.0.15
   2. OS platform - Linux 2.6.18-194.26.1.el5 #1 SMP Fri Oct 29 14:21:16 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
   3. JVM version - java version "1.6.0_17"  OpenJDK Runtime Environment (IcedTea6 1.7.5) (rhel-1.16.b17.el5-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

I see a 100s of open TCP client connection on jetty. how do i close them ?
do i need to change any configuration like socket timeout ? or session timeout ?

lsof | grep -i 16778 | grep -i tcp

java      16778    system  358u     IPv6            3247547                 TCP 10.159.25.205:39502->10.159.25.205:ldap (ESTABLISHED)
java      16778    system  361u     IPv6            3111379                 TCP 10.159.25.205:41006->10.159.25.205:ldap (ESTABLISHED)
java      16778    system  362u     IPv6            3144943                 TCP 10.159.25.205:36292->10.159.25.205:ldap (ESTABLISHED)
........
.......

any help in this regard will be highly appreciated.

Thanks and Regards,
Abhishek Singh

 



Ondřej Žižka | 10 Jan 2011 20:47
Picon
Favicon
Gravatar

[jetty-user] Stopping programatically causes “1 threads could not be stopped”

Hi,

this is a copy of http://stackoverflow.com/questions/4650713/jetty-stopping-programatically-causes-1-threads-could-not-be-stopped .
I'm sending here to bring some attention to it.


I have a Jetty 6.1.26 instance.
I want to shut it down by HTTP GET sent to `/shutdown`.
So I created a `JettyShutdownServlet`:

    <at> Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

     resp.setStatus(202, "Shutting down.");
     resp.setContentType("text/plain");
     ServletOutputStream os = resp.getOutputStream();
     os.println("Shutting down.");
     os.close();
     resp.flushBuffer();
  
     // Stop the server.
     try {
        log.info("Shutting down the server...");
        server.stop();
     } catch (Exception ex) {
        log.error("Error when stopping Jetty server: "+ex.getMessage(), ex);
     }

However, when I send the request, Jetty does not stop - a thread keeps hanging in `QueuedThreadPool` on the line with `this.wait()`:

       // We are idle
       // wait for a dispatched job
       synchronized (this)
       {
           if (_job==null)
              this.wait(getMaxIdleTimeMs());
           job=_job;
           _job=null;
       }

...

    2011-01-10 20:14:20,375 INFO  org.mortbay.log jetty-6.1.26
    2011-01-10 20:14:34,756 INFO  org.mortbay.log Started SocketConnector <at> 0.0.0.0:17283
    2011-01-10 20:25:40,006 INFO  org.jboss.qa.mavenhoe.MavenHoeApp Shutting down the server...
    2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown SocketConnector <at> 0.0.0.0:17283
    2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown org.mortbay.jetty.servlet.Context <at> 1672bbb{/,null}
    2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown org.mortbay.jetty.webapp.WebAppContext <at> 18d30fb{/jsp,file:/home/ondra/work/Mavenhoe/trunk/target/classes/org/jboss/qa/mavenhoe/web/jsp}
    2011-01-10 20:25:43,007 INFO  org.mortbay.log Stopped SocketConnector <at> 0.0.0.0:17283
    2011-01-10 20:25:43,009 WARN  org.mortbay.log 1 threads could not be stopped
    2011-01-10 20:25:45,010 INFO  org.mortbay.log Shutdown hook executing
    2011-01-10 20:25:45,011 INFO  org.mortbay.log Shutdown hook complete

It blocks for exactly one minute, then shuts down.
I've added the Graceful shutdown, which should allow me to shut the server down from a servlet; However, it does not work as you can see from the log.

I've solved it this way:

    Server server = new Server( PORT );
    server.setGracefulShutdown( 3000 );
    server.setStopAtShutdown(true);
    ...
    server.start();

    if( server.getThreadPool() instanceof QueuedThreadPool ){
       ((QueuedThreadPool) server.getThreadPool()).setMaxIdleTimeMs( 2000 );
    }

`setMaxIdleTimeMs()` needs to be called after the `start()`, becase the threadPool is created in `start()`. However, the threads are already created and waiting, so it only applies after all threads are used at least once.

I don't know what else to do except some awfulness like interrupting all threads or `System.exit()`.

Any ideas? Is there a good way?

Thanks,
Ondra


Jesse McConnell | 10 Jan 2011 20:49
Picon
Gravatar

Re: [jetty-user] Stopping programatically causes “1 threads could not be stopped”

http://docs.codehaus.org/display/JETTY/Securing+Jetty

try using the approach described here?

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell <at> gmail.com

On Mon, Jan 10, 2011 at 13:47, Ondřej Žižka <ozizka <at> redhat.com> wrote:
> Hi,
>
> this is a copy of
> http://stackoverflow.com/questions/4650713/jetty-stopping-programatically-causes-1-threads-could-not-be-stopped
> .
> I'm sending here to bring some attention to it.
>
>
> I have a Jetty 6.1.26 instance.
> I want to shut it down by HTTP GET sent to `/shutdown`.
> So I created a `JettyShutdownServlet`:
>
>      <at> Override
>     protected void doGet(HttpServletRequest req, HttpServletResponse resp)
> throws ServletException, IOException {
>
>      resp.setStatus(202, "Shutting down.");
>      resp.setContentType("text/plain");
>      ServletOutputStream os = resp.getOutputStream();
>      os.println("Shutting down.");
>      os.close();
>      resp.flushBuffer();
>
>      // Stop the server.
>      try {
>         log.info("Shutting down the server...");
>         server.stop();
>      } catch (Exception ex) {
>         log.error("Error when stopping Jetty server: "+ex.getMessage(), ex);
>      }
>
> However, when I send the request, Jetty does not stop - a thread keeps
> hanging in `QueuedThreadPool` on the line with `this.wait()`:
>
>        // We are idle
>        // wait for a dispatched job
>        synchronized (this)
>        {
>            if (_job==null)
>               this.wait(getMaxIdleTimeMs());
>            job=_job;
>            _job=null;
>        }
>
> ...
>
>     2011-01-10 20:14:20,375 INFO  org.mortbay.log jetty-6.1.26
>     2011-01-10 20:14:34,756 INFO  org.mortbay.log Started
> SocketConnector <at> 0.0.0.0:17283
>     2011-01-10 20:25:40,006 INFO  org.jboss.qa.mavenhoe.MavenHoeApp Shutting
> down the server...
>     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown
> SocketConnector <at> 0.0.0.0:17283
>     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown
> org.mortbay.jetty.servlet.Context <at> 1672bbb{/,null}
>     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown
> org.mortbay.jetty.webapp.WebAppContext <at> 18d30fb{/jsp,file:/home/ondra/work/Mavenhoe/trunk/target/classes/org/jboss/qa/mavenhoe/web/jsp}
>     2011-01-10 20:25:43,007 INFO  org.mortbay.log Stopped
> SocketConnector <at> 0.0.0.0:17283
>     2011-01-10 20:25:43,009 WARN  org.mortbay.log 1 threads could not be
> stopped
>     2011-01-10 20:25:45,010 INFO  org.mortbay.log Shutdown hook executing
>     2011-01-10 20:25:45,011 INFO  org.mortbay.log Shutdown hook complete
>
> It blocks for exactly one minute, then shuts down.
> I've added the Graceful shutdown, which should allow me to shut the server
> down from a servlet; However, it does not work as you can see from the log.
>
> I've solved it this way:
>
>     Server server = new Server( PORT );
>     server.setGracefulShutdown( 3000 );
>     server.setStopAtShutdown(true);
>     ...
>     server.start();
>
>     if( server.getThreadPool() instanceof QueuedThreadPool ){
>        ((QueuedThreadPool) server.getThreadPool()).setMaxIdleTimeMs( 2000 );
>     }
>
> `setMaxIdleTimeMs()` needs to be called after the `start()`, becase the
> threadPool is created in `start()`. However, the threads are already created
> and waiting, so it only applies after all threads are used at least once.
>
> I don't know what else to do except some awfulness like interrupting all
> threads or `System.exit()`.
>
> Any ideas? Is there a good way?
>
> Thanks,
> Ondra
>
>
>

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

    http://xircles.codehaus.org/manage_email

Ondřej Žižka | 10 Jan 2011 21:14
Picon
Favicon
Gravatar

Re: [jetty-user] Stopping programatically causes “1 threads could not be stopped”

Seems not to work with a standalone Jetty.

Ondra




Jesse McConnell píše v Po 10. 01. 2011 v 13:49 -0600:
http://docs.codehaus.org/display/JETTY/Securing+Jetty try using the approach described here? cheers, jesse -- jesse mcconnell jesse.mcconnell <at> gmail.com On Mon, Jan 10, 2011 at 13:47, Ondřej Žižka <ozizka <at> redhat.com> wrote: > Hi, > > this is a copy of > http://stackoverflow.com/questions/4650713/jetty-stopping-programatically-causes-1-threads-could-not-be-stopped > . > I'm sending here to bring some attention to it. > > > I have a Jetty 6.1.26 instance. > I want to shut it down by HTTP GET sent to `/shutdown`. > So I created a `JettyShutdownServlet`: > >     <at> Override >     protected void doGet(HttpServletRequest req, HttpServletResponse resp) > throws ServletException, IOException { > >      resp.setStatus(202, "Shutting down."); >      resp.setContentType("text/plain"); >      ServletOutputStream os = resp.getOutputStream(); >      os.println("Shutting down."); >      os.close(); >      resp.flushBuffer(); > >      // Stop the server. >      try { >         log.info("Shutting down the server..."); >         server.stop(); >      } catch (Exception ex) { >         log.error("Error when stopping Jetty server: "+ex.getMessage(), ex); >      } > > However, when I send the request, Jetty does not stop - a thread keeps > hanging in `QueuedThreadPool` on the line with `this.wait()`: > >        // We are idle >        // wait for a dispatched job >        synchronized (this) >        { >            if (_job==null) >               this.wait(getMaxIdleTimeMs()); >            job=_job; >            _job=null; >        } > > ... > >     2011-01-10 20:14:20,375 INFO  org.mortbay.log jetty-6.1.26 >     2011-01-10 20:14:34,756 INFO  org.mortbay.log Started > SocketConnector <at> 0.0.0.0:17283 >     2011-01-10 20:25:40,006 INFO  org.jboss.qa.mavenhoe.MavenHoeApp Shutting > down the server... >     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown > SocketConnector <at> 0.0.0.0:17283 >     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown > org.mortbay.jetty.servlet.Context <at> 1672bbb{/,null} >     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown > org.mortbay.jetty.webapp.WebAppContext <at> 18d30fb{/jsp,file:/home/ondra/work/Mavenhoe/trunk/target/classes/org/jboss/qa/mavenhoe/web/jsp} >     2011-01-10 20:25:43,007 INFO  org.mortbay.log Stopped > SocketConnector <at> 0.0.0.0:17283 >     2011-01-10 20:25:43,009 WARN  org.mortbay.log 1 threads could not be > stopped >     2011-01-10 20:25:45,010 INFO  org.mortbay.log Shutdown hook executing >     2011-01-10 20:25:45,011 INFO  org.mortbay.log Shutdown hook complete > > It blocks for exactly one minute, then shuts down. > I've added the Graceful shutdown, which should allow me to shut the server > down from a servlet; However, it does not work as you can see from the log. > > I've solved it this way: > >     Server server = new Server( PORT ); >     server.setGracefulShutdown( 3000 ); >     server.setStopAtShutdown(true); >     ... >     server.start(); > >     if( server.getThreadPool() instanceof QueuedThreadPool ){ >        ((QueuedThreadPool) server.getThreadPool()).setMaxIdleTimeMs( 2000 ); >     } > > `setMaxIdleTimeMs()` needs to be called after the `start()`, becase the > threadPool is created in `start()`. However, the threads are already created > and waiting, so it only applies after all threads are used at least once. > > I don't know what else to do except some awfulness like interrupting all > threads or `System.exit()`. > > Any ideas? Is there a good way? > > Thanks, > Ondra > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Ondřej Žižka | 10 Jan 2011 21:15
Picon
Favicon
Gravatar

Re: [jetty-user] Stopping programatically causes “1 threads could not be stopped”

I mean, embedded.



Ondřej Žižka píše v Po 10. 01. 2011 v 21:14 +0100:
Seems not to work with a standalone Jetty.

Ondra




Jesse McConnell píše v Po 10. 01. 2011 v 13:49 -0600:
http://docs.codehaus.org/display/JETTY/Securing+Jetty try using the approach described here? cheers, jesse -- jesse mcconnell jesse.mcconnell <at> gmail.com On Mon, Jan 10, 2011 at 13:47, Ondřej Žižka <ozizka <at> redhat.com> wrote: > Hi, > > this is a copy of > http://stackoverflow.com/questions/4650713/jetty-stopping-programatically-causes-1-threads-could-not-be-stopped > . > I'm sending here to bring some attention to it. > > > I have a Jetty 6.1.26 instance. > I want to shut it down by HTTP GET sent to `/shutdown`. > So I created a `JettyShutdownServlet`: > >     <at> Override >     protected void doGet(HttpServletRequest req, HttpServletResponse resp) > throws ServletException, IOException { > >      resp.setStatus(202, "Shutting down."); >      resp.setContentType("text/plain"); >      ServletOutputStream os = resp.getOutputStream(); >      os.println("Shutting down."); >      os.close(); >      resp.flushBuffer(); > >      // Stop the server. >      try { >         log.info("Shutting down the server..."); >         server.stop(); >      } catch (Exception ex) { >         log.error("Error when stopping Jetty server: "+ex.getMessage(), ex); >      } > > However, when I send the request, Jetty does not stop - a thread keeps > hanging in `QueuedThreadPool` on the line with `this.wait()`: > >        // We are idle >        // wait for a dispatched job >        synchronized (this) >        { >            if (_job==null) >               this.wait(getMaxIdleTimeMs()); >            job=_job; >            _job=null; >        } > > ... > >     2011-01-10 20:14:20,375 INFO  org.mortbay.log jetty-6.1.26 >     2011-01-10 20:14:34,756 INFO  org.mortbay.log Started > SocketConnector <at> 0.0.0.0:17283 >     2011-01-10 20:25:40,006 INFO  org.jboss.qa.mavenhoe.MavenHoeApp Shutting > down the server... >     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown > SocketConnector <at> 0.0.0.0:17283 >     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown > org.mortbay.jetty.servlet.Context <at> 1672bbb{/,null} >     2011-01-10 20:25:40,006 INFO  org.mortbay.log Graceful shutdown > org.mortbay.jetty.webapp.WebAppContext <at> 18d30fb{/jsp,file:/home/ondra/work/Mavenhoe/trunk/target/classes/org/jboss/qa/mavenhoe/web/jsp} >     2011-01-10 20:25:43,007 INFO  org.mortbay.log Stopped > SocketConnector <at> 0.0.0.0:17283 >     2011-01-10 20:25:43,009 WARN  org.mortbay.log 1 threads could not be > stopped >     2011-01-10 20:25:45,010 INFO  org.mortbay.log Shutdown hook executing >     2011-01-10 20:25:45,011 INFO  org.mortbay.log Shutdown hook complete > > It blocks for exactly one minute, then shuts down. > I've added the Graceful shutdown, which should allow me to shut the server > down from a servlet; However, it does not work as you can see from the log. > > I've solved it this way: > >     Server server = new Server( PORT ); >     server.setGracefulShutdown( 3000 ); >     server.setStopAtShutdown(true); >     ... >     server.start(); > >     if( server.getThreadPool() instanceof QueuedThreadPool ){ >        ((QueuedThreadPool) server.getThreadPool()).setMaxIdleTimeMs( 2000 ); >     } > > `setMaxIdleTimeMs()` needs to be called after the `start()`, becase the > threadPool is created in `start()`. However, the threads are already created > and waiting, so it only applies after all threads are used at least once. > > I don't know what else to do except some awfulness like interrupting all > threads or `System.exit()`. > > Any ideas? Is there a good way? > > Thanks, > Ondra > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Picon
Gravatar

[jetty-user] null in the log file

Good afternoon,

We sometimes get null in the access log for the IP address.

Why would that be?

thanks

alan
--
   http://www.aw20.co.uk/

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

    http://xircles.codehaus.org/manage_email

Joe Greenawalt | 14 Jan 2011 14:48
Picon

[jetty-user] Jetty jndi env javax.naming.NameNotFoundException

Hi I'm trying to migrate from Tomcat to Jetty. We have environment setting in jndi that i can't seem to get to work as a deployed app, even though the maven jetty plugin works for the same app.
ERROR:

    Invocation of init method failed; nested exception is javax.naming.NameNotFoundException; remaining name 'env/rimPropertiesLocation':
    jvm 1    | javax.naming.NameNotFoundException; remaining name 'env/rimPropertiesLocation'

After reading the docs my set up is like this:
context name = my
JETTY_HOME/contexts/my.xml
environment variable like so (summarized):
...
       <Set name="contextPath">/my</Set>
      <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/my.war</Set>
      <Set name="extractWAR">false</Set>
      <Set name="copyWebDir">false</Set>
    <New id="rimPropertiesLocation" class="org.mortbay.jetty.plus.naming.EnvEntry">
          <Arg>rimPropertiesLocation</Arg>
          <Arg type="java.lang.String">file:///path/to/MY.properties</Arg>
         <Arg type="boolean">true</Arg>
         </New>
...
JETTY_HOME/etc/jetty.xml (summarized):
...
     <Array id="plusConfig" type="java.lang.String">
        <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
        <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
        <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
        <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
        <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
      </Array>
      
      <Call name="addLifeCycle">
          <Arg>
            <New class="org.mortbay.jetty.deployer.WebAppDeployer">
              <Set name="contexts"><Ref id="Contexts"/></Set>
              <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/webapps</Set>
              <Set name="parentLoaderPriority">false</Set>
              <Set name="extract">true</Set>
              <Set name="allowDuplicates">false</Set>
              <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
              <Set name="configurationClasses"><Ref id="plusConfig"/></Set>
            </New>
          </Arg>
    </Call>
...
I have the war in JETTY_HOME/webapps/my.war


However when i start jetty, the app looks like its starting up correctly (as in initial config is working) then i get the above mentioned error.  The lookup for the env/rimPropertiesLocation is set in a spring applicationContext.xml.


In some examples I have seen an additional < Arg > in the environment definition, sometimes blank and sometimes with and 'id' or a 'server'.  I believe I understand their meaning and have tried them all.
 

Running: latest 6 jetty, on WindowsXP with latest java.

Thanks in advance
j

Jesse McConnell | 14 Jan 2011 16:59
Picon
Gravatar

Re: [jetty-user] Jetty jndi env javax.naming.NameNotFoundException

First off I would recommend using jetty7 if your just starting out, no
reason to start out on the deprecated release.

http://www.eclipse.org/jetty/

http://wiki.eclipse.org/Jetty

if you have issues on jetty7 do come back and we'll help you get it sorted out.

if there is a compelling reason your using jetty6 lemme know

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell <at> gmail.com

On Fri, Jan 14, 2011 at 07:48, Joe Greenawalt <joe.greenawalt <at> gmail.com> wrote:
> Hi I'm trying to migrate from Tomcat to Jetty. We have environment setting
> in jndi that i can't seem to get to work as a deployed app, even though the
> maven jetty plugin works for the same app.
> ERROR:
>     Invocation of init method failed; nested exception is
> javax.naming.NameNotFoundException; remaining name
> 'env/rimPropertiesLocation':
>     jvm 1    | javax.naming.NameNotFoundException; remaining name
> 'env/rimPropertiesLocation'
> After reading the docs my set up is like this:
> context name = my
> JETTY_HOME/contexts/my.xml
> environment variable like so (summarized):
> ...
>        <Set name="contextPath">/my</Set>
>       <Set name="war"><SystemProperty name="jetty.home"
> default="."/>/webapps/my.war</Set>
>       <Set name="extractWAR">false</Set>
>       <Set name="copyWebDir">false</Set>
>     <New id="rimPropertiesLocation"
> class="org.mortbay.jetty.plus.naming.EnvEntry">
>           <Arg>rimPropertiesLocation</Arg>
>           <Arg type="java.lang.String">file:///path/to/MY.properties</Arg>
>          <Arg type="boolean">true</Arg>
>          </New>
> ...
> JETTY_HOME/etc/jetty.xml (summarized):
> ...
>      <Array id="plusConfig" type="java.lang.String">
>         <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
>         <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
>         <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
>         <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
>         <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
>       </Array>
>
>       <Call name="addLifeCycle">
>           <Arg>
>             <New class="org.mortbay.jetty.deployer.WebAppDeployer">
>               <Set name="contexts"><Ref id="Contexts"/></Set>
>               <Set name="webAppDir"><SystemProperty name="jetty.home"
> default="."/>/webapps</Set>
>               <Set name="parentLoaderPriority">false</Set>
>               <Set name="extract">true</Set>
>               <Set name="allowDuplicates">false</Set>
>               <Set name="defaultsDescriptor"><SystemProperty
> name="jetty.home" default="."/>/etc/webdefault.xml</Set>
>               <Set name="configurationClasses"><Ref id="plusConfig"/></Set>
>             </New>
>           </Arg>
>     </Call>
> ...
> I have the war in JETTY_HOME/webapps/my.war
>
> However when i start jetty, the app looks like its starting up correctly (as
> in initial config is working) then i get the above mentioned error.  The
> lookup for the env/rimPropertiesLocation is set in a spring
> applicationContext.xml.
>
> In some examples I have seen an additional < Arg > in the environment
> definition, sometimes blank and sometimes with and 'id' or a 'server'.  I
> believe I understand their meaning and have tried them all.
>
> Running: latest 6 jetty, on WindowsXP with latest java.
> Thanks in advance
> j
>

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

    http://xircles.codehaus.org/manage_email

Joe Greenawalt | 14 Jan 2011 17:08
Picon

Re: [jetty-user] Jetty jndi env javax.naming.NameNotFoundException

well, i thought about that, but looking over the documentation and setup, it seemed that for JNDI and Windows (has to be windows) it seemed like 6 was a better candidate for a proof of concept, but if your offering to help with 7 i'm game.  


let me try 7, i've made some inroads there.  Do you have a link for jndi setup and jetty 7?

thanks,
joe

On Fri, Jan 14, 2011 at 10:59 AM, Jesse McConnell <jesse.mcconnell <at> gmail.com> wrote:
First off I would recommend using jetty7 if your just starting out, no
reason to start out on the deprecated release.

http://www.eclipse.org/jetty/

http://wiki.eclipse.org/Jetty

if you have issues on jetty7 do come back and we'll help you get it sorted out.

if there is a compelling reason your using jetty6 lemme know

cheers,
jesse



--
jesse mcconnell
jesse.mcconnell <at> gmail.com



On Fri, Jan 14, 2011 at 07:48, Joe Greenawalt <joe.greenawalt <at> gmail.com> wrote:
> Hi I'm trying to migrate from Tomcat to Jetty. We have environment setting
> in jndi that i can't seem to get to work as a deployed app, even though the
> maven jetty plugin works for the same app.
> ERROR:
>     Invocation of init method failed; nested exception is
> javax.naming.NameNotFoundException; remaining name
> 'env/rimPropertiesLocation':
>     jvm 1    | javax.naming.NameNotFoundException; remaining name
> 'env/rimPropertiesLocation'
> After reading the docs my set up is like this:
> context name = my
> JETTY_HOME/contexts/my.xml
> environment variable like so (summarized):
> ...
>        <Set name="contextPath">/my</Set>
>       <Set name="war"><SystemProperty name="jetty.home"
> default="."/>/webapps/my.war</Set>
>       <Set name="extractWAR">false</Set>
>       <Set name="copyWebDir">false</Set>
>     <New id="rimPropertiesLocation"
> class="org.mortbay.jetty.plus.naming.EnvEntry">
>           <Arg>rimPropertiesLocation</Arg>
>           <Arg type="java.lang.String">file:///path/to/MY.properties</Arg>
>          <Arg type="boolean">true</Arg>
>          </New>
> ...
> JETTY_HOME/etc/jetty.xml (summarized):
> ...
>      <Array id="plusConfig" type="java.lang.String">
>         <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
>         <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
>         <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
>         <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
>         <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
>       </Array>
>
>       <Call name="addLifeCycle">
>           <Arg>
>             <New class="org.mortbay.jetty.deployer.WebAppDeployer">
>               <Set name="contexts"><Ref id="Contexts"/></Set>
>               <Set name="webAppDir"><SystemProperty name="jetty.home"
> default="."/>/webapps</Set>
>               <Set name="parentLoaderPriority">false</Set>
>               <Set name="extract">true</Set>
>               <Set name="allowDuplicates">false</Set>
>               <Set name="defaultsDescriptor"><SystemProperty
> name="jetty.home" default="."/>/etc/webdefault.xml</Set>
>               <Set name="configurationClasses"><Ref id="plusConfig"/></Set>
>             </New>
>           </Arg>
>     </Call>
> ...
> I have the war in JETTY_HOME/webapps/my.war
>
> However when i start jetty, the app looks like its starting up correctly (as
> in initial config is working) then i get the above mentioned error.  The
> lookup for the env/rimPropertiesLocation is set in a spring
> applicationContext.xml.
>
> In some examples I have seen an additional < Arg > in the environment
> definition, sometimes blank and sometimes with and 'id' or a 'server'.  I
> believe I understand their meaning and have tried them all.
>
> Running: latest 6 jetty, on WindowsXP with latest java.
> Thanks in advance
> j
>

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

   http://xircles.codehaus.org/manage_email



Jesse McConnell | 14 Jan 2011 17:10
Picon
Gravatar

Re: [jetty-user] Jetty jndi env javax.naming.NameNotFoundException

http://wiki.eclipse.org/Jetty/Feature/JNDI

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell <at> gmail.com

On Fri, Jan 14, 2011 at 10:08, Joe Greenawalt <joe.greenawalt <at> gmail.com> wrote:
> well, i thought about that, but looking over the documentation and setup, it
> seemed that for JNDI and Windows (has to be windows) it seemed like 6 was a
> better candidate for a proof of concept, but if your offering to help with 7
> i'm game.
> let me try 7, i've made some inroads there.  Do you have a link for jndi
> setup and jetty 7?
> thanks,
> joe
>
> On Fri, Jan 14, 2011 at 10:59 AM, Jesse McConnell
> <jesse.mcconnell <at> gmail.com> wrote:
>>
>> First off I would recommend using jetty7 if your just starting out, no
>> reason to start out on the deprecated release.
>>
>> http://www.eclipse.org/jetty/
>>
>> http://wiki.eclipse.org/Jetty
>>
>> if you have issues on jetty7 do come back and we'll help you get it sorted
>> out.
>>
>> if there is a compelling reason your using jetty6 lemme know
>>
>> cheers,
>> jesse
>>
>>
>>
>> --
>> jesse mcconnell
>> jesse.mcconnell <at> gmail.com
>>
>>
>>
>> On Fri, Jan 14, 2011 at 07:48, Joe Greenawalt <joe.greenawalt <at> gmail.com>
>> wrote:
>> > Hi I'm trying to migrate from Tomcat to Jetty. We have environment
>> > setting
>> > in jndi that i can't seem to get to work as a deployed app, even though
>> > the
>> > maven jetty plugin works for the same app.
>> > ERROR:
>> >     Invocation of init method failed; nested exception is
>> > javax.naming.NameNotFoundException; remaining name
>> > 'env/rimPropertiesLocation':
>> >     jvm 1    | javax.naming.NameNotFoundException; remaining name
>> > 'env/rimPropertiesLocation'
>> > After reading the docs my set up is like this:
>> > context name = my
>> > JETTY_HOME/contexts/my.xml
>> > environment variable like so (summarized):
>> > ...
>> >        <Set name="contextPath">/my</Set>
>> >       <Set name="war"><SystemProperty name="jetty.home"
>> > default="."/>/webapps/my.war</Set>
>> >       <Set name="extractWAR">false</Set>
>> >       <Set name="copyWebDir">false</Set>
>> >     <New id="rimPropertiesLocation"
>> > class="org.mortbay.jetty.plus.naming.EnvEntry">
>> >           <Arg>rimPropertiesLocation</Arg>
>> >           <Arg
>> > type="java.lang.String">file:///path/to/MY.properties</Arg>
>> >          <Arg type="boolean">true</Arg>
>> >          </New>
>> > ...
>> > JETTY_HOME/etc/jetty.xml (summarized):
>> > ...
>> >      <Array id="plusConfig" type="java.lang.String">
>> >         <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
>> >         <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
>> >         <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
>> >         <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
>> >         <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
>> >       </Array>
>> >
>> >       <Call name="addLifeCycle">
>> >           <Arg>
>> >             <New class="org.mortbay.jetty.deployer.WebAppDeployer">
>> >               <Set name="contexts"><Ref id="Contexts"/></Set>
>> >               <Set name="webAppDir"><SystemProperty name="jetty.home"
>> > default="."/>/webapps</Set>
>> >               <Set name="parentLoaderPriority">false</Set>
>> >               <Set name="extract">true</Set>
>> >               <Set name="allowDuplicates">false</Set>
>> >               <Set name="defaultsDescriptor"><SystemProperty
>> > name="jetty.home" default="."/>/etc/webdefault.xml</Set>
>> >               <Set name="configurationClasses"><Ref
>> > id="plusConfig"/></Set>
>> >             </New>
>> >           </Arg>
>> >     </Call>
>> > ...
>> > I have the war in JETTY_HOME/webapps/my.war
>> >
>> > However when i start jetty, the app looks like its starting up correctly
>> > (as
>> > in initial config is working) then i get the above mentioned error.  The
>> > lookup for the env/rimPropertiesLocation is set in a spring
>> > applicationContext.xml.
>> >
>> > In some examples I have seen an additional < Arg > in the environment
>> > definition, sometimes blank and sometimes with and 'id' or a 'server'.
>> >  I
>> > believe I understand their meaning and have tried them all.
>> >
>> > Running: latest 6 jetty, on WindowsXP with latest java.
>> > Thanks in advance
>> > j
>> >
>>
>> ---------------------------------------------------------------------
>> 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