Re: Using JNDI from Jetty/Start.java

2011-12-29 Thread Chantal Ackermann
On Wed, 2011-12-28 at 16:52 +0100, armhold wrote:
 I moved the config file to src/test/jetty/jetty-env.xml because I didn't want
 it deployed with my production war file. It was really the two property
 settings I was missing. You might not even need the properties if you are
 using the jetty-maven-plugin; I did because I'm running Start#main()
 directly from my IDE.
 

Ok, it is probably cleaner to keep it under src/test/. I might have had it 
there in the beginning and it probably did not work.

Now, I'm excluding it when building the war.


 PS: also using Solr.  Small world. :-)

Cheers :)
Chantal


 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Using-JNDI-from-Jetty-Start-java-tp4237903p4240237.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Using JNDI from Jetty/Start.java

2011-12-28 Thread Chantal Ackermann
Hi,

I'm also using wicket 1.5 and jetty 7.5 (eclipse's) with mortbay's
eclipse plugin of the same version, and I had no need to add those
properties you mention.

From my pom.xml:
wicket.version1.5.3/wicket.version
jetty.version7.5.0.v20110901/jetty.version

dependency
groupIdorg.eclipse.jetty.aggregate/groupId
artifactIdjetty-all-server/artifactId
version${jetty.version}/version
scopeprovided/scope
/dependency

plugin
groupIdorg.mortbay.jetty/groupId
artifactIdjetty-maven-plugin/artifactId
version${jetty.version}/version
...
[the rest is what wicket quickstart brings]
...
/plugin


In src/main/webapp/WEB-INF/jetty-env.xml - which is found without
problems:

?xml version=1.0 encoding=UTF-8? 
!DOCTYPE Configure PUBLIC -//Mort Bay Consulting//DTD Configure//EN 
http://jetty.mortbay.org/configure.dtd;
Configure class=org.eclipse.jetty.webapp.WebAppContext
New id=db class=org.eclipse.jetty.plus.jndi.Resource
Argjdbc/db/Arg
Arg
New class=oracle.jdbc.pool.OracleDataSource
Set name=DriverTypethin/Set
Set 
name=URLjdbc:oracle:thin:@[ip]:1521:[db]/Set
Set name=User[user]/Set
Set name=Password[pw]/Set
Set name=connectionCachingEnabledtrue/Set
Set name=connectionCacheProperties
New class=java.util.Properties
Call name=setProperty
ArgMinLimit/Arg
Arg5/Arg
/Call
!-- put the other properties 
in here too --
/New
/Set
/New
/Arg
/New
New id=solrHome class=org.eclipse.jetty.plus.jndi.EnvEntry
Argsolr/home/Arg
Arg type=java.lang.Stringsolr/home/Arg
Arg type=booleantrue/Arg
/New
/Configure


I found the mix of eclipse and mortbay packages annoying. When copying
examples you always have to take care not to overlook package names that
do not fit into your version setup...

Cheers,
Chantal




On Wed, 2011-12-28 at 04:37 +0100, armhold wrote:
 Thanks to a hint from Christian Huber I got it working.
 
 System.setProperty(java.naming.factory.url.pkgs,
 org.eclipse.jetty.jndi);
 System.setProperty(java.naming.factory.initial,
 org.eclipse.jetty.jndi.InitialContextFactory);
 
 EnvConfiguration envConfiguration = new EnvConfiguration();
 URL url = new File(src/test/jetty/jetty-env.xml).toURI().toURL();
 envConfiguration.setJettyEnvXml(url);
 
 bb.setConfigurations(new Configuration[]{ new WebInfConfiguration(),
 envConfiguration, new WebXmlConfiguration() });
 
 
 
 Full details here: 
 http://blog.armhold.com/2011/12/28/how-to-get-jndi-working-with-wicket-1-5-and-jetty-7-5/
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Using-JNDI-from-Jetty-Start-java-tp4237903p4238955.html
 Sent from the Users forum mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Using JNDI from Jetty/Start.java

2011-12-28 Thread armhold
I moved the config file to src/test/jetty/jetty-env.xml because I didn't want
it deployed with my production war file. It was really the two property
settings I was missing. You might not even need the properties if you are
using the jetty-maven-plugin; I did because I'm running Start#main()
directly from my IDE.

PS: also using Solr.  Small world. :-)


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-JNDI-from-Jetty-Start-java-tp4237903p4240237.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Using JNDI from Jetty/Start.java

2011-12-27 Thread armhold
Has anyone got a JNDI config that works with Start.java under Wicket 1.5 (and
therefore Jetty 7.5)?

I've got JNDI working fine for my production Tomcat deployment, but can't
seem to figure out which incantations are needed to get it working with
Jetty for development/testing (I use Start.java to launch directly inside my
IDE, rather than mvn jetty-run).

I've created a datasource in WEB-INF/jetty-env.xml, but I suspect the file
is not being read at all. I get:

INFO  - NamingHelper   - JNDI InitialContext properties:{}
ERROR - tasourceConnectionProvider - Could not find datasource:
java:/comp/env/jdbc/mydatasource
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file:  java.naming.factory.initial

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-JNDI-from-Jetty-Start-java-tp4237903p4237903.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Using JNDI from Jetty/Start.java

2011-12-27 Thread Christian Huber
The server complains about a missing value for jndi context factory. 
Where do you define that value?



The Sanity Resort http://sanityresort.blogspot.com/

Am 27.12.2011 19:41, schrieb armhold:

Has anyone got a JNDI config that works with Start.java under Wicket 1.5 (and
therefore Jetty 7.5)?

I've got JNDI working fine for my production Tomcat deployment, but can't
seem to figure out which incantations are needed to get it working with
Jetty for development/testing (I use Start.java to launch directly inside my
IDE, rather than mvn jetty-run).

I've created a datasource in WEB-INF/jetty-env.xml, but I suspect the file
is not being read at all. I get:

INFO  - NamingHelper   - JNDI InitialContext properties:{}
ERROR - tasourceConnectionProvider - Could not find datasource:
java:/comp/env/jdbc/mydatasource
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file:  java.naming.factory.initial

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-JNDI-from-Jetty-Start-java-tp4237903p4237903.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Using JNDI from Jetty/Start.java

2011-12-27 Thread armhold
Thanks to a hint from Christian Huber I got it working.

System.setProperty(java.naming.factory.url.pkgs,
org.eclipse.jetty.jndi);
System.setProperty(java.naming.factory.initial,
org.eclipse.jetty.jndi.InitialContextFactory);

EnvConfiguration envConfiguration = new EnvConfiguration();
URL url = new File(src/test/jetty/jetty-env.xml).toURI().toURL();
envConfiguration.setJettyEnvXml(url);

bb.setConfigurations(new Configuration[]{ new WebInfConfiguration(),
envConfiguration, new WebXmlConfiguration() });



Full details here: 
http://blog.armhold.com/2011/12/28/how-to-get-jndi-working-with-wicket-1-5-and-jetty-7-5/


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-JNDI-from-Jetty-Start-java-tp4237903p4238955.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org