-
1. Re: invoke EJB session bean across applications
darranl Sep 4, 2004 6:31 AM (in response to tse_sherman)This sounds like the problem that a bug was raised for yesterday http://sourceforge.net/tracker/index.php?func=detail&aid=1021980&group_id=22866&atid=376685
-
2. Re: invoke EJB session bean across applications
tse_sherman Sep 4, 2004 1:41 PM (in response to tse_sherman)Thank you darranl. I tried the workarounds suggested in the bug description and is able to call the PortableRemoteObject.narrow method. But when I call the create of the casted object method I get the following error message. The same piece of code works find if I call BeanB from a separate server.
javax.ejb.EJBException: Invalid invocation, check your deployment packaging
This is the code I am using to get a remote reference.env = new Properties(); env.put(Context.PROVIDER_URL, "jnp://host:1099"); ic = new InitialContext(env); Object objref = ic.lookup("BeanB"); Object obj = PortableRemoteObject.narrow(objref, bean_b_package.IBeanBRemoteHome.class); home = (bean_b_package.IBeanBRemoteHome) obj; isc = home.create(); // error occurs here
-
3. Re: invoke EJB session bean across applications
jae77 Sep 7, 2004 11:39 AM (in response to tse_sherman)are the ejbs deployed inside an ear archive? if yes, are they scoped?
-
4. Re: invoke EJB session bean across applications
tse_sherman Sep 7, 2004 12:50 PM (in response to tse_sherman)Yes. The ejbs are deployed inside a jar which in turn is packaged in an ear file and are scoped. Both application A and B are scoped (I think...). The following are the settings in the application.xml of the two ears.
Application A <?xml version="1.0" encoding="UTF-8"?> <jboss-app> <loader-repository>localhost:Aloader=A.ear</loader-repository> </jboss-app> Application B: <?xml version="1.0" encoding="UTF-8"?> <jboss-app> <loader-repository>localhost:Bloader=B.ear</loader-repository> </jboss-app>
-
5. Re: invoke EJB session bean across applications
jae77 Sep 8, 2004 10:56 AM (in response to tse_sherman)go read this: http://www.jboss.org/wiki/Wiki.jsp?page=HotDeployClassCastExceptions
more or less same situation as this - basically, you need to pull out the local/home interfaces and any other dependent classes for those ejbs and package them outside of both of those ears.
you could also turn on "pass by value" for ejb invocations, but that reduces your performance dramatically.
from my experiences, scoping works best if you have a stand alone legacy application that has older/incompatible library dependencies (i'm sure there are other useful scenarios too, but i have not stumbled across them yet).
if you have the jboss admin book, read chapter 2, it talks all about how the classloader works.