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 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



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:
1.5.3
7.5.0.v20110901


org.eclipse.jetty.aggregate
jetty-all-server
${jetty.version}
provided



org.mortbay.jetty
jetty-maven-plugin
${jetty.version}
...
[the rest is what wicket quickstart brings]
...



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

 
http://jetty.mortbay.org/configure.dtd";>


jdbc/db


thin
jdbc:oracle:thin:@[ip]:1521:[db]
[user]
[pw]
true



MinLimit
5








solr/home
solr/home
true




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-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



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 

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



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