sure,

but better yet, debug it!

marc


|-----Original Message-----
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Peter Braswell
|Sent: Tuesday, December 05, 2000 7:27 PM
|To: jBoss Developer
|Subject: [jBoss-Dev] Conformity issue
|
|
|All,
|
|I just found this as an issue when resurecting the
|JCTS stuff.  See code below.  It involves removing
|SessionBeans.  Its not a big deal, just the wrong
|exception comes back.  The strange thing is the
|exception which is an NotSerializable exception.  I've
|included the exception stack also.
|
|Marc: insert into bugzilla??
|
|cheers,
|peter
|
|
|//-------------------------------------------------------------------------
|   // EJB 1.1 (Page 42)
|   // Removing a Session Object.
|   // Because session objects do not have primary keys
|that are
|   // accessible to clients, invoking the
|javax.ejb.Home.remove( Object primaryKey )
|   // method on a session results in the
|javax.ejb.RemoveException.
|   //
|
|   /**
|    * Method testRemoveSessionObject
|    *
|    *
|    */
|
|   public void testRemoveSessionObject ()
|   {
|      System.out.println(
|
|"**************************************************************");
|      System.out.println("
|testRemoveSessionObject()");
|
|      try
|      {
|         Properties props = System.getProperties();
|
|         System.out.println("Obtain home interface");
|
|         // Create a new session object
|         Context             ctx         = new
|InitialContext(props);
|         StatefulSessionHome home        =
|            ( StatefulSessionHome )
|ctx.lookup("ejbcts/StatefulSessionBean");
|         StatefulSession     sessionBean =
|home.create();
|
|         home.remove(new DummyPK("pk"));
|      }
|      catch (javax.ejb.RemoveException rmEx)
|      {
|
|         // Expected behavior
|         return;
|      }
|      catch (Exception ex)
|      {
|         ex.printStackTrace();
|         fail("Expected javax.ejb.RemoveException, got
|Unknown Exception");
|      }
|
|      fail("Expected javax.ejb.RemoveException, got NO
|exception");
|      System.out.println(
|
|"**************************************************************");
|   }
|
|
|java.io.NotSerializableException:
|org.jboss.test.cts.test.Main
|        at
|java.io.ObjectOutputStream.outputObject(Unknown
|Source)
|        at
|java.io.ObjectOutputStream.writeObject(Unknown Source)
|        at
|java.io.ObjectOutputStream.outputClassFields(Unknown
|Source)
|        at
|java.io.ObjectOutputStream.defaultWriteObject(Unknown
|Source)
|        at
|java.io.ObjectOutputStream.outputObject(Unknown
|Source)
|        at
|java.io.ObjectOutputStream.writeObject(Unknown Source)
|        at java.rmi.MarshalledObject.<init>(Unknown
|Source)
|        at
|org.jboss.ejb.CacheKey.<init>(CacheKey.java:58)
|        at
|org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:168)
|        at $Proxy0.remove(Unknown Source)
|        at
|org.jboss.test.cts.test.Main.testRemoveSessionObject(Main.java:177)
|        at java.lang.reflect.Method.invoke(Native
|Method)
|        at
|junit.framework.TestCase.runTest(TestCase.java:155)
|        at
|junit.framework.TestCase.runBare(TestCase.java:129)
|        at
|junit.framework.TestResult$1.protect(TestResult.java:100)
|        at
|junit.framework.TestResult.runProtected(TestResult.java:117)
|        at
|junit.framework.TestResult.run(TestResult.java:103)
|        at
|junit.framework.TestCase.run(TestCase.java:120)
|        at
|junit.framework.TestSuite.run(TestSuite.java:144)
|        at
|junit.textui.TestRunner.doRun(TestRunner.java:61)
|        at
|junit.textui.TestRunner.start(TestRunner.java:242)
|        at
|junit.textui.TestRunner.main(TestRunner.java:94)
|java.lang.reflect.UndeclaredThrowableException:
|java.io.NotSerializableException: org.jboss.test.cts
|.test.Main
|
|__________________________________________________
|Do You Yahoo!?
|Yahoo! Shopping - Thousands of Stores. Millions of Products.
|http://shopping.yahoo.com/
|
|


Reply via email to