2
InitialContext ctx = new InitialContext();
StatelessInterogareRemote beanStatelessRemote = (StatelessInterogareRemote) ctx
.lookup("java:global/ShopEAP/ShopEJB/StatelessInterogare!shop.StatelessInterogareRemote");
StatefulShopCartLocal beanStateful = (StatefulShopCartLocal) ctx
.lookup("java:global/ShopEAP/ShopEJB/StatefulShopCart!shop.StatefulShopCartLocal");
當我運行應用程序,第二查詢後出現的錯誤:EJB:爲什麼我在JNDI查找中遇到這個錯誤?
[[[ Error ]]]: Lookup failed for 'java:global/ShopEAP/ShopEJB/StatelessInterogare' in SerialContext
INFO: [Ljava.lang.StackTraceElement;@89708c
WARNING: "IOP00100006: (BAD_PARAM) Class com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate is not Serializable"
org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 6 completed: Maybe
at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemException.java:990)
at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemException.java:1005)
at com.sun.corba.ee.impl.orbutil.ORBUtility.throwNotSerializableForCorba(ORBUtility.java:753)
...
似乎序列化是問題。有一個Statefull bean和2個屬性:private transient HashMap qty; si私有ArrayList 產品;該類實現了Serializable,但仍然無法工作。 –
Emanuel
檢查ProdusDTO是否可序列化,並且其屬性是否可序列化等 –
@Oscar:WHy是否實現了StatelessInterogareRemote a.k.a EJB bean需要可序列化? – Victor