Hi !!!

            I am just curious and a bit clueless. I updated Orion recently and 
suddenly I have "internal" problems parsing the datasource XML file. The problem I get 
is that I create a datasource like this:

    javax.naming.Context context = new javax.naming.InitialContext();
    String dsName = (String) context.lookup("java:comp/env/datasource-name");
    javax.sql.DataSource datasource = (javax.sql.DataSource) context.lookup(dsName);

    And it is created OK, but as soon as I call : Connection conn = 
datasource.getConnection();

    An exception is created reporting java.lang.NullPointerException. And the 
exception is created ** inside ** the getConnection method.

    But that happens only if I created the connection inside my beans, which I compile 
with Jbuilder. If I create and use a datasource directly on the jsp page ( and hence 
letting orion compile it into a servlet ) then it works OK.


        Has anyone observed this as well ? Or has a clue ?



Just in case, my datasources looks like this:
----------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE data-sources PUBLIC "Orion data-sources" 
"http://www.orionserver.com/dtds/data-sources.dtd">

<data-sources>
 <data-source 
  name="Default data-source"
  class="com.evermind.sql.ConnectionDataSource"
  location="jdbc/agreement"
  pooled-location="jdbc/DefaultPooledDS"
  xa-location="jdbc/xa/DefaultXADS"
  ejb-location="jdbc/DefaultEJBDS"
  url="jdbc:oracle:thin:@ELCON00:1521:orcl"
  connection-driver="oracle.jdbc.driver.OracleDriver"
  username="myuser"
  password="mypassword"/>
 />
</data-sources>
-----------------------------------------------------
 and web.xml contains an entry like this

 <env-entry>
  <env-entry-name>datasource-name</env-entry-name>
  <env-entry-type>java.lang.String</env-entry-type>
  <env-entry-value>jdbc/agreement</env-entry-value>
 </env-entry>
-------------------------------------------------------



Reply via email to