Kong:
           1."t3://localhost:80" Are you sure port number ?
           2. In ejb-jar.xml
                <env-entry>
                  <env-entry-name>Conntion Pool Name(TestPool)</env-entry-name>
                  <env-entry-type>>javax.sql.DataSource</env-entry-type>
                  <env-entry-value>jdbc/TXDataSource</env-entry-value>
               </env-entry>
           3. ds=(DataSource)ctx.lookup("java:comp/env/TestPool")

  
>>> kongtao <[EMAIL PROTECTED]> 08/26/02 01:49AM >>>
Hi All:
    In my EJB ,I can't get a connection through the  PoolConnection.Follwing is 
fragment of EntityBean/config.xml/ejb-jar.xml/weblogic-ejb-jar.xml.Pls help me!
your help would be appreciated! In bean codes,The NullPointerException
will be thrown when I invoke the getConnection method.Maybe I can find
the JNDIName of DataSource .Why?
-------java code--------
env.put(Context.PROVIDER_URL,"t3://localhost:80");
ctx=new InitialContext(env);
ds=(DataSource)ctx.lookup("java:comp/env/jdbc/TXDataSource")
--------config.xml-----
<JDBCConnectionPool
        DriverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
        InitialCapacity="20" LoginDelaySeconds="1" 
MaxCapacity="50" naame="TestPool" 
URL="jdbc:microsoft:sqlserver://192.168.0.246:1433"/> 
-------web.xml-----
<resource-ref>
    <description />
    <res-ref-name>jdbc/TXDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>
-------ejb-jar.xml-----
<entity>
            <resource-ref>
                <description />
                <res-ref-name>jdbc/TXDataSource</res-ref-name>
                <res-type>javax.sql.DataSource</res-type>
                <res-auth>Container</res-auth>
            </resource-ref>
</entity>
------weblogic-ejb-jar.xml------------
<weblogic-enterprise-bean>
        <ejb-name>StyleBean</ejb-name>
        <reference-descriptor>
            <resource-description>
                <res-ref-name>jdbc/TXDataSource</res-ref-name>
                <jndi-name>MyDataSource</jndi-name>
            </resource-description>
        </reference-descriptor>
        <jndi-name>StyleBean</jndi-name>
</weblogic-enterprise-bean>
------------------------exception fragment
java.lang.NullPointerException
        at com.sabrina.ejb.StyleBean.getConnection(StyleBean.java:341)
        at com.sabrina.ejb.StyleBean.ejbCreate(StyleBean.java:55)
        at =
com.sabrina.ejb.StyleBean_81hvkv_Impl.ejbCreate(StyleBean_81hvkv_Impl
..............

Albert Pi
Corp IS System Delivery
516-803-3762

==========================================================================To 
unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to