as explained so many times, you can't get to datasources in jboss jndi from
another vm.  If you want to use jboss pooling rather than tomcats pooling,
you could remove everything from jboss except the tm and pool code and run
tomcat in this mini-jboss.

david jencks

On 2002.02.27 21:08:10 -0500 Bernardinus wrote:
> Hi there,
> 
> I have downloaded jboss-2.4.4 and intend to use it.
> I have a web app deployed on tomcat-4.0.2 on the same machine with the
> jboss
> (eventually will be running on seperate machine).
> I wish to use DataSource object provided by jboss in my web app, so I
> wrote
> a simple jsp page to test it like this:
> ================== tst.jsp===========================================
> <%@ page import="java.util.*" %>
> <%@ page import="javax.naming.InitialContext" %>
> <%@ page import="javax.naming.Context" %>
> <%@ page import="javax.rmi.PortableRemoteObject" %>
> <%@ page import="javax.sql.DataSource" %>
> 
> Properties env = new Properties();
> //env.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingCo
> ntextFactory");
> //env.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.i
> nterfaces");
> //env.setProperty("java.naming.provider.url","localhost");
> 
> env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFac
> tory");
> env.put(Context.PROVIDER_URL,"localhost");
> env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces"
> );
> 
> Context jndiContext = new InitialContext(env);
> //DataSource ds = (DataSource) jndiContext.lookup("java:/DefaultDS");
> DataSource ds = (DataSource) jndiContext.lookup("DefaultDS");
> 
> ============================================================================
> ==
> 
> but it throws exception saying the "DefaultDS" is not bound........
> 
> I have not changed anything in Jboss as per my download, and it started
> ok.
> On seperate instance , tomcat was running ok, too. Only when I run the
> test
> jsp it trows the exception.
> 
> I have copied jboss-client.jar and jnp-client.jar from jboss to tomcat's
> common\lib directory.
> I did not at datasource entry (<resource-ref>) in my web app's web.xml,
> though. Should I ? and what should I put in there?
> 
> Any idea how I should approach this? alternatives?
> For some reasons (not up to me), our web app must run on its own Tomcat
> separately from jboss, yet I wish to use the features of jboss, for now
> datasource (connection pooling, etc) and later move to ejb and jms......
> 
> Thanks.
> 
> 
> 
> 
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to