Format of the JNDI name for lookup in DataSource

Hi
a) I have made a datasource in Weblogic 10.3 called SQL and its JNDI name as jdbc/SQLDS.
The driver was BEA'S Type 4 Driver for MS SQL Server
Now I am trying to lookup the datasource through an application. I have used the following
lines of code:
InitialContext context = new InitialContext();
DataSource ds = context.lookup("jdbc/SQLDS");
Connection conn = ds.getConnection();
The Application was a success.
I saw in some articles that you can refer to the datasource by even java:comp/env/jdbc/SQLDS,
instead of just jdbc/SQLDS. I tried both ways and I was able to run the application.
b) Then I made another datasource in Weblogic 10.3 called SQL1 and its JNDI name as jdbc/SQL1.
The driver was MS SQL Server Type 4 Driver for versions 2000, 2005
Now I am trying to lookup the datasource through an application. I have used the following
lines of code:
InitialContext context = new InitialContext();
DataSource ds = context.lookup("jdbc/SQL1");
Connection conn = ds.getConnection();
The Application was a success.
I saw in some articles that you can refer to the datasource by even java:comp/env/jdbc/SQL1,
instead of just jdbc/SQL1. I tried the first way and it didnt work. It gave me a NullPointerException
at the line Connection conn = ds.getConnection();
c)Then I made a 3rd datasource in Weblogic 10.3 called SQL2 and its JNDI name as jdbc/SQL2DS.
The driver was MS SQL Server Type 4 Driver for versions 2000, 2005
Now I am trying to lookup the datasource through an application. I have used the following
lines of code:
InitialContext context = new InitialContext();
DataSource ds = context.lookup("jdbc/SQL2DS");
Connection conn = ds.getConnection();
The Application was a success.
I saw in some articles that you can refer to the datasource by even java:comp/env/jdbc/SQL2DS,
instead of just jdbc/SQL2DS. I tried the first way and it didnt work. Again, it gave me a NullPointerException
at the line Connection conn = ds.getConnection();
I was confused why the 2nd and 3rd way didnt work . Is it becaue I used Microsoft's MS SQL Server Type 4 Driver?
I have added the jar file in the WEBLOGIC_CLASSPATH. Why is it not recognising java:comp/env/jdbc/SQL2DS ?
I would be grateful if somebody could give me ideas on this...
Thanks
Neeti

To use application scoped or indirect JNDI lookups (i.e. java:comp/env/...) you usually need to define a <resource-ref> entry in your deployment descriptor(s). Not sure what type of application you are using to test (web-app, EJB,) but for java:comp/env/ lookups to work, you need to define resource references. The fact that your first test succeeded is somewhat strange. Without the resource reference definitions, I would have expected your JNDI lookups to fail with a NamingException instead of the lookup returning NULL for the datasource.
Assuming you are doing your test from a web-app, you need to add <resource-ref> definitions to your web.xml file similar to the following:
<resource-ref>
<res-ref-name>*jdbc/SQL2DS*</res-ref-name>
<res-type>java.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
and then add <reference-descriptor> definitions to your weblogic.xml file similar to the following:
<reference-descriptor>
<resource-description>
<res-ref-name>*jdbc/SQL2DS*</res-ref-name>
<jndi-name>*jdbc/SQL2DS*</jndi-name>
</resource-description>
</reference-descriptor>
Once you do these steps your lookup("java:comp/env/jdbc/SQL2DS") should function properly from within your web-app.

Similar Messages

  • Need the JNDI name for Destinations present in JMS Modules

    Hi all,
    I need JNDI`s of all the Destinations present in JMS Modules. With this code i am able to get all info about the JMS Modules, Destinations and as well as information about messages, but still not able to extract JNDI of Destination. Can some one give me pointer on this ?
    try {
    JMXServiceURL serviceUrl =
    new JMXServiceURL(
    "service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.runtime");
    System.out.println("Connecting to: " + serviceUrl);
    Hashtable env = new Hashtable();
    env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "weblogic.management.remote");
    env.put(javax.naming.Context.SECURITY_PRINCIPAL, "weblogic");
    env.put(javax.naming.Context.SECURITY_CREDENTIALS, "welcome1");
    jmxCon = JMXConnectorFactory.newJMXConnector(serviceUrl, env);
    jmxCon.connect();
    MBeanServerConnection con = jmxCon.getMBeanServerConnection();
    Set<ObjectName> mbeans = con.queryNames(queryObjectName, null);
    for (ObjectName mbeanName : mbeans) {
    String temp = mbeanName.toString();
    System.out.println(temp);
    String[] mBeanAttributes = {"Name", "DestinationType", "MessagesCurrentCount",
    "MessagesPendingCount", "MessagesReceivedCount", "MessagesHighCount" };
    queryObjectName = new ObjectName("*:*,Type=JMSDestinationRuntime");
    mbeans = con.queryNames(queryObjectName, null);
    for (ObjectName mbeanName : mbeans) {
    AttributeList attributes = con.getAttributes(mbeanName, mBeanAttributes);
    System.out.println((Attribute) attributes.get(0)+ "" +
    (Attribute) attributes.get(1)+
    (Attribute) attributes.get(2)+
    (Attribute) attributes.get(3)+
    (Attribute) attributes.get(4)+
    (Attribute) attributes.get(5));
    String temp = mbeanName.toString();
    ObjectInstance inst = con.getObjectInstance(mbeanName);
    System.out.println(temp);
    finally {
    if (jmxCon != null)
    jmxCon.close();
    But Nowhere i am getting the JNDI of destination Queues or Topics.
    Edited by: mdev on Feb 21, 2012 5:21 PM

    You are accessing the runtime mbean of a JMS destination. The JNID name of a destination is not available on the runtime destination MBean.
    If you are using jms-system-resource to deploy your JMS module, you should be able to access the deployment mbean of the destination. The starting MBean for JMS is JMSSystemResourceMBean in this case.

  • JNDI name for TransactionManager?

    What is the JNDI name for TransactionManager on Oracle9ias? I thought
    it was "java:comp/UserTransaction" but everytime I try to get the
    TransactionManager I get a javax.naming.NamingTransaction, root exception is java.lang.NullPointerException. Any help would be appreciated. :-)
    TransactionManager trans = null;
    String name = null;
    try {
    InitialContext ctx = new javax.naming.InitialContext();
    name = "java:comp/UserTransaction";
    trans = (TransactionManager) ctx.lookup( name );
    out.println("<p>*** class of TransactionManager is: " + trans);
    trans.begin();

    Srini,
    You mention EJB client -> is the EJB an entity bean? Is it BMT or CMT? If its an entity bean with CMT then you cannot (and should not) be starting the transactions. If however this is BMT then you can use a Sesssion Bean to start and commit the transaction.
    I have a feeling that you are using a remote client to access the EJB and then would like to start and commit a transaction. I would like to point out that this kind of transaction demarcation is not supported in OC4J. Here is quote from the OC4J documentation:
    "Client-side transaction demarcation is not supported in the application client container: OC4J does not support client-side transaction demarcation. This form of transaction demarcation is not required by the J2EE specification, and is not recommended for performance and latency reasons."
    I would recommend that you start using SLSB instead of remote clients.
    Hope this helps.
    Deepak

  • How to get the JNDI name of an EJB from within itself

    Hello,
    I'm trying to find a way to get the JNDI name of a session bean from
    within itself.
    In the application I'm working on we need to support multiple
    customers. In order to do that, each EJB has a normal home and remote
    interface, a base class bean implementation and different children
    bean implemetations for each customer (when the logic for the
    customers is different). JNDI is used to get the proper implementation
    based on the customer.
    I've got an EJB that provides some services that are the same for all
    customers, except for the fact that it contains one variable that
    should have a different value depending on the customer. I don't want
    to creat subclasses just for that. What I want is to be able to get
    the JNDI name and set the variable based on the it.
    Is there a way to get the JNDI name for the EJB from within itself?
    TIA
    MJ

    Hi Pradeep,
    Please try referring to this post which is discussed earliar and seems its also answered.
    http://forums.adobe.com/thread/504861
    Thanks,
    Bhasker Chari

  • Specify JNDI Name For EJB Module

    Hi folks, please I need to know how I can specify the Jndi name for an ejb module I am creating in netbeans 5.0, to be accessed by a web application.
    If this can be done using the sun java system application server 9 admin consle (just as for JDBC Resources), i'll also like to know how.
    Thanks.

    Thanks Jay. I went through the links, it seems that if you have the JNDI name set in the weblogic-ejb-jar.xml, there is no need to set the same in the weblogic admin console. I am using ejb 2.x version. Particularly if you get the WLInitialContextFactory in your code , then there is no need to set the JNDI name in the JNDI tree in weblogic admin console.
    Like:-
    Context ctx = null;
    java.sql.Connection conn = null;
    Hashtable<String,String> ht = new Hashtable<String,String>();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
    This will take care of JNDI tree, hence there is no need to set the JNDI name explictly in the weblogic admin console.
    Please correct me if i am wrong. Whether for datasource also whether we can do the same, by setting the resource-ref with datasource in the ejb-jar.xml and not set anything in weblogic admin console? Thanks.

  • JNDI name for a JMB is not replicatet to other servers in the cluster

    Hi,
              wl6.1sp7, two server cluster
              When I look at the JNDI Tree for a server I can't find JNDI names of JMB's from the other server in the cluster.
              I get an exception when trying to send to a destinaton on the other server. (Unable to resolve 'xlink.jms.service.report.biztalk-lab.Report' Resolved: 'xlink.jms.service.report' Unresolved:'biztalk-lab')
              Setting are same as explained in this thread...
              http://forums.bea.com/bea/thread.jspa?threadID=600003492&tstart=0
              And JNDINameReplicated is set to true....
              Why is the JNDI names not replicated?
              <JMSQueue JNDIName="xlink.jms.service.report.biztalk-lab.Report"
              JNDINameReplicated="true" Name="Report" StoreEnabled="default"/>
              This is the DD of a JMB:
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>xlink.jms.service.report.biztalk-lab.Report</ejb-name>
              <message-driven-descriptor>
              <pool>
              <max-beans-in-free-pool>3</max-beans-in-free-pool>
              <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
              </pool>
              <destination-jndi-name>xlink.jms.service.report.biztalk-lab.Report</destination-jndi-name>
              <connection-factory-jndi-name>xlink.jms.factory.commerceFactory</connection-factory-jndi-name>
              </message-driven-descriptor>
              <jndi-name>xlink.jms.service.report.biztalk-lab.Report</jndi-name>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              ~b

    1. yes
              <JMSConnectionFactory AllowCloseInOnMessage="false"
              DefaultDeliveryMode="Persistent" DefaultPriority="4"
              DefaultTimeToLive="0"
              JNDIName="xlink.jms.factory.commerceFactory"
              MessagesMaximum="10" Name="xlink.jms.factory.commerceFactory"
              OverrunPolicy="KeepOld" Targets="bluej,biztalk-lab,devtestCluster"/>
              2. No I am just using the jndi name of the queue.
              This is an example of how I send a message:
                   Context ctx = new InitialContext();
              QueueConnectionFactory qconFactory;
              QueueConnection qcon;
              QueueSession qsession;
              QueueSender qsender;
              Queue queue;
              ObjectMessage msg;
              qconFactory = (QueueConnectionFactory) ctx.lookup("xlink.jms.factory.commerceFactory");
              qcon = qconFactory.createQueueConnection();
              qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
              queue = (Queue) ctx.lookup("xlink.jms.queue.biztalk-lab.OrdrspImport");
              qsender = qsession.createSender(queue);
              msg = qsession.createObjectMessage(reportExecutorContainer);
              qcon.start();
              qsender.send(msg);
              qsender.close();
              qsession.close();
              qcon.close();
              3. I don't know those setting (wl 6.1sp7)

  • Could take the same JNDI-names for both tags: jndi-name and local-jndi-name

    Hello!
    I try to design the weblogic-ejb-jar.xml descriptor and I ask myself, if I could
    take the same JNDI-names for both tags:
    <jndi-name> and <local-jndi-name> ?
    Could you give me and advice if this is ok?
    Thanks

    if you have two separate interfaces, you cant bind them to the same jndi
    name. you will have a local home that extends EJBLocalHome and a remote
    home called EJBHome. also you need to know which one you are looking up
    so you can cast it properly, and use it property (remote interfaces need
    PortableRemoteObject, remote parameters are passed by value, ...)
    joern kirch wrote:
    Hello!
    I try to design the weblogic-ejb-jar.xml descriptor and I ask myself, if I could
    take the same JNDI-names for both tags:
    <jndi-name> and <local-jndi-name> ?
    Could you give me and advice if this is ok?
    Thanks

  • Help needed on allocating a JNDI name for MYSQL on Glassfish

    Hi,
    I am trying to invoke my database (MYSQL) through a JNDI lookup on GlassFish Server. I copied the MySQL connector into the GLASSFISH_HOME/lib directory and went into Admin console (http://localhost:8080/login.jsf) to create a ConnectionPool. After this, I am not sure what I should do, inorder to associate a "jdbc/mysql" JNDI name for this pool. Can anybody point me to what has to be done?
    Thank you.

    Figured it. After you've setup your pool, you need to go to Resources -> JDBC -> JDBC Resources and then create an new mapping of the pool that you've just created to some name (ex: "java/mysql"); This should integrated Glassy with Mysql
    Thanks.

  • What is the table name for Workload analysis?

    Hi All TechGurus,
    We need to create an ABAP program in which it displays some information of Transaction (STO3n), Report for the same (SAPWL_ST03N)
    We want  to create an ABAP program to get the output in excel format?
    What is the table name for Workload analysis?
    Many thanks in advance!!

    Hi  Keshav,
    Thank you for your reply.
    As per my requirement, i want to create an ABAP program in which it displays some information of Transaction (STO3n) and want to send the output in excel format. however I don't understand how to start with it.
    Below are the conditions -
    1. display data for today's date
    2 .In transaction profile,  task should be Dialogue.
    from where should i fetch data which is getting displyed after executing t.code ST03n?
    Please help me with your suggessions...
    Thanks

  • Dynamic JNDI name for database adapter in BPEL

    Hi All,
    I am having some major issues trying to make the JNDI location for the database adapter dynamic (10.1.3.4). I already went through the followin link, but that didnt work for me: http://www.oracle.com/technology/pub/articles/bpel_cookbook/carey.html
    The below example works, but only the first run. Second time around the first runs JNDI value gets retained and connects to that database.
    This is what worked atleast the first time.
    I parameterized the JNDI with a variable defined in the partnerlink definition in the bpel.xml
    In Bpel. xml
    <partnerLinkBinding name="updatetbl">
    <property name="wsdlLocation">updatetbl.wsdl</property>
    <property name="CONN">eis/DB/na</property>
    <property name="retryInterval">60</property>
    </partnerLinkBinding>
    In the updatetbl.wsdl file
    <service name="updatetbl">
    <port name="updatetbl_pt" binding="tns:updatetbl_binding">
    <jca:address location="$CONN"/>
    </port>
    </service>
    At run time I change the partnerlink CONN variable in embedded Java.
    try
    Element targetAdapterElement =(Element)getVariableData("Invoke_getFromTbl_OutputVariable","getFromTblOutputCollection","/ns2:getFromTblOutputCollection/ns2:getFromTblOutput/ns2:SRC_JNDI");
    getLocator().lookupProcess("JndiIssueTest").getDescriptor().getPartnerLinkBindings().getPartnerLinkBinding ("updatetbl").setPropertyValue ("CONN",targetAdapterElement.getTextContent());
    ("updatetbl").getPropertyValue ("CONN"));
    catch(Exception ex)
    addAuditTrailEntry("Error is " + ex);
    This works fine the first time, but the second time I run it to look at a different CONN value, it somehow still connects using the first runs value!
    If I redeploy or clear the WSDL cache, it works. But we plan to run it multiple times from several environment so manually or programatically clearing WSDL is not the right solution.
    Can someone tell me what is the standard process of doing this so it works everytime?
    Thanks,
    Shaf

    Shaf,
    Please refer the mail thread for details. If you want I can send you(send me your email id) the sample BPEL process which uses Dynamic JNDI.
    Re: How to externalize JNDI name (setting JNDI name dynamically)
    Thanks,
    Sen

  • 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.

  • 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

  • WLS10.3.1 : How to overload the jndi name of a stateless EJB

    Hi,
    I am trying to overload the jndi name of a stateless bean defined in an application by using a weblogic-ejb-jar.xml descriptor file.
    This does not work.
    The ear contains a jar that have a weblogic-ejb-jar.xml file in its META-INF directory. The file is :
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-ejb-jar
    xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>HelloWorldBean</ejb-name>
    <enable-call-by-reference>true</enable-call-by-reference>
    <jndi-name>TOTO</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    This is the code of my bean :
    package test;
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    @Stateless( name = "HelloWorldBean", mappedName="HWBean")
    @Local( IHelloWorldLocal.class)
    @Remote( IHelloWorldRemote.class)
    public class HelloWorldBean implements IHelloWorldLocal, IHelloWorldRemote
    public void sayHello(String name) {
    System.out.println( "Hello " + name + "!!!!");
    The bean implements the following interfaces :
    package test;
    public interface IHelloWorldRemote extends IHelloWorld {
    package test;
    public interface IHelloWorldLocal extends IHelloWorld {
    package test;
    public interface IHelloWorld {
    public void sayHello( String name);
    When i browse the JNDI tree, i see the bean registered with the mapped name attribute (HWBean#test.IHelloWorldRemote) but i don't see any bean registered with the name provided by the weblogic-ejb-jar.xml (TOTO)
    My standalone client can't perform a lookup using the JNDI name 'TOTO' but reaches the bean when using 'HWBean#test.IHelloWorldRemote'
    It seem's that the overload of the Jndi name using the weblogic-ejb-jar file descriptor doesn't work.
    Can you help me to solve the problem.
    Thanks.

    Thank you, my sample works fine with the following weblogic-ejb-jar.xml :
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/10.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/10.0 http://www.bea.com/ns/weblogic/10.0/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>HelloWorldBean</ejb-name>
    <enable-call-by-reference>true</enable-call-by-reference>
    <stateless-session-descriptor>
    <business-interface-jndi-name-map>
    <business-remote>test.IHelloWorldRemote</business-remote>
    <jndi-name>TOTO</jndi-name>
    </business-interface-jndi-name-map>
    </stateless-session-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>

  • How to Set the JNDI name in J2EE 1.4 ??

    Hello,
    I am sure i am have done everything right except for the JNDI name ! I have recently shifted to J2EE 1.4. I was using j2EE 1.2.
    So kindly tell me how should i set me JNDI name in the deploytool.
    Here is the exception i got when i tried to run my application without having set any JNDI name !!
    http://img220.imageshack.us/img220/832/hellodt5.gif
    Thanks.

    There are 2 types of descriptors:
    standard and portable deployment descriptors (e.g. ejb-jar.xml, web.xml, application.xml, etc)
    vendor specific deployment plan (e.g., sun-ejb-jar.xml, sun-web.xml, sun-application.xml, jboss.xml, weblogic.xml, etc)
    When you are developing ejb apps with glassfish, or JavaEE SDK, or Sun Java System Application Server, you usually package all descriptors in META-INF directory inside the jar.
    You can also create portable apps that do not contain any vendor specific deployment plans. So you can deploy it to any appserver. At deployment time, you then specify an option to pass the deployment plan to deploy tool. This is required by JSR 88 and all J2EE- or JavaEE-compliant appserver must support this.
    In Glassfish, JavaEE SDK, or SJSAS, you can:
    $SJSAS_HOME/bin/asadmin deploy --deploymentplan /tmp/deploy-plan.jar /tmp/my-ejb.jar
    where /tmp/deploy-plan.jar is a jar file containing sun-ejb-jar.xml for the deployable ejb-jar:
    jar tvf deployment-plan.jar
    0 Thu Oct 12 11:55:00 EDT 2006 META-INF/
    106 Thu Oct 12 11:54:58 EDT 2006 META-INF/MANIFEST.MF
    570 Thu Oct 12 11:55:00 EDT 2006 sun-ejb-jar.xml

  • Unable to bind EJB Home Interface to the JNDI name

    Why do I get this error?? What is the jndi-name in weblogic-ejb-jar.xml
    Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
    Unable to bind EJB Home Interface to the JNDI name:
    com.sempire.builder.business
    _component.Organization. The error was:
    javax.naming.NameAlreadyBoundException: Organization is already bound;
    remaining
    name 'com.sempire.builder.business_component'
    <<no stack trace available>>

    Slava,
    In case I change the name of the jndi name to a unique name. I still get the same
    problem. I checked for multiple occurences, but there aren't any.
    My web.xml file is:
    <ejb-local-ref>
    <description>
    Reference EJB resources in Weblogic Resources
    </description>
    <ejb-ref-name>GangsterEJB</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.sempire.builder.business_component.GangsterHome</local-home>
    <local>com.sempire.builder.business_component.Gangster</local>
    </ejb-local-ref>
    My weblogic-ejb-jar.xml file is:
    <weblogic-enterprise-bean>
    <ejb-name>GangsterEJB</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/GangsterDB</res-ref-name>
    <jndi-name>oraclePool</jndi-name>
    </resource-description>
    </reference-descriptor>
    <local-jndi-name>Gangster_test</local-jndi-name>
    </weblogic-enterprise-bean>
    I do not get the problem.
    Thank you
    Ronak Parekh
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ronak,
    This exception means that you already have a bean
    with the same JNDI name. Search your weblogic-ejb-jar.xml files
    for multiple occurrences of the name and fix the problem.
    Regards,
    Slava Imeshev
    "Ronak Parekh" <[email protected]> wrote in message
    news:[email protected]...
    Why do I get this error?? What is the jndi-name in weblogic-ejb-jar.xml
    Unable to deploy EJB: OrganizationEJB from sempire_bc.jar:
    Unable to bind EJB Home Interface to the JNDI name:
    com.sempire.builder.business
    _component.Organization. The error was:
    javax.naming.NameAlreadyBoundException: Organization is already bound;
    remaining
    name 'com.sempire.builder.business_component'
    <<no stack trace available>>

Maybe you are looking for

  • Is there anyone who knows how to fix the CD burning issue?

    It appears that with an upgrade to iTunes 6.02, I can't burn an audio Cd. I have read through many of the discussion comments to look for anwswers and it appears that MANY of we iTunes users are frustrated with the inability of iTunes to burn audio C

  • Russian characters getting printed as boxes when downloaded to PDF

    Hi, My program downloads smartform output to PDF file to local system. But the downloaded PDF file contains Boxes instead of Russian characters. But in print preview, i am able to see the Russian chracters. Do i need to upload any font to sap system?

  • Transaction SOLMAN_SET does not exist

    Hi All, I have installed SMD agent  in one if the R/3 System's and trying to configure that managed system in solution manager .As per the document we need to configure managed system from transaction SOLMAN_SETUP. But the txn SOLMAN_SETUP does  not

  • Need to turn down Volume/ sensitivity of microphone on 8350i

    is there a way to turn down the microphone ? everybody i talk to always tells me they can hear every little noise in backround and they said its very loud. ive never had this problem with another phone .im wondering also if the mic gets turned down i

  • Ipod not recognised, not charging and starting up

    I was getting the sad ipod icon on trying to use my ipod, i followed the '5 R's' to try and sort the problem which hasn't worked. I downloaded the latest ipod updater but it isn't recognising my ipod. Also, when connected, it is showing the static lo