[JBoss jBPM] - ActionHandler and ClassCastException
by aledbf
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@6018e0
| DEBUG - bPersistenceServiceFactory - creating persistence service
| DEBUG - DbPersistenceService - creating hibernate session
| DEBUG - DbPersistenceService - beginning hibernate transaction
| DEBUG - DbPersistenceService - begun hibernate transaction org.hibernate.transaction.JTATransaction@6431f
| 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.invoke(Method.java:585)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(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.invoke(Method.java:585)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(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.processListener(ActionEvent.java:77)
| at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:758)
| at javax.faces.component.UICommand.broadcast(UICommand.java:368)
| at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:448)
| at javax.faces.component.UIViewRoot.processApplication(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.service(FacesServlet.java:244)
| 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:96)
| 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.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| 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:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| 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: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@59fe79'
| DEBUG - Services - closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@9e160a
| 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;
|
| /**
| * @see 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.2\">result</oResultVariable><sBeanName xmlns=\"urn:jbpm.org:jpdl-3.2\">remaingTimesvc</sBeanName><sWSServiceUrl xmlns=\"urn:jbpm.org:jpdl-3.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
19Â years
[JBoss Seam] - Workspaces and Concurrent Conversations
by harpritt
Hi again
im having a bit of a bad day - i can seem to get my mojo back from friday night!....
Ive just noticed that when i log Person A in to Browser A and then Person B in to Browser B - That Person A in Browser A Flicks over to person B.
Ive been thumbing through the JBOSS SEAM book by Yuan & Huete and come accross a chapter that talks about Works Spaces and Concurrent conversations, its late and im a bit tierd so i may have read it wrong but it seems to imply that conversations are kept seperate by default so the symptoms above should only happen if ive told the app to share the user accross sessions..... damn it...
... can anyone point me in the right direction for a solution please..
Thanks again.... i hate being a noob.....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064374#4064374
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064374
19Â years
[JBoss Seam] - better/easier logging configuration?
by ellenzhao
Hi folks,
I don't know how many people still watch console a lot and resort to log files when debugging, maybe only me (my eclipse amd64 version on Debian crashes whenever I attempted to start the jboss server from the eclipse and crashes whenever I start any debugger....)...
I wish the seam-gen could provide a template log4j.properties so that people who do need neat logging can easily configure appenders, output file names (like "myProject.log") and category filters (like "org.jboss = ERROR, org.hibernate = WARN, org.jboss.seam = WARN, org.mydomain = DEBUG, ...." ) in this file. And this file should be deployed together with the app code. If the developer is not using log4j, then a template for jdk logging configuration could be generated.
Maybe the seam-gen can add dialogs like this:
|
| Do you want a template for logging configuration? [yes or no, default no]
| yes
|
| Which logging engine are you using? [log4j or jdk, default log4j]
| log4j
|
| What's the preferred name of your logging file? [default myproject.log]
| myproject.log
|
| ...
|
Regards,
Ellen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064367#4064367
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064367
19Â years