Access ejb in another websphere

I have installed webpshere in 2 machines. How can I access ejb in the second websphere from servlet in the first websphere?
Thanks in advance

You would have to read up on JNDI to get the InitialContext from the firstWebsphere to get beans from another. Another solution would be using SOAP or JMS to relay information from one to another.
Dan

Similar Messages

  • ClassNotFound Exception accessing EJBs in a cluster

    I am experiencing some weird behavior when attempting to access EJBs in a
              Weblogic 5.1.0 cluster. The cluster nodes startup fine, and the EJBs are
              correctly deployed. However, when my test client attempts to access them I
              get the ClassNotFoundException listed below. This same client can access the
              same EJBs deployed in a non-clustered environment without any problems, so
              it's definitely related to my cluster configuration. The problem seems to be
              that the client is not receiving the client-side stub. To confim this, I put
              the stub in the client's classpath, and did NOT get the
              ClassNotFoundException. Has anyone else seen this error?
              BTW, I have compiled the EJB both with and without the <home-is-clusterable>
              flag set to true. I get the same exception either way.
              Thanks for any assistance,
              Jason Donnell
              javax.naming.CommunicationException. Root exception is
              java.lang.ClassNotFoundException: class
              com.landacorp.maxmc.ejb.security.ProviderSecurityBeanHomeImpl_ServiceStub
              previously not found
              at weblogic.rjvm.MsgAbbrev.read(MsgAbbrev.java:184)
              at weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
              at weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
              at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:700)
              at
              weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.jav
              a:34)
              at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
              at weblogic.socket.JVMAbbrevSocket.dispatch(JVMAbbrevSocket.java:393)
              at weblogic.socket.JVMSocketT3.dispatch(JVMSocketT3.java:355)
              at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:247)
              at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              --------------- nested within: ------------------
              weblogic.rmi.UnmarshalException: Unmarshalling return
              - with nested exception:
              [java.lang.ClassNotFoundException: class
              com.landacorp.maxmc.ejb.security.ProviderSecurityBeanHomeImpl_ServiceStub
              previously not found]
              at
              weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.jav
              a:256)
              at weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
              at javax.naming.InitialContext.lookup(InitialContext.java:350)
              at
              com.landacorp.maxmc.ejb.security.ClusterSecurityTest.main(ClusterSecurityTes
              t.java:52)
              

    Just a side note: I setup the cluster using the WebLogic recommended
              directory structure (see
              http://www.weblogic.com/docs51/cluster/setup.html#676105) and I no longer
              get the exception. I'm still interested in hearing, though, if anyone has a
              scheme for setting up the cluster in a directory that isn't directly under
              the weblogic installation directory.
              Jason
              "Jason Donnell" <[email protected]> wrote in message
              news:[email protected]...
              > My current idea is that our directory structure is not properly supported
              by
              > WebLogic. We are NOT putting everything under the weblogic install
              > directory, as the documentation suggests. Instead, it looks something like
              > this (on an NT box):
              >
              > \weblogic_install\<Weblogic 5.1.0 installation here>
              >
              > \our_weblogic\startWeblogicNode1.cmd
              > \our_weblogic\startWeblogicNode2.cmd
              > \our_weblogic\weblogic.properties (cluster-wide)
              > \our_weblogic\public_html\
              > \our_weblogic\our_cluster_name\
              > \our_weblogic\our_cluster_name\all_ejbs\<compiled beans are here>
              > \our_weblogic\our_cluster_name\server_node1\
              > \our_weblogic\our_cluster_name\server_node1\weblogic.properties
              > (server-specific)
              > \our_weblogic\our_cluster_name\server_node2\
              > \our_weblogic\our_cluster_name\server_node2\weblogic.properties
              > (server-specific)
              >
              > So, on the command line in our per-server startup scripts, we set the
              > weblogic.system.home=\our_weblogic,
              weblogic.cluster.name=our_cluster_name,
              > and weblogic.system.name=server_nodeX.
              >
              > Now, I want to emphasize that the server claims to start up just fine. It
              > claims the EJBs have been deployed. However, it is unable to deliver
              classes
              > dynamically, as we found by trying the
              > http://yourweblogic..../classes/some/class/name.class suggestion noted
              > previously.
              >
              > We had a similar directory structure for a single server, and it worked
              just
              > fine. However, in that case we obviously did not have the extra level of
              the
              > \our_cluster_name\ directory. It would seem that in the cluster
              > configuration, we cannot do it this way. I would be VERY interested to
              hear
              > if anyone else has setup a cluster in a directory that is not under the
              > weblogic installation directory.
              >
              > Hopefully this may shed some light on your problem. Feel free to contact
              me
              > if you need any additional information (or if you solve the problem!).
              >
              > Jason Donnell
              > [email protected]
              >
              >
              > "Chad" <[email protected]> wrote in message
              > news:[email protected]...
              > > I am very interested in this thread - I am having the same behavior:
              > >
              > > javax.naming.CommunicationException. Root exception is
              > > java.lang.ClassNotFoundException: class
              > > healthecare.drug.ejb.DrugAlternateBeanHomeImpl_ServiceStub previously
              > > not found
              > > at weblogic.rjvm.MsgAbbrev.read(MsgAbbrev.java:181)
              > > at
              > weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
              > > at
              weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
              > > at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:630)
              > > at
              >
              weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.jav
              > a:34)
              > > at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
              > > at weblogic.socket.JVMAbbrevSocket.dispatch(JVMAbbrevSocket.java:393)
              > > at weblogic.socket.JVMSocketT3.dispatch(JVMSocketT3.java:355)
              > > at
              > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:247)
              > > at
              > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
              > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
              > >
              > > --------------- nested within: ------------------
              > > weblogic.rmi.UnmarshalException: Unmarshalling return
              > > - with nested exception:
              > > [java.lang.ClassNotFoundException: class
              > > healthecare.drug.ejb.DrugAlternateBeanHomeImpl_ServiceStub previously
              > > not found]
              > > at
              >
              weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.jav
              > a:256)
              > > at weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
              > > at javax.naming.InitialContext.lookup(InitialContext.java:350)
              > > at healthecare.util.EJBBase.findHomeInterface(EJBBase.java:178)
              > >
              > > One additional bit of information that I can add is that when I
              > > getInitialContext() like this:
              > >
              > > public static Context getInitialContext() throws Exception
              > > {
              > > String providerURL =
              > > "t3://" + CommonUtil.getProperty("ejb.server.name") +
              > > ":" + CommonUtil.getProperty("ejb.server.port");
              > >
              > > Hashtable ht = new Hashtable();
              > > ht.put(Context.INITIAL_CONTEXT_FACTORY,
              > > "weblogic.jndi.WLInitialContextFactory");
              > > ht.put(Context.PROVIDER_URL, providerURL);
              > >
              > > return new InitialContext(ht);
              > > }
              > >
              > > When the "ejb.server.name" property is one server, like "serverName1",
              > > the code works. But when the "ejb.server.name" property is clustered,
              > > like "serverName1, serverName2", the code throws the exception above.
              > >
              > > I'll definitely re-post if I come up with anything.
              > >
              > > thanks,
              > > chad small
              > >
              > > "Jason Donnell" <[email protected]> wrote in message
              > news:<[email protected]>...
              > > > Well, that was a good test. I discovered I am unable to download
              classes
              > > > from the clustered server when pointing my browser at it. Any ideas
              what
              > > > kind of misconfiguration on my part would cause that behavior?
              > > >
              > > > Thanks,
              > > > Jason Donnell
              > > >
              > > > "Dimitri Rakitine" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > Try to point your browser to make sure you can actually download
              > classes
              > > > from it
              > > > > (point it to http://yourweblogic..../classes/some/class/name.class)
              > > > >
              > > > > Jason Donnell <[email protected]> wrote:
              > > > > > Yes, I know. That's the behavior that I had always seen before. Do
              > you
              > > > know
              > > > > > of any directory configurations or properties file settings that
              > could
              > > > make
              > > > > > the stub not be downloaded correctly, even though the EJB is
              > deployed on
              > > > the
              > > > > > server?
              > > >
              > > > > > "Tao Xie" <[email protected]> wrote in message
              > > > > > news:[email protected]...
              > > > > >> That's weird, Replica-aware stub should be downloaded to the
              client
              > > > except
              > > > > >> the client is on another Weblogic server.
              > > > > >>
              > > > > >> "Jason Donnell" <[email protected]> wrote in message
              > > > > >> news:[email protected]...
              > > > > >> | I am experiencing some weird behavior when attempting to access
              > EJBs
              > > > in
              > > > a
              > > > > >> | Weblogic 5.1.0 cluster. The cluster nodes startup fine, and the
              > EJBs
              > > > are
              > > > > >> | correctly deployed. However, when my test client attempts to
              > access
              > > > them
              > > > I
              > > > > >> | get the ClassNotFoundException listed below. This same client
              can
              > > > access
              > > > the
              > > > > >> | same EJBs deployed in a non-clustered environment without any
              > > > problems,
              > > > so
              > > > > >> | it's definitely related to my cluster configuration. The
              problem
              > > > seems
              > > > to
              > > > be
              > > > > >> | that the client is not receiving the client-side stub. To
              confim
              > > > this, I
              > > > put
              > > > > >> | the stub in the client's classpath, and did NOT get the
              > > > > >> | ClassNotFoundException. Has anyone else seen this error?
              > > > > >> |
              > > > > >> | BTW, I have compiled the EJB both with and without the
              > > > <home-is-clusterable>
              > > > > >> | flag set to true. I get the same exception either way.
              > > > > >> |
              > > > > >> | Thanks for any assistance,
              > > > > >> | Jason Donnell
              > > > > >> |
              > > > > >> |
              > > > > >> | javax.naming.CommunicationException. Root exception is
              > > > > >> | java.lang.ClassNotFoundException: class
              > > > > >> |
              > > > > >
              > > >
              > com.landacorp.maxmc.ejb.security.ProviderSecurityBeanHomeImpl_ServiceStub
              > > > > >> | previously not found
              > > > > >> |
              > > > > >> | at weblogic.rjvm.MsgAbbrev.read(MsgAbbrev.java:184)
              > > > > >> |
              > > > > >> | at
              > > > > >>
              > > >
              > weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
              > > > > >> |
              > > > > >> | at
              > > >
              weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
              > > > > >> |
              > > > > >> | at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:700)
              > > > > >> |
              > > > > >> | at
              > > > > >> |
              > > > > >>
              > > > > >
              > > >
              >
              weblogic.rjvm.ConnectionManagerClient.handleRJVM(ConnectionManagerClient.jav
              > > > > >> | a:34)
              > > > > >> |
              > > > > >> | at
              > > > weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
              > > > > >> |
              > > > > >> | at
              > > > weblogic.socket.JVMAbbrevSocket.dispatch(JVMAbbrevSocket.java:393)
              > > > > >> |
              > > > > >> | at weblogic.socket.JVMSocketT3.dispatch(JVMSocketT3.java:355)
              > > > > >> |
              > > > > >> | at
              > > > > >>
              > > >
              > weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:247)
              > > > > >> |
              > > > > >> | at
              > > > > >>
              > > >
              > weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
              > > > > >> |
              > > > > >> | at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              > > > > >> |
              > > > > >> |
              > > > > >> |
              > > > > >> | --------------- nested within: ------------------
              > > > > >> |
              > > > > >> | weblogic.rmi.UnmarshalException: Unmarshalling return
              > > > > >> | - with nested exception:
              > > > > >> | [java.lang.ClassNotFoundException: class
              > > > > >> |
              > > > > >
              > > >
              > com.landacorp.maxmc.ejb.security.ProviderSecurityBeanHomeImpl_ServiceStub
              > > > > >> | previously not found]
              > > > > >> |
              > > > > >> | at
              > > > > >> |
              > > > > >>
              > > > > >
              > > >
              >
              weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.jav
              > > > > >> | a:256)
              > > > > >> |
              > > > > >> | at
              > > > weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
              > > > > >> |
              > > > > >> | at javax.naming.InitialContext.lookup(InitialContext.java:350)
              > > > > >> |
              > > > > >> | at
              > > > > >> |
              > > > > >>
              > > > > >
              > > >
              >
              com.landacorp.maxmc.ejb.security.ClusterSecurityTest.main(ClusterSecurityTes
              > > > > >> | t.java:52)
              > > > > >> |
              > > > > >> |
              > > > > >> |
              > > > > >> |
              > > > > >>
              > > > > >>
              > > > >
              > > > >
              > > > >
              > > > > --
              > > > > Dimitri
              >
              >
              >
              >
              >
              >
              

  • Lookup ejb in another application in same container

    Hi,
    The 1012 ejb faq http://www.oracle.com/technology/tech/java/oc4j/1012/collateral/OC4J-EJB-FAQ-101202.pdf states:
    "If you want to access an EJB in another application in the same OC4J container you do not have to use RMIInitialContextFactory and you can make the application that contains your application as the parent of your application from your you are trying to access EJBs from e.g. ..."
    Question: The FAQ implies that the "parent" attribute is NOT necessary to facilitate this situation and RMIInitialContextFactory may be used - is this correct? I have not found any examples that demonstrate how to do this as elsewhere in the Oracle doco they seem to imply that "parent" must be used (but not in 10.1.3). Can anyone please clarify this and/or what works and what doesn't?
    Note: The lookup of remote ejb from another application in same container does work without the parent attribute, its just subsequent calls from a 3rd application or redeploy breaks.
    My problem: I get a ClassCastException when :
    a) lookup remote EJB (in application A) following redeploy of application B
    b) the next invocation of the application A method from client application C
    Thanks for any advice,
    Paul

    Your understanding is correct.
    If you make application a to be the parent application of app b; then app b could access app a without using RMIInitialContext.
    Also you could use RMIInitialContext to obtain the object without using "parent application" approach, example:
    Hashtable env = new Hashtable();
    env.put("java.naming.factory.initial",
    "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put("java.naming.provider.url","ormi://remotehost/bmpapp");
    env.put("java.naming.security.principal","SCOTT");
    env.put("java.naming.security.credentials","TIGER");
    Context context = new InitialContext(env);
    Object homeObject =
    context.lookup("java:comp/env/EmployeeBean");
    For this servlet example, you also need to declare <ejb-ref> elements in the web.xml file:
    <ejb-ref>
    <ejb-ref-name>EmployeeBean</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>bmpapp.EmployeeHome</home>
    <remote>bmpapp.Employee</remote>
    </ejb-ref>
    In addition, orion-web.xml, must include a mapping from the logical name EmployeeBean to the actual JNDI name where the EJB is bound, as shown in the following example:
    <ejb-ref-mapping name="EmployeeBean" location="bmpapp/EmployeeBean" />
    Hope this helps,
    -Frances

  • Error in calling an EJB from another EJB

    Hello All,
    I have a scenario where i need to call a method of an ejb from another ejb.
    Both the EJB's are in different DC's.
    EG: DC1 using DC2
    I have added the public part of DC2 in DC1.
    The following code is written in DC1 to access the EJB of DC2
          MyRemote l_remote;
           MyHome l_home;
           InitialContext l_ctx = new InitialContext();
    >>       l_home = (MyHome)l_ctx.lookup("JNDI Name");
           l_remote = (MyRemote)l_home.create();
    There is no error at build time and deploy time, but at run time "MyHome" class is not found.
    Even i am not able to access the helper class defined in the DC2 at runtime.
    Please help.
    Thanks in Advance

    First off, wrong forum section.
    Check if your JNDI name is correctly placed for the bean you're calling -- check j2ee-engine.xml for that. Check the EJB container if the ear file you deployed is there and updated.
    Try placing  "localejbs/JNDI name" on your lookup parameter.
    Regards,
    Jan

  • Error when One EJB calls anothe EJB

    Hi,
    I got the following error when I use one EJB call another EJB in OAS 4.0.8.1, the code is developed in JDeveloper 3.0/Win NT 4.0/SP5.
    Can anyone give me some ideas? or is there any samples in this case?
    Thanks a lot!
    Creating an initial context
    Looking for the EJB published as 'APP/APPEJB'
    Creating a new EJB instance
    Calling APPEJB methods...
    CORBA: org.omg.CORBA.BAD_OPERATION: ; nested exception is:
    org.omg.CORBA.BAD_OPERATION:
    java.rmi.ServerException: CORBA: org.omg.CORBA.BAD_OPERATION: ; nested exception is:
    org.omg.CORBA.BAD_OPERATION:
    at javax.rmi.oas.corba.CorbaRemoteExceptionHelperValue.OBVObjFrom(Compiled Code)
    at TwoEJB._stub_APPEJB.callEJBMapping(Compiled Code)
    at TwoEJB.TwoEJBClient.main(Compiled Code)
    null

    Home handle is an object that identifies an enterprise bean. A client may serialize the handle, and then later deserialize it to obtain a reference to the enterprise bean.
    The javax.ejb.HomeHandle is similar to javax.ejb.Handle. Just as the Handle is used to store and retrieve reference to EJB objects, the HomeHandle is used to store and retrieve remote references to EJB homes. HomeHandle can be stored and later used to access an EJB home remote refrence the same way that a Handle can be serialized and later used to access an EJB object's remoe reference.
    import java.io.*;
    import javax.ejb.EJBHome;
    import javax.ejb.HomeHandle;
    public class WorkingWithEJBHandles {
    public static void main( String[] args ) throws Exception {
    EJBHome aHome = null;
    // get hold of a home interface
    HomeHandle handle = aHome.getHomeHandle();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream( bos );
    oos.writeObject( handle );
    byte[] handleAsBytes = bos.toByteArray();
    // store in the database, on file. howwever you want
    FileInputStream fis = new FileInputStream( "fileobj" );
    ObjectInputStream ois = new ObjectInputStream( fis );
    HomeHandle theHandle = (HomeHandle) ois.readObject();
    // get back the EJBHome from the HomeHandle
    aHome = theHandle.getEJBHome();
    // the same kind of logic also holds for EJBHandles, as well as
    // HomeHandles
    Transfer Object is a Design pattern. Refer to Core J2EE Design Pattern.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
    Rgds,
    Seetesh

  • I am trying to import developed images from LightRoom 5 in o Photoshop 6.  I am receiving this message and the images will not open.....'Could not open scratch file because the file is locked, you do not have necessary access permissions or another progra

    I am trying to import developed images from LightRoom 5 Photoshop 6 for further editing.  I am receiving this message and the images will not open.....'Could not open scratch file because the file is locked, or you do not have necessary access permissions or another program is using the file.  Use the 'Properties' command in the Windows Explorer to unlock the file. How do I fix this?  I would greatly appreciate it if you would respond with terms and procedures that a computer ignorant user, such as me, will understand.   Thanks.

    Have you tried restoring the Preferences yet?

  • I am trying to import developed images from LightRoom 5 into Photoshop 6.  I am receiving this message and the images will not open.....'Could not open scratch file because the file is locked, you do not have necessary access permissions or another progra

    I am trying to import developed images from LightRoom 5 into Photoshop 6.  I am receiving this message and the images will not open.....'Could not open scratch file because the file is locked, you do not have necessary access permissions or another program is using the file.  Use the 'properties' command in the Windows Explorer to unlock the file'.  This has not happened before.  How do I change this?

    Could not open a scratch file because the file is locked or you do not have the necessary access privileges. (…) | Mylen…
    Mylenium

  • When I close Photoshop CS6, the following message appears: "Could not save Preferences because the file is locked, you do not have necessary access permissions, or another program is using the file.

    When I quit Photoshop CS6, the following message appears:
    " Could not save Preferences because the file is locked, you do not have necessary access permissions, or another program is using the file. Use the ‘Get Info’ command in the Finder to ensure the file is unlocked and you have permission to access the file. If the problem persists, save the document to a different file or duplicate it in the Finder."
    If I try to change the Workspace in PS6 from Essentials to any other Workspace, the following messsage appears:
    "Could not apply the workspace because the file is locked, you do not have necessary access permissions, or another program is using the file. Use the ‘Get Info’ command in the Finder to ensure the file is unlocked and you have permission to access the file. If the problem persists, save the document to a different file or duplicate it in the Finder."
    I have checked the Sharing and Permissions section of the "Get Info" panel accessed from the Finder and I have set Read and Write Privileges for my user account for Photoshop CS6. System and Admin are also set to Read and Write.
    I have a MacBook Pro with OS X Version 10.9.5 and have all available updates for Photoshop CS6, Lightroom 5 and Bridge CS6.
    I tried uninstalling the program and downloading it again and reinstalling, but nothing changed.
    Can you help?
    Thanks,
    cjpnm

    You may get better help in Photoshop General Discussion
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll
    If FINDER means Mac, read below (and try to give more information when asking a question)
    Mac 10.9.3 workaround https://forums.adobe.com/thread/1489922
    Enable Mac Root User https://forums.adobe.com/thread/1156604
    -more Root User http://forums.adobe.com/thread/879931
    -and more root user http://forums.adobe.com/thread/940869?tstart=0

  • Photoshop won't start: Could not open a scratch file because the file is locked, you do not have necessary access permissions, or another program is using the file.

    Adobe Photoshop CS6 Extended
    "Could not open a scratch file because the file is locked, you do not have necessary access permissions, or another program is using the file."
    I've tried finding and checking and fixing permissions but no success.
    This happened from one day to the next. I think it has to do with the sn attached to the disk rather then the motherboard. I have the suite co-installed with Symphony 5.05. I've tried reinstalling.
    What's to b done? The rest of the Creative Suite 6 (AE, AI etc.) works fine.
    Anyone...?
    Loui

    Have you tried restoring the Preferences yet?

  • How to call one EJB in another EJB?

    How to call one EJB in another EJB? Please explain with some example code.

    To refer a Ejb from another Ejb include <ejb-ref> element in ejb-jar.xml
    <session>
    <ejb-name>EjbA</ejb-name>
    <ejb-ref>
    <ejb-ref-name>EjbB</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.ejb.EjbBHome</home>
    <remote>com.ejb.EjbB</remote>
    </ejb-ref>
    </session>
    Include a <reference-descriptor> in weblogic-ejb-jar.xml
    <weblogic-enterprise-bean>
    <ejb-name>EjbA</ejb-name>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>EjbB</ejb-ref-name>
    <jndi-name>com.ejb.EjbBHome</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    In EjbA Bean class refer to EjbB with
    a remote reference to EjbB.
    InitialContext initialContext=new InitialContext();
    EjbBHome EjbBHome=(EjbBHome)
    initialContext.lookup("com.ejb.EjbBHome");
    EjbB ejbB=EjbBHome.findByPrimaryKey(primarykey);

  • Ejb-link not working when i access ejb in different ear

    Hi All
    I am here trying to access ejb's which is in different ear, I am providing ejb-link inside web.xml of war file deployed inside deffirent ear file.
    I am using wls8.1sp5. I tried different combination with elb-link name , but its not working . <ejb-ref>
    <ejb-ref-name>ejb/AuditService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.audit.ejb.AuditServiceHome</home>
    <remote>com.onstar.audit.ejb.AuditService</remote>
    <ejb-link>ccarenewal.jar#AuditService</ejb-link>
    </ejb-ref>
    <ejb-ref>
         <ejb-ref-name>ejb/AccountService</ejb-ref-name>
         <ejb-ref-type>Session</ejb-ref-type>
         <home>com.onstar.account.ejb.AccountServiceHome</home>
         <remote>com.onstar.account.ejb.AccountService</remote>
         <ejb-link>ccarenewal.jar#AccountService</ejb-link>
         </ejb-ref>
    Exception:weblogic.management.ApplicationException: activate failed for sbwo Module: sbwo Error: weblogic.management.DeploymentException: Could not setup environment - with nested exception: [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ccarenewal.jar#AuditService' declared in the ejb-ref or ejb-local-ref 'ejb/AuditService' in the application module 'accountadj.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.] weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ccarenewal.jar#AuditService' declared in the ejb-ref or ejb-local-ref 'ejb/AuditService' in the application module 'accountadj.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct. at weblogic.deployment.EnvironmentBuilder.addEJBLinkRef(EnvironmentBuilder.java:658) at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:467) at weblogic.servlet.internal.CompEnv.init(CompEnv.java:123) at weblogic.servlet.internal.WebAppServletContext.activate
    I will appreciate any help.
    Rajiv

    Rob,
    Thanks for your reply.
    Below is all deployment descriptor entries i have(ejb-jar.xml, weblogic-ejb-jar.xml, web.xml, weblogic.xml)
    please correct me if i have wrong entries any where.
    ejb-jar.xml
    ejb-ref>
    <description />
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.account.ejb.AccountServiceHome</home>
    <remote>com.onstar.account.ejb.AccountService</remote>
    <ejb-link>AccountService</ejb-link>
    </ejb-ref>
    weblogic-ejb-jar.xml
    <ejb-reference-description>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <jndi-name>cca/AccountService</jndi-name>
    </ejb-reference-description>
    web.xml
    <ejb-ref>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.account.ejb.AccountServiceHome</home>
    <remote>com.onstar.account.ejb.AccountService</remote>
    <ejb-link>ccarenewal.jar#AccountService</ejb-link>
    </ejb-ref>
    weblogic.xml
    <ejb-reference-description>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <jndi-name>cca/AccountService</jndi-name>
    </ejb-reference-description>
    I appreciate your help.
    Thanks
    Rajiv

  • Could not save Preferences because the file is locked, you do not have necessary access permissions, or another program is using the file. Use the 'Get Info' command in the Finder to ensure the file is unlocked and you have permission to access the file.

    I have this massage every time close ps cc
    Could not save Preferences because the file is locked, you do not have necessary access permissions, or another program is using the file. Use the ‘Get Info’ command in the Finder to ensure the file is unlocked and you have permission to access the file. If the problem persists, save the document to a different file or duplicate it in the Finder.

    You may get better help in Photoshop General Discussion
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll
    If FINDER means Mac, read below (and try to give more information when asking a question)
    Mac 10.9.3 workaround https://forums.adobe.com/thread/1489922
    Enable Mac Root User https://forums.adobe.com/thread/1156604
    -more Root User http://forums.adobe.com/thread/879931
    -and more root user http://forums.adobe.com/thread/940869?tstart=0

  • How to access EJB deployed in JBOSS 4 from Creator

    Hello.
    I am trying to access EJBs deployed on JBOSS in order to develop a web app client, when I import the EJB set from Creator (sessions and entities packages in a jar file) I got the following error message....."No EJB set found in file....." .
    I presume there is an kind of xml file description specific for Sun App Server missing. I would like to know if there is other way to expose EJB in creator?....maybe write a config file by hand.
    I already read the tutorials related to EJB but those only use pre build EJB jars for Sun App Sserver.
    Also I read all the posted about JBoos and EJB in this forum but those are pretty general.
    By the way I have Delegate classes to access the EJB. How do I register my delegates in Creator in order to expose their methods?
    I�ll really appreciate some light in this matter.
    Thanks in advance!!!

    Hi,
    The below forum thread may help you :
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=51321
    Thanks,
    Runa.

  • Access EJB from Servlet that in different archive?

    <font class="mediumtxt">package kyro.ejb.session;
    import javax.ejb.*;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(name="StandAlone")
    @Remote(StandAlone.class)
    public class StandAloneBean
    implements StandAlone, StandAloneLocal
    public StandAloneBean() {
    public String sayHello() {     
    return "sayHello";
    I want to access ejb from servlet that .war and .jar not in single .ear. I want to try that just with annotation not xml descriptor cause is easy to understand for me. I use Glassfish. But i can't lookup that ejb. How can i lookup that ejb with jndi? Can't you give me example of servlet to access that? I not use JNDI.properties, are that caused i can't access my ejb? I just thing .war and.jar in one server, are i have to used JNDI.properties. can you explain how to use JNDI.properties in servlet or separate file?
    </font>

    But i can't lookup that ejb. How are you trying and what exception is occurring?
    How can i lookup that ejb with jndi? [https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html|https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html]
    m

  • Issue in accessing EJB from plain java

    Hi,
    I am new to OAS. I am using OAS 10.1.2.
    I want to access EJB which runs inside OAS, through a plain java program which runs from outside the OAS environment (standalone java program).
    I am confused on what to use. RMIInitialContextFactory or ApplicationClientInitialContextFactory for the context in the java program.
    what should be the provide URL ?
    java.naming.provider.url","ormi://hostname:18140/
    is it "ormi" or something else? what is the port number should i use. there are many ports in this OAS. i see that in the console("Ports") link.
    also let me know what should i mention in the EJB xml descriptor.
    Is this lookup to be done by retrieving from jndi?
    pls help.
    Thanks,
    Sukumar
    with this confusion i developed an EJB with the following details
    ejb-jar.xml
    <ejb-ref>
         <ejb-ref-name>ejb/testDetails</ejb-ref-name>
         <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.xxx.xxx.testDetailsHome</home>
    <remote>com.xxx.xxx.testDetails</remote>
         </ejb-ref>
    orion-ejb-jar.xml
    <entity-deployment name="ejb/testDetails" location="ejb/testDetails"
    Client Java program
    public class testDetailsClient
    public static void main(String [] args)
    testDetailsClient testDetailsClient = new testDetailsClient();
    try
    Context context =getInitialContext();
    testDetailsHome testDetailsHome = (testDetailsHome)PortableRemoteObject.narrow(context.lookup("java:comp/env/ejb/testDetails"), testDetailsHome.class);
    testDetails testDetails;
    catch(Throwable ex)
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException
    Hashtable env = new Hashtable();
    env.put("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
    //env.put("java.naming.factory.initial","com.evermind.server.ApplicationClientInitialContextFactory");
    env.put("java.naming.provider.url","ormi://host_name:18140/"); //23791 18140
    env.put(Context.SECURITY_PRINCIPAL, "ias_admin");
    env.put(Context.SECURITY_CREDENTIALS, "abc123");
    InitialContext context = new InitialContext(env);
    return context;
    if i execute this, it says
    javax.naming.NameNotFoundException: java:comp/env/ejb/testDetails not found
    18140 is Application Server Control RMI port.
    if i run the same code with ApplicationClientInitialContextFactory, it throws exception saying
    java.lang.InstantiationException: No location specified and no suitable instance of the type 'com.testdetails.testDetails' found for the ejb-ref ejb/testDetails
         at com.evermind.server.administration.ApplicationResourceFinder.getEJBHome(ApplicationResourceFinder.java:268)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    javax.naming.NamingException: Error reading application-client descriptor: No location specified and no suitable instance of the type 'com.testdetails.testDetails' found for the ejb-ref ejb/testDetails
         at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:161)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.<init>(InitialContext.java:195)
         at com.testdetails.testDetailsClient.getInitialContext(testDetailsClient.java:89)
         at com.testdetails.testDetailsClient.main(testDetailsClient.java:20)
    pls help

    Hi,
    you do not have to package your EJB and PAR together! You can deploy them separately and then reference the J2EE Application from your PAR or vice versa to access it.
    For instance you can access the EJB from your PAR as described here:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/42/9ddf20bb211d72e10000000a1553f6/frameset.htm
    Or you can access a Portal application from J2EE like described here:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/42/9ddd0cbb211d72e10000000a1553f6/frameset.htm
    Even if you package your PAR in to the same EAR with your EJB they will result in two different containers on the J2EE Engine and you will have to reference them as described in the link above to access the functionality of one component from the other.
    Best regards,
    Stefan Brauneis

Maybe you are looking for

  • Single Sign On -- Enterprise portal and BI JAVA

    Hi, I need to watch reports BI J2ee from an EP 7.00. I have configured the single sign On but it works just for ABAP BI Stack. This is what I have done for SSO JAVA: Importing the BI JAVA Certificate to the SAP NetWeaver 2004s Portal (SAP EP 7.0)    

  • How can I read a binary file stream with many data type, as with AcqKnowledge physio binary data file?

    I would like to read in and write physiological data files which were saved by BioPac�s AcqKnowledge 3.8.1 software, in conjunction with their MP150 acquisition system. To start with, I�d like to write a converter from different physiodata file forma

  • Flat file to xml file

    hello I am having a scenario a flat file to XML file. in the comm. channel of the sender I made a content conversion to the file and I see in the SXMB MONI and it looks ok. the output file, is declared as a file and I recieve an empty xml file. what

  • Export and import Oracle 10G database

    Hello all Can anyone tell me once for all how can i backup oracle 10G database and restore it in other computer (export and import) thanks alot Ron

  • Update FIBU Debitor

    Hello, I have to programm a correction report which should update different fibu debitors. Could anyone tell me how to do this? Which table should be used to update the name and adress of the fibu debitor? The KNA1? The report should run in the backg