Okay, I understand now...  It was very clear answer.  Thanx. ;-)
 
- kimion -
----- Original Message -----
Sent: Monday, September 10, 2001 9:35 PM
Subject: RE: [JBoss-dev] JBoss & MS SQL Server 2000

I think you are getting this because you are attempting to access the DataSource from outside of JBoss.  DataSources can only be accessed from code running in the same JVM as the DataSource i.e. from within ejb's or mbean's deployed by JBoss.  Separately running clients cannot access the DataSource's. 
 
So the code you have below (using "java:/SQLServerPool") should work from within JBoss not from another JVM.
 
Does this help?
 
Cheers,
David
-----Original Message-----
From: Yong T. Kim [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 11, 2001 1:28 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-dev] JBoss & MS SQL Server 2000

I think I have successfully created a connection pool for MS SQL 2000... but I can't connect to it from my test client code...
 
When JBoss starts up, I get output like below...
[XADataSourceLoader] Starting                                               
[SQLServerPool] XA Connection pool SQLServerPool bound to java:/SQLServerPool
[XADataSourceLoader] Started
 
It seems like JBoss was able to create the connection pool successfully...
 
However, when I run my client code below, I get an error message saying, "javax.naming.NameNotFoundException: SQLServerPool not bound
        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
        at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
        at sun.rmi.server.UnicastRef.invoke(Unknown Source)
        at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at DataSourceTest.main(DataSourceTest.java:37)"
 
What am I doing wrong?
 
Here is the sample code...
 
            env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
            env.put(Context.PROVIDER_URL, "localhost:1099");
            javax.naming.Context ctx = new InitialContext(env);
            DataSource ds = (DataSource) ctx.lookup("SQLServerPool"); // I tried with java:/SQLServerPool, still didn't work
            Connection con = ds.getConnection();
 
Can someone help?
 
Thanks, in advance...
 
================================
Yong T. Kim (kimion.com)
Software Developer
[EMAIL PROTECTED]
http://www.kimion.com:8080
 
 

Reply via email to