Calling EJB on specific node from EJB on another node

Hello,
In cluster environment what is the best approach to call session bean on one node from session bean on another node? The scenario would allow synchronization of local cache (singleton) between two nodes. I understand that there are other options like SingletonService, distributed cache etc., but I wonder how hard would be to implement synchronization calls between nodes on remote session beans.
Thanks
Greg K.

Hi,
Based on your query on thread i can suggestthe following as a best option: Re: replica-aware stub.
Use the JMX code to get the Cluster details....It means the name of the Cluster members and their Listen port and Listen Addresses then in your Client code do the following:
InitialContext ic = getInitialContext(“t3://ClusterMemberOne:7002,ClusterMemberTwo:7003″);Like that whatever InitialContext object you will get will be able to provide you the correct EJB from any newly added member of the Cluster as well..
You can enhance the JMX code mentioned in the following link : http://middlewaremagic.com/weblogic/?p=210 you will need to add only 2-3 lines to make it work for your requirement.
Just tweak the following code to get the ListenPort and ListenAddress of cluster Nodes:
public void printClusterInfo() throws Exception
     ObjectName[] serverRT = getServerRuntimes();
     Hashtable server_states = new Hashtable();
     for(ObjectName ser: serverRT)
          server_states.put((String) connection.getAttribute(ser,”Name”), (String) connection.getAttribute(ser,”State”));
     }Thanks
Jay SenSharma

Similar Messages

  • How to call a servlets specific function from a link?

    hi all ! Im trying to call a function callled A from a link in my JSP. Im not using any buttons. How do I make this work?
    Thanks in advance.

    Hi,
    A solution to call A might include a custom JSP element. Inside the code for the
    element, you can get a reference to whatever object that "does an A", and make a call on the respective method/function/behavior. You need to extend the standard tag handler classes.
    Good luck!

  • Insert Parent Node From Tree To Another

    Hello
    My problem is: haw can I insert or shift Parent Node with its child from tree to another without use SQL query.
    I should find the child and if this child has a child to shift with the parent to another tree, there are no tools or function can return the child of the node? Or what is the best procedure to do that?
    I will be thankful if there some one can help me
    Regards

    You can grab the data with ftree.populate_group_from_tree and then use ftree.add_tree_data to put it in another tree.

  • Calling a Report/Transaction iview from Webdynpro..

    Hi all,
              Our first issue is we have a scenareio, where we need to execute reports(ABAP Program) from webdynpro. Is it possibile to execute a standard report from webdynpro? using JCO. Also tell me how to pass the input/output parameters.I am not allowed to create RFC.I can use only standard BAPI.
              Our second issue is we created one transaction type callable object, and we want to call this transaction callable object from webdynpro, in another callable object in GP. Is this Possibile in webdynpro. We tried using portal navigation, but it is working for normal webdynpro iviews only, not for url iviews also.
              Does any body know the answer for the above issues. please let us know.
             Thanks in advance.

    hi,
    1) it is not possible in web dynpro to call abap reports, what you can do is creating wrapper of Remote enabled FM around the report. But you dont have authorisation to create BAPI, so gotta take use of standard BAPIs.
    ABAP Report in WebDynpro
    this link will help you out for that(calling standard bapi in WD)
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/webcontent/uuid/f0b0e990-0201-0010-cc96-d7ecd2e51715 [original link is broken]
    2) go thru this links
    WebDynpro Application as callable object in GP?
    Webdynpro callable object - RFC model
    implenting webdynpro as a Calable Object with GP Interface
    hope it helps
    regards

  • Calling Web Service from EJB using HTTP Client

    Hi,
    Scenario:
    I need to Call a Web Service from an EJB Application.I used HttpClient for calling the Web Service in the EJB Application. When i call the execute method of the HttpCLient it throws an exception
    The element type "META" must be terminated by the matching end-tag "</META>"
    The input XML does not have a node called META.
    When i call the Web Service using Http Client form an Java Application it is working fine.
    Kindly Suggest me the changes/steps that needs to be done
    Regards,
    S.V.Satish Kumar

    Hi Manish,
    SOAP adapter does pass the message to XI (this message contains SOAP envelope although XI expects to get message without it), and during the mapping step i get "Runtime Exception in Message-Mapping transformatio~".
    I suppose it's because i created proxy manually. I did so because when i imported WSDL, and tried to generate proxy in CRM, i got an error message that said that proxy couldn't be generated because external definitions are only allowed in XI 3. But my XI version is 3.0! And when I generate the same proxy in my R/3 system that is installed on WAS 640, it works.
    What can I do?
    Cheers,
    Anya.

  • Call RFC from EJB using SSO

    Can anyone point me in the right direction on the best practice for calling an RFC using SSO from an EJB?
    When using the local interface for the EJB, the only solution I see is to pass the authenticated IUser instance from the portal component to the EJB business method through the method signature.
    I am guessing that there is a better way to get access to an authenticated user in the EJB container.

    Thanks for the reply.
    Actually I was able to solve the problem last night. To get SSO to work in my local EJBs I created an RFC destination in the destination service using the visual administrator. I then used the destination service at runtime to pull the system definition from the J2EE system definitions store instead of the portal system landscape definitions and my connection object was created as expected.
    Here is the code to create the connection in my EJB business method:
    //get the user
    IUser user = UMFactory.getUserFactory().getUserByUniqueName(this.myContext.getCallerPrincipal().getName());
    // get the destination service
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sapportals.portal.prt.registry.PortalRegistryFactory");
    InitialContext context = new InitialContext(env);
    IDestinationsService destinationsService =
         (IDestinationsService) context.lookup(IDestinationsService.SERVICE_JNDI_NAME);
    // define a destination filter to restrict to the RFC defined destinations
    DestinationFilter destinationFilter1 =
         new DestinationFilter(DestinationFilter.SOURCE_J2EE_DESTINATION_SERVICE, DestinationFilter.TYPE_SAP);
    // get a user specific connection
    IConnection connection = destinationsService.getConnection(user, "ECC", destinationFilter1);

  • Error while calling PI webservice from EJB

    Hi Experts,
    We are getting exception while calling PI webservice from EJB which is deployed in CE 7.2. Earlier we used to call the same webservice but from different PI system at that it worked fine. Now we have changed the consumer proxies required in CE and tried to call from CE and it is throwing error. We have checked usernames and passwords that we are using to call the service and that is working fine. PI team tested from their side and li is also fine. We have also restarted the CE system but invain. Can somebody help on this.  The below is the trace that we got.
    Location: com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding
    Text: Connection IO Exception. Check nested exception for details. (Connection reset).
    [EXCEPTION]
    com.sap.engine.services.webservices.espbase.client.bindings.exceptions.TransportBindingException: Connection IO Exception. Check nested exception for details. (Connection reset).
    at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.outputSOAPMessage(SOAPTransportBinding.java:419)
    at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.call_SOAP(SOAPTransportBinding.java:1364)
    at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.callWOLogging(SOAPTransportBinding.java:990)
    at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.call(SOAPTransportBinding.java:944)
    at com.sap.engine.services.webservices.espbase.client.jaxws.core.WSInvocationHandler.processTransportBindingCall(WSInvocationHandler.java:168)
    at com.sap.engine.services.webservices.espbase.client.jaxws.core.WSInvocationHandler.invokeSEISyncMethod(WSInvocationHandler.java:121)
    at com.sap.engine.services.webservices.espbase.client.jaxws.core.WSInvocationHandler.invokeSEIMethod(WSInvocationHandler.java:84)
    at com.sap.engine.services.webservices.espbase.client.jaxws.core.WSInvocationHandler.invoke(WSInvocationHandler.java:65)
    at $Proxy780.mioaRDMDataDistribution(Unknown Source)
    at com.MDMEventListener.callToPIWS(MDMEventListener.java:100)
    at com.MDMEventListener.ListenerMethod(MDMEventListener.java:173)
    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:597)
    at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_WS.invoke(Interceptors_WS.java:31)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:39)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:23)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
    at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
    at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
    at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
    at com.sap.engine.services.ejb3.webservice.impl.DefaultImplementationContainer.invokeMethod(DefaultImplementationContainer.java:203)
    at com.sap.engine.services.webservices.espbase.server.runtime.RuntimeProcessingEnvironment.process0(RuntimeProcessingEnvironment.java:730)
    at com.sap.engine.services.webservices.espbase.server.runtime.RuntimeProcessingEnvironment.preProcess(RuntimeProcessingEnvironment.java:682)
    at com.sap.engine.services.webservices.espbase.server.runtime.RuntimeProcessingEnvironment.process(RuntimeProcessingEnvironment.java:324)
    at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPostWOLogging(ServletDispatcherImpl.java:199)
    at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:65)
    at com.sap.engine.services.webservices.servlet.SoapServlet.doPost(SoapServlet.java:61)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)
    at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:38)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:404)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:204)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:440)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:429)
    at com.sap.engine.services.servlets_jsp.filters.DSRWebContainerFilter.process(DSRWebContainerFilter.java:38)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:82)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:268)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)
    at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
    at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:54)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:42)
    at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
    at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
    at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:447)
    at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:264)
    at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
    at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)
    Caused by: java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:168)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
    at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.readLine(HTTPSocket.java:950)
    at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.getInputStream(HTTPSocket.java:414)
    at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.getResponseCode(HTTPSocket.java:319)
    at com.sap.engine.services.webservices.espbase.client.bindings.ClientHTTPTransport.getResponseCode(ClientHTTPTransport.java:209)
    at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.outputSOAPMessage(SOAPTransportBinding.java:385)
    ... 78 more
    Regards,
    Pradeep

    Hi Pradeep,
    this looks like if the server is not reachable. Have you checked if both server are able to communicate? Maybe firewall rules block the request.
    Regards,
    Tobias

  • Calling stored procedure from EJB in JSever

    I have some trouble to call stored procedure from EJB deployed to JServer on Oracle8i (815).
    I have been able to sucessfully test the stored procedure using thin client JDBC driver. But when I user the default connection in JServer, the stored procedure never got called. Is there any restriction of EJB in JServer?
    Thanks
    null

    Thanks man! that was a great help. looks like i am almost there. i created those items t obe hidden.
    now i am passing three parameters to the procedure. my url for that column value looks like this,
    javascript:P65_PARTITION_ID=#PARTITION_ID#;P65_DBC=#DBC#;P65_FILE_ID=#FILE_ID#;doSubmit('Sku_Save');
    the #DBC# parameter is a name of the person that has spaces(firstname lastname). i am getting a javascript error saying,
    Line: 1
    Char: 37
    Error:Expected ';'
    i see that char 37 is the space after firstname.
    any idea how i should get rid of this error.
    Also, as you have been very helpful, a question further beyond :). the above procedure will return a OUT varchar parameter. i guess i have to create another item for that. how do i read it and display just below my report as text.
    Thanks Again!

  • JCo 3.0  - RFC call from EJB with SSO

    Hello,
    I am trying to call abap using JCo 3.0 from EJB (NW CE 1.0). I have configured destination on server with authentication method to use SAP Logon tickets. But when I call my EJB method that looks like this:
    JCoDestination dest=JCoDestinationManager.getDestination("RFCCallTest");
    JCoRepository repo=dest.getRepository();
    JCoFunction f= repo.getFunction("ZMG_RET_NAME");
    JCoParameterList in=f.getImportParameterList();
    in.setValue(0, "param1");
    f.execute(dest);
    I get an exception when executing the first line of code:
    Message:     Exception occurred during lookup of RFC Destination RFCCallTest: No SAP logon ticket found
    Category:     /System/Security
    Location:com.sap.security.core.server.destinations.provider.DestinationsProviderFrame.getDestinationProperties()
    When I change the destination authentication method to Technical user it works well.
    SSo between the servers works.
    This scenarion also works when I use older JCo implementation (2.x)
    BR
    Viktor

    Hi Bill,
    I too faced the same problem for quite some time on SP9. I thought it was the adapter problem that persisted ...but it was not !!
    After importing the RFC structure into XI, if the name of the imported RFC program is renamed/changed on R/3 side, then you will get the same error "lookup of binding via CPA-cache failed for AdapterType RFC, AdapterN."
    So make sure that RFC program name on the R/3 side was not changed/renamed after you have imported the RFC structure into XI.
    If the RFC program name had changed, make sure you reimport the RFC structure to avoid this problem.
    Regards,
    Sridhar

  • Calling an EJB deployed in OC4J from Java Stored Proc in Oracle

    Hello!
    Trying to make a call to an EJB deployed in OCJ4 from a oracle java stored proc. After loaded orion.jar and crimson.jar lib into SCOTT schema, I can't get the JNDI Context working because of this error:
    ============================================
    javax.naming.NoInitialContextException: Cannot instantiate class:
    com.evermind.server.ApplicationClientInitialContextFactory. Root exception is
    java.lang.ClassNotFoundException:
    com/evermind/server/ApplicationClientInitialContextFactory
    at java.lang.Class.forName0(Class.java)
    at java.lang.Class.forName(Class.java)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java)
    at javax.naming.InitialContext.init(InitialContext.java)
    at javax.naming.InitialContext.<init>(InitialContext.java)
    ===============================
    I did load the java with "loadjava" with on time with the "resolve" option and time time no option and still no working.
    Here is the EJB client code:
    =======================================
    import java.sql.*;
    import java.util.*;
    import javax.naming.*;
    import com.evermind.server.ApplicationClientInitialContextFactory;
    class EmpRemoteCall {
    public static void main(String[] args) {
    System.out.println(getEmpName());
    public static String getEmpName() {
    String ejbUrl = "java:comp/env/ejb/Emp";
    String username = "admin";
    String password = "admin";
    Hashtable environment = new Hashtable();
    environment.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    environment.put(Context.PROVIDER_URL, "ormi://127.0.0.1/testemp");
    environment.put(Context.SECURITY_PRINCIPAL, username);
    environment.put(Context.SECURITY_CREDENTIALS, password);
    //environment.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    //environment.put(javax.naming.Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    com.kboum.sertir.essais.EmpHome homeInterface = null;
    try {
    Class.forName("com.evermind.server.ApplicationClientInitialContextFactory", true, ClassLoader.getSystemClassLoader());
    System.out.println("Creating an initial context");
    Context ic = new InitialContext(environment);
    System.out.println("Looking for the EJB published as 'java:comp/env/ejb/Emp'");
    homeInterface = (com.kboum.sertir.essais.EmpHome) ic.lookup(ejbUrl);
    catch (CommunicationException e) {
    System.out.println("Unable to connect: " + ejbUrl);
    e.printStackTrace();
    //System.exit(1);
    catch (NamingException e) {
    System.out.println("Exception occurred!");
    System.out.println("Cause: This may be an unknown URL, or some" +
    " classes required by the EJB are missing from your classpath.");
    System.out.println("Suggestion: Check the components of the URL," +
    " and make sure your project includes a library containing the" +
    " EJB .jar files generated by the deployment utility.");
    e.printStackTrace();
    //System.exit(1);
    catch (ClassNotFoundException e) {
    System.out.println("Unable to connect: " + ejbUrl);
    e.printStackTrace();
    //System.exit(1);
    try {
    System.out.println("Creating a new EJB instance");
    com.kboum.sertir.essais.Emp remoteInterface = homeInterface.findByPrimaryKey(Integer.valueOf("7369"));
    System.out.println(remoteInterface.getENAME());
    System.out.println(remoteInterface.getSAL());
    remoteInterface.setSAL(2);
    System.out.println(remoteInterface.getSAL());
    return remoteInterface.getENAME();
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    return "error";
    null

    What I did to solve this problem was to
    create a simple RMI remote object that
    resides outside the database JVM and that
    serves as a proxy EJB client for your java
    stored procedure. The stored procedure can
    invoke a method on the remote RMI object
    which then looks up the EJBean's home
    interface and invokes the relevant method on
    the bean's remote interface, and relays any
    return values back to the java stored
    procedure.
    Hope this helps,
    Avi.
    null

  • Calling a Java aplication from EJB container

    We have a standalone Java application which is thread safe, and works well when called from web container. Now we are planning to call this app from EJB container (We are using OC4J) i.e our client apps which call this Java app will be written as EJBs. Our concern is to make sure that our application's thread mechanism does not conflict with EJB Container's thread mechanism. Any thoughts on this will be appreciated. Thanks. (Mubashar Tariq)

    Thread management isn't really a problem as long as you keep a couple of things in mind:
    1. You(r EJB) can only act on incoming calls (or messages) or so to say
    2. You're not allowed to spawn threads when acting on an incoming call
    3. Calls via RMI may timeout (check the default SocketFactory for the timeout, I think it's about 3 mins)
    Calling an outside application isn't really a problem as well I think. As long as you remember the two rules above and the following: an EJB cannot have two 'clients'. So if your application gets called and you're somehow able to reach (within your standalone application) the EJB, you're not allowed to call it (because it's already called by somebody else, on which the EJB acts).
    Also you should check if OC4J (I don't really know) offers the possibility of having resourcemanagers for RMI. Just opening an RMI connection might not be possible from an EJB. HTTP however is (but then you would have to open an HTTP server at the client, the rules above would not apply then however).
    The solution I see:
    either bind a Object in the RMI Registry you create at the client or open a ServerSocket. Somehow the EJB making the client application gets called (via the Web part???), it contacts the client application via the ServerSocket or the RemoteObject and does it work. Then the business method ends and the thread the EJB is working on dies...
    alef

  • Calling .ejb from .ejb

    I am using Weblogic Workshop WLS8.1. I have one .ejb calling another .ejb. Appearenlty,
    MyBeanHome.java MyBean.java resolve in the workshop. But they are not resolving
    when I use ant build. Any suggestions.
    Thanks

    Hi John,
    check the following URLS's for your requirement
    1>procedure  for  Accessing  WebService in ejb By using NetWeaver,
    2>i am using webservice in ejb but it is giving Naming exception in NetWeaver  (if you get naming exception while calling webservice from ejb)
    3>http://help.sap.com/saphelp_webas630/helpdata/en/2c/ce9535c22ecd4db8820e238c3acce0/frameset.htm    (Accessing the Web Services Context from a WS-EJB )
    4>Webservice call does not return data
    Do reward points if it helps

  • How to call EJB deployed on OC4J from java stored procedure?

    Hello,
    I'd like to call EJB from java stored procedure. My example works fine from command line, but the problem seems to be with deployment of this code into database. Especialy I'm wondering how to reference jars like oc4jclient.jar, ejb.jar, ... from java stored procedure.
    Is there some example how to do that ?
    Can You help me please ?
    Many thanks,
    Radim Kolek,
    Eurotel Prague.

    Hi,
    You may want to check up this thread
    Calling JBoss EJBs from Java stored procedure
    Hope this helps,
    Sujatha.
    OTN Group.

  • ejb-client-jar example from the core specification

    Hello all,
    the ejb3.0 specification says (chapter 60 page 241):
    the jar file that contains the client should contain one of the following: 
    • a reference to the ejb-client JAR file 
    • a reference to the ejb-jar file that contains the client view classes 
    • a copy of the client view classes  There is also an example on page 242:
    In this example, the Bean Provider has chosen to package the enterprise bean client view classes in a
    separate jar file and to reference that jar file from the other jar files that need those classes. Those classes
    are needed both by ejb2.jar, packaged in the same application as ejb1.jar, and by ejb3.jar,
    packaged in a different application. Those classes are also needed by ejb1.jar itself because they
    define the remote interface of the enterprise beans in ejb1.jar, and the Bean Provider has chosen the
    by reference approach to making these classes available.
    The deployment descriptor for ejb1.jar names the client view jar file in the ejb-client-jar
    element. Because ejb2.jar requires these client view classes, it includes a Class-Path reference to
    ejb1_client.jar.
    The Class-Path mechanism must be used by components in app2.ear to reference the client view jar
    file that corresponds to the enterprise beans packaged in ejb1.jar of app1.ear. Those enterprise
    beans are referenced by enterprise beans in ejb3.jar. Note that the client view jar file must be
    included directly in the app2.ear file.
        app1.ear:
            META-INF/application.xml
            ejb1.jar Class-Path: ejb1_client.jar
                deployment descriptor contains:
                    <ejb-client-jar>ejb1_client.jar</ejb-client-jar>
            ejb1_client.jar
            ejb2.jar Class-Path: ejb1_client.jar
        app2.ear:
            META-INF/application.xml
            ejb1_client.jar
            ejb3.jar Class-Path: ejb1_client.jarNow finally my questions are:
    1. Why did we need to include the ejb1_client.jar in app2.ear (or even in app1.ear), wasn't it enough to deploy the ejb1_client.jar separately then refer to it (using class-path in Manifest, or may be just by using <ejb-client-jar>) as the bullets quoted first suggest?
    2. How come we didn't need to use <ejb-client-jar> for ejb2.jar
    3. Since both of ejb1.jar and ejb2.jar are packaged in app1.ear couldn't we simply refer to the ejb1_client.jar in the Manifest file of app1.ear?
    Please, I appreciate your input on this

    I am guessing here and please correct me if I am wrong:
    ejb1.jar uses interfaces in ejb1_client.jar as the interface for some of the beans so we needed to use ejb-client-jar and we needed a reference in the manifest file.
    ejb2.jar uses some of the claess/interfaces as may be a return type but not as an interface for one of its beans so we didn't need to use ejb-client-jar but we needed an entry in the manifest file.
    regarding app1.ear, we can put the ejb1_client.jar in the META-INF/lib app1.ear without the need for any entries in the manifest files.
    Edited by: malrawi on Jun 14, 2009 11:59 PM

  • Calling Servlets from EJB

    Please can anyone help me out of how to make sevlet calls from EJB? Example source code if available will be of great help too.
    I know that this is a rare senario but this is required for a very urgent work.

    Vladimir - thanks again !!
    I am getting closer, I have 3 errors for "cannot resolve symbol"
    .../work/jsp_testmap1175186470750.java:78: cannot resolve symbol
    symbol  : class mappingservices
    location: package appsrv
    fsd.oms.appsrv.mappingservices mappingServicesLocal = null;
                          ^
    .../work/jsp_testmap1175186470750.java:79: cannot resolve symbol
    symbol  : class mappingservices
    location: package appsrv
    mappingServicesLocal = (fsd.oms.appsrv.mappingservices)pageContext.getAttribute("mappingServicesLocal", PageContext.SESSION_SCOPE);
                                                               ^
    .../work/jsp_testmap1175186470750.java:85: cannot resolve symbol
    symbol  : class mappingservices
    location: package appsrv
    mappingServicesLocal = (fsd.oms.appsrv.mappingservices) Beans.instantiate(getClass().getClassLoader(), "fsd.oms.appsrv.mappingservices");
                                                               ^
    3 errors
    (all ^ point between appsrv and mappingservices)
    This appears to be a classpath issue? Could this fall under this SAP note?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_jas/~form/handler
    Or do you know of issues with string methods instead of object methods?
    Those were a couple of posts I found, that seemed similar, but not really. I appreciate the experienced help and your thoughts!
    thanks again - Allen

Maybe you are looking for

  • Sorry anyone check for me??? problem....or any advanced features

    import java.util.Scanner; public class JPetWorld      public static void main(String[] args) Scanner sc = new Scanner(System.in);           System.out.print("Enter Name of Pet : ");           String name = sc.nextLine(); System.out.print("Enter Gende

  • BPEL or PL/SQL

    In following situation where business logic needs to be applied Using FTP Adapter reading a file then need to apply some business logic and then pushing the data to DB Here to apply business logic can I use BPEL or PL/SQL Which one is better option i

  • Where does FireFox get the default value of a preference from. What is the format of the file that has the default value?

    Where does FireFox get the default value of a preference from. What is the format of the file that has the default value?. I need the actual default value for a particualr preference. About:config does show some default values but I need the source f

  • Ai::UnicodeString.as_Platform throwing Unhandled exception

    Hi I'm trying to read layer titles from an AI file using the following code, but the application keeps on throwing an Unhandled exception Access violation reading location error. Here's the code. This code populates a list box with the layers in the

  • Time restriction on Batch Job

    Hi Friends, I have a requirement to set up a batch job to run every 15 minutes to print some labels. The catch is that it has to run only on working days between 6:15 AM and 6:15 PM. I believe that we can schieve the working days part by giving the f