[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Problem getting JDBC datasource from JBOSS
jaikiran
do-not-reply at jboss.com
Fri Jun 20 05:00:54 EDT 2008
One more observation, you seem to be creating the entity manager using the entity manager factory. Maybe there might be a problem there. But that does not explain why, the simple lookup of the datasource through a jsp returns null. Try this from a very simple jsp in your application:
| <%
| Properties props = new Properties();
| props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
| props.put(Context.PROVIDER_URL,"jnp://localhost:1099");
| props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming.jnp.interfaces");
| Context ctx = new InitialContext(props);
|
| Object obj = ctx.lookup("java:MySqlDS");
|
| System.out.println("DS is = " + obj);
|
| %>
I am suspecting that for some reason maybe the context properties are either not being picked up right or something else is going on.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159493#4159493
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159493
More information about the jboss-user
mailing list