tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: OpenEJB + Jetty = JNDI conflict
Date Sat, 05 Mar 2011 11:35:02 GMT
I had this problem also.

I did get a partial working solution.

You end up leaving OpenEJB to handle it's JNDI and leave Jetty handling its.

Then you essentially sync between the two JNDI scopes.

I also had another solution whereby I modifies the jetty-plus to work around
a NPE when using jetty's JNDI from OpenEJB.

Now that got your hopes up.... here comes the hope-dash

That was all work for my previous employer.

That work remains the property of my previous employer.

So I no longer have the source code.

But one of the two solutions above works... you just need to persist in the
hackyness to get there

-Stephen

On 4 March 2011 21:17, Yegor Bugayenko <egor@technoparkcorp.com> wrote:

> I'm trying to test my WAR application in-container with Jetty and OpenEJB.
> I'm not sure that my understanding of the situation is correct, but looks
> like:
>
> 1. Jetty has its own jndi.properties where java.naming.factory.initial is
> set to Jetty class (org.mortbay.naming.InitialContextFactory). This setting
> is overlapping my own jndi.properties.
>
> 2. To resolve this overriding I'm explicitly providing the value of this
> property via <systemProperty> in pom.xml:
>
>  <systemProperty>
>    <name>java.naming.factory.initial</name>
>    <value>org.apache.openejb.client.LocalInitialContextFactory</value>
>  </systemProperty>
>
> 3. Now Jetty can't work with OpenEJB JNDI, and very strange
> NullPointerExceptions are being thrown. Like the following:
>
> javax.naming.NamingException [Root exception is
> java.lang.NullPointerException]
> at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:588)
>  at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:533)
> at
> javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:320)
>  at javax.naming.InitialContext.lookup(InitialContext.java:392)
> at
>
> org.eclipse.jetty.plus.webapp.EnvConfiguration.deconfigure(EnvConfiguration.java:120)
>  at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:528)
> at
>
> org.mortbay.jetty.plugin.JettyWebAppContext.doStop(JettyWebAppContext.java:168)
>  at
>
> org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:80)
> at
>
> org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:235)
>  at
>
> org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:80)
> at
>
> org.eclipse.jetty.server.handler.HandlerCollection.doStop(HandlerCollection.java:235)
>  at
>
> org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:80)
> at
>
> org.eclipse.jetty.server.handler.HandlerWrapper.doStop(HandlerWrapper.java:106)
>  at org.eclipse.jetty.server.Server.doStop(Server.java:300)
> at
>
> org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:80)
>  at org.mortbay.jetty.plugin.Monitor.run(Monitor.java:102)
> Caused by: java.lang.NullPointerException
> at
>
> org.apache.openejb.core.ivm.naming.java.javaURLContextFactory.getContext(javaURLContextFactory.java:41)
>  at
>
> org.apache.openejb.core.ivm.naming.java.javaURLContextFactory.getObjectInstance(javaURLContextFactory.java:34)
> at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:584)
>  ... 15 more
>
> My pom.xml is here:
> http://trac.fazend.com/rempl/browser/rempl/trunk/rempl/rempl-oss/pom.xml
>
> I tried to raise a similar question at stackoverflow:
> http://stackoverflow.com/questions/5172788. Still no answer. Maybe someone
> in this mailing list can help?
>
> —
> Yegor Bugayenko
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message