Hi All,
I am facing a strange problem while deploying the bean that accesses the
database by doing the lookup for the datasource object.

Here is the code that i have used in the bean class to get the ref to the
datasource object.

Context initContext = new InitialContext();
DataSource ds = (DataSource) initContext.lookup("db");
Connection conn = ds.getConnection();

Here, "db" is the logical JNDI name of the datasource.

For mapping this name with the actual JNDI name, container configuration
file is used as follows

<configuration>
<description>Test Container</description>
<display-name>Hello</display-name>
category>Hi</category>
<enterprise-beans>
    <session>
     <ejb-name>Hello</ejb-name>
     <jndi-name>hello</jndi-name>
     <jndi-source-name>CosNaming</jndi-source-name>
       <resource-ref>
                <res-ref-name>db</res-ref-name>
                <res-ref-link>dbtry</res-ref-link>
     </resource-ref>
    </session>
</enterprise-beans>

<jndi-sources>
   <jndi-source>
      <jndi-source-name>CosNaming</jndi-source-name>
      <property>
        <prop-name>java.naming.factory.initial</prop-name>
        <prop-value>com.sun.jndi.cosnaming.CNCtxFactory</prop-value>
        </property>
      </jndi-source>
  </jndi-sources>

  <resources>
       <resource>
       <resource-name>dbtry</resource-name>
       <jndi-name>IPASSequelinkDataSource</jndi-name>
         <property>
           <prop-name>java.naming.factory.initial</prop-name>

<prop-value>com.sun.jndi.fscontext.RefFSContextFactory</prop-value>
           <prop-name>java.naming.provider.url</prop-name>
            <prop-value>file:///c:/</prop-value>
         </property>
       </resource>
 </resources>
</configuration>

In this "IPASSequelinkDataSource" is the name of the wrapper datasource
object provided by the IONA. This name is registered with the File System
JNDI using the RegisterDataSource utility provided by the IONA.

While deploying i am getting different errors like
"java.rmi.remoteexception: CORBA UNKNOWN 1230242048; nested exception is:
org.omg.CORBA.UNKOWN: Minor Code 12302420148 completed:No" or
"NamingException" etc.
It is giving diff errors at diff times.

Anyone faced a similar problem please reply back.

Regards
Ripan

===========================================================================
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