-
Bug
-
Resolution: Won't Do
-
Major
-
JBossAS-5.1.0.GA
-
None
-
None
java.lang.ClassCastException: javax.naming.Reference cannot be cast to com.sdt.pellworm.ejb.Pellworm
at com.sdt.pellworm.test.junit.TestPellwormEJB.testSayHello(TestPellwormEJB.java:29)
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 junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
When i call the test case below from within eclipse I get this exception with JBoss-5.1.0.GA.
I do not get it with JBoss-5.0.0.GA.
Here's the code:
public class TestPellwormEJB extends TestCase {
public void testSayHello() {
InitialContext ctx = null;
Pellworm tsBean = null;
TestUtils.echoLogHello(this.getClass().getSimpleName(), this.getName());
try
catch (NamingException e)
{ fail(e.getMessage()); }try { // tsBean = (Pellworm) ctx.lookup("PellwormBean/remote"); Object object = ctx.lookup("PellwormBean/remote"); tsBean = (Pellworm) object; } catch (NamingException e) { fail(e.getMessage()); }
try
{ assertEquals("Hallo! Ich bin Pellworm. ", tsBean.sayHello()); }catch (RemoteException e)
{ fail(e.getMessage()); }}
}
I haven't found a compatiblity issue in the release notes about this.
Cheers,
-M.