[jBPM] - jbpm5.2.final and Jboss 5.1 issue when creating the ksession
by miloud haimoune
miloud haimoune [http://community.jboss.org/people/milhaim] created the discussion
"jbpm5.2.final and Jboss 5.1 issue when creating the ksession"
To view the discussion, visit: http://community.jboss.org/message/643520#643520
--------------------------------------------------------------
Hi all,
I was using jbpm5.1.final on jboss 5.1 server, after migrating to jbpm5.2.final I had this issue :
] Participating in existing JTA transaction, but no JTA TransactionManager or TransactionSychronizationRegistry available:
javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.syncwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.syncwhenaborted] Can't register synchronization because the transaction is in aborted state
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronizationImple(TransactionImple.java:476)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronization(TransactionImple.java:451)
at org.drools.persistence.jta.JtaTransactionManager.registerTransactionSynchronization(JtaTransactionManager.java:229)
at org.drools.persistence.SingleSessionCommandService.registerRollbackSync(SingleSessionCommandService.java:388)
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:149)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:129)
.......
I'm using a persisted session
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
Properties sessionconfigproperties = new Properties();
sessionconfigproperties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
sessionconfigproperties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(sessionconfigproperties);
ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
The same code was running correctly with jbpm 5.1
any suggestion ?
many thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/643520#643520]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 4 months
[JBoss Remoting] - meet hang on call a ejb, add a timeout property in jboss-server.xml?
by freeliuade freeliuade
freeliuade freeliuade [http://community.jboss.org/people/freeliuade] created the discussion
"meet hang on call a ejb, add a timeout property in jboss-server.xml?"
To view the discussion, visit: http://community.jboss.org/message/643490#643490
--------------------------------------------------------------
Hi,
I'm doing a nagative case for my application, a client to call a ejb server. (client and server is on different machine), when ejb call reach server side, unplug the server machine network. (by using debug to suspend server side to know the ejb server is on processing client call)
client will wait forever. following is the client side thread dump, block at java.net.SocketInputStream.socketRead0(Native Method), and I debugged it, the timeout value send to native api is 0, means never timeout.
C:\Documents and Settings\hyliu>jstack 18320
2011-12-28 14:32:26
Full thread dump Java HotSpot(TM) Client VM (17.0-b17 mixed mode):
"RMI RenewClean-[pek-wkst71btb:1101]" daemon prio=6 tid=0x171ec000 nid=0x19f0 in Object.wait() [0x17
3af000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x02eb00d0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <0x02eb00d0> (a java.lang.ref.ReferenceQueue$Lock)
at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:516)
at java.lang.Thread.run(Thread.java:619)
"RMI Scheduler(0)" daemon prio=6 tid=0x171ddc00 nid=0x4070 waiting on condition [0x1735f000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x07f746b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
at java.util.concurrent.DelayQueue.take(DelayQueue.java:160)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
"GC Daemon" daemon prio=2 tid=0x171da400 nid=0x43c4 in Object.wait() [0x1730f000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x07f74038> (a sun.misc.GC$LatencyLock)
at sun.misc.GC$Daemon.run(GC.java:100)
- locked <0x07f74038> (a sun.misc.GC$LatencyLock)
"RMI RenewClean-[pek-wkst2cwxc:1101]" daemon prio=6 tid=0x171d9800 nid=0x471c in Object.wait() [0x17
2bf000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x07f73cb0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <0x07f73cb0> (a java.lang.ref.ReferenceQueue$Lock)
at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:516)
at java.lang.Thread.run(Thread.java:619)
"Low Memory Detector" daemon prio=6 tid=0x16bc8400 nid=0x3c78 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
"CompilerThread0" daemon prio=10 tid=0x16bb2000 nid=0x2090 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
"JDWP Command Reader" daemon prio=6 tid=0x16baec00 nid=0x45b4 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
"JDWP Event Helper Thread" daemon prio=6 tid=0x16bad400 nid=0x2bb0 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
"JDWP Transport Listener: dt_socket" daemon prio=6 tid=0x16baa800 nid=0x26c0 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
"Attach Listener" daemon prio=10 tid=0x16b9a800 nid=0x4704 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=10 tid=0x16b99400 nid=0x403c runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=8 tid=0x16b89000 nid=0x3cbc in Object.wait() [0x16cff000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x07f20a30> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <0x07f20a30> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
"Reference Handler" daemon prio=10 tid=0x16b84400 nid=0x40f8 in Object.wait() [0x16caf000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x07f20958> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x07f20958> (a java.lang.ref.Reference$Lock)
"main" prio=6 tid=0x00847800 nid=0x449c runnable [0x0091f000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
- locked <0x02afb570> (a java.io.BufferedInputStream)
at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2249)
at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:242
9)
at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2499)
at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2571)
at java.io.ObjectInputStream.read(ObjectInputStream.java:820)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.readVersion(MicroSocketClientInvoker.java:1000)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:574)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
at org.jboss.remoting.Client.invoke(Client.java:1634)
at org.jboss.remoting.Client.invoke(Client.java:548)
at org.jboss.invocation.unified.interfaces.UnifiedInvokerHAProxy.invoke(UnifiedInvokerHAProxy.java:188)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
at org.jboss.proxy.ejb.RetryInterceptor.invoke(RetryInterceptor.java:176)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy2.getDomainInfo(Unknown Source)
at com.qilin.EJBLookupTest.lookupEJB(EJBLookupTest.java:78)
at com.qilin.EJBLookupTest.lookup(EJBLookupTest.java:58)
at com.qilin.EJBLookupTest.main(EJBLookupTest.java:33)
"VM Thread" prio=10 tid=0x16b81c00 nid=0x43c8 runnable
"VM Periodic Task Thread" prio=10 tid=0x16bca000 nid=0x4314 waiting on condition
JNI global references: 2172
and after some google search, add a timeout property (blue part) in server side jboss-service.xml can get a timeout. and tried it works
<!-- The following are specific to socket invoker -->
<!-- <attribute name="numAcceptThreads">1</attribute>-->
<!-- <attribute name="maxPoolSize">303</attribute>-->
<!-- <attribute name="clientMaxPoolSize" isParam="true">304</attribute>-->
*<attribute name="timeout" isParam="true">600000</attribute>*
<attribute name="socketTimeout" isParam="true">600000</attribute>
<attribute name="serverBindAddress">${jboss.bind.address}</attribute>
<attribute name="serverBindPort">4446</attribute>
<!-- <attribute name="clientConnectAddress">216.23.33.2</attribute> -->
<!-- <attribute name="clientConnectPort">7777</attribute> -->
My question are:
1. is it a right way to add this timeout. what's any side effect?
2. why jboss hasn't a default timeout value for this?
BTW, the ejb is a cluster ejb, have multiple nodes run on server side. unpluged one of nodes's network when using debug to get the client call is load balanced to this node.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/643490#643490]
Start a new discussion in JBoss Remoting at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 4 months
[Javassist] - Javassist 3.15.0-GA, StackOverflowError with $sig in call to static method, can anyone confirm?
by Wanja Gayk
Wanja Gayk [http://community.jboss.org/people/wgayk] created the discussion
"Javassist 3.15.0-GA, StackOverflowError with $sig in call to static method, can anyone confirm?"
To view the discussion, visit: http://community.jboss.org/message/643454#643454
--------------------------------------------------------------
Cheers,
here's an Example of a possible bug I've found.
Could anyone confirm this or prove me an idiot, so I can either file a bug report or go kill myself in shame?
Using $sig or $class as method parameter only seems to work on nonstatic methods, on static methods I get a StackOverflow Error.
Have I missed something in the dicumentation or is that a serious bug?
I could reproduce this with the latest JRE6 and the current JRE7:
Using $sig:
instrumenting class: de/plush/brix/instrumentation/Main (995 bytes)
instrumenting class: javassist/runtime/Desc (3280 bytes)
Exception in thread "main" java.lang.StackOverflowError
at javassist.runtime.Desc.getParams(Desc.java)
at javassist.runtime.Desc.getParams(Desc.java)
at javassist.runtime.Desc.getParams(Desc.java)
[..]
Using $class:
instrumenting class: de/plush/brix/instrumentation/Main (995 bytes)
instrumenting class: javassist/runtime/Desc (3280 bytes)
Exception in thread "main" java.lang.StackOverflowError
at javassist.runtime.Desc.getClazz(Desc.java)
at javassist.runtime.Desc.getClazz(Desc.java)
[...]
Compile the following code, create JAR-File, have a manifest like:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.7.0_02-b13 (Oracle Corporation)
Premain-Class: de.plush.brix.instrumentation.Agent
Class-Path: javassist.jar
Start some Main.class with the jvm-arg:
-javaagent:${project_loc}\Agent.jar
And watch it happen.
package de.plush.brix.instrumentation;
public class Main {
void foo() {
System.out.println("Hello world");
}
public static void main(final String[] args) {
new Main().foo();
}
}
package de.plush.brix.instrumentation;
import java.io.IOException;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Modifier;
import java.security.ProtectionDomain;
import java.util.Arrays;
import javassist.ByteArrayClassPath;
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;
public class Agent implements ClassFileTransformer {
public Agent(final String agentArgs, final Instrumentation instrumentation) {
instrumentation.addTransformer(this);
}
public static void premain(final String agentArgs, final Instrumentation inst) {
new Agent(agentArgs, inst);
}
public static void before(Class[] paramTypes) { //works
System.out.println("test passed");
}
public static void before(Class paramTypes) { //works
System.out.println("test passed");
}
public static void beforeStatic(Class[] paramTypes) { //stackOverflow
System.out.println("test passed");
}
public static void beforeStatic2(Class paramTypes) { //stackOverflow
System.out.println("test passed");
}
@Override
public byte[] transform(final ClassLoader loader, final String className, final Class<?> classBeingRedefined, final ProtectionDomain protectionDomain,
final byte[] classfileBuffer) throws IllegalClassFormatException {
System.out.println("instrumenting class: " + className + " (" + classfileBuffer.length + " bytes)");
try {
final String javaClassName = className.replace('/', '.');
// turn bytecodes into a Javassist CtClass
final CtClass clazz = createClass(classfileBuffer, javaClassName);
// add output at the beginning and end of each method
for (final CtMethod method : clazz.getMethods()) {
if (!isInherited(javaClassName, method)) {
if (Modifier.isStatic(method.getModifiers())) {
method.insertBefore("{"+Agent.class.getName() + ".beforeStatic($sig);}"); // -- $sig kills it!, also $class
// method.insertBefore("{"+Agent.class.getName() + ".beforeStatic2($sig);}"); // -- kills it too!
} else {
method.insertBefore("{"+Agent.class.getName() + ".before($sig);}"); // -- $sig kills it!, also $class
// method.insertBefore("{"+Agent.class.getName() + ".before2($class);}"); // -- kills it too!
}
}
}
return clazz.toBytecode();
} catch (final NotFoundException e) {
throw new RuntimeException(e);
} catch (final CannotCompileException e) {
if (!e.getMessage().contains("no method body")) {
throw new RuntimeException(e);
}
// don't care
} catch (final IOException e) {
throw new RuntimeException(e);
}
return classfileBuffer;
}
private boolean isInherited(final String javaClassName, final CtMethod method) {
return !method.getLongName().startsWith(javaClassName);
}
private CtClass createClass(final byte[] classfileBuffer, final String javassistClassName) throws NotFoundException {
final ClassPool cp = ClassPool.getDefault();
cp.insertClassPath(new ByteArrayClassPath(javassistClassName, classfileBuffer));
final CtClass cc = cp.get(javassistClassName);
return cc;
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/643454#643454]
Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 4 months