1 Reply Latest reply on Jul 21, 2002 6:19 PM by Dain Sundstrom

    Relation problem getting a java.rmi.ServerException

    Ryan Kinzy Newbie

      I have looked through all the posts and seen some problems that are similar, but haven't seen an answer yet.

      I'm trying to create a simple relation between two beans: TransactionBean and LineItemBean with the primary key on the TransactionBean = transactionBean and the reference field on the LineItemBean = parentBean. I've followed the relation guidelines in the quick start guide, but haven't been able to get it to work. I continue to get a java.rmi.ServerException: null Embedded Exception.

      I've read something about not being able to do this from a remote interface, but I'm not sure if that has anything to do with it. I'm at a lose and really need some help. Suggestions?

      I'm trying to access the line item children from the following code:

      public ArrayList getLineItemList() {
      ArrayList list = new ArrayList();
      Iterator c = getLineItems().iterator();
      while (c.hasNext()) {
      list.add((LineItem)c.next());
      }
      return list;
      }


      The ejb-jar.xml file has the following relations:

      <ejb-relation>
      <ejb-relation-name>TransactionToLineItem</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Transaction-LineItem</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>Transaction</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>lineItems</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>LineItem-Transaction</ejb-relationship-role-name>
      Many
      <cascade-delete />
      <relationship-role-source>
      <ejb-name>LineItem</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>parentID</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      </ejb-relation>

      The jbosscmp-jdbc.xml file is the following:

      <jbosscmp-jdbc>

      <ejb-relation>
      <ejb-relation-name>TransactionToLineItem</ejb-relation-name>
      <read-only>false</read-only>
      <read-time-out>300</read-time-out>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Transaction-LineItem</ejb-relationship-role-name>
      <fk-constraint>true</fk-constraint>
      <key-fields>
      <key-field>
      <field-name>transactionID</field-name>
      <column-name>parentID</column-name>
      </key-field>
      </key-fields>
      <read-ahead>on-load</read-ahead>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>LineItem-Transaction</ejb-relationship-role-name>
      <fk-constraint>true</fk-constraint>
      <key-fields/>
      <read-ahead>on-load</read-ahead>
      </ejb-relationship-role>
      </ejb-relation>

      </jbosscmp-jdbc>

      Here's an excerpt from the log file:

      2002-07-21 09:54:17,288 INFO [org.jboss.web.localhost.Engine] action: Populating form from Transaction:101
      2002-07-21 09:54:17,288 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Transaction] Executing SQL: SELECT name, type, description, state FROM Transaction WHERE (transactionID=?)
      2002-07-21 09:54:17,298 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Transaction] Executing SQL: SELECT name, type, description, state FROM Transaction WHERE (transactionID=?)
      2002-07-21 09:54:17,298 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Transaction] Executing SQL: SELECT name, type, description, state FROM Transaction WHERE (transactionID=?)
      2002-07-21 09:54:17,308 INFO [org.jboss.web.localhost.Engine] action: Forwarding to 'success' page
      2002-07-21 09:54:24,569 INFO [org.jboss.web.localhost.Engine] jsp: init
      2002-07-21 09:54:24,579 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Transaction] Executing SQL: SELECT name, type, description, state FROM Transaction WHERE (transactionID=?)
      2002-07-21 09:54:35,885 INFO [org.jboss.web.localhost.Engine] jsp: init
      2002-07-21 09:54:35,895 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Transaction] Executing SQL: SELECT name, type, description, state FROM Transaction WHERE (transactionID=?)
      2002-07-21 09:54:35,895 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.Transaction] Executing SQL: SELECT lineItemID FROM LineItem WHERE (parentID=?)
      2002-07-21 09:54:36,185 ERROR [org.jboss.web.localhost.Engine] ApplicationDispatcher[/salescenter] Servlet.service() for servlet jsp threw exception
      java.rmi.ServerException: null
      Embedded Exception
      $Proxy46; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      $Proxy46
      javax.ejb.EJBException: null
      Embedded Exception
      $Proxy46
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1208)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:190)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:340)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:193)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.Container.invoke(Container.java:705)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:116)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy45.getLineItemList(Unknown Source)
      at org.apache.jsp.price_0005fbody$jsp._jspService(price_0005fbody$jsp.java:210)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
      at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:820)
      at org.apache.jsp.priceTest$jsp._jspService(priceTest$jsp.java:269)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
      at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1758)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
      at java.lang.Thread.run(Thread.java:484)
      java.lang.ClassCastException: $Proxy46
      at com.k3.transaction.TransactionBean.getLineItemList(Unknown Source)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1197)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:190)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:340)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.jav