• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception in find Method  RSS feed

 
Suneesh Raman
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am getting the following exception while calling the find method

public Collection findForums() throws FinderException,RemoteException;



java.rmi.MarshalException: CORBA BAD_PARAM 1330446342 Maybe; nested exception is:
java.io.NotSerializableException:
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:239)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.wrapException(Util.java:591)
at javax.rmi.CORBA.Util.wrapException(Util.java:277)
at com.forum.ejb._AccessForum_Stub.getForums(Unknown Source)
at org.apache.jsp.test.testForum_jsp._jspService(testForum_jsp.java:55)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:499)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:236)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:141)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 220)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:109)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 168)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:109)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:109)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:107)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:107)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java :134)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:107)
at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:107)
at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:107)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:11 4)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:109)
at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingVal ve.java:166)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.j ava:107)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnecti on(Http11Protocol.java:604)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:6 47)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.io.NotSerializableException:
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:232)
... 55 more
Caused by: org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 6 completed: Maybe
at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemExcep tion.java:990)
at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemExcep tion.java:1005)
at com.sun.corba.ee.impl.orbutil.ORBUtility.throwNotSerializableForCorba(ORBUtilit y.java:609)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_abstract_interface(CDR OutputStream_1_0.java:625)
at com.sun.corba.ee.impl.encoding.CDROutputStream.write_abstract_interface(CDROutp utStream.java:235)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.writeAbstractObject(Util.java:402)
at javax.rmi.CORBA.Util.writeAbstractObject(Util.java:129)
at com.sun.corba.ee.impl.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.jav a:717)
at com.sun.corba.ee.impl.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.ja va:783)
at com.sun.corba.ee.impl.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutput Stream.java:197)
at com.sun.corba.ee.impl.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:56 6)
at com.sun.corba.ee.impl.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.ja va:152)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.j ava:222)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueWithVersion(ValueHandlerImp l.java:204)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:144)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.writeRMIIIOPValueType(CDROut putStream_1_0.java:773)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_ 1_0.java:822)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_ 1_0.java:836)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_abstract_interface(CDR OutputStream_1_0.java:620)
at com.sun.corba.ee.impl.encoding.CDROutputStream.write_abstract_interface(CDROutp utStream.java:235)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.writeAbstractObject(Util.java:402)
at javax.rmi.CORBA.Util.writeAbstractObject(Util.java:129)
at com.sun.corba.ee.impl.io.IIOPOutputStream.writeObjectOverride(IIOPOutputStream. java:131)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:274)
at java.util.ArrayList.writeObject(ArrayList.java:530)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.corba.ee.impl.io.IIOPOutputStream.invokeObjectWriter(IIOPOutputStream.j ava:598)
at com.sun.corba.ee.impl.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:56 4)
at com.sun.corba.ee.impl.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.ja va:152)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.j ava:222)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValueWithVersion(ValueHandlerImp l.java:204)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:144)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.writeRMIIIOPValueType(CDROut putStream_1_0.java:773)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_ 1_0.java:822)
at com.sun.corba.ee.impl.encoding.CDROutputStream_1_0.write_value(CDROutputStream_ 1_0.java:836)
at com.sun.corba.ee.impl.encoding.CDROutputStream.write_value(CDROutputStream.java :218)
at com.sun.corba.ee.impl.copyobject.ORBStreamObjectCopierImpl.copy(ORBStreamObject CopierImpl.java:39)
at com.sun.corba.ee.impl.copyobject.FallbackObjectCopierImpl.copy(FallbackObjectCo pierImpl.java:34)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.copyObject(Util.java:646)
at javax.rmi.CORBA.Util.copyObject(Util.java:314)
at com.forum.ejb._AccessForum_Stub.getForums(Unknown Source)
... 52 more


My ejb-jar.xml file is

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" version="2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>ForumJar</display-name>
<enterprise-beans>
<entity>
<ejb-name>ForumBean</ejb-name>
<local-home>com.forum.ejb.ForumHome</local-home>
<local>com.forum.ejb.Forum</local>
<ejb-class>com.forum.ejb.ForumBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>t_forum</abstract-schema-name>
<cmp-field>
<description>no description</description>
<field-name>forumDesc</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>forumId</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>updationDate</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>userId</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>forumTitle</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>creationDate</field-name>
</cmp-field>
<primkey-field>forumId</primkey-field>
<security-identity>
<use-caller-identity/>
</security-identity>
<query>
<query-method>
<method-name>findForums</method-name>
<method-params/>
</query-method>
<ejb-ql>SELECT OBJECT(p) FROM t_forum p</ejb-ql>
</query>
<query>
<query-method>
<method-name>ejbSelectMaxFId</method-name>
<method-params/>
</query-method>
<ejb-ql>SELECT MAX(x.forumId) FROM t_forum x</ejb-ql>
</query>
</entity>
<session>
<ejb-name>AccessForumBean</ejb-name>
<home>com.forum.ejb.AccessForumHome</home>
<remote>com.forum.ejb.AccessForum</remote>
<ejb-class>com.forum.ejb.AccessForumBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/ForumBean</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.forum.ejb.ForumHome</local-home>
<local>com.forum.ejb.Forum</local>
<ejb-link>ejb-jar-ic1.jar#ForumBean</ejb-link>
</ejb-local-ref>
<security-identity>
<use-caller-identity/>
</security-identity>
</session>
</enterprise-beans>
<assembly-descriptor>
<method-permission>
<unchecked/>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>remove</method-name>
<method-params>
<method-param>java.lang.Object</method-param>
</method-params>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>create</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>int</method-param>
</method-params>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>updateForum</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.sql.Date</method-param>
</method-params>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>findByPrimaryKey</method-name>
<method-params>
<method-param>java.lang.Integer</method-param>
</method-params>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>isIdentical</method-name>
<method-params>
<method-param>javax.ejb.EJBLocalObject</method-param>
</method-params>
</method>
</method-permission>
<method-permission>
<unchecked/>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumId</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumDesc</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>creationDate</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>LocalHome</method-intf>
<method-name>findForums</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumTitle</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>updationDate</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>userId</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>getPrimaryKey</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
</method>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>getEJBLocalHome</method-name>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumTitle</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>updateForum</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.sql.Date</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumDesc</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>remove</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>forumId</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>creationDate</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>updationDate</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ForumBean</ejb-name>
<method-intf>Local</method-intf>
<method-name>userId</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are some restrictions specified in RMI-IIOP because of IDL in CORBA.

Here are those :-

1. Make sure all constant definitions in remote interfaces are of primitive types or String and evaluated at compile time.
2. Don't use Java names that conflict with IDL mangled names generated by the Java to IDL mapping rules. See section 28.3.2 of the Java Language to IDL Mapping specification for the Java to IDL name mapping rules.
3. Don't inherit the same method name into a remote interface more than once from different base remote interfaces.
4. Be careful when using names that differ only in case. The use of a type name and a variable of that type whose name differs from the type name only in case is supported. Most other combinations of names that differ only in case are not supported.
5. Don't depend on runtime sharing of object references to be preserved exactly when transmitting object references across IIOP. Runtime sharing of other objects is preserved correctly.
6. Don't use the following features of RMI:
* RMISocketFactory
* UnicastRemoteObject
* Unreferenced
* The DGC interfaces

You might be getting the error because of not conforming to one of the above restrictions.
 
Suneesh Raman
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In one of the method I have been using which was returning Collection which contain the Local entity bean objects . I changed the method by extracting the properties from the bean object and added the primitives to an array list and returned . It worked .

Thanks
Suneesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!