By the way, I notice the 'Jetty
dependencies site' is broken, and the jndi intro page that
mentions it looks out of date.
Why isn't the source for jetty-jndi.jar in the distribution? It
would be easier to debug. I found the jar on maven and got it
via my build.gradle:
compile group: 'org.eclipse.jetty', name: 'jetty-jndi',
version: '9.3.0.v20150612'
But now it gives me this on lookup:
09:25:46.627 [qtp1963387170-11] ERROR
com.priot.servlet.GetSession - Naming
javax.naming.NameNotFoundException
at
org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:532)
~[jetty-jndi-9.3.0.v20150612.jar:9.3.0.v20150612]
at
org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:563)
~[jetty-jndi-9.3.0.v20150612.jar:9.3.0.v20150612]
at
org.eclipse.jetty.jndi.NamingContext.lookup(NamingContext.java:578)
~[jetty-jndi-9.3.0.v20150612.jar:9.3.0.v20150612]
at
org.eclipse.jetty.jndi.java.javaRootURLContext.lookup(javaRootURLContext.java:106)
~[jetty-jndi-9.3.0.v20150612.jar:9.3.0.v20150612]
at
javax.naming.InitialContext.lookup(InitialContext.java:417)
~[?:1.8.0_45]
at
com.priot.servlet.GetSession.doPost(GetSession.java:53)
[classes/:?]
I wonder if this I got from the doc is right, since it defines
the name - what about the empty first arg?
Hm - it uses jetty.plus but jetty-plus.jar seems to be a thing
of the past (see note on out of date page above - jetty-plus.jar
seems to have ended w/ v7 in maven central). Another odd thing
is that the name is in the Arg, not in the id, which is normally
what I'd expect to use to look up an object:
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<New id="prDataSource" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/pr</Arg>
<Arg>
<New class="com.mchange.v2.c3p0.ComboPooledDataSource">
<Set name="driverClass">com.mysql.jdbc.Driver</Set>
<Set name="jdbcUrl">jdbc:mysql://localhost:3306/pr</Set>
<Set name="user">user</Set>
<Set name="password">pwd</Set>
</New>
</Arg>
</New>
</Configure>
Thanks,
Bill
On 7/10/2015 11:05 PM, Jan Bartel wrote: