Calling non ejb from ejb using jndi lookup

Is it possible to call a non ejb java object from an ejb using a jndi lookup?
For example, we have a java class where main registers itself with our application server (JBoss 3.0.1). We have a test client that can use jndi to look up the object, but we can't get an ejb inside the application server to use the object.
Are we trying to do the impossible? If my question is not clear, please let me know so I can try to clarify.
Thanks

JNDI uses factories to create objects.
It's possible that JBoss has a Bean Factory which you can use to create your instance.
Tomcat has a Bean factory in its JNDI implementation. I use it just as you have indicated.
The JBoss documenation may help?
Dave

Similar Messages

  • Calling BRM from UDF using JNDI lookup with @EJB annotation

    Hi Experts
    I am trying to implement a UDF to invoke my BRM Rules set via JNDI Lookup instead of a SOAP Channel lookup.
    I have had a look at the following links/docs:
    Calling BRM from UDF using Public API
    http://www.gleanster.com/system/resources/W1siZiIsIjIwMTIvMDgvMDcvMjAvNDcvNTAvNDMvVGhpbmdzX1lvdV9TaG91bGRfS25vd19hYm91dF9TQVBfTmV0V2VhdmVyX0JSTS5wZGYiXV0/Things%20You%20Should%20Know%20about%20SAP%20NetWeaver%20BRM.pdf
    For item 1 above, the example looks really good, but it doesnt explain how I get access to the following required imports from my UDF:
    import com.sap.brms.qrules.ejb.*;
    import com.sap.brms.qrules.engine.AbstractProject;
    import com.sap.brms.qrules.engine.RuleEngine;
    import com.sap.brms.qrules.engine.RulesetContext;
    import javax.ejb.EJB;
    The second document is really good as well, but I could not figure out how to get it to work from my UDF.
    So, can anyone help me to understand specifically what is required to get this to work?
    Is is possible to invoke the rule set from my UDF?
    How do I give my UDF access to all the required jars/imports?
    I have manage to create a new DC (Development Component) with a public part and this enables me to get my code to compile on my local PC but I am not able to activate it due to the server not having access to the same java packages as my local copy.
    Any help would be greatly appreciated.

    You resolve the dependency by importing the required jars with using the dependency tab for the mapping program.
    As stipulated before, I have managed to resolve the dependency issue but I have now getting the same error as in the forum: Calling BRM from UDF using Public API
    The specific error is:
    com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:238)
    Has anyome manage to get invoke a BRM Ruleset using JNDI?

  • UserTransaction -  Scope using JNDI lookup from jspInit() method

    Howdy,
    I'm using JSP's with JavaBeans accessing a DataSource and some other enviroment variables using JNDI lookups. I've read that JNDI lookups can take a fair amount of time and should be limited whenever possible. My previous configuration had the JNDI lookups inside the constructors of the JavaBeans but I've recently decided to move them to the jspInit() method of the calling JSP. This way the lookup only needs to be performed once and then I pass the values to the JavaBean in a method called setContextVariables. Two of the references to objects that i'm sending are the UserTransaction and DataSource objects. Within the Javabeans I have userTran.begin() and commit() statements. So far it's running great but i'm starting to wonder about the thread safety of this method. My question lies in the actual delagation of the UserTransaction object to the calling client method. It seems that i'm passing the same transaction to every Javabean (or am I?) Is the transaction actually issued when the begin() method is called, or at the time of the JNDI lookup? To test everything out, I opened two sessions and put a breakpoint inside one of the transactions. When I stopped at the breakpoint I ran another thread (also using a transaction retrieved from the same JSP). Then I went back and resumed the first thread and everything seemed to work ok. So... this seems completely fantabulastic so far (definitely noticable response time increases) but I'm still a little skeptical. If anyone is using a process similar to this I would appreciate some feedback. Thanks.

    Hi,
    The EJB bean will use the client transaction when the following attributes are specified in descriptor.
    1) Required
    2) Mandatory
    3) Supports
    In Required case, if the client is associated with Transaction, then the EJB bean will use the same transaction. This is achieved by Transaction context. The EJB bean will use the same transaction context set by client. if the client doesn't have any transaction, then the container will create new transaction context for EJB bean and completes the transaction.
    In Mandatory case, the client must be associated with Transaction so that EJB bean will use the same transaction. If the client doesn't associate with transaction, then container will throw TransactionRequiredException for EJB bean.
    In Supports case, it works similar to Required case except that if the client doesn't associate with transaction, then there won't be any transaction in EJB bean.
    hope this helps.

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

  • How to use JNDI lookup

    Hi ,
    I am creating a POC for my project.Its using ATG and spring frameworks using RAD 6.first I have created ATG sample project in that same EAR file i created sample Spring project.Both are running in the same EAR.
    I want to use spring classes from ATG components to use those methods.that is i should pass parameters to spring project methods and i should get the return value after executing those methods.
    I heard that using JNDI look up I can get spring project class objects using that I can invoke spring project methods.
    My requirement is two projects will be running in the same EAR.But one project will not be having information about other projects.both are independent from other.Using JNDI look up i need to invoke Spring project methods.
    Please anyone help me how to do this.
    I used java:comp/env/com/dao/EmpDAO to get instance of my class EmpDAO.But i am getting naming exception.Can anyone help me how to do this
    Thanks in advance.

    If Tomcat is your servlet/JSP engine, they have a nice bit about how to do it:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    MOD

  • Calling Java API from ABAP using JCo (Part 2)

    Hello,
    This is an additional question to thread Calling Java API from ABAP using JCo
    Has anyone managed to get the input parameter value
    input.getString("REQUTEXT")
    that is being passed from ABAP?
    If yes, what kind of setting you need to do? Because when I execute, it has no value.
    Thus, the below ECHOTEXT parameter returns blank value:
    output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
    When I debug by printing the below line, the input XML is indeed without value:
    System.out.println(input.toXML());
    Anybody knows how to pass input variable from ABAP to JAVA using JCo?
    rgs,
    hiroshi

    Hallo Hiroshi,
    as far as I can see, you are doing it the right way. The problem might be that the ABAP program does not fill in this parameter because something went wrong in the SAP System.
    Have you tried setting a breakpoint (an HTTP session - remote breakpoint) and tried checking step by step if the value is being processed and put into the REQUTEXT field?
    Bye,
    Sameer

  • Need help in retrieving attributes from LDAP using JNDI

    I am trying to retrieve attributes from LDAP using JNDI, but I'm getting the following error when I try to run my Java program.
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/naming/NamingException
    I have all the jar files in my classpath: j2ee.jar, fscontext.jar and providerutil.jar. The interesting thing is that it gets compiled just fine but gives an error at run-time.
    Could anyone tell me why I'm getting this error? Thanks!
    Here's my code:
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.*;
    import java.io.*;
    class Getattr {
    public static void main(String[] args) {     
    // Identify service provider to use     
    Hashtable env = new Hashtable(11);     
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");      
    // user     info
    String userName = "username";     
    String password = "password";          
    // LDAP server specific information     
    String host = "ldaphostname";     
    String port = "portnumber";     
    String basedn = "o=organization,c=country";     
    String userdn = "cn=" + userName + "," + basedn;          
    env.put(Context.PROVIDER_URL, "ldap://" + host + ":" + port + "/" + basedn);     
    env.put(Context.SECURITY_PRINCIPAL, userdn);     
    env.put(Context.SECURITY_CREDENTIALS, password);     
    try {          
    System.setErr(new PrintStream(new FileOutputStream(new File("data.txt"))));     
    // Create the initial directory context     
    DirContext ctx = new InitialDirContext(env);          
    // Ask for all attributes of the object      
    Attributes attrs = ctx.getAttributes("cn=" + userName);          
    NamingEnumeration ne = attrs.getAll();                    
    while(ne.hasMore()){                         
    Attribute attr = (Attribute) ne.next();                                   
    if(attr.size() > 1){               
    for(Enumeration e = attr.getAll(); e.hasMoreElements() ;) {                                       
    System.err.println(attr.getID() + ": " + e.nextElement());                     
    } else {
         System.err.println(attr.getID() + ": " + attr.get());
    // Close the context when we're done     
    ctx.close();     
    } catch(javax.naming.NamingException ne) {
         System.err.println("Naming Exception: " + ne);     
    } catch(IOException ioe) {
         System.err.println("IO Exception: " + ioe);     

    That doesn't work either. It seems its not finding the NamingException class in any of the jar files. I don't know why? Any clues?

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

  • EJB 3.0 and jndi lookup (simple question)

    hi all,
    i am newbie on Weblogic Application Server and i have some issues,
    i have weblogic application server 10.0, also i have oracle timesten in-memory database, i have configured datasource and deploy my ejb 3.0 application, but i could not done jndi lookup?
    here is my example:
    1. one stateless session bean :
    import javax.ejb.Remote;
    @Remote
    public interface InsertSubscriber {
         public void insertSubscriber(SubscriberT subscriberT);
    } 2. here is it's implementation :
    @Remote(InsertSubscriber.class)
    @Stateless
    public class InsertSubscriberBean implements InsertSubscriber {
         @PersistenceContext(unitName = "TimesTenDS")
         private EntityManager oracleManager;
         public void insertSubscriber(SubscriberT subscriber)
              try {
                   System.out.println("started");
                   oracleManager.persist(subscriber);
                   System.out.println("end");
              } catch (Exception e) {
                   e.printStackTrace();
    }3 and my test client :
    public class Client {
         public static void main(String[] args) {
              Context ctx = null;
              Hashtable ht = new Hashtable();
              ht.put(Context.INITIAL_CONTEXT_FACTORY,
                        "weblogic.jndi.WLInitialContextFactory");
              ht.put(Context.PROVIDER_URL, "t3://192.9.200.222:7001");
              try {
                   ctx = new InitialContext(ht);
                   InsertSubscriber usagefasade = (InsertSubscriber) ctx
                             .lookup("ejb.InsertSubscriberBean");               
              } catch (NamingException e) {
                   e.printStackTrace();
              } finally {
                   try {
                        ctx.close();
                   } catch (Exception e) {
                        e.printStackTrace();
    }what i did incorrect ???
    i got error like this : Name not fount exception
    when i tried to view jndi tree on weblogic server application console i found this :
         Binding Name:     
    TimestenExampleTimestenExample_jarInsertSubscriberBean_InsertSubscriber     
         Class:     
    test.InsertSubscriberBean_o7jk9u_InsertSubscriberImpl_1000_WLStub     
         Hash Code:     
    286     
         toString Results:     
    weblogic.rmi.internal.CollocatedRemoteRef - hostID: '2929168367193491522S::billing_domain:AdminServer', oid: '286', channel: 'null'what does it mean how i can done lookup to jndi ?
    Regards,
    Paata Lominadze,
    Magticom LTD.
    Georgia.

    Hi All,
    I am using the weblogic cluster with session replication and EJB 2.0 with Local entity beans.
    for fail-over session should be replicated to another server so we can achive the same session if 1st server fails.
    Suppose i m using two managed server(server1,server2) in the cluster.I am storing the object of class ABC into session and object contains the instance of Local-EntityBean home but i put that as a transient.I have also override the readObject and write object method.
    when write object is called on 1st server,readObject method should be called on second server so we will be sure that session is replicating properly.
    pleaase find the code below : -
    public IssuerPageBean() {
    initEJB();
    private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
    stream.defaultReadObject();
    initEJB();
    initializeCommonObject();
    private void writeObject(java.io.ObjectOutputStream stream) throws IOException {
    stream.defaultWriteObject();
    private void initEJB() {
    try {
    ic = new InitialContext();
    issuerHome = (LocalIssuerHome) ic.lookup("java:comp/env/Issuer");
    } catch (NamingException e) {
    e.printStackTrace();
    in my case if i am calling the constructor IssuerPageBean(),it calls the initEJB() method and lookeup the entity local home properly but when readObject method is called on another server only initEJB() method is called directly and getting the exception below :
    WARNING: Error during create -
    javax.naming.NameNotFoundException: remaining name: env/ejb/Client
    at weblogic.j2eeclient.SimpleContext.resolve(Ljavax/naming/Name;Z)Ljavax/naming/Context;(SimpleContext.java:35)
    at weblogic.j2eeclient.SimpleContext.resolve(Ljavax/naming/Name;)Ljavax/naming/Context;(SimpleContext.java:39)
    at weblogic.j2eeclient.SimpleContext.lookup(Ljavax/naming/Name;)Ljava/lang/Object;(SimpleContext.java:57)
    at weblogic.j2eeclient.SimpleContext.lookup(Ljavax/naming/Name;)Ljava/lang/Object;(SimpleContext.java:57)
    at weblogic.j2eeclient.SimpleContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(SimpleContext.java:62)
    at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(Ljava/lang/String;)Ljava/lang/Object;(ReadOnlyCont
    extWrapper.java:45)
    at weblogic.jndi.internal.AbstractURLContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(AbstractURLContext.jav
    a:130)
    at javax.naming.InitialContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(InitialContext.java:347)
    at com.lb.equities.veda.tools.salesvault.jsp.ClientPageBean.initEJB()V(ClientPageBean.java:218)
    at com.lb.equities.veda.tools.salesvault.jsp.ClientPageBean.readObject(Ljava/io/ObjectInputStream;)V(ClientPageB
    ean.java:191)
    at java.lang.LangAccessImpl.readObject(Ljava/lang/Class;Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown
    Source)
    at java.io.ObjectStreamClass.invokeReadObject(Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject()Ljava/lang/Object;(Unknown Source)
    at java.util.HashMap.readObject(Ljava/io/ObjectInputStream;)V(Unknown Source)
    at java.lang.LangAccessImpl.readObject(Ljava/lang/Class;Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown
    Source)
    at java.io.ObjectStreamClass.invokeReadObject(Ljava/lang/Object;Ljava/io/ObjectInputStream;)V(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.defaultReadFields(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Ljava/lang/Object;Ljava/io/ObjectStreamClass;)V(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Z)Ljava/lang/Object;(Unknown Source)
    at java.io.ObjectInputStream.readObject()Ljava/lang/Object;(Unknown Source)
    at weblogic.common.internal.ChunkedObjectInputStream.readObject()Ljava/lang/Object;(ChunkedObjectInputStream.jav
    a:120)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(Ljava/lang/Class;)Ljava/lang/Object;(MsgAbbrevInputStream.java:
    121)
    at weblogic.cluster.replication.ReplicationManager_WLSkel.invoke(ILweblogic/rmi/spi/InboundRequest;Lweblogic/rmi
    /spi/OutboundResponse;Ljava/lang/Object;)Lweblogic/rmi/spi/OutboundResponse;(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(Lweblogic/rmi/extensions/server/RuntimeMethodDescriptor;Lweblogic
    /rmi/spi/InboundRequest;Lweblogic/rmi/spi/OutboundResponse;)V(BasicServerRef.java:492)
    Please help .
    Thanks in Advance.
    Edited by hforever at 03/04/2008 7:28 AM

  • 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

  • Call BPM flow from EJB container

    Hi,
    I wondered, since we can start a BPM flow through a webservice call, how we could call a webservice from an EJB 3.x container?
    Anyone an idea?
    Thx,
    Wesley

    You mean from a bean?
    Like any other web service call, in which case your EJB will be a WS-Client
    regards,
    Harsha

  • Calling ejb from ejb of other container

    Hi,
    My problem is : I have one application that call one EJB. This EJB must call another EJB from other container, in other server... Is it possible ???? How can I make this ????? I'm trying to call BuscaEnderecoHome from BuscaCEPBean....
    I'm trying to do that but I'm having the following problem :
    Oracle9iAS (1.0.2.2.1) Containers for J2EE initialized
    Exception --> Erro em setSessionContext (ServicoPostalECTBean) - ERROR :
    ejb/BuscaEnderecoHome not found in BuscaCEPBean
    java.lang.NullPointerException
    at com.ect.corporate.ejb.CEP.consultaPorCep(CEP.java:78)
    at com.ect.corporate.ejb.BuscaCEPBean.consultaPorCEP(BuscaCEPBean.java:7
    2)
    at BuscaCEP_StatelessSessionBeanWrapper0.consultaPorCEP(BuscaCEP_Statele
    ssSessionBeanWrapper0.java:54)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:66)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62)
    Erro null

    Hi,
    My problem is : I have one application that call one EJB. This EJB must call another EJB from other container, in other server... Is it possible ???? How can I make this ????? I'm trying to call BuscaEnderecoHome from BuscaCEPBean....
    I'm trying to do that but I'm having the following problem :
    Oracle9iAS (1.0.2.2.1) Containers for J2EE initialized
    Exception --> Erro em setSessionContext (ServicoPostalECTBean) - ERROR :
    ejb/BuscaEnderecoHome not found in BuscaCEPBean
    java.lang.NullPointerException
    at com.ect.corporate.ejb.CEP.consultaPorCep(CEP.java:78)
    at com.ect.corporate.ejb.BuscaCEPBean.consultaPorCEP(BuscaCEPBean.java:7
    2)
    at BuscaCEP_StatelessSessionBeanWrapper0.consultaPorCEP(BuscaCEP_Statele
    ssSessionBeanWrapper0.java:54)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:66)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:62)
    Erro null

  • Loading remote EJB from servlet using jakarta and openejb

    I am trying to create an environment where I use
    openejb as my EJB container, and JAKARTA Tomcat
    as my
    Servlet/JSP container. However,
    i'm having a problem in lookingup my remote EJB from my
    jakarta application.
    That exact code works perfectly if I run it standalone. I
    am using the same JRE. Jakarta has also loaded the
    openejb-0.8.3.jar and openejb_client-0.8.3.jar
    What I dont understand is why jakarta
    would behave differently than command-line java when I
    am
    running in the same JRE on a single machine.
    Any help would be much appreciated.

    Several fairly major improvements have been maid in OpenEJB specifically for the Tomcat people. For one, the whole way you integrate them has completely been rewritten. Now all you have to do is copy a openejb_loader-0.9.1.war into the Tomcat webapps directory and change an init-param in it. Pretty straight forward. OpenEJB 0.8.3 won't work with Tomcat in the same VM, however OpenEJB 0.9.0 and up have been totally revamped in all things related to classloading so that it can co-exist with Tomcats unique classloading architecture.
    O'Reilly just published an article detailing the ins and outs of the integration, it's a pretty good read:
    http://www.onjava.com/pub/a/onjava/2003/02/12/ejb_tomcat.html

  • Question? calling a servlet from EJB.

    Can anyone tell me how I would go about calling a servlet
    from a session bean that’s running in the same J2EE application.
    Application server is Oracle10g.
    Thanks.

    Welcome to the forum
    You seem to be misunderstanding something. Do some googling to learn what you need about servlets. Simplified, servlets are java code that's hosted by a web container, such as Tomcat. When a servlet gets called as a consequence of someone requesting a url from the container, it takes in a request object and a response object. All the magic is then in creating an appropriate response (e.g. html) for the incoming request.

Maybe you are looking for

  • EBS R12.1.1 databse copy windows to windows??

    Hi All, I am a report developer. I have two servers(VMs) Server1: Win 2008, Oracle EBS R12.1.1. Server2: Win XP SP3, about to install Oracle 11g R1 My goal is to copy the whole EBS R12.1.1 Vision Instance database (VIS) on Server1 to Server 2 Oracle

  • Confirming allowing several dialog box permanently for an plug in.

    I'm using the InTranslator 4.0 plug-in. But can't find any way to permanently confirm to Firefox to allow all the necessary dialog windows. Now I have to manual allow them every time i run an translation whit spell check activated. I have an print sc

  • Documentation on user parameters set in SU3 or SU01?

    Hello all. I am trying to find documentation on the available user parameters set in SU3 for self-service or in SU01 by an admin. I frequently have users with issues with various reports, exports, etc. When all else fails, I remove all of their user

  • Lpc of a voice

    hello there! I am new to labview and can any body please help me to calculate the lpc of a sound/voice. Actually my project is based on voice recognition Solved! Go to Solution.

  • ICal Server won't send invites to e-mail addresses

    Set up a new 10.7.2 Server, enabled OD, added 6 users. Set up iCal Server, everything works fine between OD users. Problem is when you try to share a calendar with an e-mail address for someone outside the company, iCal comes back with "The server re