OK.
I think this is the typical case when the class bytecode is equal, but the 
classes are loaded by different classloaders (if this was not the case, the web 
application would fail and the application only fails when I access it through 
the EJB). 
In any case, here is the trace of the exception:

  | 14:34:37,859 ERROR [LogInterceptor] EJBException in method: public abstract 
org.ildefe.webfciobusiness.command.interfaces.Command 
org.ildefe.ejb.interfaces.WorkFlow.executeCommand(org.ildefe.webfciobusiness.command.interfaces.Command)
 throws java.rmi.RemoteException,javax.ejb.EJBException, causedBy:
  | org.ildefe.webfciobusiness.exceptions.AppException
  |     at 
org.ildefe.webfciobusiness.command.impl.TerceroCommand.execute(TerceroCommand.java:61)
  |     at org.ildefe.ejb.impl.WorkFlow.executeCommand(WorkFlow.java:69)
  |     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:324)
  |     at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
  |     at 
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
  |     at 
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
  |     at 
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
  |     at 
org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
  |     at 
org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
  |     at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
  |     at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
  |     at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
  |     at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
  |     at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
  |     at 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
  |     at 
org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
  |     at org.jboss.ejb.Container.invoke(Container.java:873)
  |     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:324)
  |     at 
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
  |     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
  |     at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
  |     at 
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
  |     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
  |     at 
org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
  |     at 
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
  |     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:324)
  |     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
  |     at sun.rmi.transport.Transport$1.run(Transport.java:148)
  |     at java.security.AccessController.doPrivileged(Native Method)
  |     at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
  |     at 
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
  |     at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
  |     at java.lang.Thread.run(Thread.java:534)
  | Caused by: java.lang.ClassCastException
  |     at 
org.ildefe.webfciobusiness.dao.impl.UsuarioDAOHibernateImpl.getTerceroByDNI(UsuarioDAOHibernateImpl.java:83)
  |     at 
org.ildefe.webfciobusiness.command.impl.TerceroCommand.execute(TerceroCommand.java:53)
  |     ... 41 more
  | Causada por: 
  | java.lang.ClassCastException
  |     at 
org.ildefe.webfciobusiness.dao.impl.UsuarioDAOHibernateImpl.getTerceroByDNI(UsuarioDAOHibernateImpl.java:83)
  |     at 
org.ildefe.webfciobusiness.command.impl.TerceroCommand.execute(TerceroCommand.java:53)
  |     at org.ildefe.ejb.impl.WorkFlow.executeCommand(WorkFlow.java:69)
  |     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:324)
  |     at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
  |     at 
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
  |     at 
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
  |     at 
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
  |     at 
org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
  |     at 
org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
  |     at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
  |     at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
  |     at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
  |     at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
  |     at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
  |     at 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
  |     at 
org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
  |     at org.jboss.ejb.Container.invoke(Container.java:873)
  |     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:324)
  |     at 
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
  |     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
  |     at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
  |     at 
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
  |     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
  |     at 
org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
  |     at 
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
  |     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:324)
  |     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
  |     at sun.rmi.transport.Transport$1.run(Transport.java:148)
  |     at java.security.AccessController.doPrivileged(Native Method)
  |     at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
  |     at 
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
  |     at 
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
  |     at java.lang.Thread.run(Thread.java:534)
  | 
The UsuarioDAOHibernateImpl.java:83 line is the line I showed in the past topic:

  | tercero = (Tercero)q.uniqueResult();
  | 

IMPORTANT: The actual code of the execute method of the Command class is:

  | public void execute() throws AppException {
  |             Session session = null;
  |             JbpmSession jbpmSession = null;
  |             try {
  |                     session = PersistenceUtil.getSession();
  |                     jbpmSession = PersistenceUtil.getJbpmSession();
  |                     
  |                     if(getTercero().getDni() != null && 
!"".equals(getTercero().getDni())){
  |                             UsuarioDAOHibernateImpl usuarioDAO = new 
UsuarioDAOHibernateImpl();
  |                             Tercero terceroBBDD = 
usuarioDAO.getTerceroByDNI(new Long(getTercero().getDni()).longValue(), 
session);
  |                             if(terceroBBDD != null){
  |                                     setTercero(terceroBBDD);
  |                                     ProcessInstanceDAOHibernateImpl 
processInstanceDAO = new ProcessInstanceDAOHibernateImpl();
  |                                     
setTramitesTercero(processInstanceDAO.getTramitesTercero(terceroBBDD.getDni(), 
session, jbpmSession));
  |                             }
  |                     }
  |             } catch (Exception e) {
  |                     throw new AppException(e);
  |             }finally{
  |                     try {
  |                             PersistenceUtil.closeJbpmSession(jbpmSession);
  |                             PersistenceUtil.closeSession(session);
  |                     } catch (InfrastructureException e) {
  |                             throw new AppException("Error al intentar 
cerrar las sesiones de Hibernate (Session y JbpmSession)", e);
  |                     }
  |             }
  |     }
  | 
It's similar that the first topic, although with less redundant code.
The TerceroCommand execute method, line 53 is

  | Tercero terceroBBDD = usuarioDAO.getTerceroByDNI(new 
Long(getTercero().getDni()).longValue(), session);
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3890780#3890780

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3890780


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to