DataSource-class pool-JNDI-bind-lookup

Hi,
I am a beginner in this subject and it is confused. I read that
the best way to use the connections is from a DataSource. There
are 2 ways to configure it:
1- From the data-source.xml file
2- Or using InitialContext, Context and bind method from a java
program loaded in the startup.
If so, which one is better?
On the other hand, there are some classes I can use, for
instance:
1- OracleConnectionCacheImpl
2- OracleConnectionPoolDataSource
etc.
which one is better?
Thank you very much for any comment.
Andres.

Hi:
upon further research, i find that the data
that was used in State class at binding does not change on any update,
like via foll -
State s = (State)ic.lookup(JNDINAME);
s.addHashtableEntry (key, val); or
s.setDesc ("new desc");
next time i lookup State class the hashtable entry is missing and desc is
old and not "new desc".
any help appreciated.
thanks
rajans
Rajan Sadasivan wrote:
Hi:
I am using jdk1.3, weblogic6.0
I am binding a state class like ->
public class State implements Serializable {
private String desc;
private Hashtable sessions;
onto the JNDI tree. Binding is done like initialCxt.bind (name,
_state);
and state's sessions has one entry in it and state's desc is set.
I then use another client to do _initialCxt.lookup (name) on same
weblogic JVM.
The _state object is returned with correct value of desc; but the
sessions
hashtable is empty and the single entry is gone. I do see also the the
State's finialize () method is called.
Can anyone explain why i am losing hashtable information ?
How do I make this work in weblogic jndi with hashtable info ?
thanks
rajans

Similar Messages

  • The DataSource with the JNDI name: MyDataSource could not be located.

    hi,
    I created a connection pool myconnectionpool and i create a data source MyDataSource with jndi name as mydsn.
    in my weblogic-cmp-rdbms-jar.xml i gave
    <data-source-name>MyDataSource</data-source-name> and
    When i deploy the bean i am getting following exception.
    Unable to deploy EJB: containerManaged from cmp7.jar:
    weblogic.ejb20.WLDeploymentException: The DataSource with the JNDI name: MyDataSource could not be located. Please ensure that the DataSource has been deployed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.setup(RDBMSPersistenceManager.java:128)
         at weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:213)
         at weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:185)
         at weblogic.ejb20.manager.DBManager.setup(DBManager.java:160)
         at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.deploy(ClientDrivenBeanInfoImpl.java:928)
         at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1216)
         at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:850)
         at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:70)
         at weblogic.j2ee.Application.addComponent(Application.java:253)
         at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:144)
         at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:364)
         at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:301)
         at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:255)
         at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:206)
         at java.lang.reflect.Method.invoke(Native Method)
         at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:716)
         at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:698)
         at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:380)
         at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
         at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
         at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:902)
         at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:480)
         at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:208)
         at $Proxy34.updateDeployments(Unknown Source)
         at weblogic.management.configuration.ServerMBean_CachingStub.updateDeployments(ServerMBean_CachingStub.java:3724)
         at weblogic.management.deploy.slave.SlaveDeployer.updateServerDeployments(SlaveDeployer.java:1584)
         at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:337)
         at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:233)
         at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:61)
         at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:852)
         at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:273)
         at weblogic.Server.main(Server.java:33)
    Where i went wrong?
    Thanks in advance
    phani

    Hi ,
    I have the same problem .when i look into JNDI tree view the jndi name is listed. but it saying error below listed.
    my
    ejb-name:=containerManaged
    datasourcename=EX_DataSource
    jndi-name=EX_JNDI
    <Feb 14, 2005 3:10:08 PM IST> <Error> <Deployer> <149231> <The slave deployer was unable to set the activatio
    true for the application EX_Container
    weblogic.management.ApplicationException: activate failed forEX_Container
    Module Name: EX_Container, Error: Exception activating module: EJBModule(EX_Container,status=PREPARED)
    Unable to deploy EJB: containerManaged from EX_Container.jar:
    The DataSource with the JNDI name: EX_DataSource could not be located. Please ensure that the DataSource has
    ed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
    TargetException:
    Unable to deploy EJB: containerManaged from EX_Container.jar:
    The DataSource with the JNDI name: EX_DataSource could not be located. Please ensure that the DataSource has
    ed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1093)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:1022)
    at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForAllApplications(SlaveDeployer.
    at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:376)
    at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLife
    ava:235)
    at weblogic.t3.srvr.ServerLifeCycleList.resume(ServerLifeCycleList.java:65)
    at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:832)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:300)
    at weblogic.Server.main(Server.java:32)
    my weblogic-ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
    'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>containerManaged</ejb-name>
    <entity-descriptor>
    <persistence>
         <persistence-use>
         <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
         <type-version>7.0</type-version>
         <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
         </persistence-use>
    </persistence>
    </entity-descriptor>
    <jndi-name>EX_JNDI</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-rdbms-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB RDBMS Persistence//EN'
    'http://www.bea.com/servers/wls700/dtd/weblogic-rdbms20-persistence-700.dtd'>
    weblogic-cmp-rdbms-jar.xml file
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>containerManaged</ejb-name>
    <data-source-name>EX_DataSource</data-source-name>
    <table-map>
    <table-name>ejbAccounts</table-name>
    <field-map>
    <cmp-field>accountId</cmp-field>
    <dbms-column>id</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>balance</cmp-field>
    <dbms-column>bal</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>accountType</cmp-field>
    <dbms-column>type</dbms-column>
    </field-map>
    </table-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>DropAndCreateAlways</create-default-dbms-tables>
    </weblogic-rdbms-jar>
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC
    "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>containerManaged</ejb-name>
    <home>containerBN.EX.AccountHome</home>
    <remote>containerBN.EX.Account</remote>
    <ejb-class>containerBN.EX.AccountBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>AccountBean</abstract-schema-name>
    <cmp-field>
    <field-name>accountId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>balance</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>accountType</field-name>
    </cmp-field>
    <primkey-field>accountId</primkey-field>
    <query>
    <query-method>
    <method-name>findBigAccounts</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.balance > ?1]]>
    </ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findAccount</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.balance = ?1]]>
    </ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findNullAccounts</method-name>
    <method-params>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM AccountBean AS a WHERE a.accountType IS NULL]]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>containerManaged</ejb-name>
         <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    <ejb-client-jar>EX_Container.jar</ejb-client-jar>
    </ejb-jar>
    pls lhelp me .
    my email id: [email protected]
    thanks in advance.
    Sudhakar.M

  • Added DataSource not in JNDI tree; WLS6.1SP1

    I have added a new DataSource, but I don't see it in the JNDI tree? I have restarted the server after adding. (BTW if I check the examples server, not every name is in the JNDI tree either?! eg. examples-dataSource-demoPool is not in the tree; but examples-dataSource-demoXAPool is in the tree)
    If possible please also reply to my email address... [email protected]

    Thanks for your suggestion. I did this after adding the pool. I should have mentioned
    this in my first post.
    I have tried again to add a ConnectionPool and a DataSource: to my supprise it
    was in the JNDI tree. So everything seemed OK now, but read on...
    Because I couldn't access other PC's in my network (Weblogic is installed on my
    laptop, which I used during the day without network connection) I rebooted my
    laptop and the JNDI name was gone??? Must be something with IP addresses or so.
    I will investigate and reply when I have figured it out.
    Deepak Vohra <[email protected]> wrote:
    Ben
    Set the Targets Server.
    Click on JDBC node. Click on Data Sources Node. Click on the DataSource
    node. click on Targets tab. Choose a Targets Server. click Apply. The
    added DataSource should get a JNDI binding.
    Deepak
    Ben Verloop wrote:
    I have added a new DataSource, but I don't see it in the JNDI tree?I have restarted the server after adding. (BTW if I check the examples
    server, not every name is in the JNDI tree either?! eg. examples-dataSource-demoPool
    is not in the tree; but examples-dataSource-demoXAPool is in the tree)
    If possible please also reply to my email address... [email protected]

  • Shared Services API - Error when getting datasource weblogic/pool/PooledConnectionDataSource

    Hello,
    I have a program that connects to shared services using Java APIs. The code is usually working fine on other environment.
    This one is on EPM version 11.1.2.1 and I get an error after this procedure --> system = CSSSystem.getInstance(context, "");
    Jan 27, 2015 9:36:44 AM com.hyperion.hit.registry.RegistryUtils buildConnFromDriverManager
    WARNING: Check whether Oracle Home and Instance environment variables are defined appropriately. RootCause : weblogic.jdbc.sqlserver
    .SQLServerDriver
    Error when getting datasource weblogic/pool/PooledConnectionDataSource
    Jan 27, 2015 9:36:44 AM com.hyperion.hit.registry.RegistryUtils createNewConnection
    SEVERE: Failed to create connection from data source. RootCause:weblogic/pool/PooledConnectionDataSource.
    Jan 27, 2015 9:36:44 AM com.hyperion.hit.registry.exceptions.RegistryException <init>
    INFO: Registry Exception Occured - Failed to create new database connection using datasource.RootCause:[weblogic/pool/PooledConnecti
    onDataSource]
    Jan 27, 2015 9:36:44 AM com.hyperion.hit.registry.Registry lookupComponentsWithException
    INFO: EPMREG-11045
    Jan 27, 2015 9:36:44 AM com.hyperion.hit.registry.exceptions.RegistryException <init>
    INFO: Registry Exception Occured - Failed to create new database connection using datasource.RootCause:[weblogic/pool/PooledConnecti
    onDataSource]
    Jan 27, 2015 9:36:44 AM com.hyperion.hit.registry.Registry lookupWithException
    INFO: EPMREG-11038
    Jan 27, 2015 9:36:44 AM com.hyperion.hit.registry.exceptions.RegistryException <init>
    INFO: Registry Exception Occured - com.hyperion.hit.registry.exceptions.RegistryException: Failed to create new database connection
    using datasource.RootCause:[weblogic/pool/PooledConnectionDataSource]
    Jan 27, 2015 9:36:44 AM com.hyperion.hit.registry.Registry lookup
    INFO: EPMREG-11038
    Jan 27, 2015 9:36:44 AM com.hyperion.css.registry.RegistryManager RegistryManager
    SEVERE: Failed to initialize EPM Shared Services security instance. Component SYSTEM9/FOUNDATION_SERVICES_PRODUCT/SHARED_SERVICES_PR
    ODUCT is null in EPM System Registry. Verify EPM System Registry configuration.
    java.lang.NullPointerException
            at start.initialize(start.java:84)
            at start.Sample(start.java:59)
            at cc.main(cc.java:10)
    I guess it is something with the SQLServer driver.Do you have any ideas?
    My ORACLE_HOME and ORACLE_INSTANCE are set correctly.
    Thanks in advance,
    Regards,
    Nicolas

    Hello,
    I finally got it working!
    I added the weblogic libraries located under EPM/Middleware/wlserver_10.3/server/lib, and now it works fine.
    It was a pain to find it out, because the error message did not specify that it was a missing library..
    Anyway, if it helps, here is the list of external libraries I am using:
    "wlssapi.jar"
    "wlssapi-internal.jar"
    "wlss-datatier.jar"
    "wlss-descriptor-binding.jar"
    "wlssdiameter.jar"
    "wlssechosvr.jar"
    "wlss-mbeaninfo.jar"
    "WLSSSecurityProviders.jar"
    "wlthint3client.jar"
    "wlw-langx.jar"
    "wlw-langx-ja.jar"
    "wlw-langx-ko.jar"
    "wlw-langx-zh_CN.jar"
    "wlw-langx-zh_TW.jar"
    "wlw-wsee-soapfault.jar"
    "xmlparserv2_sans_jaxp_services.jar"
    "xmlrpc-2.0.1.jar"
    "audit-client.jar"
    "castor-1.0.5.jar"
    "com.bea.core.apache.commons.pool_1.3.0.jar"
    "commons-lang-2.1.jar"
    "css.jar"
    "dms.jar"
    "interop-sdk.jar"
    "ojdl.jar"
    "quartz.jar"
    "regexp.jar"
    "registry-api.jar"
    "scheduler_ces.jar"
    "sqljdbc.jar"
    "wf_ces_utils.jar"
    "wf_eng_agent.jar"
    "wf_eng_api.jar"
    "wf_eng_server.jar"
    "wlcipher.jar"
    "wlclient.jar"
    "wlcommons-logging.jar"
    "wlconnector.jar"
    "wldb2.jar"
    "wldeploy.jar"
    "wlinformix.jar"
    "wl-j2ee-client.jar"
    "wljarbuilder.jar"
    "wljmsclient.jar"
    "wljmxclient.jar"
    "wllog4j.jar"
    "wlnmclient.jar"
    "wlpool.jar"
    "wlsafclient.jar"
    "wls-api.jar"
    "wlss.jar"
    "wlss_i18n.jar"
    Thank you all for your help.
    Regards,
    Nicolas

  • Probmel with Local EJB JNDI Binding

    Hi friends,
    I am using jboss server. I need to deployee one session bean and one entity bean. and I have done it. but it show me jndi binding like this
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookBean' to jndi 'local/BookBean@18722656'
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookFacadeBean' to jndi 'local/BookFacadeBean@9668715'
    but it should be bind jndi bninding like this
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookBean' to jndi 'BookBean'
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookFacadeBean' to jndi 'BookFacadeBean'
    I don't understand where I am comminting mistake. I am giving ejb-jar.xml mapping below.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
         <description>BookEJB</description>
         <display-name>BookEJB</display-name>
         <enterprise-beans>
              <session>
                   <display-name>BookFacade</display-name>
                   <ejb-name>BookFacadeBean</ejb-name>
                   <local-home>com.ejb.book.service.BookFacadeHome</local-home>
                   <local>com.ejb.book.service.BookFacadeLocal</local>
                   <ejb-class>com.ejb.book.service.BookFacadeBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
              <entity>
                   <description>EntityBean</description>
                   <display-name>BookEntity</display-name>
                   <ejb-name>BookBean</ejb-name>
                   <local-home>com.ejb.book.persistence.BookLocalHome</local-home>
                   <local>com.ejb.book.persistence.BookLocal</local>
                   <ejb-class>com.ejb.book.persistence.BookLocalBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <abstract-schema-name>book</abstract-schema-name>
                   <cmp-field>
                        <field-name>bookID</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookName</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookAuthor</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookVersion</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookPrice</field-name>
                   </cmp-field>
                   <primkey-field>bookID</primkey-field>
                   <query>
                        <description>Query By All</description>
                             <query-method>
                                  <method-name>findAll</method-name>
                                  <method-params></method-params>
                             </query-method>
                             <ejb-ql>SELECT OBJECT(u) FROM book AS u </ejb-ql>
                   </query>
                   <query>
                        <description>Query for findByBookName</description>
                        <query-method>
                             <method-name>findByPrimaryKey</method-name>
                                  <method-params>
                                       <method-param>java.lang.Integer</method-param>
                                  </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookID=?1</ejb-ql>
              </query>
                   <query>
                        <description>Query for findByBookName</description>
                        <query-method>
                             <method-name>findByBookName</method-name>
                                  <method-params>
                                       <method-param>java.lang.String</method-param>
                                  </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookName=?1</ejb-ql>
              </query>
              <query>
                        <description>Query for findByBookAuthor</description>
                        <query-method>
                             <method-name>findByBookAuthor</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookAuthor=?1</ejb-ql>
              </query>
              <query>
                   <description>Query for findByBookVersion</description>
                   <query-method>
                        <method-name>findByBookVersion</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>SELECT OBJECT(u) FROM book AS u     WHERE u.bookVersion=?1</ejb-ql>
              </query>
              <query>
                   <description>Query for findByBookPrice</description>
                   <query-method>
                        <method-name>findByBookPrice</method-name>
                        <method-params>
                             <method-param>java.lang.Float</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookPrice=?1</ejb-ql>
              </query>
              </entity>
         </enterprise-beans>
         <assembly-descriptor>
              <container-transaction>
                   <method>
                        <ejb-name>BookBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
              <container-transaction>
                   <method>
                        <ejb-name>BookFacadeBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    I appreciate if you reply me on [email protected].
    Thanks in advance.
    TumoDav (UmaShankar)

    Hi friend,
    Thanks for replying me. But , I am unable to call this EJB by simple EJBClient (simple java file) when I am trying to call this ejb, then it show me this error :-
    javax.naming.NameNotFoundException: BookFacadeBean not bound
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
         at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
         at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
         at sun.rmi.transport.Transport$1.run(Transport.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
         at java.lang.Thread.run(Thread.java:595)
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at EJBClient.EJBClient.BookEJBClient(EJBClient.java:45)
         at EJBClient.EJBClient.main(EJBClient.java:30)
    Here I am giving my ejb client.
    package EJBClient;
    import java.util.Iterator;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import com.ejb.book.service.BookFacadeBean;
    import com.ejb.book.service.BookFacadeHome;
    import com.ejb.book.service.BookFacadeLocal;
    import com.ejb.book.vo.BookVo;
    * @author UmaShankar
    public class EJBClient {
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              BookEJBClient();
         public static void BookEJBClient(){
              String providerURL = "jnp://localhost:1099";
              String factoryName = "org.jnp.interfaces.NamingContextFactory"; //org.jnp.interfaces.NamingContextFactory
              String factoryPkgs = "org.jboss.naming:org.jnp.interfaces";
              Properties prop = System.getProperties();
              prop.put("Context.PROVIDER_URL", providerURL);
              prop.put("java.naming.provider.url", providerURL);
              prop.put("java.naming.factory.initial", factoryName);
              prop.put("java.naming.factory.url.pkgs", factoryPkgs);
              try{
                   Context ctx = new InitialContext(prop);
                   Object obj = ctx.lookup("BookFacadeBean");
                   BookFacadeHome home = (BookFacadeHome)PortableRemoteObject.narrow(obj, BookFacadeHome.class);
                   BookFacadeLocal local = home.create();
                   //java.util.Hashtable allD = local.getBookName();
                   System.out.println("-------------Start-------------------");
                   System.out.println("BookName:-"+local.getBookName());
                   System.out.println("BookAuthor:-"+local.getBookAuthor());
                   if(allD.isEmpty()){
                        System.out.println("There is no record. Empty Hash");
                   java.util.Set set = allD.keySet();
                   for(Iterator it = set.iterator();it.hasNext();System.out.println("-----------------------------")){
                        Integer key = (Integer)it.next();
                        BookVo vo = (BookVo)allD.get(key);
                        System.out.println(vo.getBookId());
                        System.out.println(vo.getBookName());
                        System.out.println(vo.getBookAuthor());
                        System.out.println(vo.getBookVersion());
                        System.out.println(vo.getBookPrive());
              }catch(Exception e){
                   e.printStackTrace();
    }

  • The DataSource with the JNDI name: contentDataSource could not be located

    Hello,
    We try to deploy our system/application to the servers that structed as
    Machine one has:
    1 administration domain
    1 managed domain
    Machine two has :
    1 managed domain which is administrated by machine one.
    I was trying to deploy the UI(portal application) to managed domain under Machine one. I got
    error message as following:
    Exception:weblogic.management.ApplicationException: activate failed for content.jar Module: content.jar Error: Exception activating module: EJBModule(content.jar,status=PREPARED) Unable to deploy EJB: ValueBean from content.jar: [EJB:011028]The DataSource with the JNDI name: contentDataSource could not be located. Please ensure that the DataSource has been deployed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
    I have portalFrameworkPool Data Sources deployed to both managed domains.
    when I deploy the application to the server that has one one domain(both adminstrator domain and application domain are in one), it is fine.
    Can some one with same experience, or BEA people provide some help on this? Very appreciate any help on this issue.
    Thanks in advance.
    Christina

    :-p
    If you go to each Managed Server on the console, you can see the Service tab and then go to JDBC. Under JDBC you can see all the pool connections. Instead of localhost they should be pointing to the specific hostname or ip address of the adminserver and the pointbase port on that server (9093 by default) so the EAR files can be correctly deployed and then the JNDI Tree will look exactly the same on both servers. Change all the connection pools to use the specific hostname instead of localhost. Hope this works for you.

  • JNDI bind from StartupClass ?

    Hi,
    I am trying to perfrom a simple JNDI bind from my StartupClass's startUp
    method using the following code [where configFileName is a valid
    string]:
         Context ctx = new InitialContext();
         try {
              CompositeName name =
                   new CompositeName("java:comp/env/ConfigFile");
              ctx.bind(name, configFileName);
         } catch(Exception e) {
              System.err.println("\nException while trying to bind.\n");
              e.printStackTrace();
    I recieve the following exception:
    Exception while trying to bind.
    javax.naming.OperationNotSupportedException
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.naming.NamingException.<init>(NamingException.java:114)
    at
    javax.naming.OperationNotSupportedException.<init>(OperationNotSupportedException.java:39)
    at com.netscape.server.jndi.CompContext.bind(Unknown Source)
    at com.netscape.server.jndi.java.javaURLContext.bind(Unknown Source)
    at com.netscape.server.jndi.java.javaURLContext.bind(Unknown Source)
    at javax.naming.InitialContext.bind(InitialContext.java:378)
    at
    com.getpaid.thinclient.config.ConfigService.initialize(ConfigService.java:123)
    at
    com.getpaid.thinclient.config.ConfigService.startService(ConfigService.java:40)
    at
    com.iplanet.ias.startup.StartupClass.startUp(StartupClass.java:53)
    at com.kivasoft.engine.Engine.invokeStartUp(Unknown Source)
    at com.kivasoft.engine.Engine.run(Compiled Code)
    at com.kivasoft.engine.Engine.main(Unknown Source)
    The same code works from a JBoss MBean (analagous to StartupClass).
    Can you tell me what, if anything, I'm doing wrong?
    Thank you,
    Eric Kahler

    The startup class uses cosnaming for JNDI so it behaves the same as the
    rich client, ie no java:comp/etc.. you will need to use the absolute
    name.
    regards
    Han-Dat
    [email protected] wrote:
    >
    Hi,
    I am trying to perfrom a simple JNDI bind from my StartupClass's startUp
    method using the following code [where configFileName is a valid
    string]:
    Context ctx = new InitialContext();
    try {
    CompositeName name =
    new CompositeName("java:comp/env/ConfigFile");
    ctx.bind(name, configFileName);
    } catch(Exception e) {
    System.err.println("\nException while trying to bind.\n");
    e.printStackTrace();
    I recieve the following exception:
    Exception while trying to bind.
    javax.naming.OperationNotSupportedException
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.naming.NamingException.<init>(NamingException.java:114)
    at
    javax.naming.OperationNotSupportedException.<init>(OperationNotSupportedException.java:39)
    at com.netscape.server.jndi.CompContext.bind(Unknown Source)
    at com.netscape.server.jndi.java.javaURLContext.bind(Unknown Source)
    at com.netscape.server.jndi.java.javaURLContext.bind(Unknown Source)
    at javax.naming.InitialContext.bind(InitialContext.java:378)
    at
    com.getpaid.thinclient.config.ConfigService.initialize(ConfigService.java:123)
    at
    com.getpaid.thinclient.config.ConfigService.startService(ConfigService.java:40)
    at
    com.iplanet.ias.startup.StartupClass.startUp(StartupClass.java:53)
    at com.kivasoft.engine.Engine.invokeStartUp(Unknown Source)
    at com.kivasoft.engine.Engine.run(Compiled Code)
    at com.kivasoft.engine.Engine.main(Unknown Source)
    The same code works from a JBoss MBean (analagous to StartupClass).
    Can you tell me what, if anything, I'm doing wrong?
    Thank you,
    Eric Kahler--
    Senior Consultant
    Sun Professional Services
    iPlanet e-commerce Solutions
    Sun Microsystems Australia Pty Ltd

  • How to use JNDI to lookup remote EJB Home?

    Hello,
    I am writing a servlet to call a remote EJB on another machine.
    I use JNDI to lookup remote EJBHome (not) but fail.
    Any advice?
    Any trick to configure application-client.xml?
    Thanks!

    Use com.evermind.server.rmi.RMIInitialContextFactory instead
    Here an example
    // EmployeeClient.java
    package mypackage5;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.io.*;
    import java.util.*;
    import java.rmi.RemoteException;
    import com.evermind.server.ApplicationClientInitialContextFactory;
    import com.evermind.server.rmi.RMIInitialContextFactory;
    * A simple client for accessing an EJB.
    public class EmployeeClient
    public static void main(String[] args)
    System.out.println("EmployeeClient.main(): client started...");
    try
    * initialize JNDI context by setting factory, url and credential
    * in a hashtable
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    //env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://koushikm:23791/application4");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "admin");
    * or set these properties in jndi.properties
    * or use container defaults if that's where client got launched from
    Context context = new InitialContext(env);
    * Lookup the EmployeeHome object. The reference is retrieved from the
    * application-local context (java:comp/env). The variable is
    * specified in the assembly descriptor (META-INF/application-client.xml).
    Object homeObject =
    context.lookup("HelloEJB");
    System.out.println("EmployeeClient.main(): bean found...");
    // Narrow the reference to EmployeeHome.
    HelloEJBHome home =
         (HelloEJBHome) PortableRemoteObject.narrow(homeObject,
    HelloEJBHome.class);
    System.out.println("EmployeeClient.main(): home narrowed...");
    // Create remote object and narrow the reference to Employee.
    HelloEJB remote =
         (HelloEJB) PortableRemoteObject.narrow(home.create(), HelloEJB.class);
    System.out.println("EmployeeClient.main(): remote created...");
    String message=remote.helloWorld("SUCCESS");
    System.out.println(message);
    } catch(NumberFormatException e) {
    System.err.println("NumberFormatException: " + e.getMessage());
    } catch(RemoteException e) {
    System.err.println("RemoteException: " + e.getMessage());
    } catch(IOException e) {
    System.err.println("IOException: " + e.getMessage());
    } catch(NamingException e) {
    System.err.println("NamingException: " + e.getMessage());
    } catch(CreateException e) {
    System.err.println("CreateException: " + e.getMessage());
    Hello,
    I am writing a servlet to call a remote EJB on another machine.
    I use JNDI to lookup remote EJBHome (not) but fail.
    Any advice?
    Any trick to configure application-client.xml?
    Thanks!

  • How to create a class pool

    Hi how to create a class pool when i tried to create it has shown the following error
    <b>Unable to change program from or to type K
    Message no. DS165
    Diagnosis
    You tried to assign a type to a program that cannot be assigned in the program attributes, but can only be set internally by one of the tools in the ABAP Workbench.
    The following program types are reserved:
    F Reserved for Function Groups
    Function groups are adminstered by the Function Builder, and you can only create or delete them using the Function Builder or the Object Navigator (Transaction SE80).
    K Reserved for Class Defintions
    Class definitions are administered in the Class Builder. You can only create or delete them using the Clas Builder or the Object Navigator.
    J Reserved for Interface Definitions
    Interface definitions are administered in the Clas Builder. You can only create or delete them using the class Builder or the Object Navigator.</b>

    Hi,
    Though you get a popup for different options for different program types like Class pools, function groups etc in SE 38 Program attributes, you can't create them from Se38 transaction.
    They have to be created from different places.
    Class Pools are nothing but creating CLASSes and INTERFACEs using the T Code SE24.
    This needs little Java/OOPs concepts to create and use them.
    Hope this helps.
    Regards,
    Anji

  • Can I set the Datasource/Conn-pool credential programmatically ?

    Hi all,
    Within our ADF BC + Faces application, we use Crystal Report for our reporting solution.
    Crystal use different db connection from one used by the ADF BC. so I create a Datasource in OAS, to be used only by Crystal Report.
    Here is my problem :
    We also use VPD. So I have requirement to login as DifferentUser to make the VPD run correctly.
    How can I programmatically set the username and password of the datasource/conn-pool based on who is logging in to the application ?
    Thank you for your help,
    xtanto

    Good question; I don't know the answer. Try a post in the Identity Management section.
    Perhaps something with Enterprise Authentication may help.

  • Difference between interface pool and class pool

    Hi,
    Can any body tell me the difference between Interface pool and Class pool.
    thank you in advance.
    regards

    Hi,
    Class and Interface Pools
    This section discusses the structure and special features of class and interface pools for global classes.
    Global Classes and Interfaces
    Classes and interfaces are object types. You can define them either globally in the Repository or locally in an ABAP program. If you define classes and interfaces globally, special ABAP programs called class pools or interface pools of type K or J serve as containers for the respective classes and interfaces. Each class or interface pool contains the definition of a single class or interface. The programs are automatically generated by the Class Builder when you create a class or interface.
    A class pool is comparable to a module pool or function group. It contains both declarative and executable ABAP statements, but cannot be started on its own. The runtime system can create runtime instances (objects) through a request using the CREATE OBJECT statement. These objects execute the statements of the class pool.
    Interface pools do not contain any executable statements. Instead, they are used as containers for interface definitions. When you implement an interface in a class, the interface definition is implicitly included in the class definition.
    Structure of a Class Pool
    Class pools are structured as follows:
    Class pools contain a definition part for type declarations, and the declaration and implementation parts of the class.
    Differences From Other ABAP Programs
    Class pools are different from other ABAP programs for the following reasons:
    ·        ABAP programs such as executable programs, module pools, or function modules, usually have a declaration part in which the global data for the program is defined. This data is visible in all of the processing blocks in the program. Class pools, on the other hand, have a definition part in which you can define data and object types, but no data objects or field symbols. The types that you define in a class pool are only visible in the implementation part of the global class.
    ·        The only processing blocks that you can use are the declaration part and implementation part of the global class. The implementation part may only implement the methods declared in the global class. You cannot use any of the other ABAP processing blocks (dialog modules, event blocks, subroutines, function modules).
    ·        The processing blocks of class pools are not controlled by the ABAP runtime environment. No events occur, and you cannot call any dialog modules or procedures. Class pools serve exclusively for class programming. You can only access the data and functions of a class using its interface.
    ·        Since events and dialog modules are not permitted in classes, you cannot process screens in classes. You cannot program lists and selection screens in classes, since they cannot react to the appropriate events. It is intended to make screens available in classes. Instead of dialog modules, it will be possible to call methods of the class from the screen flow logic.
    Local Classes in Class Pools
    The classes and interfaces that you define in the definition part of a class pool are not visible externally. Within the class pool, they have a similar function to local classes and interfaces in other ABAP programs. Local classes can only be instantiated in the methods of the global class. Since subroutines are not allowed in class pools, local classes are the only possible modularization unit in global classes. Local classes have roughly the same function for global classes as subroutines in function groups, but with the significant exception that they are not visible externally
    Reward points if useful....
    Regards
    AK

  • Program of type Class Pool

    When we create a class in the Class Builder i.e. SE24, a program of type Class Pool is generated automatically. Where will we find the name of that program?
    Thanks,
    Ibrahim

    Hello Ibrahim
    In the TADIR table you will find only the object entry for your class (e.g. R3TR CLAS ZCL_MY_CLASS).
    However, table PROGDIR contains all the sub-objects of your class (Macros section not available).
    In addition, you may find class CL_OO_CLASSNAME_SERVICE useful.
    Regards
      Uwe

  • Class pools

    how to see the name of the class pool of my global class.
    can i use this class pool in my abap editor program. so that i can make friendship with it.

    HI john
    Yo can define your ABAP Unit test class as a friend of the global class to be tested in the local class definition include of your global class. So, you have to add a line of code like
    CLASS <name of global class to be tested> DEFINITION LOCAL FRIENDS <name of local ABAP Unit class> in the include where the definition of local ABAP Unit Class is in. Then you can call the private methods of your global class in the local abap unit class methods.
    just refer these links
    <b>http://help.sap.com/saphelp_nw2004s/helpdata/en/ec/d9ab291b0b11d295400000e8353423/content.htm</b>
    local class -> global class
    Regards Rk

  • DataSource & Connection pools

    Hi,
    I have a couple of question about DataSources and connection pools.
    1. Are DataSources & connection pools the same thing?
    2. Typically the data-sources.xml file, shows in plain text a user/name password combination. Isn't this a security risk? Can anything be done about this?
    thanks in advance,
    Kevin

    Hi Kevin --
    1. Are DataSources & connection pools the same thing?
    A DataSource enables the clean abstraction of the database connection details from the code.
    A DataSource has a name, and it provides you with access to connections via some configuration information it has (ie database host, port, sid, username/password). To get a connection, you first locate the datasource, and then ask it for a connection.
    Since the DataSource is now providing access to connections, you can get different types of DataSources that give you different behaviour. One example of this is a DataSource which supports connection pooling -- it will pool the connections for you. Some other datasources will support the use of container-managed-connections, which are used by EJB containers to support CMT.
    So while a DataSource can support connection pooling, the two are not synonomous.
    2. Typically the data-sources.xml file, shows in plain text a user/name password combination. Isn't this a security risk? Can anything be done about this?
    In the current production version and prior, the data-sources.xml file stored details in clear-text. Besides ensuring that the file has the correct level of OS priviliges set on it to ensure it can't be easily viewed, the only other workaround was to specify the username/password as parameters to the ds.getConnection() method. This puts the username/password back into the code so it breaks the concept of clean abstraction, but it was an option to avoid it being in the xml file.
    In our 904 release (available as a dev preview now on OTN) we support the use of password indirection for the passwords in this file. This enables you to specify a logcal name for a password, then create the actual user/password combination in our encrypted JAZN user repository. When the datasource is used, the container follows the indirection and retrives the password from the encrypted storage area.
    I'm pretty sure this is documented in the beta version of 904 J2EE Services Guide, see
    http://otn.oracle.com/tech/java/oc4j/904/doc_library/services-904-preview.pdf
    cheers
    -steve-

  • Help|| Is there any tool available to register Oracle datasource objects into JNDI

    Is there any tool available to register Oracle datasource objects into JNDI.If so please tell me where can I download.
    Thanks
    shiva

    I'd like to know the answer to this also.
    I just started reading about JNDI 2 days ago and have never used it. I'd like to use DataSource in my application with JNDI. If I can use the database as my JNDI "server", then I'd prefer to do that instead of having a seperate external server.

Maybe you are looking for