This content has been marked as final.
Show 5 replies
-
1. Re: EJB lookup failure in 5.0.0.GA
jaikiran Dec 11, 2008 1:05 AM (in response to jhsingle)Please post the entire exception stacktrace. And also please ensure that your client uses the jbossall-client.jar (and other jar files listed in the META-INF/MANIFEST.MF of jbossall-client.jar) from the JBoss-5GA version. You can find these jars in the %JBOSS_HOME%/client folder.
-
2. Re: EJB lookup failure in 5.0.0.GA
jhsingle Dec 19, 2008 11:01 PM (in response to jhsingle)Here is the exception stacktrace:
java.lang.ClassCastException: javax.naming.Reference at security.ejb.server.SecurityManagerRemoteFactory.createSecurityManangerRemote(SecurityManagerRemoteFactory.java:44) at security.ejb.server.SecurityManagerTest.cleanup(SecurityManagerTest.java:760) at security.ejb.server.SecurityManagerTest.setUp(SecurityManagerTest.java:742) at junit.framework.TestCase.runBare(TestCase.java:128) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) 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:585) at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) 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:585) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Here is the toString of the object returned by the lookup:EJB lookup returned: Reference Class Name: Proxy for: security.ejb.client.SecurityManagerRemote Type: ProxyFactoryKey Content: ProxyFactory/SecurityManager/usermgmt/SecurityManager/remote Type: EJB Container Name Content: jboss.j2ee:ear=usermgmt.ear,jar=usermgmt-ejb-2.7.0.jar,name=SecurityManager,service=EJB3 Type: Proxy Factory is Local Content: false Type: Remoting Host URL Content: socket://Macintosh.home:3873/? Type: Remote Business Interface Content: security.ejb.client.SecurityManagerRemote
As far as using jbossall-client.jar from the distro client directory, there is a problem there. My client, a JUnit test, like everything else in our project uses a Maven2 build. So we don't point to any local directories, but rather our pom.xml file points to artifacts from networked maven repositories. I was unable to locate the client jar files in the current jboss maven repository (http://repository.jboss.org/maven2/) so for this test I loaded the jbosssx-as-client.jar from the distribution client directory into our local project maven repository. This raises two questions: (1) are the JBoss5 client jars available in any maven repository, and (2) given the indirect nature of jbossall-client.jar, will it even work with maven, or do I need to name all of the referenced jar files in my pom for this test? -
3. Re: EJB lookup failure in 5.0.0.GA
jaikiran Dec 21, 2008 4:02 AM (in response to jhsingle)Going by the exception stacktrace, its definitely an issue with the client classpath not having the jboss jar file(s).
This raises two questions: (1) are the JBoss5 client jars available in any maven repository, and
Yes, they are.(2) given the indirect nature of jbossall-client.jar, will it even work with maven, or do I need to name all of the referenced jar files in my pom for this test?
I guess you will have to name all the relevant referenced jar files in the pom. -
4. Re: EJB lookup failure in 5.0.0.GA
jhsingle Dec 23, 2008 3:01 PM (in response to jhsingle)Thanks, using the correct dependency fixed it.
Running security.ejb.server.SecurityManagerTest Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.608 sec
For those interested, I only needed to add a single "pom" dependency to my JUnit test pom.xml file and that brings in all the necessary client jars:<dependency> <groupId>org.jboss.jbossas</groupId> <artifactId>jboss-as-client</artifactId> <version>5.0.0.GA</version> <type>pom</type> </dependency>
-
5. Re: EJB lookup failure in 5.0.0.GA
jaikiran Dec 24, 2008 1:46 AM (in response to jhsingle)"jhsingle" wrote:
For those interested, I only needed to add a single "pom" dependency to my JUnit test pom.xml file and that brings in all the necessary client jars:<dependency> <groupId>org.jboss.jbossas</groupId> <artifactId>jboss-as-client</artifactId> <version>5.0.0.GA</version> <type>pom</type> </dependency>
Thanks for letting us know, learnt something new today :-)