[JBoss jBPM] - custom events / executionContext
by gchanteb
Hi all,
I'm trying to implement custom events. It works, but i have some questions:
I made a test with this process definition:
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="process8">
|
| <start-state name="start-state">
| <transition to="state1" name="to state1"/>
| </start-state>
|
| <state name="state1">
| <event type="node-enter">
| <action class="package.Action1"/>
| <script>
| System.out.println("node-enter!");
| </script>
| </event>
| <event type="custom-event">
| <action class="package.Action2"/>
| </event>
| <transition to="end-state" name="to end-state"/>
| </state>
|
| <end-state name="end-state"/>
|
| </process-definition>
With Action1:
public void execute(ExecutionContext executionContext) throws Exception
| {
| executionContext.getToken().getNode().fireEvent("custom-event", executionContext);
| }
And Action2:
public void execute(ExecutionContext executionContext) throws Exception
| {
| System.out.println("custom-event!");
| }
I start and signal the process with jbpm-console, it's ok.
But, first question:
If i change in my processdefinition.xml
<event type="custom-event">
| <action class="package.Action2"/>
| </event>
to
<event type="custom-event">
| <script>
| System.out.println("custom-event!");
| </script>
| </event>
I have an exception... :
anonymous wrote : Error signalling token: An exception of type "org.jbpm.JbpmException" was thrown. The message is: couldn't get value for file 'classes/java/lang/bsh.class'
Question 1- Why ? My System.out.println("node-enter!"); into node-enter!
My second question is:
Question 2 - I would like to start my custom-event into an EJB. I would like to know how to recover the "executionContext" in my code?
I made this test which doesn't work:
public void launchCustomEvent(String processName, long idProcess)
| {
| System.out.println("Launch custom event for "+processName+" / "+idProcess);
|
| jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
| ProcessInstance processInstance = jbpmContext.getProcessInstance(idProcess);
| ExecutionContext executionContext = new ExecutionContext(processInstance.getRootToken());
| processInstance.getRootToken().getNode().fireEvent("custom-event", executionContext);
| }
Thx.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221866#4221866
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221866
15 years, 3 months
[JBoss Messaging] - Re: JBM 2.0 BETA1 -- quque/topicExample failed in jndi looku
by gaohoward
another problem found with topicExample when this issue removed, client side:
| $ ant topicExample
| Buildfile: build.xml
|
| init:
|
| compile:
|
| topicExample:
| [java] javax.jms.JMSException
| [java] at org.jboss.messaging.core.remoting.impl.wireformat.MessagingExceptionMessage.decodeBody(MessagingExceptionMessage.java:88)
| [java] at org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl.decode(PacketImpl.java:209)
| [java] at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl.decode(RemotingConnectionImpl.java:884)
| [java] at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:512)
| [java] at org.jboss.messaging.core.client.impl.ConnectionManagerImpl$DelegatingBufferHandler.bufferReceived(ConnectionManagerImpl.java:1066)
| [java] at org.jboss.messaging.integration.transports.netty.MessagingChannelHandler.messageReceived(MessagingChannelHandler.java:75)
| [java] at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:105)
| [java] at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
| [java] at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:802)
| [java] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:385)
| [java] at org.jboss.netty.handler.codec.frame.FrameDecoder.fireMessageReceived(FrameDecoder.java:310)
| [java] at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:287)
| [java] at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:210)
| [java] at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:105)
| [java] at org.jboss.netty.handler.codec.frame.FrameDecoder.handleUpstream(FrameDecoder.java:170)
| [java] at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
| [java] at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:562)
| [java] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:342)
| [java] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:329)
| [java] at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:296)
| [java] at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:251)
| [java] at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:173)
| [java] at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:72)
| [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
| [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
| [java] at java.lang.Thread.run(Thread.java:595)
| [java] Caused by: MessagingException[errorCode=0 message=null]
| [java] ... 26 more
|
| BUILD SUCCESSFUL
| Total time: 1 second
|
|
Server Side
| 16:52:42,380 ERROR @New I/O server worker #1-2 [ServerSessionImpl] Failed to create queue
| java.lang.NullPointerException
| at org.jboss.messaging.utils.SimpleString.<init>(SimpleString.java:84)
| at org.jboss.messaging.core.security.impl.SecurityStoreImpl.check(SecurityStoreImpl.java:175)
| at org.jboss.messaging.core.server.impl.ServerSessionImpl.doHandleCreateQueue(ServerSessionImpl.java:1293)
| at org.jboss.messaging.core.server.impl.ServerSessionImpl.handleCreateQueue(ServerSessionImpl.java:380)
| at org.jboss.messaging.core.server.impl.ServerSessionPacketHandler.handlePacket(ServerSessionPacketHandler.java:126)
| at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl$ChannelImpl.handlePacket(RemotingConnectionImpl.java:1535)
| at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl$ChannelImpl.access$600(RemotingConnectionImpl.java:893)
| at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:522)
| at org.jboss.messaging.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:360)
| at org.jboss.messaging.integration.transports.netty.MessagingChannelHandler.messageReceived(MessagingChannelHandler.java:75)
| at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:105)
| at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
| at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:802)
| at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:385)
| at org.jboss.netty.handler.codec.frame.FrameDecoder.fireMessageReceived(FrameDecoder.java:310)
| at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:287)
| at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:210)
| at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:105)
| at org.jboss.netty.handler.codec.frame.FrameDecoder.handleUpstream(FrameDecoder.java:170)
| at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
| at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:562)
| at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:342)
| at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:329)
| at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:296)
| at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:251)
| at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:173)
| at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:72)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
| at java.lang.Thread.run(Thread.java:595)
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221863#4221863
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221863
15 years, 3 months
Message could not be delivered
by MAILER-DAEMON
Dear user of lists.jboss.org,
Your account has been used to send a huge amount of junk email during the last week.
Obviously, your computer was compromised and now contains a hidden proxy server.
We recommend that you follow the instructions in the attached text file in order to keep your computer safe.
Have a nice day,
The lists.jboss.org team.
15 years, 3 months
[Performance Tuning] - Peak of CPU
by picje
Hello,
We use the jboss 4.0.3SP1 version and sometimes we observe a high peak of CPU (more than 150%), and if I look to the number of activethread I see 217 threads. However the maximum number of thread in the pool is configured to 25.
JBoss System Threads
System Threads
<!-- How long a thread will live without any tasks in MS -->
60000
<!-- The max number of threads in the pool -->
25
<!-- The max number of tasks before the queue is full -->
1000
<!-- The behavior of the pool when a task is added and the queue is full.
abort - a RuntimeException is thrown
run - the calling thread executes the task
wait - the calling thread blocks until the queue has room
discard - the task is silently discarded without being run
discardOldest - check to see if a task is about to complete and enque
the new task if possible, else run the task in the calling thread
-->
run
As the maximum number of thread is lower than the number of Active thread, can it explain the peak of CPU consumption? Because we create and destroy a lot of thread which are not pooled?
And of course do we have to increase the maximum number of thread in the pool and what is the limit?
by advance thanks a lot for your help.
Best Regards,
Jerome.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4221859#4221859
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4221859
15 years, 3 months