5 Replies Latest reply on Nov 28, 2005 2:28 PM by Eric Fennell

    error calling action component / binary fields in entity bea

    Eric Fennell Newbie

      Just a quick question, and it's very possible I'm just missing something or doing something stupid...

      I set up a User entity bean based on the booking example, but I modified it slightly to include a numeric (Long) identity column, similar to entity examples I've seen in Hibernate.

      I basically copied over (and modified as necessary) the booking views and action beans (and interfaces) associated with registering a new user and logging in.

      My application failed, so I tried successively eliminating some of the differences between my app and the booking app.

      It turns out that when I omitted the Long id field (and made username the id column just like the booking example), everything works like a charm.

      This may have been discussed elsewhere on the forums (I did see a post about binary fields in entity beans...)

      Are Long / other types unsupported in this context, or can I circumvent that by including a specific kind of column definition?

      Thanks,

        • 1. Re: error calling action component / binary fields in entity
          Gavin King Master

          There is no reason why this should not work.

          But you have not provided any of the needed information: stacktraces, etc.

          • 2. Re: error calling action component / binary fields in entity
            Eric Fennell Newbie

            Give me a few minutes and I'll attempt to duplicate this. I figured if it was a simple answer I wouldn't chew up forum space with stacktraces.

            • 3. Re: error calling action component / binary fields in entity
              Eric Fennell Newbie

              Superfluous code, perhaps...

              Seems like the real issue is the inclusion of the method

              public int hashCode() {
              return id.hashCode();
              }

              in the entity bean. Once I take this out, everything works fine and I no longer receive the error:

              14:05:11,140 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
              javax.faces.FacesException: Error calling action method of component with id _tagId0:_tagId20
              at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
              at javax.faces.component.UICommand.broadcast(UICommand.java:106)
              at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
              at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
              at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271)
              at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
              at java.lang.Thread.run(Thread.java:595)
              Caused by: javax.faces.el.EvaluationException: /register.xhtml @63,88 action="#{register.register}": javax.ejb.EJBException: null; CausedByException is:
              null
              at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
              at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
              ... 25 more
              Caused by: javax.ejb.EJBException: null; CausedByException is:
              null
              at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:46)
              at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:70)
              at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:136)
              at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:83)
              at $Proxy124.register(Unknown Source)
              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:585)
              at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
              at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
              at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
              at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
              ... 26 more

              ... (teach me to copy something I don't understand)...

              Is this issue trivial at this point (i.e. just don't include the hashcode method), or would you still like to see the code / anything else?

              Thanks,

              • 4. Re: error calling action component / binary fields in entity
                Gavin King Master

                Right, if you refer to Hibernate in Action, you will find advice about implementing equals()/hasCode() correctly for an entity object.

                • 5. Re: error calling action component / binary fields in entity
                  Eric Fennell Newbie

                  Once again, I appreciate your help and patience.