[jBPM] - Active Execution with executionId is null?
by Lalit Bhatia
Lalit Bhatia [http://community.jboss.org/people/lalitbhatia] created the discussion
"Active Execution with executionId is null?"
To view the discussion, visit: http://community.jboss.org/message/550324#550324
--------------------------------------------------------------
Hi,
m facing this problem when I run my JUnit to test a method to signal an execution which inturn calls this simple code -
h6. // query the process instance
ProcessInstanceQuery query = executionService.createProcessInstanceQuery();
ProcessInstance pi = query.processInstanceKey(key).list().get(0);
if(pi != null){
// signal PI to move forward
pi = executionService.signalExecutionById(pi.getId());
}
-----------------------------------------------------------------------------------------
Error Trace
-----------------------------------------------------------------------------------------
org.jbpm.api.JbpmException: executionId is null
at org.jbpm.pvm.internal.cmd.SignalCmd.<init>(SignalCmd.java:45)
at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:84)
at com.bankofamerica.crme.clientservice.service.impl.WorkflowServiceImpl.signalExecutionByBusinessKey(WorkflowServiceImpl.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy23.signalExecutionByBusinessKey(Unknown Source)
at com.bankofamerica.crme.clientservice.service.impl.WorkflowServiceNewTest.testSignalExecutionByBusinessKey(WorkflowServiceNewTest.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
-----------------------------------------------------------------------------------------------------------------------------------------------
Attached all my config files.
** Any suggestion?
Thanks,
Lalit
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/550324#550324]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[EJB 3.0] - Problem with remote JNP. Can't connect to remote JBoss
by Ilya Muromtsev
Ilya Muromtsev [http://community.jboss.org/people/timeking] created the discussion
"Problem with remote JNP. Can't connect to remote JBoss"
To view the discussion, visit: http://community.jboss.org/message/550299#550299
--------------------------------------------------------------
When startup JBoss localy it is works fine: all beans are works well.
I want to separate server and remote client.
But when I trying to connect to *+remote+* +JBoss+ by changing+ *java.naming.provider.url*+ property
from +jnp://127.0.0.1:1099+
to +jnp://remote-JBoss-IP:1099+
in the *jndi.properties* file.
Resulted +jndi.properties+ file is:
> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
> java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
> java.naming.provider.url=+jnp://remote-JBoss-IP:1099+
Then I recieve an exception:
> javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: server; nested exception is:
> java.net.UnknownHostException: server]
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:841)
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
> at javax.naming.InitialContext.lookup(InitialContext.java:392)
> at ru.net.wingbull.shop.client.ApplicationMain.createAndShowGUI(ApplicationMain.java:28)
> at ru.net.wingbull.shop.client.ApplicationMain.access$000(ApplicationMain.java:16)
> at ru.net.wingbull.shop.client.ApplicationMain$1.run(ApplicationMain.java:45)
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
> at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
> at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
> Caused by: java.rmi.UnknownHostException: Unknown host: server; nested exception is:
> java.net.UnknownHostException: server
> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:598)
> at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
> at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
> at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
> at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
> ... 13 more
> Caused by: java.net.UnknownHostException: server
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> at java.net.Socket.connect(Socket.java:529)
> at java.net.Socket.connect(Socket.java:478)
> at java.net.Socket.<init>(Socket.java:375)
> at java.net.Socket.<init>(Socket.java:189)
> at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
> at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
> at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
> ... 18 more
> Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHo
> stException: Unknown host: server; nested exception is:
> java.net.UnknownHostException: server]
> at ru.net.wingbull.shop.client.ApplicationMain$1.run(ApplicationMain.java:48)
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
> at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
> at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
> Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: server; nested exception is:
BTW, remote machine localy named as "*server*", and I checked (using +tcpview+ tool) that client application establish connection with remote-JBoss on 1099 but then throwing this exception. How to avoid it?
Ilya
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/550299#550299]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
Re: [jboss-user] [jBPM Development] - Close ProcessEngine upon BPM console undeployment
by Alejandro Guizar
Alejandro Guizar [http://community.jboss.org/people/alex.guizar%40jboss.com] replied to the discussion
"Close ProcessEngine upon BPM console undeployment"
To view the discussion, visit: http://community.jboss.org/message/550290#550290
--------------------------------------------------------------
> My first question would be - do we really need to close ProcessEngine upon console undeployment? I can think of few cases where such approach could be dangerous - just because console was down (either by administrator or server failure) whole process engine will be stopped. Is this desired?
> In my opinion console shall be treated as optional (non intrusive) component so removing it shall not affect the process engine.
>
> Does it affect only Tomcat?
The process engine needs to be closed by the module that created it. In JBoss AS this is already covered since jBPM is deployed as a service. The JbpmService bean correctly closes the engine on stop.
In Tomcat the situation is more complicated. Because it lacks the notion of services, the jbpm-console app creates the process engine itself. The engine cannot be managed by a separate module and shared via JNDI because Tomcat provides a read-only initial context.
In fact, the situation is aggravated due to Configuration.getProcessEngine() returning a shared instance. I take this method to be a formal equivalent of the http://docs.jboss.org/hibernate/stable/core/reference/en/html/tutorial.ht... HibernateUtil class in standalone environments. Unfortunately, it is tempting to call this method from within containers, where it is totally insane. The engine becomes reachable from the entire VM and there is no clear point at which it can be closed.
> If it comes to probable solution, we could register listeners (ServletContectListeners) for console to close down process engine on application destroy.
This would be an option if the shared ProcessEngine could be closed on servlet context destruction, which is not possible as said before. If the servlet context listener built its own unshared engine on initialization, it could close it on destruction. Unfortunately such an engine is unreachable for the console integration components. In a typical web app it would be set as an attribute of the servlet context, but the servlet context itself is unreachable as well.
One promising alternative I want to investigate is the Tomcat http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#Adding%... custom resource factory. There is http://community.jboss.org/wiki/UsingJNDI-boundSessionFactorywithTomcat41 prior art in this direction involving the Hibernate session factory.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/550290#550290]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months