Hello
I have tried a regular call of my EJB and I do not have the same problem. It works well after deploy, undeploy and redeploy. Here is my regular call of my EJB: String serverUrl ="rmi://localhost:8092/DeliveryNoteServiceHome"; InitialContext jndiContext = new InitialContext(); Object lookedUp = jndiContext.lookup(serverUrl); Object narrow = PortableRemoteObject.narrow(lookedUp, EdifixioEJBRemoteHome.class); EdifixioEJBRemoteHome myDeliveryNoteServiceHome = (EdifixioEJBRemoteHome)narrow; DeliveryNoteService myService = (DeliveryNoteService)myDeliveryNoteServiceHome.create(); Let me know if you need more information. Best Regards, Jérôme -----Message d'origine----- De : Raymond Feng [mailto:[EMAIL PROTECTED] Envoyé : mercredi 27 août 2008 18:58 À : [email protected] Objet : Re: EJB binding not able to recover the connection after a failure Thanks, the following stack is interesting: at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:99) at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185) at javax.naming.InitialContext.lookup(InitialContext.java:392) Can you try to use regular JNDI lookup to invoke your EJB (deploy, undeploy and redeploy)? If you see the same problem, then I guess the com.sun.jndi.rmi.registry.RegistryContext.lookup may have staled cache. Thanks, Raymond From: Jérôme Besnainou Sent: Wednesday, August 27, 2008 9:26 AM To: [email protected] Subject: RE: EJB binding not able to recover the connection after a failure Hello, Here is the full stack trace: org.osoa.sca.ServiceRuntimeException: org.osoa.sca.ServiceUnavailableException: javax.naming.NameNotFoundException: DeliveryNoteServiceHome at org.apache.tuscany.sca.binding.ejb.util.EJBHandler.<init>(EJBHandler.java:76) at org.apache.tuscany.sca.binding.ejb.util.EJBHandler.<init>(EJBHandler.java:66) at org.apache.tuscany.sca.binding.ejb.provider.EJBBindingInvoker.doInvoke(EJBBindingInvoker.java:73) at org.apache.tuscany.sca.binding.ejb.provider.EJBBindingInvoker.invoke(EJBBindingInvoker.java:50) at org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:107) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154) at $Proxy10.getDeliveryNote(Unknown Source) at com.edifixio.ecommerce.scorware.service.front.FrontServiceImpl.getDeliveryNote(FrontServiceImpl.java:202) 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 org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132) at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154) at $Proxy5.getDeliveryNote(Unknown Source) at com.edifixio.ecommerce.scorware.web.action.deliverynote.ViewDeliveryNote.execute(ViewDeliveryNote.java:93) at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tuscany.sca.host.webapp.TuscanyServletFilter.doFilter(TuscanyServletFilter.java:98) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: org.osoa.sca.ServiceUnavailableException: javax.naming.NameNotFoundException: DeliveryNoteServiceHome at org.apache.tuscany.sca.binding.ejb.util.EJBStubHelper.getStub(EJBStubHelper.java:51) at org.apache.tuscany.sca.binding.ejb.util.EJBStubHelper.lookup(EJBStubHelper.java:44) at org.apache.tuscany.sca.binding.ejb.util.EJBHandler.<init>(EJBHandler.java:73) ... 45 more Caused by: javax.naming.NameNotFoundException: DeliveryNoteServiceHome at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:99) at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.apache.tuscany.sca.binding.ejb.util.EJBLocator$JndiLocator.locate(EJBLocator.java:461) at org.apache.tuscany.sca.binding.ejb.util.EJBLocator.locate(EJBLocator.java:429) at org.apache.tuscany.sca.binding.ejb.util.EJBObjectFactory.createStub(EJBObjectFactory.java:65) at org.apache.tuscany.sca.binding.ejb.util.EJBStubHelper.getStub(EJBStubHelper.java:49) ... 47 more Best Regards, Jérôme -----Message d'origine----- De : Raymond Feng [mailto:[EMAIL PROTECTED] Envoyé : mercredi 27 août 2008 18:20 À : [email protected] Objet : Re: EJB binding not able to recover the connection after a failure It seems that there might be stale cache in the JNDI in your environment. Can you give us the full stacktrace so that we can find out what EJB locator is effective? Thanks, Raymond From: Jérôme Besnainou Sent: Wednesday, August 27, 2008 8:28 AM To: [email protected] Subject: EJB binding not able to recover the connection after a failure Hello, I have an issue with EJB binding. After a failure EJB binding is not able to recover the connection. I'm using Tuscany 1.3 inside tomcat (6.0.16) + jdk 1.6 + Jonas 4.8.5 (EJB 2.1). I have an EJB 2.1 deploy on Jonas and a SCA composite deploy on Tuscany inside Tomcat. This composite use the EJB binding in order to use the ejb service: <reference name="deliveryService"> <binding.ejb uri="rmi://localhost:8092/DeliveryNoteServiceHome" /> </reference> Everything works well in a nominal case. However if: - I undeploy my ejb on Jonas and try to access it with Tuscany. I got an exception: this normal - Then I deploy again my ejb on jonas and try to access it with Tuscany. I got an exception while it should not I had to shutdown Tuscany and restart it in order to be able to access my EJB again. Here is the stack trace I have when Tuscany try to acces my EJB after the undeploy and deploy: org.osoa.sca.ServiceRuntimeException: org.osoa.sca.ServiceUnavailableException: javax.naming.NameNotFoundException: DeliveryNoteServiceHome at org.apache.tuscany.sca.binding.ejb.util.EJBHandler.<init>(EJBHandler.java:76) at org.apache.tuscany.sca.binding.ejb.util.EJBHandler.<init>(EJBHandler.java:66) at org.apache.tuscany.sca.binding.ejb.provider.EJBBindingInvoker.doInvoke(EJBBindingInvoker.java:73) at org.apache.tuscany.sca.binding.ejb.provider.EJBBindingInvoker.invoke(EJBBindingInvoker.java:50) at org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:107) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154) at $Proxy10.getDeliveryNote(Unknown Source) Do not hesitate to contact me if you need more details. Best Regards, Jérôme
