How to access same ejb from different applications

Hi
I have two applications (.ear). Each application has 4 EJBs. These EJBs are same in both applications including their names. JNDI names are also same in each application.
in detail
ApplicationA (appA.ear) contains
web1.war
ejb1.jar
ejb2.jar
ejb3.jar
ejb4.jar
and
ApplicationB (appB.ear) contains
web2.war
ejb1.jar
ejb2.jar
ejb3.jar
ejb4.jar
both web1.war and web2.war has same JNDI references to these EJBs.
The problem:
If you access the applicationA, works fine. But if you access applicationB, it throws ClassCast Exception
After restarting.....
If you access the applicationB, works fine. But if you access applicationA, it throws ClassCast Exception
Both the applications are not working same time.
I suspect that It is because both applications have same ejbs and with same JNDI names.
Please validate.
Thanks
Srinivas

Hi Timo,
Very sorry for reply so late!
My case is that accessing a task flow(MaintainJobInstanceTaskFlow) through NevigationBean of UI Shell. please see the coding as following:
taskFlowId_SubNavigation =
"/WEB-INF/oracle/apps/pas/shell/ui/flow/SystemSetupTabFlow.xml#SystemSetupTabFlow";
taskFlowId_TaskListNavigation =
"/WEB-INF/oracle/apps/pas/shell/ui/flow/SystemSetupTaskListFlow.xml#SystemSetupTaskListFlow";
taskFlowId_QuickSearch =
"/WEB-INF/oracle/apps/pas/shell/ui/flow/SystemSetupQuickSearchFlow.xml#SystemSetupQuickSearchFlow";
taskFlowId_LocalArea =
"/WEB-INF/oracle/apps/pas/transactions/ui/flow/MaintainJobInstanceTaskFlow.xml#MaintainJobInstanceTaskFlow";
break;
In my case, how to transfer parameters to MaintainJobInstanceTaskFlow in java?
Thanks!
Susan

Similar Messages

  • In a single program how to lookup different EJB from different application

    Hi,
    I have deployed two applications app1 and app2 on oc4j.
    There is a stateless session bean in a1 called ejb1.
    And there is also a stateless session bean ejb2 in app2.
    I write a test jsp in app1 to lookup ejb1 and ejb2 as an application client. So I need to create an application-client.xml for it.
    <?xml version="1.0"?>
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN" "http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
    <application-client>
    <display-name>ejbs</display-name>
    <ejb-ref>
    <ejb-ref-name>ejb1</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>class_of_ejb1Home</home>
    <remote>class_of_ejb1</remote>
    </ejb-ref>
    <ejb-ref>
    <ejb-ref-name>ejb2</ejb-ref-name>
    <ejb-ref-type>ejb2</ejb-ref-type>
    <home>class_of_ejb2Home</home>
    <remote>class_of_ejb2</remote>
    </ejb-ref>
    </application-client>
    However, When I run the test.jsp, It will report following error:
    javax.naming.NamingException: Error reading application-client descriptor: No location specified and no suitable instance of the type 'class_of_ejb2' found for the ejb-ref ejb2
    In fact, if I only lookup any of the ejb and the application-client.xml just specify only the according ejb-ref, everything is alright.
    But how to construct the application-client.xml so that it can suitable for 2 different ejb in different application? Do I miss something in doing it?
    Kindly advice!
    Queeny Tang

    Hi Debabrata Panda,
    I did add parent in web.xml, but it still encounter
    "Error reading application-client descriptor: No location specified and no suitable instance of the type 'class_of_ejb2' found for the ejb-ref ejb2"
    In my program, a jsp in app2 will lookup ejb1 of app1. In the same way, a jsp in app1 will lookup ejb2 of app2.
    if I declare in server.xml
    <application name="app2" path="../applications/app2.ear" parent="app1" auto-start="true" />
    <application name="app1" path="../applications/app1.ear" parent="app2" auto-start="true" />
    That will cause error reading application-client.xml for all
    ejbs.
    How to solve this.
    Thanks in advance!
    Yours Queeny

  • How to access form objects from different class?

    Hello, I am new to java and i started with netbeans 6 beta,
    when i create java form application from template i get 2 classes one ends with APP and one with VIEW,
    i put for example jTextField1 with the form designer to the form and i can manipulate it's contents easily from within it's class (let's say it is MyAppView).
    Question>
    How can i access jTextField1 value from different class that i created in the same project?
    please help. and sorry for such newbie question.
    Thanks Mike

    hmm now it says
    non static variable jTree1 can not be referenced from static context
    My code in ClasWithFormObjects is
    public static void setTreeModel (DefaultMutableTreeNode treemodel){
    jTree1.setModel(new DefaultTreeModel(treemodel));
    and in Class2 it is
    ClasWithFormObjects.setTreeModel(model);

  • Accessing a variable from different application instance in fmis

    Hello everyone i like to know how to declare a global variable in FMS, so that i can access it from different application instance of a same application.
    Thank.

    Hi,
    In such a use case you can use persistent shared object to keep track of all connected users and the instances they are connected to. then when a user connects in application.xml you can check whether that user name and password is valid for a instance. This doc should help you get this achieved http://help.adobe.com/en_US/FlashMediaServer/3.5_Deving/WS5b3ccc516d4fbf351e63e3d11a0773d3 7a-7fff.html
    Thanks,
    Abhishek

  • How to access an EJB from a web application deployed in the same server

    Hey All,
    I deployed an EJB named EventServerBean to Sun Application Server 9.0, and put the client side jar file (named eventserver.jar which is generated by Sun Application Server) to C:\Sun\AppServer\lib. Now, I have a web application which is a simple jave file -- lookup EventServer EJB and invoke a remote method in this EJB. However, the web application always throws an exception "java.lang.NoClassDefFoundError: eventserver/EventServerRemoteHome"
    Here is my java class that access the ejb:
    public class Post_Event {
        public HashMap<String, String> getEventInfo(String event_name, String site) {
            System.out.println("Post_Event, the class path: " + System.getProperty("java.class.path"));       
            System.out.println("Post_Event, user.dir: " + System.getProperty("user.dir"));
            System.out.println("Post_Event, java.library.path: " + System.getProperty("java.library.path"));
            HashMap<String, String> result = null;
            EventServerRemote remote = null;
            StringTokenizer st, st2;
            // here get the event information from host
            try {
                String lookupStr = "corbaname:iiop:" + site + ":3700#ejb/EventServerBean";
                InitialContext initialContext = new InitialContext();
                EventServerRemoteHome remoteHome = (EventServerRemoteHome) javax.rmi.PortableRemoteObject.narrow(initialContext.lookup(lookupStr), EventServerRemoteHome.class);
                if (remoteHome != null) {
                    remote = remoteHome.create();
            } catch (javax.naming.NamingException ne) {
                ne.printStackTrace();
                return null;
            } catch (javax.ejb.CreateException ce) {
                ce.printStackTrace();
                return null;
            } catch (java.rmi.RemoteException re) {
                re.printStackTrace();
                return null;
            } catch (java.io.IOException ioe) {
                ioe.printStackTrace();
                return null;
            System.out.println("look up remote event server successfully.");
         result = remote.getEvent(event_name);
            return result;
        } I output the class path in this java file, and the class path DOES include the path C:\Sun\AppServer\lib where eventserver\EventServerRemoteHome.class is.
    Does anyone know why it happens? Why a java class can't find a class that is in its class path?
    appreciate any help!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Wael Abbas ([email protected]):
    Thank you for your great topic.
    I think you need to copy the snippet code and past it to every application, applet, servlet or JSP every time you need to use your EJB.
    Its better to include this snippet code in a simple JavaBean and use this bean as a bridge to your EJB, you may include a connect method in your JavaBean or but the connection code in the constructor and include a setters, getters and other methods to encapsulate your EJB methods.
    You can use your JavaBean in any application, applet, servlet or JSP just create an object form it and call its methods.
    Its just an idea
    I hope it will be useful.
    <HR></BLOCKQUOTE>
    null

  • How to access Excel files from different locations?

    Hello,
    I have successfully tested the Excel sample on WLS 7, and trying to run it on
    the WLS 8.1.
    Anyways, the common question for both is, how to access an excel files from different
    locations (e.g. c:\path\1.xls, \\domain1\finance\fin.xls, \\domain1\marketing\customer.xls,
    \\domain2\accounts\vouchers.xls)?
    From example i can see that it picks from a specific path under repository.
    Thanks
    Ashok Gupta

    The custom function sets the MS-Excel default directory to System.getProperty("user.dir")+"/excel"
    (the domain directory), then opens the filename passed as a parameter. I assume
    that if you pass in the fully specified path for the excel file ( like d:\MyDir\data\test.xls),
    that it would open that file.
    - Mike
    "Ashok Gupta" <[email protected]> wrote:
    >
    Hello,
    I have successfully tested the Excel sample on WLS 7, and trying to run
    it on
    the WLS 8.1.
    Anyways, the common question for both is, how to access an excel files
    from different
    locations (e.g. c:\path\1.xls, \\domain1\finance\fin.xls, \\domain1\marketing\customer.xls,
    \\domain2\accounts\vouchers.xls)?
    From example i can see that it picks from a specific path under repository.
    Thanks
    Ashok Gupta

  • How to access ucm table from external application?

    Hi All.
    Is it possible to access an ucm table (configuration manager-> tables) from of the other external application?
    If yes, how to do it?
    Regards,
    Diovani

    It's just another DB table so JDBC would work fine.
    You can connect to the UCM schema using a free tool like Oracle SQLDeveloper and look at the tables this alos uses a JDBC connection.
    HOWEVER
    I would not really recommend you use this approach without knowing a lot more. Certainly you should not have an external application making changes to the UCM DB. If you just want to read data SQL over JDBC is fine
    BUT
    It is better really to use the existing UCM services to access the data - if there is not a service that does what you want then you create it. This keeps you within the same design pattern of UCM and means you can continue to benefit from security and other rich services that UCM provides over and obove JDBC
    Tim

  • How to Acces an EJB from a portal

    I have a problem. I can't access EJB's from the portal.
    I downloaded the tutorial "How to Access an EJB from a Portal component". The result was the following error
    Can someone tell my how to access EJB's from a portal component. It is not needed to do this all in one EAR.
    One PAR and a other EAR is also fine.
    I use the WAS 6.4 SP9
    Starting Deployment of MyEJBPackage
    Aborted: development component 'MyEJBPackage'/'sap.com'/'localhost'/'2005.01.28.09.32.48':
    Caught exception during application deployment from SAP J2EE Engine's deploy service:
    com.sap.engine.services.rmi_p4.MarshalException: Exception when trying to read the original exception.; nested exception is:      java.lang.ClassNotFoundException: com.sapportals.portal.prt.runtime.PortalException
    (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
    Deployment of MyEJBPackage finished with Error (Duration 612133 ms)

    See Accesss an EJB from a portal component

  • Deploying EJBs with same name in different application jars on JBOSS

    Hi,
    We are attempting to deploy entity beans with the same name in 2 different EJB application jars on jboss 3.2.5. One bean is an extension of the other, so some of the DB columns they refer to are the same (they access different DB tables in different tablespaces). However, the field names corresponding to these DB columns in the beans themselves are different (i.e. DB column serviceid is associated with the field serviceid in one bean and service_id in the other).
    We have altered jboss.xml for one of the EJB applications so that the jndi-name used to access that application's bean is different to the jndi-name used to access the entity bean in the other EJB jar.
    However, when we attempt to deploy both jar files on the same jboss server, one of the applications deploys successfully and when we deploy the other, we get EJB spec violation errors, such as the following:
    14:18:34,631 WARN [verifier] EJB spec violation:
    Bean : CommunityAddress
    Section: 10.6.2
    Warning: The entity bean class must define a get accessor for each CMP field.
    Info : Field: service_id
    I'm presuming that this is because the bean which references the serviceid DB column with a field called serviceid is being mixed up with the other bean, which has a service_id field.
    Can anyone tell me if there is anything else that is required to get entity beans/EJBs in different applications but with the same names (and some overlapping fields, etc) deployed successfully on the same jboss server apart from editing jboss.xml for one of the applications?
    Is this a jbosscmp-jdbc.xml issue?
    Any help much appreciated,
    Maurice

    Hi Srinath
    Thanks for your response. Its not cloning, its like check-in file first, then check-out the file and do some editing and then again upload the same file with different revision number using RIDC. I got the solution now.
    Regards
    Raj

  • How can i access the EJB from a Webdynpro

    Dear all,
    How can i access the ejb , from a webdynpro?.
    Is there any way to do that?.
    I want to write the entire code (business functions) within the EJB and i wan to access the entire methods from a WebDynpro Application.This is the situation.
    Please help me to , resolve this problem.(Here im using JDBC Connection .. etc.).
    I want to do the basic connection setting's and data retrieval part within the EJB and use that within the WebDynpro..
    how can i seperate this two(i mean, i want to seperate the JDBC connections and WebDynpro,i dont want to hard code any connection parameters within the webdynpro code)
    So that i want use that saet of particular function's in many webdynpro applications..
    (i dont need any help regarding webservice way.)
    If anyone can , please help me..
    I tried that javabean class , manifest file , that way (importing javabean model).
    but im getting errors.
    I cant properly utilize that..
    So please help me with steps regarding that,,
    for javabean
    and if any , for EJB also..
    with regards
    Kishor.G

    HI,
    Since webdynpros follows Model View Controller Architecture You can access EJBs in webdynpro(views/frontend) infact to connec to database uding JDBC you have to utilise EJB ( opening connection to database closing, and other Business functionality).See this link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/unkown/web dynpro tutorial and sample applications.faq#q-7
    <b>How to access the Car Rental Web Service?</b>
    Regards,
    RK

  • How to use the same component in different applications

    Hi All,
    I need to use the same component in different applications. i.e In opportunity, Quotation & Promotion.
    The Search help view in the component PRD01QR should be used in all these components but with different search criteria.
    With help of the DO_determine_configuration, different view configurations are possible but Different search criteria is not possible.
    for Eg. search parameter without DDLB, F4 options in another components.
    How can I control the behavior of the search view in different applications with restricting the field properties?
    Is it possible to find out where and in which component these search_help_search component is used?

    Hi Harry,
    Is it possible to find out where and in which component these search_help_search component is used?
    ans: I am giving an Example for your question go through that u might get clear about this.
    Ex: BT115IT_SLSO  sales order component
    below screen they component usage using for populate the product search component.
    please let me know any help required .
    Regards,
    vishwa.

  • How can I include a jsp file in other jsp from different applications?

              Hi,
              I'd like know if it´s possible to include jsp or servlet from different applications.
              

              Thanks Deepak but I think you don´t understand me.
              I would like the include works like a normal include. I have a jsp in my application
              and , when the client requests this jsp, in the jsp should be added the result
              of the other jsp ejecution that belong to other application in the same domain.
              Is this possible?
              Thank you very much.
              Deepak Vohra <[email protected]> wrote:
              > A Jsp from a different application is included with a relative url to
              >th=
              >e Jsp.
              ><%@ include file=3D"relative url" %>
              >
              >A Jsp could be included with request parameter.
              > <jsp:include page=3D'<%=3D request.getParameter("incFile") %>' />
              >
              >javilla wrote:
              >
              >> Hi,
              >>
              >> I'd like know if it=B4s possible to include jsp or servlet from differe=
              >nt applications.
              >
              

  • TS1382 I want to add multiples of the same song from different playlists to my ipod but iTunes wont let me. How can I override this so that I get the songs I want on my ipod?

    I want to add multiples of the same song from different playlists to my ipod but iTunes wont let me. How can I override this so that I get the songs I want on my ipod?

    You can sync those different playlists to the iPod, and the song appears on each playlist.  However, the song is stored on the iPod once.  What is the practical reason for wanting to store the same song file multiple times (and waste storage space) on the iPod?

  • How to call a servlet from Webdynpro application

    Hi All,
        I am new to SAP . I have requirement to call a SERVLET which is on a different application server from my webdynpro application , the servlet will return a file .. i need to display that file to the user .. can some one tell me how this can be done .. If possibel please provide some sample code.
    Regards,
    Tarun.

    Hi
    Check this
    1. How to access Servlet information from a webdynpro application ?
    Regards
    Abhijith YS

  • How i access file which stored at application server .? Is there any fm ?

    Hi,
    How i access file which stored at application server . Is there any function module which provide same funtinality.
    Regards,
    Gurprit Bhatia

    Hi ,
            U need to use datasets for reading data from application server.Do a f1 on dataset,u will get to know rest of the things.
    TRY.
        OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING UTF-8.
      ENDTRY.
      IF sy-subrc = 0.
          READ DATASET file INTO <wa_data> MAXIMUM LENGTH 200.
               move the data in to internal table
        close dataset
    Edited by: A kumar on Aug 21, 2008 1:37 PM

Maybe you are looking for

  • Check box als column in a standard table, how to get the selected row

    Dear experts, I habe standard tablt with check box as column. Now I want to get the current selected row structure and do some changes. How could I solve this problem? till now I just know to get the structure via lead selection. lo_node->get_element

  • Baffled by performance

    Oracle 11.1.0.6.0 client, 10.2.0.3 database, Visual Studio 2005. I have a C# program that had a pretty involved update in it. There were two bind variables, one used several times. When I ran the update as a fat statement within the program, it took

  • No internet for mac?

    ADSL via Motorola SBV 5220 plugged directly into my Vista PC and works fine. Plugged into brand new MacBook Pro Snow Leopard... nothing. Tried all the usual resets and reboots... nothing. Purchased airport express... same problem. No IP address... se

  • Acrobat XI plugin for Outlook 2013 crashes constantly; has to be re-enabled

    I have a user that has Windows 7 (32 bit)  and Oultook 2013 (also 32 bit).  The export to PDF plugin did not work with Acrobat X so we upgraded to Acrobat XI, however this plugin crashes and "disappears" quite often, requiring the user to open the se

  • Problem after consolidating library

    Hi, I've changed the location of my iTunes music, as described in this link: http://support.apple.com/kb/HT1449 After I consolidated the library, I compared the size of the iTunes folder in both locations and there is a difference of 50 GB. So what w