Warning: orion newbie alert. I have looked through archives to no avail. Any
pointers are greatly appreciated.

I'm running on NT using JDK 1.2.2-001.
Orion is installed on G:\orion

I am trying to build the example SessionBean tutorial on the orionserver
page. I've modified them slightly by putting the code in a package, see
below.

Questions:

1. Can you only deploy EJBs when they are hanging off a directory from
/orion ?
I have a set of EJBs that I created on my F drive. They are down in my
package structure (mikecart.test).
I dont know how to get orion to find these for deploying EJBs in other
directories. In fact I cant even get the installed examples to work when I
use this syntax in ejb.xml

        <!-- next 3 lines do not work -->
        <!-- <ejb-jar>file://g:/orions/demo/ejb/cart/</ejb-jar> -->
        <!-- <ejb-jar>file:g:/orions/demo/ejb/cart/</ejb-jar> -->
        <!-- <ejb-jar>file:/g:/orions/demo/ejb/cart/</ejb-jar> -->

        <!-- This next line works -->
        <ejb-jar>../demo/ejb/cart/</ejb-jar>

It appears that only this relative path from the orion home seems to work.
Thats a problem on NT because it has no unix symbolic linking ability. Any
pointers here?

2. I moved my beans from the F: drive to a directory under G:\orion\demo and
tried to deploy those there. No luck. The directory structure is:

g:/orion/demo/ejb/mikecart/test/ , complete with a META-INF directory
hanging off this containing my ejb-jar.xml file.  All my beans and client
are in the 'test' directory and the package name is:  mikecart.test . In the
ejb.xml file I have entered:

<ejb-jar>../demo/ejb/mikecart/test/</ejb-jar>

When I start orion I get the message:

Error loading package at file:/G:/orion/demo/ejb/mikecart/test/, Class
'mikecart.text.CartEJB' not found

I am using the exact code from the orionserver.com site SessionBean example
except for adding these packages. If I take this code out of a package it
works fine.

3. Which config file/what is proper syntax to add other directories and jar
files to the classpath for both use in EJBs deployed within orion, and by
any servlets or JSPs running
within orion? If I get this working my next step will be to talk to my
Oracle database...

4. Trying to get a JDBC Connection and a connection pool working is
problematic. I seem to be able to start orion properly by having my jdbc
drivers in the server.xml with

        <library-path>file:/f:/Oracle8I_JDBC</library-path>

I have my datasources.xml as follows:

        <data-source class="com.evermind.sql.ConnectionDataSource"
location="jdbc/DefaultDS">
                <name>OracleDevProjadmSchema</name>
                <description>Oracle8I Jdbc driver</description>
                <url>jdbc:oracle:thin:@111.111.111.111:1521:sample</url>
                <connection-driver>oracle.jdbc.driver.OracleDriver</connection-driver>
                <username>xxxx</username>
                <password>xxxx</password>
        </data-source>

        <!-- a Pooled data source -->
        <data-source class="com.evermind.sql.DefaultConnectionPoolDataSource"
location="jdbc/DefaultPooledDS">
                <name>Oracle Pooled Connection</name>
                <description>Connection Pool of Oracle Driver above</description>
                <source-location>jdbc/DefaultDS</source-location>
                <username>xxxx</username>
                <password>xxxx</password>
            <inactivity-timeout>300</inactivity-timeout>
            <max-connections>5</max-connections>
        </data-source>

When I run this client code I get the errors:
trying to get a jdbc/DefaultDS

java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(DriverManager.java:477)
        at java.sql.DriverManager.getConnection(DriverManager.java:137)
        at com.evermind.sql.ConnectionDataSource.getConnection(JAX)
        at CartClient.main(CartClient.java:37)

trying to get a jdbc/DefaultPooledDS
Exception in thread "main" java.lang.NullPointerException
        at com.evermind.sql.DefaultConnectionPoolDataSource.cb(JAX)
        at
com.evermind.sql.DefaultConnectionPoolDataSource.getPooledConnection(JAX)
        at CartClient.main(CartClient.java:49)


The client code looks like this.
                Object homeObject = context.lookup("CartTest");

            System.out.println("\ntrying to get a jdbc/DefaultDS");
            ConnectionDataSource datasource1 =
(ConnectionDataSource)context.lookup("jdbc/DefaultDS");
            try
            {
                Connection conn1 = datasource1.getConnection();
                System.out.println("datasource connection gotten:
"+conn1.toString());
                conn1.close();
            }
            catch(Exception e) {e.printStackTrace();}

            System.out.println("\ntrying to get a jdbc/DefaultPooledDS");
            PooledConnection pcon = null;
            Connection con = null;
            try
            {
              ConnectionPoolDataSource ds =
(ConnectionPoolDataSource)context.lookup("jdbc/DefaultPooledDS");
              pcon = ds.getPooledConnection();
              System.out.println("PooledConnection gotten:
"+pcon.toString());
              con = pcon.getConnection();
              System.out.println("connection gotten: "+con.toString());
              Statement s = con.createStatement();
              ResultSet rs = s.executeQuery("select * from country");
              rs.close();
              s.close();
            }
            catch (NamingException e) { e.printStackTrace(); }
            catch (SQLException e) {e.printStackTrace(); }
            finally


                if (pcon != null)
                try{pcon.close();}catch(Exception e){}
            }


Thanks in advance,
Mike

========================================
Mike Fontenot - Object Systems Architect
Polygon Network, Inc.
Golden, Colorado
========================================

Reply via email to