[jboss-user] [JBoss jBPM] - Question about retrieving User Object from ExecutionContext
RomeuFigueira
do-not-reply at jboss.com
Tue Jan 30 11:17:09 EST 2007
So, I've got this object:
public class MySerializableClass implements java.io.Serializable {
|
| private static final long serialVersionUID = 1L;
|
| int member;
|
| public MySerializableClass(int member){
| this.member = member;
| }
|
| public boolean equals(Object o) {
| if (! (o instanceof MySerializableClass)) return false;
| return ( member == ((MySerializableClass)o).member );
| }
| }
which I put into the context in a certain node by:
context.setVariable("a", new MySerializableClass(4));
and then further down the workflow, I try to retrieve through this operation:
MySerializableClass msc = (MySerializableClass) context.getVariable("a");
And this operation leads to this error:
java.lang.ClassCastException: common.types.MySerializableClass
| at jbpm.notifications.InsertEvent_ActionHandler.execute(InsertEvent_ActionHandler.java:55)
| at org.jbpm.graph.def.Action.execute(Action.java:123)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:235)
| at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:212)
| at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:182)
| at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:166)
| at org.jbpm.graph.def.Node.enter(Node.java:301)
| 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.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:205)
| at org.jbpm.graph.def.Node_$$_javassist_46.enter(Node_$$_javassist_46.java)
| at org.jbpm.graph.def.Transition.take(Transition.java:119)
| at org.jbpm.graph.def.Node.leave(Node.java:383)
| at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
| at org.jbpm.graph.node.Decision.execute(Decision.java:146)
| at org.jbpm.graph.def.Node.enter(Node.java:316)
| 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.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:205)
| at org.jbpm.graph.def.Node_$$_javassist_46.enter(Node_$$_javassist_46.java)
| at org.jbpm.graph.def.Transition.take(Transition.java:119)
| at org.jbpm.graph.def.Node.leave(Node.java:383)
| 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.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:205)
| at org.jbpm.graph.def.Node_$$_javassist_46.leave(Node_$$_javassist_46.java)
| at org.jbpm.graph.exe.Token.signal(Token.java:178)
| at org.jbpm.graph.exe.Token.signal(Token.java:123)
| at vvp.ws.notifications.NotificationsWS.Notify(NotificationsWS.java:122)
| 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.jboss.ws.server.ServiceEndpointInvokerJSE.invokeServiceEndpoint(ServiceEndpointInvokerJSE.java:91)
| at org.jboss.ws.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:151)
| at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:195)
| at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:373)
| at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:116)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:77)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| 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.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:595)
Now, I've searched the forums, and the best awnser that I've got was this one from JoeDeveloper:
http://blogs.sourceallies.com/roller/page/joedeveloper?entry=jbpm_3_1_auto_user
Now, I've tried his approach and still no go, so what possibly could be wrong here?
PS: My class is taken from the jbpm examples (VariableInstanceDbTest.java), which doesnt try to get the object back, only does an assertEquals.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008374#4008374
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008374
More information about the jboss-user
mailing list