[JBoss Web Development] - AJP threads waiting on socket reads in Jboss 7.1.1.final
by Jacob Marcus
Jacob Marcus [https://community.jboss.org/people/jacobmarcus20] created the discussion
"AJP threads waiting on socket reads in Jboss 7.1.1.final"
To view the discussion, visit: https://community.jboss.org/message/747731#747731
--------------------------------------------------------------
Hi all,
I see many threads in a waiting state with the following trace. Is this a problem?
+State: RUNNABLE+
+Total blocked: 3 Total waited: 45+
+Strack trace:+
+ java.net.SocketInputStream.socketRead0(Native Method)+
+ java.net.SocketInputStream.read(SocketInputStream.java:129)+
+ org.apache.coyote.ajp.AjpProcessor.read(AjpProcessor.java:1131)+
+ org.apache.coyote.ajp.AjpProcessor.readMessage(AjpProcessor.java:1213)+
+ org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:451)+
+ org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445)+
+ org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:518)+
+ org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)+
+ org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:801)+
+ org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)+
+ org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:842)+
+ java.lang.Thread.run(Thread.java:662)+
+ org.jboss.threads.JBossThread.run(JBossThread.java:122)+
I see some in the follwoing state. This is what I woud expect as I have configured some core threads.
+State: WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@38380f4b+
+Total blocked: 46 Total waited: 66+
+Strack trace:+
+ sun.misc.Unsafe.park(Native Method)+
+ java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)+
+ java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)+
+ org.jboss.threads.QueueExecutor.takeTask(QueueExecutor.java:746)+
+ org.jboss.threads.QueueExecutor.access$400(QueueExecutor.java:45)+
+ org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:835)+
+ java.lang.Thread.run(Thread.java:662)+
+ org.jboss.threads.JBossThread.run(JBossThread.java:122)+
My thread pool configuration looks like this.
*<bounded-queue-thread-pool name="test-ajp" allow-core-timeout="false">*
* <core-threads count="50"/>*
* <queue-length count="1"/>*
* <max-threads count="650"/>*
* <keepalive-time time="60" unit="seconds"/>*
*</bounded-queue-thread-pool>*
Please let me know why those some of these threads seem to be in a waiting mode. I suspect I am misisng a timeout configuration.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/747731#747731]
Start a new discussion in JBoss Web Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months
[JBoss AS 7 Development] - if-else control flow
by Alexey Loubyansky
Alexey Loubyansky [https://community.jboss.org/people/aloubyansky] created the document:
"if-else control flow"
To view the document, visit: https://community.jboss.org/docs/DOC-18764
--------------------------------------------------------------
With if-else control flow you can choose which set of commands and operations to execute based on a condition. The condition is a boolean expression which evaluates the response of the operation (or command) specified in the if statement. Let's look at an example
if (outcome != success) of /system-property=test:read-resource
/system-property=test:add(value=true)
end-if
The *if* statement can be read as "if the outcome attribute of /system-property=test:read-resource response is not success (which means the property does not exist) then add the property and initialize it to true".
To understand the condition expression better, the result of +/system-property=test:read-resource+ if the test property doesn't exist will be
https://community.jboss.org/docs/DOC-18764/standalone@localhost:9999 / https://community.jboss.org/docs/DOC-18764/standalone@localhost:9999 / /system-property=test:read-resource
{
"outcome" => "failed",
"failure-description" => "JBAS014807: Management resource '[(\"system-property\" => \"test\")]' not found",
"rolled-back" => true
}
You can see that the *outcome* attribute equals *failed*, so the expression in our *if* statement will evaluate to true and the body of the *if* will be executed. If we execute +read-resource+ after the *if* again we'll see
[standalone@localhost:9999 /] /system-property=test:read-resource
{
"outcome" => "success",
"result" => {"value" => "true"}
}
Here is another example which demonstrates *if* with *else* and inverts the true-false value every time it's executed. It also shows how you can navigate the response, i.e. it evaluates attribute *value* - the child *result* - using a dot.
if (result.value == true) of /system-property=test:read-resource
/system-property=test:write-attribute(name=value,value=false)
else
/system-property=test:write-attribute(name=value,value=true)
end-if
The *of* keyword can be followed by any management command or an operation which results in a response from the controller.
And condition expressions can contain
• boolean && (and), || (or) and parentheses to group and prioritize expressions;
• >, >=, < and <= in addition to == and !=;
• the whitespaces are insignificant and ignored.
E.g. something like this could be a valid condition expression: ((a==b || c.c1<=d && e.e1.e2>f) && g!=h || i>=j) && (k<l && m>n || o==p)
If you use a navigation path and the path doesn't exist then the expression (the comparison which involves the path) will evaluate to false.
The examples above are simple and show only one operation in the bodies of the *if* and *else* but there is no such limitation. Each if/else body is a batch (which will be translated into a single composite operation) and can contain any number of commands and operations. Although, nested if-else and try-catch-finally are not yet supported.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-18764]
Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 6 months
[jBPM Development] - Problem to start two instances of the same process
by cip80
cip80 [https://community.jboss.org/people/cip80] created the discussion
"Problem to start two instances of the same process"
To view the discussion, visit: https://community.jboss.org/message/748094#748094
--------------------------------------------------------------
hi,
can someone help me?
I'm trying to start two instances of the same process.
First instance is started correctly, but the second I get this error.
2012-07-13 20:09:04,301 INFO org.jbpm.task.service.hornetq.HornetQTaskClientConnector.createClientQueue:171 - Queue SyncHornetQHTWorkItemHandler already exists
2012-07-13 19:27:29,223 ERROR org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem:181 - Fri Jul 13 19:27:29 CEST 2012: Error when creating task on task server for work item id 1. Error reported by task server: Task operation request timed out
java.lang.RuntimeException: Task operation request timed out
at org.jbpm.task.service.SyncTaskServiceWrapper.addTask(SyncTaskServiceWrapper.java:118)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem(GenericHTWorkItemHandler.java:167)
at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:105)
Both, however, are stored correctly in db.
|
| KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); |
|
|
|
| kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2); |
|
|
|
| KnowledgeBase kbase =kbuilder.newKnowledgeBase(); |
|
|
|
| StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); |
|
|
|
|
|
|
|
|
| HornetQHTWorkItemHandler humanTaskHandler = new HornetQHTWorkItemHandler(ksession); |
|
|
|
| humanTaskHandler.setIpAddress("127.0.0.1"); |
|
|
|
| humanTaskHandler.setPort(5445); |
|
|
|
| ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler); |
|
|
|
|
|
|
|
|
|
|
|
|
|
| Map<String, Object> params = new HashMap<String, Object>(); |
|
|
|
| params.put("employee", "krisv"); |
|
|
|
| params.put("reason", "Yearly performance evaluation"); |
|
|
|
| ksession.startProcess("com.sample.evaluation", params); |
|
| ksession.dispose(); |
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/748094#748094]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months