Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- ActionHandler and ClassCastException

- ActionHandler and ClassCastException

2007-07-15       - By aledbf

 Back
Hi, I'm a new user en jbpm and I have one problem executing an Action.
Here is the error

 | DEBUG - JbpmContextInfo            - creating jbpm context with service
factories '[tx, message, scheduler, logging, persistence, authentication]'
 | DEBUG - JbpmContext                - creating org.jbpm.JbpmContext@(protected)
 | DEBUG - bPersistenceServiceFactory - creating persistence service
 | DEBUG - DbPersistenceService       - creating hibernate session
 | DEBUG - DbPersistenceService       - beginning hibernate transaction
 | DEBUG - DbPersistenceService       - begun hibernate transaction org
.hibernate.transaction.JTATransaction@(protected)
 | DEBUG - GraphElement               - event 'before-signal' on 'StartState
(Solicitar Vacaciones)' for 'Token(/)'
 | DEBUG - GraphElement               - event 'node-leave' on 'StartState
(Solicitar Vacaciones)' for 'Token(/)'
 | DEBUG - GraphElement               - event 'transition' on 'Transition
(ObtenerDias)' for 'Token(/)'
 | DEBUG - GraphElement               - event 'node-enter' on 'Node(Determinar
Dias Disponibles)' for 'Token(/)'
 | DEBUG - GraphElement               - executing action 'action
[DeterminarDias]'
 | DEBUG - Token                      - token[2] is locked by token[2]
 | DEBUG - Token                      - token[2] is unlocked by token[2]
 | ERROR - GraphElement               - action threw exception: jbpm
.SpringInvocationHandler
 | java.lang.ClassCastException Source code of java.lang.ClassCastException: jbpm.SpringInvocationHandler
 |         at org.jbpm.graph.def.Action.execute(Action.java:121)
 |         at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java
:255)
 |         at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java
:220)
 |         at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent
(GraphElement.java:190)
 |         at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
 |         at org.jbpm.graph.def.Node.enter(Node.java:302)
 |         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 Source code of java.lang.reflect.Method(Method.java:585)
 |         at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer Source code of org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer
(CGLIBLazyInitializer.java:157)
 |         at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$a160d766.enter(
<generated>)
 |         at org.jbpm.graph.def.Transition.take(Transition.java:151)
 |         at org.jbpm.graph.def.Node.leave(Node.java:393)
 |         at org.jbpm.graph.node.StartState.leave(StartState.java:70)
 |         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 Source code of java.lang.reflect.Method(Method.java:585)
 |         at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer Source code of org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer
(CGLIBLazyInitializer.java:157)
 |         at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$a160d766.leave(
<generated>)
 |         at org.jbpm.graph.exe.Token.signal(Token.java:194)
 |         at org.jbpm.graph.exe.Token.signal(Token.java:157)
 |         at org.jbpm.jsf.core.action.SignalActionListener.handleAction
(SignalActionListener.java:56)
 |         at org.jbpm.jsf.core.impl.JbpmActionListenerWrapper.processAction
(JbpmActionListenerWrapper.java:82)
 |         at javax.faces.event.ActionEvent Source code of javax.faces.event.ActionEvent(ActionEvent.java
:77)
 |         at javax.faces.component.UIComponentBase Source code of javax.faces.component.UIComponentBase(UIComponentBase
.java:758)
 |         at javax.faces.component.UICommand Source code of javax.faces.component.UICommand(UICommand.java:368)
 |         at javax.faces.component.UIViewRoot Source code of javax.faces.component.UIViewRoot(UIViewRoot.java
:448)
 |         at javax.faces.component.UIViewRoot Source code of javax.faces.component.UIViewRoot(UIViewRoot
.java:752)
 |         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute
(InvokeApplicationPhase.java:97)
 |         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java
:248)
 |         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java
:117)
 |         at javax.faces.webapp.FacesServlet Source code of javax.faces.webapp.FacesServlet(FacesServlet.java:244)
 |         at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:252)
 |         at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:173)
 |         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
(ReplyHeaderFilter.java:96)
 |         at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:202)
 |         at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:173)
 |         at org.apache.catalina.core.StandardWrapperValve Source code of org.apache.catalina.core.StandardWrapperValve
(StandardWrapperValve.java:213)
 |         at org.apache.catalina.core.StandardContextValve Source code of org.apache.catalina.core.StandardContextValve
(StandardContextValve.java:178)
 |         at org.jboss.web.tomcat.security.SecurityAssociationValve Source code of org.jboss.web.tomcat.security.SecurityAssociationValve
(SecurityAssociationValve.java:175)
 |         at org.apache.catalina.authenticator.AuthenticatorBase Source code of org.apache.catalina.authenticator.AuthenticatorBase
(AuthenticatorBase.java:524)
 |         at org.jboss.web.tomcat.security.JaccContextValve.invoke
(JaccContextValve.java:74)
 |         at org.apache.catalina.core.StandardHostValve Source code of org.apache.catalina.core.StandardHostValve
(StandardHostValve.java:126)
 |         at org.apache.catalina.valves.ErrorReportValve Source code of org.apache.catalina.valves.ErrorReportValve
(ErrorReportValve.java:105)
 |         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke
(CachedConnectionValve.java:156)
 |         at org.apache.catalina.core.StandardEngineValve Source code of org.apache.catalina.core.StandardEngineValve
(StandardEngineValve.java:107)
 |         at org.apache.catalina.connector.CoyoteAdapter Source code of org.apache.catalina.connector.CoyoteAdapter
(CoyoteAdapter.java:148)
 |         at org.apache.coyote.http11.Http11Processor Source code of org.apache.coyote.http11.Http11Processor(Http11Processor
.java:869)
 |         at org.apache.coyote.http11.Http11BaseProtocol Source code of org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 |         at org.apache.tomcat.util.net.PoolTcpEndpoint Source code of org.apache.tomcat.util.net.PoolTcpEndpoint
(PoolTcpEndpoint.java:527)
 |         at org.apache.tomcat.util.net.MasterSlaveWorkerThread Source code of org.apache.tomcat.util.net.MasterSlaveWorkerThread
(MasterSlaveWorkerThread.java:112)
 |         at java.lang.Thread Source code of java.lang.Thread(Thread.java:613)
 | DEBUG - JbpmContext                - closing JbpmContext
 | DEBUG - Services                   - executing default save operations
 | DEBUG - HibernateSaveOperation     - saving process instance
 | DEBUG - SaveLogsOperation          - flushing logs to logging service.
 | DEBUG - CascadeSaveOperation       - cascading save of 'org.jbpm.graph.exe
.ProcessInstance@(protected)'
 | DEBUG - Services                   - closing service 'persistence': org
.jbpm.persistence.db.DbPersistenceService@(protected)
 | DEBUG - DbPersistenceService       - rolling back hibernate transaction
 | DEBUG - DbPersistenceService       - closing hibernate session
 |

and this is the code of the handler:

 |
 |
 |
 | public class SpringInvocationHandler implements ActionHandler
 | {
 |
 |     private String oResultVariable;
 |
 |     private String sWSServiceUrl;
 |
 |     private String sBeanName;
 |
 |     private String sExtraParam;
 |
 |     /**
 |      * @(protected) org.jbpm.graph.def.ActionHandler#execute(org.jbpm.graph.exe
.ExecutionContext)
 |      */
 |     public void execute( final ExecutionContext executionContext )
 |     {
 |         try
 |         {
 |             final Map<Object, Object> oProcessParams =
 |                 (Map) executionContext.getProcessInstance()
.getContextInstance().getVariables();
 |
 |             if (sExtraParam != null)
 |             {
 |                 String[] aMapContent = sExtraParam.split( "=" );
 |                 if (aMapContent != null && aMapContent.length == 2)
 |                 {
 |                     oProcessParams.put( aMapContent[0], aMapContent[1] );
 |                 }
 |             }
 |
 |             final String sInstanceId =
 |                 String.valueOf( executionContext.getToken().getId() );
 |             final String sProcessName =
 |                 executionContext.getToken().getNode().getName();
 |             final Service serviceModel =
 |                 new ObjectServiceFactory().create( IWSFrontController.class
);
 |             final XFire xfire = XFireFactory.newInstance().getXFire();
 |             final XFireProxyFactory factory = new XFireProxyFactory( xfire
);
 |
 |             try
 |             {
 |                 final IWSFrontController oSpringClient =
 |                     (IWSFrontController) factory.create( serviceModel,
sWSServiceUrl );
 |                 final Object oResult =
 |                     oSpringClient.execute( sBeanName, sInstanceId,
sProcessName, oProcessParams );
 |                 executionContext.setVariable( oResultVariable, oResult );
 |             } catch (Exception e)
 |             {
 |                 e.printStackTrace();
 |             }
 |         } catch (Exception e)
 |         {
 |             e.printStackTrace();
 |         }
 |     }
 | ...
 |
 | (plus the getter and setter of the fields).
 |

I try the config-type field and bean whith the same result.
If I see the source code of Action (line 151) the error belong a manual cast
and later execution of the handler. But if I try this:

 |         String sConf =
 |             "<oResultVariable xmlns=\"urn:jbpm.org:jpdl-3 (See http://pdl-3.ora-code.com).2\">result<
/oResultVariable><sBeanName xmlns=\"urn:jbpm.org:jpdl-3 (See http://pdl-3.ora-code.com).2\">remaingTimesvc<
/sBeanName><sWSServiceUrl xmlns=\"urn:jbpm.org:jpdl-3 (See http://pdl-3.ora-code.com).2\">http://10.0.0.126:8080
/services/WSFrontController</sWSServiceUrl>";
 |         Object o =
 |             new FieldInstantiator().instantiate( jbpm
.SpringInvocationHandler.class, sConf );
 |         ActionHandler o1 = (ActionHandler) o;
 |
works fine.

The jbpm version is 3.2.1.

Any idea?
Thanks in advice.


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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4064376
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.