  | 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
|
|
|
  | | | - 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 : 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 (Method.java:585) | at 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 (Method.java:585) | at 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 (ActionEvent.java :77) | at javax.faces.component.UIComponentBase (UIComponentBase .java:758) | at javax.faces.component.UICommand (UICommand.java:368) | at javax.faces.component.UIViewRoot (UIViewRoot.java :448) | at 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 (FacesServlet.java:244) | at org.apache.catalina.core.ApplicationFilterChain  (ApplicationFilterChain.java:252) | at 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  (ApplicationFilterChain.java:202) | at org.apache.catalina.core.ApplicationFilterChain  (ApplicationFilterChain.java:173) | at org.apache.catalina.core.StandardWrapperValve  (StandardWrapperValve.java:213) | at org.apache.catalina.core.StandardContextValve  (StandardContextValve.java:178) | at org.jboss.web.tomcat.security.SecurityAssociationValve  (SecurityAssociationValve.java:175) | at 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  (StandardHostValve.java:126) | at 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  (StandardEngineValve.java:107) | at org.apache.catalina.connector.CoyoteAdapter  (CoyoteAdapter.java:148) | at org.apache.coyote.http11.Http11Processor (Http11Processor .java:869) | at org.apache.coyote.http11.Http11BaseProtocol  $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) | at org.apache.tomcat.util.net.PoolTcpEndpoint  (PoolTcpEndpoint.java:527) | at org.apache.tomcat.util.net.MasterSlaveWorkerThread  (MasterSlaveWorkerThread.java:112) | at 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
|
|
 |