-
1. Re: Communication between EJBs across 2 ears
wolfgangknauf Jun 16, 2010 7:46 AM (in response to njv)1 of 1 people found this helpfulHi,
don't combine "@EJB" annotation and manual lookup, use only one way ;-).
If you want to do the lookup yourself:
How did you declare the environment naming context (ENC)? You need a JBoss specific file to do so. If you want to access the ENC from another session bean, you probably have to add a "jboss.xml" file to your project. In "ejb-jar.xml", you need an "ejb-ref" element, and "jboss.xml" also needs this element and points to the global JNDI name of the bean.
Lookup will also work if you use the global JNDI name of your bean. This defaults to "earname/MyBean/local" for the local interface and "earname/MyBean/remote" for the Remote interface. In your sample, it should be "svc/Role/remote".
Did you verify that the Role bean is bound to the JNDI names you expect (use the "JNDIView" mbean to check those bindings)?
Hope this helps
Wolfgang
-
2. Re: Communication between EJBs across 2 ears
njv Jun 16, 2010 11:06 AM (in response to wolfgangknauf)Thanks for the helpful reply.
Here is more information:
RoleBean is the class that implements Role
ejb-jar.xml of both the calling ear and the ear being called have only <display-name> tag. I do not have jboss.xml.
The contents of the Global JNDI namesapce regarding my beans are...
+- svc (class: org.jnp.interfaces.NamingContext)
| +- UnitBean (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy108 implements No ClassLoaders found for: ejb.Unit (no security manager: RMI class loader disabled))
| | +- remote (proxy: $Proxy107 implements No ClassLoaders found for: ejb.Unit (no security manager: RMI class loader disabled))
| +- RoleBean (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy104 implements No ClassLoaders found for: ejb.Role (no security manager: RMI class loader disabled))
| | +- remote (proxy: $Proxy103 implements No ClassLoaders found for: ejb.Role (no security manager: RMI class loader disabled))
Both the statements below fail with the name not bound exception(whether I use @EJB or not):
RoleBean roleLookup = (ejb.RoleBean) new InitialContext().lookup("svc/RoleBean/remote");
or
Role roleLookup = (ejb.Role) new InitialContext().lookup("svc/Role/remote");
Any ideas how to fix this?
Thanks
-
3. Re: Communication between EJBs across 2 ears
wolfgangknauf Jun 17, 2010 11:12 AM (in response to njv)Hi,
this part of the JNDIView results is strange:
"remote (proxy: $Proxy103 implements No ClassLoaders found for: ejb.Role (no security manager: RMI class loader disabled))"
I have never seen this "No Class Loaders found" error before. Did you modify the JBoss config? Anything special about your app? Does it include JAR files or classes from JBoss core?
Best regards
Wolfgang