As far as I know, you can't access datasource connections 'remotely'.

On Sun, 25 Mar 2001, Duane Fields wrote:

> I've a problem accessing a pooled datasource from OUTSIDE the web
> application. I can access and use the regular datasource, but when I try to
> get a connection from the pooled datasource I get null pointer exceptions
> from orion's pooled driver. The scenario is this: I have defined a
> data-source with Sybase...
> 
> <data-source
>    name="Default data-source"
>    class="com.evermind.sql.ConnectionDataSource"
>    location="jdbc/DefaultDS"
>    pooled-location="jdbc/DefaultPooledDS"
>    xa-location="jdbc/xa/DefaultXADS"
>    ejb-location="jdbc/DefaultEJBDS"
>    url="jdbc:sybase:Tds:dfields:4201/sponsortool"
>    connection-driver="com.sybase.jdbc2.jdbc.SybDriver"
>    username="myuser"
>    password="mypassword"
>    schema="database-schemas/sybase.xml"
>    min-connections="5"
>    max-connections="10"
>    inactivity-timeout="30"
> />
> 
> 
> In my app and my outside clients and test code, I use JNDI to grab a default
> datasource, and use it, my JNDI properties are:
> 
> java.naming.factory.initial=com.evermind.server.ApplicationClientInitialCont
> extFactory
> #java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactor
> y
> java.naming.provider.url=ormi://localhost/
> java.naming.security.principal=admin
> java.naming.security.credentials=123
> 
> >From the servlets and JSPs, I can access both the pooled datasource and the
> regular datasource just fine, but not from outside applications. Outside
> applications only work with the core datasource, not the pooled. It's not
> that they fail to get the datasource reference from JNDI, It's that
> orionserver gets NULL POINTER exceptions when I try to get a connection from
> it. Observe:
> 
> java.lang.NullPointerException
>         at com.evermind.sql.OrionPooledDataSource.d7(JAX)
>         at com.evermind.sql.OrionPooledDataSource.d8(JAX)
>         at com.evermind.sql.OrionPooledDataSource.getConnection(JAX)
> 
> I've tried both the RMI and ApplicationContext Factories, with the same
> results, although my outside applications are not ejb-client applications.
> In fact, I'm deploying my app as a j2ee application but am not using EJBs.
> 
> I've been banging my head on this problem for several weeks, and would
> appreciate any insight anyone out ther would have into this. Thanks!
> 
> --
> Duane Fields
> [EMAIL PROTECTED]
> Sr. Software Engineer
> NetSpend Corporation
> 
> 
> 
> 


Reply via email to