Problem of JNDI name

In JBuilder7,the default JNDI Name of a entity bean(Authors) is
AuthorsRemote (in the webogic-ejb-jar.xml). I configed a Tx DATA source
configuration using this JNDI name.When I deployed the entity bean , the
WLS7.0 reported errors like this:
unable to deploy EJB: Authors from mymod2.jar:
weblogic.ejb20.WLDeploymentException: Unable to bind EJB Home Interface to
the JNDI name: AuthorsRemote. The error was:
javax.naming.NameAlreadyBoundException: AuthorsRemote is already bound;
remaining name ''
If I configed the Tx Data Source with a different JNDI name MyJNDI3 and
deloyed ,I got errors like this:
javax.naming.NameNotFoundException: Unable to resolve 'AuthorsRemote'
Resolved: '' Unresolved:'AuthorsRemote' ; remaining name 'AuthorsRemote'
at
weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.
java:109)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
:262)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
:229)-- Failed initializing bean access.

Hi,
If say, the EJB deploys without error with the jndi name 'AuthorsRemote'
what do you expect when doing a ctx.lookup("AuthorsRemote")
A ejb instance or a datasource instance??
I think the above would validate the error that is thrown.
Vimala
paul wrote:
In JBuilder7,the default JNDI Name of a entity bean(Authors) is
AuthorsRemote (in the webogic-ejb-jar.xml). I configed a Tx DATA source
configuration using this JNDI name.When I deployed the entity bean , the
WLS7.0 reported errors like this:
unable to deploy EJB: Authors from mymod2.jar:
weblogic.ejb20.WLDeploymentException: Unable to bind EJB Home Interface to
the JNDI name: AuthorsRemote. The error was:
javax.naming.NameAlreadyBoundException: AuthorsRemote is already bound;
remaining name ''
If I configed the Tx Data Source with a different JNDI name MyJNDI3 and
deloyed ,I got errors like this:
javax.naming.NameNotFoundException: Unable to resolve 'AuthorsRemote'
Resolved: '' Unresolved:'AuthorsRemote' ; remaining name 'AuthorsRemote'
at
weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.
java:109)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
:262)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
:229)-- Failed initializing bean access.

Similar Messages

  • A problem determining the JNDI Name of a local EJB with WL 8.1

    Hi,
    I created a very simple local EJB and deployed it with Weblogic8.1. When I test
    it in the Weblogic server admin page, I got the following message:
    "The EJB MyLocal has not been tested successfully. There was a problem determining
    the JNDI Name of the given bean."
    Can anyone help figure out the problem?
    Thanks
    Henry

    Does the ejb have a target server specified?
    Does the Ejb have a Jndi binding as specified in the <local-jndi-name></local-jndi-name>
    element of weblogic-ejb-jar.xml?
    thanks,
    Deepak
    "Henry" <[email protected]> wrote:
    >
    >
    Hi,
    I created a very simple local EJB and deployed it with Weblogic8.1. When
    I test
    it in the Weblogic server admin page, I got the following message:
    "The EJB MyLocal has not been tested successfully. There was a problem
    determining
    the JNDI Name of the given bean."
    Can anyone help figure out the problem?
    Thanks
    Henry

  • Problem in setting up jndi name in servlet

    hi,
    I am using netbeans6.8, glassfishv3 with mysql5.1. I set up a new jdbc Resource & connection pool by using the glassifsh admin console, and associated the connection pool with jdbc resource
    when i ping the status of the connection pool , it is success.
    Following is the lines added from my config.xml file in glassfish domain
    <jdbc-resource pool-name="knockknock_poool" description="For connecting with knockknock for testing" jndi-name="jdbc/knockknock" />
    <jdbc-connection-pool datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" max-pool-size="250" res-type="javax.sql.DataSource" steady-pool-size="32" description="pool for contains connection to connect with knockknock" name="knockknock_poool" non-transactional-connections="true" ping="true">
    <property description="jdbcname" name="URL" value="jdbc:mysql://localhost:3306/knockknock" />
    <property description="knockknock" name="databaseName" value="knockknock" />
    <property description="knockknock" name="datasourceName" value="knockknock" />
    <property description="tcp" name="networkProtocol" value="tcp" />
    <property description="admin" name="password" value="admin" />
    <property description="3306" name="portNumber" value="3306" />
    <property description="localhost" name="serverName" value="192.168.2.36" />
    <property description="root" name="user" value="root" />
    </jdbc-connection-pool>
    My DB name is knockknock & jndi name of datasource is jdbc/knockknock and ping status is true
    when i try to make a datasource lookup from my servlet i am getting the following exception
    javax.naming.NamingException: Lookup failed for 'jdbc/knockknock' in SerialContext [Root exception is javax.naming.NameNotFoundException: knockknock not found]
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at knockingvideopackage.NewRegistration.init(NewRegistration.java:50)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1073)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: javax.naming.NameNotFoundException: knockknock not found
    at com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:197)
    at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:168)
    at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:172)
    at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:58)
    at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:101)
    at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430)
    ... 28 more
    and my servlet code is
    @Override
    public void init(ServletConfig config)
    try {
    InitialContext ctx = new InitialContext();
    // ctx.bind("java:comp/env/jdbc/knockknock", ctx);
    if(ctx == null )
    try {
    throw new Exception("Boom - No Context");
    } catch (Exception ex) {
    Logger.getLogger(NewRegistration.class.getName()).log(Level.SEVERE, null, ex);
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/knockknock");
    try {
    con = ds.getConnection();
    } catch (SQLException ex) {
    Logger.getLogger(NewRegistration.class.getName()).log(Level.SEVERE, null, ex);
    } catch (NamingException ex) {
    Logger.getLogger(NewRegistration.class.getName()).log(Level.SEVERE, null, ex);
    i believe that what i am doing is correct from this document of mysql
    http://dev.mysql.com/doc/refman/5.1/en/connector-j-usagenotes-j2ee.html
    But i cannot understand what is the problem. any help is appreciated
    thanks

    Hello there.
    Here's the ServiceLocator and delegates I am using....
    // LoginDelegate.as
    package com.myproj.products.business {
         import com.myproj.products.vo.LoginVO;
         import mx.rpc.IResponder;
         import com.adobe.cairngorm.business.ServiceLocator;
         public class LoginDelegate {
              // anything that implements the IResponder interface can act as a responder
              private var responder:IResponder;
              private var service:Object;
              public function LoginDelegate(responder:IResponder) {
                   this.responder = responder;
                   this.service = ServiceLocator.getInstance().getRemoteObject("loginService");
              public function login(loginAttempt:LoginVO):void {
                   // Call the method of service that resides on server
                   var call:Object = service.login(loginAttempt);
                   // Send the response to responder
                   call.addResponder(responder);
    // com/myproj/products/business/Services.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <cairngorm:ServiceLocator
         xmlns:mx="http://www.adobe.com/2006/mxml"
            xmlns:cairngorm="com.adobe.cairngorm.business.*">
         <!-- Login Service -->
         <mx:RemoteObject
              id="loginService"
              destination="zend"
              source="LoginService"
              showBusyCursor="true">
              <mx:method name="doLogin" />
         </mx:RemoteObject>
    </cairngorm:ServiceLocator>
    With kind regards
    ShiVik

  • Problem with Database JNDI Name

    I have written an entity bean & tring to deploy it with CMP 1.0
    I have already included classes12.jar in my classpath.
    (I am using Oracle database)
    I have specified driver & datasource as follows
    j2eeadmin -addJdbcDriver oracle.jdbc.driver.Driver
    j2eeadmin -addJdbcDataSource jdbc/Oracle jdbc:oracle:[email protected]:1521:listorcl
    When I tried Deployment Settings I have given following specs
    Database JNDI Name : jdbc/Oracle
    User : username
    Password : password
    When I click on Generate SQL Now or Generate Default SQL the following exception occurs .
    NameNotFoundException : Oracle__pm not found
    Note : The J2EE server & Database Server are running.
    Pl Help Me.
    Thanks In Advance

    mmm I will try to explain it better:
    1) long time ago I created my account SDN, in "kind of relationship with SAP option", I indicated "partner"  (i work for consulting company, SAP partner), and register in the form our S000... number.
    2) From there, I login SDN with my personal mail, and in my profile my data OK and like SAP partner.
    3) from a few months ago, when I try to login using my ma.il as usual, I get an error message:
    The email address does not exist.  and that I must enter you user S000 ....
    4) but when I login user our S000.. (such as SAP partner), "Ariela" data appears (who is my boss), because she is the comercial contact person with SAP, and she manage the S000 account 
    5) the history, posts, points and others are mine (Leandro Balboni);
    6) but I do not want is to change this profile, because in this way would be modifying the data responsible for the SAP account as a partner.
    7) I wonder if I can still loing SDN as before,  perhaps must not indicate "partner", but simply put the name of my company.
    8) how can I fix it?
    thanks in advance,
    best regards,
    Leandro
    Edited by: Ariela Mara Fefer on Aug 25, 2009 1:03 PM

  • Destination-jndi-name problems

    When I try to run my message-driven bean, the server complains that it
    cannot resolve 'CheckoutQueue'. In the weblogic-ejb-jar.xml file, I have
    specified the destination-jndi-name to be 'CheckoutQueue'. Is there
    anything I have to do in the console to make it so that the server finds the
    name?

    Please do not crosspost.
    Eric Lin wrote:
    When I try to run my message-driven bean, the server complains that it
    cannot resolve 'CheckoutQueue'. In the weblogic-ejb-jar.xml file, I have
    specified the destination-jndi-name to be 'CheckoutQueue'. Is there
    anything I have to do in the console to make it so that the server finds the
    name?--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Problem with JNDI and JSP in Tomcat

    Hi,
    Basically, what I've done is to use the Tomcat administration web
    application to create the DataSource, which looks like it populated the
    server.xml (see below). I then try to access the testconn.jsp, and am
    getting that "Name java:comp is not bound in this Context" error.
    I was wondering if anyone could tell me what I'm doing wrong?
    Thanks,
    Feri
    My Configuration:
    - Tomcat 5.0.19
    - MySQL 4.0.18-nt
    - mysql-connector-java-3.0.15-ga-bin.jar
    server.xml:
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <!--Feri test JNDI-->
         <Context crossContext="true" debug="5" docBase="injury" path="/injury" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_injury_log." suffix=".txt" timestamp="true"/>
              <Resource name="jdbc/injury" auth="Container"
    type="javax.sql.DataSource">
    </Resource>
    <ResourceParams name="jdbc/injury">
         <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>
    <parameter>
    <name>username</name>
    <value>root</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>root</value>
    </parameter>
         <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
         <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost:3306/injury</value>
    </parameter>
         <parameter>
              <name>maxIdle</name>
              <value>30</value>
         </parameter>
         <parameter>
              <name>maxActive</name>
              <value>10</value>
         </parameter>
         <parameter>
              <name>maxWait</name>
              <value>10000</value>
         </parameter>
    </ResourceParams>
         </Context>
    <!--Feri test JNDI end-->
    </GlobalNamingResources>
    \webapps\injury\WEB-INF\web.xml:
    <resource-ref>
    <description>Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file.</description>
    <res-ref-name>jdbc/injury</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    \webapps\injury\testconn.jsp
    <%@ page import="java.sql.*" %>
    <%@ page import="javax.sql.*" %>
    <%@ taglib prefix="ct" uri="/injury" %>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
    <h1>Connection test</h1>
    <ct:connection name="jdbc/injury">
    <%
    Statement stmt= conn.createStatement();
    ResultSet rs;
    rs = stmt.executeQuery("select * from user");
    while (rs.next()){
    %><%=rs.getString(1)%><%=rs.getInt(2) %><br><%
    rs.close();
    stmt.close();
    %>
    </ct:connection>
    ConnectionTag.java
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import javax.naming.*;
    import javax.sql.*;
    import javax.sql.DataSource;
    public class ConnectionTag extends TagSupport implements TryCatchFinally {
    private Connection conn;
    // JNDI name of the connection
    private String name;
    public void setName(String name)
         this.name = name;
    public int doStartTag()
         throws JspException
         try {
         Context env = (Context) new InitialContext().lookup("java:comp/env");
         DataSource ds = (DataSource) env.lookup(name);
         if (ds != null)
              conn = ds.getConnection();
         } catch (Exception e) {
         throw new JspException(e);
         if (conn == null)
         throw new JspException("can't open connection " + name);
         pageContext.setAttribute("conn", conn);
         return EVAL_BODY_INCLUDE;
    public void doCatch(Throwable t)
         throws Throwable
         throw t;
    public void doFinally()
         try {
         Connection conn = this.conn;
         this.conn = null;
         pageContext.removeAttribute("conn");
         conn.close();
         } catch (Exception e) {
    Tomcat 5.0\conf\Catalina\localhost\injury.xml
    <?xml version='1.0' encoding='utf-8'?>
    <Context displayName="Injury" docBase="E:\Tomcat 5.0\webapps\injury" path="/injury" className="org.apache.catalina.core.StandardContext"
    cachingAllowed="true" charsetMapperClass="org.apache.catalina .util.CharsetMapper" cookies="true" crossContext="false" debug="0"
    mapperClass="org.apache.catalina.core.StandardContextMapper" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper" >
    <Resource auth="Container" description="Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file." name="jdbc/injury" type="javax.sql.DataSource"/>
    <ResourceLink global="jdbc/injury" name="injury" type="javax.sql.DataSource"/>
    </Context>

    Hi,
    First of all, you can find alot of information about this in the forum about jsp's.
    I think a good thing to do is not to put your context tag directly into the server.xml file.
    What you should do is create a context.xml file with the context-tag in it, and put it in the META-INF directory of your .war file. Upon deployment to tomcat5 this file will be extracted from the war, copied to the conf\enginename\hostname directory, and it will be renamed to contextName.xml.
    I think you are developing directly into the webapps directory, and I believe you should avoid that and use the deployment feature of the manager web-app or you should use the deployertool from you ide or standalone ant.
    anyway, for starters try to remove the context tag from the server.xml file as described above, and check out the jsp / jdbc forums for simular problems and answers.
    good luck

  • Problem with JNDI in WLS 5.1

    Hi all,
    i have a problem with JNDI in WLE 5.1.
    i am accessing an LDAP on another machine running Netscape Directory Server.
    The host URL is ldap://myhost:65535/o=marco, c=fi
    i am always getting back the following exception:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.
    WLInitialContextFactory. Root exception is java.lang.ClassCastException: weblog
    ic.jndi.WLInitialContextFactory
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    58)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242
    at javax.naming.InitialContext.init(InitialContext.java:218)
    at javax.naming.InitialContext.<init>(InitialContext.java:194)
    and my code is this:
    Hashtable _environment = new Hashtable();
    try {
    environment.put(Context.INITIALCONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    environment.put(Context.PROVIDERURL, "ldap://myhost:65535");
    if ((principal!=null) || (credentials!=null)) {
    environment.put(Context.SECURITYAUTHENTICATION, "simple");
    environment.put(Context.SECURITYPRINCIPAL, principal);
    environment.put(Context.SECURITYCREDENTIALS, credentials);
    context = new InitialContext(environment);
    parser = context.getNameParser(initialCtxFactory);
    } catch(Exception e) {
    e.printStackTrace();
    can anyone help me please??
    thanx in advance
    marco

    Take out the "weblogic.jndi.WLInitialContextFactory" and add the respective factory NAME..
    environment.put(Context.INITIALCONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    Cheers,
    Naggi
    Senthil Kumar S wrote:
    http://weblogic.com/docs51/classdocs/API_jndi.html#delegate
    Marco wrote:
    Hi all,
    i have a problem with JNDI in WLE 5.1.
    i am accessing an LDAP on another machine running Netscape Directory Server.
    The host URL is ldap://myhost:65535/o=marco, c=fi
    i am always getting back the following exception:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.
    WLInitialContextFactory. Root exception is java.lang.ClassCastException: weblog
    ic.jndi.WLInitialContextFactory
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    58)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242
    at javax.naming.InitialContext.init(InitialContext.java:218)
    at javax.naming.InitialContext.<init>(InitialContext.java:194)
    and my code is this:
    Hashtable _environment = new Hashtable();
    try {
    environment.put(Context.INITIALCONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    environment.put(Context.PROVIDERURL, "ldap://myhost:65535");
    if ((principal!=null) || (credentials!=null)) {
    environment.put(Context.SECURITYAUTHENTICATION, "simple");
    environment.put(Context.SECURITYPRINCIPAL, principal);
    environment.put(Context.SECURITYCREDENTIALS, credentials);
    context = new InitialContext(environment);
    parser = context.getNameParser(initialCtxFactory);
    } catch(Exception e) {
    e.printStackTrace();
    can anyone help me please??
    thanx in advance
    marco--
    http://www.net4tech.com

  • A prefix can be included in the EJB JNDI name dynamically?

    In the Stateless annotation, we can specify the mappedName attribute to the EJB JNDI name bind.
    Can we specify a prefix to the mappedName separately?
    For example: We have this:
    @Stateless(mappedName="myEJB")And don't want to do this:
    @Stateless(mappedName="prefix/myEJB")We want to include the prefix in another place in the code dynamically.
    Can we do that??

    jtahlborn wrote:
    eudesf wrote:
    Hello! Thanks for reply!
    As I can't configure programatically, there is any way to configure in an application descriptor, or in another place of the application server?
    The idea is to publish two applications that use the same EJB classes, but in different JNDI namespaces, because we don't want to share the resources. Otherwise, it will result in JNDI name conflicts. The applications works in different contexts and we want to reuse the existing EJB definitions.
    Any suggestion?yes you can do this. ejb 3.0 keeps the features from 2.1, namely all the xml based configuration (although it is now optional). and, the annotations are always overriden by the xml configuration. thus, you can create different deployments with different the same compiled class files. you just need to override the annotation configuration with xml configuration (via ejb-jar.xml or whatever).Yes, we can do that. I've tested here, and it works. But, can we do better?
    The configuration via XML implies maintenance, and it's not good, because we have so many EJBs to maintain.
    And there is another problem... The EJB classes are in JARs, and these JARs are shared across the applications.
    Pretend that you have to maintain two versions of each EJB JAR. One with XML configured and other without. If we change one, the another must be changed too. How can it be productive?
    I have seen some EJB implementations that are more flexible with JNDI naming.
    See:
    - [http://openejb.apache.org/jndi-names.html|http://openejb.apache.org/jndi-names.html]
    - [http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html|http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html]
    Does it have a better solution in Glassfish?

  • Dynamic jndi-name in weblogic-ejb-jar.xml

    Is there a way to create dynamic (i.e. runtime) jndi-names for EJBs instead of
    (or in addition to) "hard coding" them in the weblogic-ejb-jar.xml file? What
    I'm trying to do is have one WebLogic instance (JVM) host multiple environments
    (our Beta and Training environments) and I simply want to deploy the same .ear
    file twice but have each environment (application - .ear) reference a different
    database schema (jdbc connection pool). I have everything working just fine for
    this scenario except when I define jndi-names for our ejbs. The problem is that
    I am really deploying the same ejbs (jndi-names and actually code base) in each
    applicatoin instance and I get an exception when the WebLogic is trying to deploy
    the second application (.ear) because the jndi-names in it have already been deployed
    by the first application instance. I recieve a jndi error stating that the name
    is already deployed.
    Or is there a better path to go down for what I am trying to do to have one WebLogic
    instance support our beta and training environments? Usually (but not always)
    our code base is the for same for both of these environments, I simply need to
    have each environment use a different database schema.
    Thanks

    A little birdie tells me that BEA does this very thing. Looking at the
    descriptors for WebLogic Portal I see:
    <weblogic-enterprise-bean>
    <ejb-name>LoaderEJB</ejb-name>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>${APPNAME}.BEA_content.LoaderHome</jndi-name>
    </weblogic-enterprise-bean>
    Yes, the ${APPNAME} token really is expanded into the J2EE application
    name at deployment time!
    Sincerely,
    Daniel Selman
    Bryan Dixon wrote:
    Rewriting our build process isn't really much of an option for me. Our current
    build process is too complex and time consuming right now to convert to Ant (we
    eventually will do this but not for a while). So are there any other ideas that
    aren't build related?
    Thanks
    "Eric Ma" <[email protected]> wrote:
    You don't need run-time dynamism in JDNI names and it can't be done anyways.
    You
    need token substitution in XML configuration files when building the
    app. If
    you are using Ant for building, then it is a breeze. If not, first convert
    your
    build process to use Ant.
    Also, a single WLS instance hosting multiple environments sounds really
    INTRIGUING
    to me.
    Eric Ma
    "Bryan Dixon" <[email protected]> wrote:
    Is there a way to create dynamic (i.e. runtime) jndi-names for EJBsinstead
    of
    (or in addition to) "hard coding" them in the weblogic-ejb-jar.xml file?
    What
    I'm trying to do is have one WebLogic instance (JVM) host multiple environments
    (our Beta and Training environments) and I simply want to deploy the
    same .ear
    file twice but have each environment (application - .ear) referencea
    different
    database schema (jdbc connection pool). I have everything working just
    fine for
    this scenario except when I define jndi-names for our ejbs. The problem
    is that
    I am really deploying the same ejbs (jndi-names and actually code base)
    in each
    applicatoin instance and I get an exception when the WebLogic is trying
    to deploy
    the second application (.ear) because the jndi-names in it have already
    been deployed
    by the first application instance. I recieve a jndi error stating that
    the name
    is already deployed.
    Or is there a better path to go down for what I am trying to do to have
    one WebLogic
    instance support our beta and training environments? Usually (but not
    always)
    our code base is the for same for both of these environments, I simply
    need to
    have each environment use a different database schema.
    Thanks

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

  • Jndi-name in  Message Driven Bean

    Hi
    I have successfully created the ejb jar file for deployment using sun one studio . I created the message driven bean and I right clicked on the ejb and used the customize option to set the bean properties . But my problem is that the jndi-name in the <ejb> tags takes the value jms/(ejbname) instead of jms/(queuename) . I am attaching the xml file with this . Can any one tell how to set the jndi-name to queue value using studio
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 EJB 2.0//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-ejb-jar_2_0-0.dtd">
    <sun-ejb-jar>
    <enterprise-beans>
    <name>ejb</name>
    <ejb>
    <ejb-name>Suneesh</ejb-name>
    <jndi-name>jms/Suneesh</jndi-name> <resource-ref>
    <res-ref-name>QueueConnectionFactory</res-ref-name>
    <jndi-name>jms/QueueConnectionFactory</jndi-name>
    </resource-ref>
    <resource-env-ref>
    <resource-env-ref-name>TestQueue</resource-env-ref-name>
    <jndi-name>jms/TestQueue</jndi-name>
    </resource-env-ref>
    <pass-by-reference>false</pass-by-reference>
    </ejb>
    <ejb>
    <ejb-name>Suneesh1</ejb-name>
    <jndi-name>jms/Suneesh1</jndi-name>
    <resource-ref>
    <res-ref-name>QueueConnectionFactory</res-ref-name>
    <jndi-name>jms/QueueConnectionFactory</jndi-name>
    </resource-ref>
    <resource-env-ref>
    <resource-env-ref-name>TestQueue1</resource-env-ref-name>
    <jndi-name>jms/TestQueue1</jndi-name>
    </resource-env-ref>
    <pass-by-reference>false</pass-by-reference>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>

    Hi Bhagya,
    Thanks for your response. I think from EJB container we can call Local EJBs with the full JNDI name. The session facade bean which is being called is a remote bean. From the session facade bean I am calling a local stateless session bean for database access. I am getting the reference of the local EJB from my session facade bean with full JNDI name "java:comp/env/ejb/EJBJNDIName". It is working fine with out any problem. My servicelocator is able to provide me the reference of the local EJB from the session facade remote bean with Full JNDI name. I am only having this problem calling from the MDB. I am really not sure whether what is causing it?
    Thanks
    Amit

  • JDBC Datasource creation via ANT doesn't expose the JNDI name

    I'm using the wlconfig ANT task to create a Datasource (& JDBC connectionpool) on the weblogic server. The datasource is created fine, and I can test it using the console.
    The problem is that the provided JNDI name isn't exposed in the JNDI tree. This seems to be related to the fact that the following element is generated in the config/jdbc/CP-PoolName-2164-jdbc.xml
    &lt;jdbc-data-source&gt;
    &lt;name&gt;PoolName&lt;/name&gt;
    &lt;internal-properties&gt;
    *&lt;property&gt;*
    *&lt;name&gt;LegacyType&lt;/name&gt;*
    *&lt;value&gt;1&lt;/value&gt;*
    *&lt;/property&gt;*
    When removing the LegacyType 1 property from the JDBC config xml, the JNDI name is exposed fine.
    I've used the instructions located at [http://edocs.bea.com/wls/docs100/programming/ant_tasks.html] where an example of a JDBCConnectionPool creation is provided.
    The 10.3 documentation doesn't include the example anymore, but I'm having the problem both on BEA Weblogic 10.0 and Oracle Weblogic 10.3
    &lt;wlconfig url="t3://localhost:7001" username="weblogic" password="weblogic"&gt;
    bq. &lt;query domain="base_domain" type="Server" name="AdminServer" property="adminserver"/&gt;
    bq. &lt;create type="JDBCConnectionPool" name="MediumSecureOnlineNode1Pool" property="customPool1"&gt;
    bq. bq. &lt;set attribute="CapacityIncrement" value="1"/&gt; \\ &lt;set attribute="DriverName" value="oracle.jdbc.OracleDriver"/&gt; \\ &lt;set attribute="InitialCapacity" value="1"/&gt; \\ &lt;set attribute="MaxCapacity" value="10"/&gt; \\ &lt;set attribute="Password" value="pass"/&gt; \\ &lt;set attribute="Properties" value="user=username"/&gt; \\ &lt;set attribute="RefreshMinutes" value="0"/&gt; \\ &lt;set attribute="ShrinkPeriodMinutes" value="15"/&gt; \\ &lt;set attribute="ShrinkingEnabled" value="true"/&gt; \\ &lt;set attribute="TestConnectionsOnCreate" value="true"/&gt; \\ &lt;set attribute="TestConnectionsOnRelease" value="true"/&gt; \\ &lt;set attribute="TestConnectionsOnReserve" value="true"/&gt; \\ &lt;set attribute="TestTableName" value="SQL SELECT 1 FROM DUAL"/&gt; \\ &lt;set attribute="URL" value="jdbc:oracle:thin:@localhost:1521"/&gt; \\ &lt;set attribute="Targets" value="${adminserver}"/&gt;
    &lt;/create&gt;
    As we would like to automate the process of configuring our weblogic instances using ANT, is there a way to create JDBC datasources that don't have the LegacyType 1 element included in the config ?

    Curious if you were ever able to find a resolution to this issue?
    I am facing the same thing now with our Ant scripts and WL10.3 connection pools/datasources.
    I would like to either specify a different LegacyType or suppress it altogether. Any help would be appreciated.
    Many thanks,
    Steve

  • Datasource is not getting created with jndi name though ANT

    Please help me to come out of this problem. JDBC DATA SOURCE is getting created without jndi name when iam executing below ANT Script.
    <?xml version="1.0" ?>
         <project name="deploy" default="createDataSource" basedir=".">
         <property name="weblogic.jar" location="C:/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar"/>
         <property name="wls.username" value="weblogic" />
         <property name="wls.password" value="weblogic" />
         <property name="wls.url" value="t3://000.00.000.000:7001" />
         <property name="wls.targetServer" value="AdminServer" />
         <property name="wls.targetServer" value="soa_server1" />
         <property name="wls.domainName" value="SOA" />
         <property name="database.url" value="jdbc:oracle:thin:@000.00.000.000:7001:DEV" />
         <property name="database.driver" value="oracle.jdbc.xa.client.OracleXADataSource" />
         <property name="database.user" value="user" />
         <property name="database.password" value="password" />
         <taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy" classpath="${weblogic.jar}"/>
         <taskdef name="wlconfig" classname="weblogic.ant.taskdefs.management.WLConfig" classpath="${weblogic.jar}"/>
         <target name="createDataSource">
         <wlconfig username="weblogic" password="webfsaD1" url="t3://000.00.000.000:7001:7001">
         <query domain="SOA" type="Server" name="AdminServer" property="x" />
         <create type="JDBCConnectionPool" name="TestScriptDS" >
         <set attribute="CapacityIncrement" value="1"/>
         <set attribute="DriverName" value="oracle.jdbc.xa.client.OracleXADataSource"/>
         <set attribute="InitialCapacity" value="1"/>
         <set attribute="MaxCapacity" value="10"/>
         <set attribute="Password" value="Password"/>
         <set attribute="Properties" value="user=user"/>
         <set attribute="RefreshMinutes" value="0"/>
         <set attribute="ShrinkPeriodMinutes" value="15"/>
         <set attribute="ShrinkingEnabled" value="true"/>
         <set attribute="TestConnectionsOnRelease" value="false"/>
         <set attribute="TestConnectionsOnReserve" value="false"/>
         <set attribute="TestTableName" value="SQL SELECT 1 FROM DUAL"/>
         <set attribute="URL" value="${database.url}"/>
         <set attribute="Targets" value="${x}" />
         </create>
         <create type="JDBCTxDataSource" name="TestScriptDS">
         <set attribute="JNDINames" value="jdbc/testScriptDS"/>
         <set attribute="PoolName" value="TestScriptDS"/>
         <set attribute="Targets" value="${x}"/>
         </create>
         </wlconfig>
         </target>
         </project>
    Thanks in advance,

    Thank u very much for ur quick reply.
    C:\ANT_DataSource>ant -v
    Apache Ant(TM) version 1.8.2 compiled on December 20 2010
    Trying the default build file: build.xml
    Buildfile: C:\ANT_DataSource\build.xml
    Detected Java version: 1.6 in: C:\Oracle\Middleware\jdk160_24\jre
    Detected OS: Windows 7
    parsing buildfile C:\ANT_DataSource\build.xml with URI = file:/C:/ANT_DataSource/build.xml
    Project base dir set to: C:\ANT_DataSource
    parsing buildfile jar:file:/D:/ANT/apache-ant-1.8.2/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/D:/ANT/apache-ant-1.8.2/lib/ant.jar!/org/a
    pache/tools/ant/antlib.xml from a zip file
    Build sequence for target(s) `makeDataSource' is [makeDataSource]
    Complete build sequence is [makeDataSource, ]
    makeDataSource:
    Property "AdminServer" has not been set
    Property "SoaServer" has not been set
    Property "AdminServer" has not been set
    Property "SoaServer" has not been set
    [wlconfig] QUERY -pattern SOA:*,Name=AdminServer,Type=Server
    [wlconfig] Set size is 1
    [wlconfig] QUERY -pattern SOA:*,Name=soa_server1,Type=Server
    [wlconfig] Set size is 1
    [wlconfig] Created MBEAN: SOA:Name=SampleDS,Type=JDBCConnectionPool
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Capa
    cityIncrement 1
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Driv
    erName oracle.jdbc.xa.client.OracleXADataSource
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Init
    ialCapacity 0
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property MaxC
    apacity 50
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Stat
    ementTimeout 600
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Pass
    word USER
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Prop
    erties user=PASSWORD
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Refr
    eshMinutes 0
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Shri
    nkPeriodMinutes 15
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Shri
    nkingEnabled true
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Test
    ConnectionsOnRelease false
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Test
    ConnectionsOnReserve false
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Test
    ConnectionsOnCreate true
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Test
    TableName SQL SELECT 1 FROM DUAL
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property URL
    jdbc:oracle:thin:@100.10.000.100:1601:DEVDB
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCConnectionPool -property Targ
    ets SOA:Name=AdminServer,Type=Server;SOA:Name=soa_server1,Type=Server
    [wlconfig] Ok
    [wlconfig] Created MBEAN: SOA:Name=SampleDS,Type=JDBCTxDataSource
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCTxDataSource -property JNDINa
    me jdbc/SampleDS
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCTxDataSource -property PoolNa
    me SampleDS
    [wlconfig] Ok
    [wlconfig] SET -mbean SOA:Name=SampleDS,Type=JDBCTxDataSource -property Target
    s SOA:Name=AdminServer,Type=Server;SOA:Name=soa_server1,Type=Server
    [wlconfig] Ok
    [wlconfig] QUERY -pattern SOA:*,Name=AdminServer,Type=WebServer
    [wlconfig] Set size is 1
    [wlconfig] SET -mbean SOA:Name=AdminServer,Type=WebServer,Server=AdminServer -p
    roperty LogFileName logs/access.log
    [wlconfig] Ok
    BUILD SUCCESSFUL
    Total time: 41 seconds
    Edited by: soa.dev on 12-Sep-2012 02:09

  • Changing JNDI-name

    I'm doing an exercise from SAMS Teach yourself J2EE in 21 days, and I'm stuck allready on day 4.
    The exercise uses an example from the book. In short:
    An EJB that returns some information registers in the JNDI as "ejb/Agency"
    A client application looks up "java:comp/env/ejb/Agency" and retrives the informtion for the EJB and prints it.
    I've got the application working, and everything is fine and dandy, until I'm stuck at exercise 4:
    "Try changing the name under which the EJB is reistered in the JNDI using "deploy-tool". Change the JNDI name used by your client to find the Agency EJB and make sure that it still works"
    The first thing I did was to change the name of the EJB (under sun spesific settings) in deploytool, redeploy the EJB and make sure that It did'nt work (just to make sure that the change had taken effect).
    Then I edited my SimpleClient.java to match the new name, recompiled it and ran it. (It did'nt work of course).
    I soon figured out that the file i actually ran was the jar.file returned upon deployment from deploytool, and that my change had not propagated to this file yet. I redeployed the application and explicitly retrived the jar file afterwards, but it still did'nt work.
    I'm not sure where the problem is, but I expect it to be in my understanding of how the different files are treated by the deploytool, and that my changes to the client-file in fact has not been propagated at all. (I'm actually quite sure of this, since leaving the sun spesific settings as they were, and changing my SimpleClient.java/class does not give any errors).
    One thing that puzzels me is how I need the jar-file that is returned upon deployment to compile my client-file whille at the same time it's this jar-file I afterwards run to start my client.
    Any suggestions, enlightning information or other help is much appreciated.

    I've about determined that deploytool is about the worst thing you could use when learning J2EE. When I was first working with ejb's I tried using that thing, and getting up to speed took far longer than it should have. Once I ditched that crappy 'tool' and spent a day messing with the xml descriptors everything started to make sense.
    Deploy tool could be nice, but I find it far more a hinderance than a help.

Maybe you are looking for

  • When is verizon going to upgrade fios speed tiers?

    I'd like to upgrade my speed from 35/35 plan.  Does anyone know when Verizon is going to upgrade the fios speed tiers?  Compared to cable co docsis 3, fios is starting to look and feel slow.

  • How do i stop purchased items form automatically transferring

    i've disabled all automatic downloads on both my ios and my comp. when i purchase music i change the bitrate and delete the icloud purchase. however it Still appears Everytime i connect... this is a PITA.. and because i change the bitrate, causes dup

  • How to trigger FI Standard Workflows

    Hi, I have never worked on FI Standard Workflows . As far as I knpow there is a std WF available  WS00400012 with Object type BSEG. For Vendor Down Payment Request, Vendor Payment Request Against Invoice, Vendor Down Payment Posting,Vendor Payment Po

  • Adding Business Days to a Date

    Hi everyone, I'm trying to add a certain number of working days to  a date,what I am hoping to get is a date excluding the weekends For example: If i was to add 12 working days to 01/05/2009 i should get 19/05/2009 Thank You MT

  • Sending chinese HTML with javamail - is there no definitive answer ?

    I'm using the following code to send a HTML and text e-mail (text for people with HTML-challenged email clients). I sent 2 emails to 2 email addresses which reside on the same server - eg. [email protected] and [email protected] - and read the emails with