Help how to look up ejb3 deployed in ear using jndi

Hi,everyone:
I'm trying to use jndi to look up ejb3 depoyed in ear-file. The structure of ear file is like: taas.ear\app.jar , the "app.jar" is where the ejbs are deployed.
If i write code:
jndiContext.lookup("ServiceProviderDaoImpl/local");There will be exception:
javax.naming.NameNotFoundException: ServiceProviderDaoImpl not boundHowever, if i deploy the ejbs directly in a app.jar which is not in a ear-file, then same same code will work fine.
I cannot figure out how to write the correct code to look up the ejbs.
I use jboss 5.0.1GA.
Could anyone help me? Thanks a lot.

Usually the lookup name is:
earname/ServiceProviderDao/local
Replace "earname" with the name of your ear of course, without the '.ear' extension.
Use the JBoss JMX console and then the jndiView service to see under what names your EJBs are bound (under "global namespace" I think the label was).

Similar Messages

  • How to look up a TxDataSource bound in weblogic JNDI

    HI,
    How can i look up a TxDataSource bound in weblogic JNDI. When i access it using
    javax.sql.XADataSourse ds = (XADataSourse)context.lookUp(jndiName)
    ..it gives me classcast exception.
    and if i lookup it using javax.sql.DataSource like below
    javax.sql.DataSourse ds = (DataSourse)context.lookUp(jndiName)
    then while executing my sql on the connection object it throws some other excepiton
    like below
    java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
    [weblogic.rjvm.PeerGoneException: ; nested exception is:
    java.io.EOFException]
    at weblogic.jdbc.rmi.SerialStatement.executeQuery(SerialStatement.java:92)
    at TestTransactionMgr.main(TestTransactionMgr.java:46)
    How can i solve this problem.. Actually my application needs to handle distributed transactions so i need to implement XADataSource.
    can somebody help me iin this.
    Thanks & Regards
    Akhil Nagpla

    Hi Akhil did u get the solution for distributed database /
    I am also working on same but i dint get the solution yet. Please if u have any solution for the same do mail me to [email protected] and [email protected]
    here goes my problem !
    we have 2 oracle databases.
    I am using Stateless EJB and container managed transaction !
    And inside a ejb method i am getting 2 different connection from 2 different datasources ok !
    Since am using container managed transaction it starts transaction automatically when the method begins,
    and the transaction ends when the method exit out ok !
    Now i insert into 2 databases and when the method exits it gives an error listed below !
    i am using NON emulated datasource with class name "com.evermindsql.DriverManagerDataSource"
    and looking up this datasource in the EJB with name specified in location attribute of datasource !
    "com.evermind.server.rmi.OrionRemoteExcepttion: Transaction was rolled back: javax.transaction.SystemException: could not commit: error code 29540- for additional error code check the oracle log file"
    For distributed database we configured DBLINK also !
    If u can give more info regarding DBlink it will be better ! Even after we set DBlink we are getting error !
    Please tell us how to configure the database !
    Oracle 9iAS
    Oracle 9i DB
    regards
    Sreenath.V

  • NW7.3] Problem while trying to deploy an EAR using ant task

    (I posted this in another forum, but I think this is the right one )
    Hello!
    I'm trying to deploy a EAR file to my Netweaver instance using ANT but I'm facing the following problem.
    I've downloaded all the files from j2ee/deployment and j2ee/j2eeclient as SAP's documentation states, the classpath is correctly set, however I get this error:
    BUILD FAILED!
    build.xml:16: taskdef class com.sap.engine.services.dc.ant.convert.SAPImportEAR cannot be found
    I've taken a look at tcjedc_ant.jar, which I downloaded from my instance, and it appears that SAPImportEAR is missing.
    By opening the file I can see com.sap.engine.services.dc.ant.deploy, com.sap.engine.services.dc.ant.undeploy and com.sap.engine.services.dc.ant.params, but the whole package com.sap.engine.services.dc.ant.convert is missing.
    Is it suposed to be anywhere else? All the articles/posts I found state that it should be on tcjedc_ant.jar.
    Thanks in advance!

    Hi,
    I guess this example_build.xml is outdated (belongs to NW 7.1).
    To build an SDA, look at make_SDA.csh.
    Class is com.sap.engine.lib.deploy.sda.SDAProducer.
    To buid an EAR, you do not need SAPImportEAR at all, just <taskdef "sapdeploy"...
    Regards
    Rolf

  • How to profile a pre-deployed J2EE app. using JSE8?

    I would like to profile a J2EE application that is already deployed on Sun Appserver. I do not have the source structure with me to start the profiling directly from the tool by the usual documented steps of JSE8.
    In JSE7, once I enabled the profiler feature for the appserver instance, I was able to get stats for the app. How do i achieve something similar using JSE8?
    -Girix

    This is possible, but is not a use case that the profiler supports directly. You will have to trick the profiler into profiling this predeployed app.
    First, deploy the application you wish to profile. Next comes the trick. Create a ghost enterprise project for the sole purpose of getting the profiler setup and running. While creating the ghost project, just accept all the defaults from the wizard. Since this project in an Enterprise Application project, when it is set as the main project, the J2EE Profiler menu item will be enabled.
    Enable the collection as if you were going to profile this ghost project. With the appserver started (you have already deployed the application you really want to profile), open the profiler.
    You will not be able to see data in the Transactions tab, because this relies on a filter place in the web component of the application. Since you did not do this, you will not get this data.
    You will be able to get method level, EJB container stats, and memory monitoring. Select the MEthods tab and notice that the application that was deployed appears in the tree. The profiler is designed to create this tree from whatever is deployed indiscriminately. You can select the methods in your application for instrumentation and then run the application.
    After running the application the profile data will be ready for viewing. In the Methods tab select the "Get MEthod Trace" button. You will see the all the profile data for your application.

  • How to create Websevice and deploy on Server using Oracle SOA 10g ?

    Is that possible to create WSDL without BPEL process ? How to do this ?? And how to deploy it ??
    Edited by: user11180835 on Aug 21, 2011 8:18 AM

    Create a java Class with your code and expose it as a web service in JDeveloper it self.
    Go to Resources folder-you will find webservices.deploy-right click on it deploy to your application server.
    Use the url provided at the end of the WSDL file to access this Webservice.
    Incase of deploying this webservice on some other environment-take the .ear file and upload in the application tab and then do deployment.
    Thanks,
    Chandra_

  • Help, how to install jvm and set the classpath using a batch file

    hello,
    i have created my java application and now have to create an installable / batch file which will install the JVM on the users machine and also the java packages such as javamail and the class files that i have created . it also has to set the classpath.
    i would like to know if anyone can tell me how to go about iti.e. how can i install the JVM using a batch file and then place the javamial packages etc in the apropriate directory .
    or is it advisable to explain it to the user how to go about it in tht user manual.
    and would also like to know that if i install the JVM will the path for the java.exe be set
    or will i have to set the path explicitly from the "batch file" so that the user can run the application without and problem just by running the java command followed by filename from the command prompt.

    hi,
    I have windows and I use it.
    The only problem with the free edition is that you can only create 1 launcher and that during the installation you get 1 popup showing that the installer was created with an unregistered version.
    Stijn

  • How to look at a Mac hard drive using another Mac

    The motherboard in my G5 iMac recently bit the dust, so I removed the hard drive and installed it in my external inclosure. When I access the old hard drive from a newer Mac to retrieve the information I didn't have backed up, it sends me to the file on the "new" Mac, {If I try to go to "Documents" on the old hard drive, it takes me to "Documents" on the new Mac} If I click on the External "Mac HD" in Finder, then select "Applications" - it deselects the External "Mac HD" & shows the "Applications" folder on the external hard drive {I have some apps on the old one that aren't on the new one} but when I click on iPhoto, it takes me to iPhoto on the new Mac - How do I access the files on the old hard drive?

    If you have an external hard drive connected to your Mac, it should show up in the sidebar of your Finder window, just like a mounted server on a network. So if you select that external drive, it should show you the contents of the drive, including all folders and files that aren't normally invisible. From that starting point, you should be able to navigate to whatever folder or file you want on the external drive.
    Don't be fooled into thinking you can click on the folders or files listed in the normal Finder window and expect them to take you where you want to go, or do what you want to do.

  • How to resolve a host name from IP using JNDI/DNS service provider

    Hi
    I got two questions on JNDI/DNS service provider:
    1) How to resolve a host name when i got an IP
    I understand How I do it inverse.
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
    env.put(Context.PROVIDER_URL, "dns://"+server+"/"+domain);
    DirContext ictx = new InitialDirContext(env);
    Attributes attrs1 = ictx.getAttributes(host, new String[] {"A"});
    2) This example above works when I specify the domain in the provider url.
    If I am not specifing a domain but only the dns server I got an NameNotFoundException.
    What should I do if I don't got the domain?
    get the availible domains and loop on them?

    Hi,
    if your DNS server supports that, you can do a reverse DNS lookup. This works as follows:
    String server = "your.dns.server";
    String domain = "in-addr.arpa";
    String ip = "4.3.2.1";
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
    env.put(Context.PROVIDER_URL, "dns://" + server + "/" + domain);
    DirContext ictx = new InitialDirContext(env);
    Attributes attrs1 = ictx.getAttributes(ip, new String[] {"PTR"});1: Use the pseudo-domain in-addr.arpa
    2: Use the reverse IP address for lookup, i.e. if your host has 1.2.3.4, use 4.3.2.1!!
    3: Request the PTR attribute
    see also [http://en.wikipedia.org/wiki/Reverse_DNS_lookup|http://en.wikipedia.org/wiki/Reverse_DNS_lookup]
    Martin

  • Problem in accessing Data Source Deployed in JBoss using JNDI

    Hi everybody!
    I need your help in the next question:
    I have created a data source to connect to my MySql data base using the following entry in mysql-ds.xml (JBOSS 3.2.5)
    <datasources>
        <local-tx-datasource>
            <jndi-name>MySqlDS</jndi-name>
            <connection-url>jdbc:mysql://localhost:3306/mytest</connection-url>
            <driver-class>com.mysql.jdbc.Driver</driver-class>
            <user-name>root</user-name>
            <password>1</password>
        </local-tx-datasource>
    </datasources> in Eclipse SDK 3.1.2 i trying get access to the datasource
    InitialContext initialContext = new InitialContext();
    DataSource  ds = (DataSource)initialContext.lookup("java:/MySqlDS");
    if (ds != null) {
        result = ds.getConnection();
                       System.out.println("OK");
        else {
             System.out.println("Failed to lookup datasource.");
        } http://localhost:8080/jmx-console service = JNDI name equal "java:/MySqlDS"
    I have error "Cannot get connection: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial"
    Error happen in
    DataSource  ds = (DataSource)initialContext.lookup("java:/MySqlDS");I trying
    DataSource  ds = (DataSource)initialContext.lookup("MySqlDS");and i had such error.
    Can anybody help me?

    hi,
    please check is your error corrected
    public class DBConnection {
         static DataSource dataSource = null;
         * To get the datsource
         public static DataSource getDatasource() {
              InitialContext ctx=null;
         if (dataSource == null){
         try {
              ctx=new InitialContext();
    dataSource = (DataSource) ctx.lookup("java:/MySqlDS");
         } catch (Exception e) {
         System.out.println("eror in DataSource class"+e);
         try {
         ctx.close();
         } catch (Exception e) {
              System.out.println("eror in DataSource class context closing"+e);
         return dataSource;
         * To get connection from Database.
         public static Connection getConnection() {
                   Connection con = null;
                   DataSource dataSource = null;
                   try {
                        dataSource =getDatasource();
                        con = dataSource.getConnection();
                   } catch (SQLException e) {
                        e.printStackTrace();
                   } catch (Exception e) {
                        e.printStackTrace();
                   return con;
    if you want a connetion then call Connection con=DBConnection .getConnection()
    hope this helps you

  • How to deploy an ear remotely.

    Hi all,
        I have an ear in my system.I want to deploy it remotely in the webas 6.40(server). I can able to deploy the ear using sdm batch from the same machine(server). But i want to deploy it from my system into server. Now actually i want know how NWDS can able to deploy remotely.so that we can use same mechanism to deploy.pls help me out to resolve this issue.
    Regards,
    Kiran.

    Hello Kiran,
    you can deploy via command line only locally. If you want to deploy remotely in SDM, you can use the remote GUI:
    The SDM Server and
    the remote GUI can run on different hosts, however they must be connected by a network
    connection. Use the command remotegui to start the remote GUI:
    sdm remotegui
    Since there is no current separate installation for the GUI, you must perform a complete SDM
    installation even if you only want to start the remote GUI on the host.
    Best Regards,
    Elena

  • HT4623 hi. i had erased iphone. now its not showing in itunes. help how restore?.

    hi. i had erased iphone. now its not showing in itunes. help how restore?.

    thanks feffo87.
    but i hav used ERASE ALL CONTENT AND SETTINGS  to erase, but my iphone 4s is not reading on itunes.
    how to restore new ios now.

  • Unexpected ClassCastException when looking up Home using JNDI

    J2EE Gurus,
    In the attached sample program, a EJB (named MyScheduler in package mytest) is
    used to install a java code dynamically in weblogic service (8.1sp1), as well
    as to invoke a test java code (MyTest.run()) in it using Java reflection. Another
    EJB (named MyEJB in package myejb) is deployed dynamically using Weblogic console
    with its client side packaged with dynamically deployed java code. When invoked
    through MyScheduler, MyTest.run() simply looks up the home of MyEJB using JNDI,
    and when it is cast to MyEJBHome, a ClassCastException is thrown.
    Can someone explain why this exception occurs? Does this mean that a (dynamically)
    deployed code (java or EJB) cannot call other (dynamically) deployed EJBs, even
    when it has the client side of EJB packaged with it?
    Any help will be deeply appreciated.
    Thanks,
    Abhay
    [testjava.jar]

    "Nick" <[email protected]> wrote in message news:40343200$[email protected]..
    Because returned instance implements javax.sql.DataSource.Ha ha.
    No kidding :-)No. One could have found it himself by printing out returned type class
    or just by going to google and typing XADataSource weblogic +ClassCastException...
    Why would you want to do it? weblogic takes care of all the XA
    connection pooling, resource enlistments etc.Yeah, true.
    I should know this - I just got a little confused ... :-)
    I have just come from doing all the XA stuff myself... and got used to having
    XADataSources around...Thanks to J2EE, there is no need for low level plumbing when transaction
    support is needed.
    Also, with JMS resources, you DO have to have the XAQueueConnection etc etc for
    XA - even in an appserver.Per my knowledge weblogic allows you creating XA-aware JMS resources.
    Regards,
    Slava Imeshev
    >
    Thanks.
    "Slava Imeshev" <[email protected]> wrote:
    "Nick" <[email protected]> wrote in message news:403121e2$[email protected]..
    I am getting a ClassCast exception when I lookup a "Global Transaction"enabled
    JDBC DataSource.
    XADataSource xads = (XADataSource) ctx.lookup("jdbc/MyDS");
    Why is this?Because returned instance implements javax.sql.DataSource.
    How do I configure an XADataSource in JNDI?Why would you want to do it? weblogic takes care of all the XA connection
    pooling, resource enlistments etc.
    Regards,
    Slava Imeshev

  • Hi, I have this green mark (with pointing arrow looks like a link) on some words show on my window screen when I open a web page, I wonder if it is a virus link or such. Need help how to get rid of it. Thanks

    Hi, I have this green mark (with pointing arrow looks like a link) on some words show on my window screen when I open a web page, I wonder if it is a virus link or such. Need help how to get rid of it. Here's the example:
    WING
    GAMES
    MAJORITY
    Thanks

    If the third link you posted (the link containing the word "majority") does not look like the following then you inadvertently installed adware.
    That particular page should resemble the following:
    The word "majority" in the third paragraph should not be a link and should not have the green icon associated with it.
    To learn how this may have occurred, and how to prevent it from occurring in the future, read How to install adware
    Most so-called "news" websites are nothing more than entertainment outlets that cater to prurient interests, and contain advertisements that leave the user about three clicks away from installing junk. If you decide to frequent those websites, Safari's "Reader" feature helps minimize that exposure.
    Try it:

  • Any one can help how to install sharepoin2013 in multi servers .any deployment guide please provide

    Any one can help how to install sharepoin2013 in multi servers .if you have any  guide please provide

    I am sharing few links which can be helpful for you to understand and install/configure multi server sharepoint environment.
    Install SharePoint 2013 across multiple servers for a three-tier farm
    Test Lab Guide: Configure SharePoint Server 2013 in a three-tier farm
    Install and Configure SharePoint farm (3 -tier)
    Office Web Apps 2013 multi servers (NLB) Installation and Deployment for SharePoint
    2013 step by step guide
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • "dtutil", how to tell which configuration file for packages using after deployment?

    Hello All, 
    Trying to achieve this feature, 
    Using DOS command to automatic my deployment process--glad I found dtutil. However, it doesnt give you any chance to identify which configuration file to be used by SSIS packages after deployment.
    Deployment Method: file deployment
    Configuration sued: XML file and SQL Table. IN XML file, it tells which DB connection for packages to look up the configuration table.
    Who can share some thoughts on this?
    Derek

    It is NOT about sequence.
    It is about how to point which configuration file to be used by deployed packages as during the "dtutil.exe"
    deployment, you dont have chance to identify which physical location confg files to be used.
    Derek
    That you do only at the time of execution of packages. By default it uses configuration settings created at design time within the package. If you want to override it, you can use \Configfile switch of dtexec for that. You can also set explicit values for
    properties using /SET switch
    http://technet.microsoft.com/en-us/library/ms162810(v=sql.105).aspx
    See this to understand how configs are applied in runtime
    http://technet.microsoft.com/en-us/library/ms141682(v=sql.105).aspx
    and this to understand behaviour difference in ssis 2008 
    http://technet.microsoft.com/en-us/library/bb500430(v=sql.105).aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • Backing up partitions to an external HD, how many images does it make?

    I have several partitions on my MBP of which I would like to backup only 2. I know I can control this in the TM setup. However my question is would TM than make one or two sparse images. And if only one how could I get it to make two images. Or? Any

  • Not able to video ichat

    I have two macbook's and I am not allowed to video chat between the two.  Can any one tell me why this is?

  • IMAP accounts keeps getting disabled

    I have MobileMe and 3 IMAP accounts and for some reason my 3 IMAP accounts keeps getting disabled and I would have to go into preferences and re-enable the accounts. Does anyone know what's happening here? I also just done a reset sync data on Mobile

  • Compressor failing: "3x should not be auto-detect at this point"

    I have something that I can't seem to fix. I'm trying to render to MPEG2 but the job keeps failing with "Status: Failed - 3x should not be auto-detect at this point" error message in the status window of Batch Monitor. The logs show: <mrk tms="273146

  • The Official Complaint P

    I have started this thread to ) make Creative realize that customer service is important, 2) to allow them to view the complaints of their products AND services, 3) make corrections to problems, and 4) be a better company in the future. This thread i