Thanks for an incredible fast replies.................

I just got the commercial doc a few hours ago, and found the answer under
the section: JBossNS -- the JBoss naming services.  Great stuff!

And thanks for sugesting using a minimalist jboss server...... never crossed
my mind that jboss can be this great.

----- Original Message -----
From: "danch" <[EMAIL PROTECTED]>
To: "Bernardinus" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, February 28, 2002 12:41 PM
Subject: Re: [JBoss-user] DataSource lookup from webapp


> Probably what you should do is run Tomcat in a JBoss-embedded
> configuration, chopping up jboss.jcml so that it doesn't load the EJB,
> JMS, etc. related services. That way your pools will be available to
> your servlet code.
>
> As David notes, you can't get to a JDBC datasource from another VM.
>
> -danch
>
> 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........
>
>
>
>


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

Reply via email to