hello everyone, I am new here and already have a question to this annoying circumstance. I thought it's a simple task, but it already took me days by now.
I have a complete and fine working ear (including jar, war, all you need for this).
On the other hand I made a very simple SAR (implementing an interface ending to "MBean", start(), stop(), etc.) The jboss-service.xml is located in the META-INF Folder.
Both files are deployed without any errors, when I put them into the deploy folder, and I can find my MBean (from SAR) in JMX Console.
The MBean contains a test method for calling a remote interface provided by the ear (in the including jar).
I tried to use a JNDI lookup to get access to the interface, the way i found in several postings and turorials. I copied the string for the lookup from the global JNDI namespace, and tried variations of this but it never ever worked.
Always get something like this:
<javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader...>
A problem I see, I am not sure about the correct <depends> tag in the jboss-service.mxl. At the moment it looks like this: "<depends>jboss.j2ee:ear=PGN_AS_ear.ear,jar=PGN_AS.jar,name=ApplicationBean,service=EJB3</depends>" That's the String I can find via the JMX Console.
For the JDNI lookup I use "PGN_AS_ear/ApplicationBean/remote-....pgn.as.business.application.facade.ApplicationRI" (global JNDI namespace).
Note: When I do this lookup from a simple "main" class it is all working fine. I even just need a more simple way for this:
ApplicationRI appBeanRI = (ApplicationRI) ctx.lookup("ApplicationBean");
I don't know what to try else. Is this even the right way to create such a connection ?
Things I am not sure about:
- classpath codebase tag for jboss-service.xml
- really correct string for the lookup
- correct <depends> tag in jboss-service.xml
Thank in advance
edit: I am using JBoss 5.1 in the standard server configuration
Unbelievable...a team-mate stumbled over certain words in a forum posting. Using process of elemination and comparing several configuration files we really could identify the "mistake".
Just for your information...
If you are not using the default server configuration, make sure to set the flag 'isolated' to false in bean tag for "EARClassLoaderDeployer" located in the file: ".../deployers/ear-deployer-jboss-beans.xml"
<bean name="EARClassLoaderDeployer" class="org.jboss.deployment.EarClassLoaderDeployer">
I am very happy now