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.

Similar Messages

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

  • Deploytool: Can't specify a JNDI name for RA

    Using j2eesdk1.4_beta2, it appears there is no way to specify a JNDI name for a Resource Adapter. Is there a default name I can use to look up my RA if I don't specify a name? The Deploy Tool help describes some tabbed panes appear to be missing from the appication. Is there a way to work around this problem until the final release comes out?

    Headache!... That's what is expecting you in the DeployTool.
    The deploytool generates invalid deployment descriptors for Resource Adaptors.
    As you mentioned, it doesn't allow you to select a ResourceAdaptor implementation. In my case, I'm using my own Connection and ConnectionFactory and it didn't allow me to choose an implementation class for either interface neither.
    I solved these problems by downloading XMLSpy and using the XML Schema to fill-in the gaps in the ra.xml descriptor. There I had also to include other mandatory elements that where not written by the deployTool, like: <display-name>
    <vendor-name>
    <eis-type>
    <resourceadapter-version>
    Regarding to the <<null>> error, it has to deal with an invalid sun-ra.xml. It's either empty or it's missing a mandatory element. I used again XML Spy here to give a JNDI to my adaptor.
    I thought I was through it but I still can't deploy on the server. When I try, I get the following error:
    <[INFO][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:22:351 CET][ADM5604:Processing config change [Domain:add to xpath=/domain/applications
    childXPath = /domain/applications/connector-module[@name='SimpleRAR1']]]>
    <[INFO][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:23:302 CET][ADM1041:Sent the event to instance:[ModuleDeployEvent -- deploy connector/SimpleRAR1]]>
    org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    [.... 200 lines stack trace ....]
    <[WARNING][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:24:043 CET][ADM5603:Event listener error [null]]>
    So far I haven't found a way to get solve this one. The <NAMESPACE_ERR> makes me think about the infamous 'locale' error of the deploytool, but I included the JVM parameters [USER_LANG=en,USER_REGION=US,USER_COUNTRY=US] in the server startup and it didn't change anything.
    If you get further than that, please let me know.
    -regards,
    Gerard.

  • 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

  • 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

  • I need the sap bw table names for ROLE's

    I need the sap bw table names for ROLE's .
    thanks

    Hi,
    AGR_1251 - Authorization data for the activity group
    AGR_USERS - Assignment of roles to users
    AGR_TCODES - Assignment of roles to Tcodes
    You can also try putting AGR* in ur search.
    -Vikram

  • Looking up JNDI names for local client

    Sir,
    I have been trying to look up JNDI name for the local home interface in the client program.But I got only "javax.naming.NoInitialContextException".I want information about to give a JNDI name for EJB and its details.
    Thanking you.
    Yours,
    R K Ramesh

    It sounds like you are not specifying the right URL or username/credentials to get an initial context.
    A typical example would be something like this:
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, "t3://server:port");
    InitialContext ic = new InitialContext(p);
    (You can also use a properties file or system prpoerties to specify these.)
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Jndi name for AqAdaptor

    Hi
    I have implemented an ESB in Oracle Jdeveloper 11g.
    AqAdaptor-> Mediator -> File Adaptor.
    The default jndi name which has come up while adding Aqadaptor didn't work. Then I looked iinto the SOADataSource.xml file and saaw that the jndi name was jdbc/SOADataSource. Even with this, when I deploy the ESB, it is giving the error that it cannot recognise the jndi name.
    Could anybody tell me if I need to create connection pool for the default adaptors?
    Thanks
    Praveena
    Edited by: Jakarta on Oct 23, 2009 4:52 AM

    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

  • Help needed to create drop down list for a field.

    Hi,
    I have to create a parameter/select-options on the selection screen having  drop down values and also having multiple selections allowed.
    Please help me to attain this functionality.Its urgent.
    Thanks,
    Sandeep.

    Hi,
    Here is the exampel Program, i am sending the code for a Paramter, If you want this for the Select-options, then you need to have the paramer name as PS_PARM-LOW and you need to write the smae logic again for PS_PARM-HIGH to get the List box for the select-option
    REPORT ZLIST.
    TYPE-POOLS: VRM.
    DATA: NAME  TYPE VRM_ID,
          LIST  TYPE VRM_VALUES,
          VALUE LIKE LINE OF LIST.
    PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.
    AT SELECTION-SCREEN OUTPUT.
    NAME = 'PS_PARM'.
    VALUE-KEY = '1'.
    VALUE-TEXT = 'LINE 1'.
    APPEND VALUE TO LIST. VALUE-KEY = '2'.
    VALUE-TEXT = 'LINE 2'.
    APPEND VALUE TO LIST.
    CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
    START-OF-SELECTION.
    WRITE: / 'PARAMETER:', PS_PARM.

  • Mapping of logical resource-name to absolute jndi-name for data source

    Hi,
    I am using SJS AS 8.1. I do a lookup for datasource using logical name specified in ejb-jar.xml using resource-ref element as below :
    <resource-ref>
            <res-ref-name>jdbc/db-resource</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>jdbc/db-resource is mapped to absolute jndi name 'jdbc/jndi-db-resource' in sun-ejb-jar.xml as below :
    <resource-ref>
            <res-ref-name>jdbc/db-resource</res-ref-name>
            <jndi-name>jdbc/jndi-db-resource</jndi-name>
    </resource-ref>I have configued data source using admin GUI with JNDI name jdbc/jndi-db-resource. When I do a look up of datasource as below :
    initalContext.lookup("jdbc/db-resource"); from the EJB I get NameNotFoundException. How do I configure logical datasource name using admin GUI ?
    Thanks,
    Manisha.

    Hi Manisha,
    When doing a lookup of standard j2ee connection factories like jms or jdbc "java:comp/env" need to be prefixed.
    initalContext.lookup("jdbc/db-resource");
    need to be
    initalContext.lookup("java:comp/env/jdbc/db-resource");
    For more information :
    http://docs.sun.com/source/819-0079/dgjndi.html#wp24616
    Thanks,
    -Jagadish

  • 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 &lt;resource-ref&gt; 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 &lt;resource-ref&gt; definitions to your web.xml file similar to the following:
    &lt;resource-ref&gt;
    &lt;res-ref-name&gt;*jdbc/SQL2DS*&lt;/res-ref-name&gt;
    &lt;res-type&gt;java.sql.DataSource&lt;/res-type&gt;
    &lt;res-auth&gt;Container&lt;/res-auth&gt;
    &lt;/resource-ref&gt;
    and then add &lt;reference-descriptor&gt; definitions to your weblogic.xml file similar to the following:
    &lt;reference-descriptor&gt;
    &lt;resource-description&gt;
    &lt;res-ref-name&gt;*jdbc/SQL2DS*&lt;/res-ref-name&gt;
    &lt;jndi-name&gt;*jdbc/SQL2DS*&lt;/jndi-name&gt;
    &lt;/resource-description&gt;
    &lt;/reference-descriptor&gt;
    Once you do these steps your lookup("java:comp/env/jdbc/SQL2DS") should function properly from within your web-app.

  • Getting jndi name for jms queue via jmx?

    All,
    I'm trying to write a utility that will do a 9.2-style message export against 8.1 I think I have it all figured out except that I don't know how to get the jndi name of a queue or topic via jmx. I'm using jmx to find queues and subscriptions that have messages waiting, then trying to connect to them to siphon off the messages. I can't just browse jndi for any queue I find because I also want to access the durable subscriptions, for which I need the client and subscriptions ids. Is there a way to map from the jms destination runtime mbean to the jndi name? The getDestination() method isn't supported (throws an exception.)
    thanks

    Hi John,
    You can get destination JNDI names by looking up their value in the JMX configuration mbeans rather than the runtime mbeans. The client-id and subscription-name are available on the JMSDurableSubscriberRuntime mbean.
    Regards,
    Tom

  • Multiple JNDI names for EJB?

    If I'm deploying a webapp that references an EJB, do I have to use the same JNDI
    name that is configured in the EJB descriptor?
    Why can't I reference the EJB using a seperate name (as in some J2EE examples)?
    Thanks,
    Darren

    darren <[email protected]> wrote:
    If I use a new JNDI name, rather than the one defined in weblogic-ejb-jar.xml,
    it does not show up in the JNDI tree.
    Does the JNDI name referenced in weblogic.xml need to be the same as that defined
    in weblogic-ejb-jar.xml? No. ejb-ref mechanism allows you to map an actual ejb jndi name to one used by your
    application - so, in theory, system administrator can change jndi names without
    touching your application code. You do not see it in the global JNDI tree because
    this mapping exists only in the context of your application.
    <[email protected]> wrote:
    That's what ejb-ref in web.xml is for - you can create an ejb-ref in
    web.xml
    and map it to an actual jndi name in weblogic.xml ejb-reference-description.
    Darren <[email protected]> wrote:
    If I'm deploying a webapp that references an EJB, do I have to usethe same JNDI
    name that is configured in the EJB descriptor?
    Why can't I reference the EJB using a seperate name (as in some J2EEexamples)?
    Thanks,
    Darren--
    Dimitri
    Dimitri

  • HELP!  How to Add JNDI name in Entity Bean

    I am a student who doing a simple J2EE project . I met a problem
    according to the books,In J2EE RI (Appserver 8) when I click the " Sun-specific-Settings" button it will show a windows which i can give the JNDI name, it does work in the session Bean, but in entity bean, I just can change the Bean name. there is no row that i can set up the JNDI name. ( I use local home and component interfaces)
    another question is when i do verify, I find a error, that something wrong in my sun-ejb-jar.xml file. I think that file in the ****.ear file. i try to change or overwrite it in the deployment toolkit, but it is warned that i can not do that. What can i do to fix that problem
    Hope somebody can help me. sorry about the english, i am a chinese studying in UK

    hi
    i am also new to ejb but will try to answer ur question
    JNDI name....
    I dont know how u are doing but try this
    select the bean on the left pane and thengo to "Sun Specific Settings" There are 2 views here "EJB settings" and "CMP database". Likewise how ever u go to the Sun Specific Settings Check if it has more than one view
    I am also having a verify error
    For [ EntityCMP#ejb-jar-ic.jar#EmployeeBean ]
    Error: Exception [ JDO74033: Cannot deploy application 'EntityCMP' module 'ejb-jar-ic' with CMP beans: cmp-resource is not defined for this module. The minimum requirement for a cmp-resource is to specify the jndi-name of a jdbc-resource or a persistence-manager-factory-resource to be used with the beans. ] while initializing JDOCodeGenerator. Please check your descriptors and mapping files for consistency
    I am not able to come over this. this is a CMP bean i am doing. But it gets deployed and works just fine.
    Cheers

  • How to setup JNDI Name for Oracle Apps adapter?

    Hello,
    I am learning Oracle SOA 11g and trying to do some tutorial on Oracle Application Adapter.  I know how to configure JNDI for DBadapter and I did that successfully. I followed same steps to create New JNDI for Oracle Apps Adapter.
    1. I Created new data source using Path Services->Data Sources -> New Genric Data Source. Connection to database was successful and created new JNDI Name: jdbc/PKDTAPPS.
    2. Then Deployment-> OracleApps Adapter-> Configuration-> Outbound Connection Pools -> New and created JNDI Name eis/Apps/PKDTAPPS.
    However I did not find newly created JNDI Name in step 2 under Deployment-> OracleApps Adapter-> Configuration-> Outbound Connection Pools -> javax.resource.cci.ConnectionFactory.
    Please let me know if am I following correct steps to create new Oracle Apps Adapter JNDI Name or not.
    Since above approch did not work I created new JNDI for DBAdapter with same database connection details. And then latter on use that JNDI Name while creating Oracle Application Adapter in JDeveloper composite. And it allowed me to access Oracel Apps open interface. However while deploying the application it gave me following error.
    <Feb 16, 2015 10:50:59 AM CST> <Error> <oracle.integration.platform.blocks.deploy.servlet> <SOA-21537> <Sending back error message: There was an error deploying the composite on AdminServer: [JCABinding]
    [adapter-Apps-101-JournalImport.InsertJournal/1.0]Unable to complete unload due to: Cannot locate Java class oracle.tip.adapter.apps.AppsTableWriteInteractionSpec: Cannot locate Java class
    oracle.tip.adapter.apps.AppsTableWriteInteractionSpec..>
    Since I have no past experience kindly suggest me what is right way to do this.
    Thanks,
    Shri

    Hi shri,
    Can you check the targets of oracle apps adapter that is it deployed on both cluster and admin server both.
    Deployment-> OracleApps Adapter-> Targets
    Regards,
    Anshul

Maybe you are looking for

  • Printer

    I have a new Mac and can't add my HP Officejet 5740e printer

  • Emac wont start up

    I have been trying to install os9 onto my emac so as to run with the classic enviroment but machine does not seem to want to install it.I now find that the install cd is in the machine but will not start up at all. I repeatedly get the grey screen te

  • Dual 23" ACD Oddity

    Hoping someone can recognize this issue. I'll be succinct. Dual 2 G5 PPC with Radeon X800XT Card and Matrox MXO. Recently, the displays have started acting "funny" not in a ha-ha way. When I cursor from one display to the next ther is a "shift" like

  • Next Row in SMARTFORM

    hi all am printing a line in smartform with field GS_it_KOND_W-vtext but displaying the first line in that field..but my requirement is i need only second line to be printed.please pass on the code...like how can i print the line that is der in the n

  • I want to add a SSD drive

    to my early 08 MacPro desktop as the BOOT Drive, is the correct way to do this documented? I think I've seen one but I can't find it now. Thanks all.