Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Cannot deploy a WAB in OSGi Jetty 9 because of javax.naming.NameNotFoundException; remaining name 'java:comp'

Raul,

Can you post what osgi environment you are deploying into, and what
version. Please also post the list of bundles that you have deployed.

The jndi exception is odd. The jndi mechanism is only used if
appropriate jndi classes are detected on the classpath. So it looks
like those classes are detected. However, I can see that the setup is
not correct, because the lookup for "java:comp" is being done in the
default server namespace instead of the special "java:" namespace
provided by jetty.

To setup the "java:" namespace correctly, jetty needs some system
properties defined. These are in the jetty.xml file here:

 <Call class="java.lang.System" name="setProperty">
      <Arg>java.naming.factory.initial</Arg>
      <Arg><Property name="java.naming.factory.initial"
default="org.eclipse.jetty.jndi.InitialContextFactory"/></Arg>
    </Call>
    <Call class="java.lang.System" name="setProperty">
      <Arg>java.naming.factory.url.pkgs</Arg>
      <Arg><Property name="java.naming.factory.url.pkgs"
default="org.eclipse.jetty.jndi"/></Arg>
    </Call>

The second of those properties is required for "java:" namespace.

Can you dump your osgi setup environment to double check that those
values are set?

Please also post the output you get if you run with logging enabled
for org.eclipse.jetty.jndi  package.

Jan


On 19 May 2015 at 03:23, Raúl Guerrero Deschamps <raul@xxxxxxxxxxx> wrote:
> I'm trying to deploy a simple WAB application inside an OSGi container that
> has installed the Jetty 9.2.10 bundles and the JAX-RS Jersey 2.17 bundles.
>
> All the bundles start correctly and without issues, and when I install my
> WAB it also installs correctly, but when I start my WAB it sends a JNDI name
> not found exception, it's really odd because I don't use JNDI whatsoever in
> my WAB, and the name that the exception is referencing is completely bogus,
> because it just states the missing JNDI resource name is 'java:comp', which
> is just the Jetty prefix for JNDI resources, so some Jetty bundle must be
> trying to setup an empty JNDI resource which causes the problem.
>
> 2015-05-15 23:48:29.968:WARN:oejw.WebAppContext:FelixDispatchQueue: Failed
> startup of context
> o.e.j.w.WebAppContext@5718e0e{/wab,file:/private/var/folders/3h/w04868ln4j30dwqdscvy8wnw0000gn/T/jetty-0.0.0.0-8080-wab-sample-1.0.0.war-_wab-any-3819588013061278932.dir/webapp/,null}{file:/Users/****/NetbeansProjects/*****/target/bundle/wab-sample-1.0.0.war}
> javax.naming.NameNotFoundException; remaining name 'java:comp'
>
> I posted this issue in stackoverflow where I have the full exception and my
> jetty.xml configuration file.
>
> Thanks for the help!
>
> http://stackoverflow.com/questions/30272184/cannot-deploy-a-wab-in-osgi-jetty-9-because-of-javax-naming-namenotfoundexceptio
>
>
>
>
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users



-- 
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
'Expert assistance from the creators of Jetty and CometD'


Back to the top