[JBoss AOP Development] New message: "Re: ClassPool Refactoring"
by Kabir Khan
User development,
A new message was posted in the thread "ClassPool Refactoring":
http://community.jboss.org/message/518925#518925
Author : Kabir Khan
Profile : http://community.jboss.org/people/kabir.khan@jboss.com
Message:
--------------------------------------------------------------
> alesj wrote:
>
> > Finally, I detected a great deal of calls to ClassPool.get("org.jboss.aop.microcontainer.annotations.DisableAOP"). The calls are being made by org.jboss.annotation.factory.javassist.DefaultValueAnnotationValidator.getDeclaredMethods(Class<?>), and I'm confident that this can be improved somehow (such as caching DisableAOP ctClass). I think improving this will have some impact on the startup time of AS.
> We're deprecating this annotation anyway.
> But we're replacing it with just the opposite - EnableAOP, so not a lot different from performance perspective.
> Kabir, any idea on how to optimize (e.g. cache) this?
The quick and dirty way would be at DefaulValueAnnotationValidator level
-a WeakHashMap<Class<?>, CtClass>, or
-be able to configure it with annotations it should cache
But I guess the real and harder solution is that caching at class pool level could be improved? What seems to happen now is that when trying to load a CtClass we end up in Base-/JBossClClassPoolDomain which checks each relavant pool and parent domain for a locally cached CtClass which is simple but probably more work than necessary. Maybe these lookups should be cached in the initiating pool, with some invalidation if the domain (or its parent domain) has pools added/removed?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/518925#518925
14 years, 3 months
[JBoss Tools] New message: "Newbie - Problem Running TestNG on a JBoss Tools created Action."
by Ran Bittmann
User development,
A new message was posted in the thread "Newbie - Problem Running TestNG on a JBoss Tools created Action.":
http://community.jboss.org/message/518924#518924
Author : Ran Bittmann
Profile : http://community.jboss.org/people/rmbittmann
Message:
--------------------------------------------------------------
Hi,
Probably another newbie question.
I am using the following environment:
Eclipse 3.5.1, JBoss Tools 3.1.0.M4, TestNG 5.11.0.28, jdk1.6.0_17, JBoss AS 5.1.0GA-jdk6, Seam 2.2.0.GA, JBoss 4.2.2GA & MySQL 5.1.37
After successfuly creating a project using: New -> Seam Web Project and adding an action and an entity to it, I am trying to test it using the TestNG plugin.
I am going to the test project (testSeam1-test) finding the automatically created action test (TestAction1Test.java) right clicking on it and selecting: Run As -> TestNG Test. I get immediatly an error:
Exception occurred executing command line.
Cannot run program "C:\Java\jdk1.6.0_17\bin\javaw.exe" (in directory "C:\Workspace\testSeam1-test"): CreateProcess error=87, The parameter is incorrect.
The stack and session details are below.
I did not make any changes to the project other than its generation. I tried to google this problem without success.
I will appreciate your help in figuring out what when wrong.
Thanks,
Rani.
The stack for the failure is:
java.io.IOException: Cannot run program "C:\Java\jdk1.6.0_17\bin\javaw.exe" (in directory "C:\Workspace\testSeam1-test"): CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at java.lang.Runtime.exec(Runtime.java:593)
at org.eclipse.debug.core.DebugPlugin.exec(DebugPlugin.java:805)
at org.eclipse.jdt.launching.AbstractVMRunner.exec(AbstractVMRunner.java:70)
at org.eclipse.jdt.internal.launching.StandardVMRunner.run(StandardVMRunner.java:317)
at org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.launch(TestNGLaunchConfigurationDelegate.java:74)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 10 more
And the session data is:
eclipse.buildId=M20090917-0800
java.version=1.6.0_17
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
http://www.qtl.co.il/img/copy.pnghttp://www.babylon.com/favicon.icohttp:/...
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/518924#518924
14 years, 3 months
[jBPM] New message: "Re: Problem retrieving running process instance"
by Oliver Schneider
User development,
A new message was posted in the thread "Problem retrieving running process instance":
http://community.jboss.org/message/518922#518922
Author : Oliver Schneider
Profile : http://community.jboss.org/people/Masipulami
Message:
--------------------------------------------------------------
With JBPM 3 it worked as shown in the example below. But this way does not work any more with JBPM 4.
What am I doing wrong?
package org.jbpm.tutorial.db;
import java.util.List;
import junit.framework.TestCase;
import org.jbpm.db.GraphSession;
import org.jbpm.db.JbpmSession;
import org.jbpm.db.JbpmSessionFactory;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
public class HelloWorldDbTest extends TestCase {
// We need one JbpmSessionFactory per application. So we put it in
// a static variable. The JbpmSessionFactory will be used in the
// test methods to create JbpmSession's.
static JbpmSessionFactory jbpmSessionFactory =
JbpmSessionFactory.buildJbpmSessionFactory();
static {
// Since the hypersonic in-memory database is a new, fresh database,
// we need to create the schema at runtime before we start the tests.
// The next line creates the database tables and foreign key
// constraints.
jbpmSessionFactory.getJbpmSchema().createSchema();
}
public void testSimplePersistence() {
// Between the 3 method calls below, all data is passed via the
// database. Here, in this unit test, these 3 methods are executed
// right after each other because we want to test a complete process
// scenario. But in reality, these methods represent different
// requests to a server.
// Since we start with a clean, empty in-memory database, we have to
// deploy the process first. In reality, this is done once by the
// process developer.
deployProcessDefinition();
// Suppose we want to start a process instance (=process execution)
// when a user submits a form in a web application...
processInstanceIsCreatedWhenUserSubmitsWebappForm();
// Then, the arrival of an asynchronous message will continue
// execution.
theProcessInstanceContinuesWhenAnAsyncMessageIsReceived();
}
public void deployProcessDefinition() {
// This test shows a process definition and one execution
// of the process definition. The process definition has
// 3 nodes: an unnamed start-state, a state 's' and an
// end-state named 'end'.
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
"<process-definition name='hello world'>" +
" <start-state name='start'>" +
" <transition to='s' />" +
" </start-state>" +
" <state name='s'>" +
" <transition to='end' />" +
" </state>" +
" <end-state name='end' />" +
"</process-definition>"
);
// Let's open a new persistence session
JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
// ... and begin a transaction on the persistence session
jbpmSession.beginTransaction();
// Save the process definition in the database
jbpmSession
.getGraphSession()
.saveProcessDefinition(processDefinition);
// Commit the transaction
jbpmSession.commitTransaction();
// And close the jbpmSession.
jbpmSession.close();
}
public void processInstanceIsCreatedWhenUserSubmitsWebappForm() {
// The code in this method could be inside a struts-action
// or a JSF managed bean.
// Let's open a new persistence session
JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
// ... and begin a transaction on the persistence session.
jbpmSession.beginTransaction();
// Now we can query the database for the process definition that we
// deployed above.
ProcessDefinition processDefinition =
jbpmSession
.getGraphSession()
.findLatestProcessDefinition("hello world");
// With the processDefinition that we retrieved from the database, we
// can create an execution of the process definition just like in the
// hello world example (which was without persistence).
ProcessInstance processInstance =
new ProcessInstance(processDefinition);
Token token = processInstance.getRootToken();
assertEquals("start", token.getNode().getName());
// Let's start the process execution
token.signal();
// Now the process is in the state 's'.
assertEquals("s", token.getNode().getName());
// Now the processInstance is saved in the database. So the
// current state of the execution of the process is stored in the
// database.
jbpmSession
.getGraphSession()
.saveProcessInstance(processInstance);
// The method below will get the process instance back out
// of the database and resume execution by providing another
// external signal.
// At the end of the webapp action, the transaction is committed.
jbpmSession.commitTransaction();
// And close the jbpmSession.
jbpmSession.close();
}
public void theProcessInstanceContinuesWhenAnAsyncMessageIsReceived() {
// The code in this method could be the content of a message driven bean.
// Let's open a new persistence session.
JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
// ... and begin a transaction on the persistence session
// note that it's also possible to use a jdbc connection from a
// DataSource in your application server.
jbpmSession.beginTransaction();
GraphSession graphSession = jbpmSession.getGraphSession();
// First, we need to get the process instance back out of the database.
// There are several options to know what process instance we are dealing
// with here. The easiest in this simple test case is just to look for
// the full list of process instances. That should give us only one
// result. So let's look up the process definition.
ProcessDefinition processDefinition =
graphSession.findLatestProcessDefinition("hello world");
// Now, we search for all process instances of this process definition.
List processInstances =
graphSession.findProcessInstances(processDefinition.getId());
// Because we know that in the context of this unit test, there is
// only one execution. In real life, the processInstanceId can be
// extracted from the content of the message that arrived or from
// the user making a choice.
ProcessInstance processInstance =
(ProcessInstance) processInstances.get(0);
// Now we can continue the execution. Note that the processInstance
// delegates signals to the main path of execution (=the root token).
processInstance.signal();
// After this signal, we know the process execution should have
// arrived in the end-state.
assertTrue(processInstance.hasEnded());
// Now we can update the state of the execution in the database
graphSession.saveProcessInstance(processInstance);
// At the end of the MDB, the transaction is committed.
jbpmSession.commitTransaction();
// And the jbpmSession is closed.
jbpmSession.close();
}
}
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/518922#518922
14 years, 3 months
[JBoss Messaging] New message: "Re: Problem with cluster failover."
by Yong Hao Gao
User development,
A new message was posted in the thread "Problem with cluster failover.":
http://community.jboss.org/message/518920#518920
Author : Yong Hao Gao
Profile : http://community.jboss.org/people/gaohoward
Message:
--------------------------------------------------------------
Hi,
I tried a simple sending example against a two node cluster and I got the exception (max failover reached).
The difference of my example from yours is probably I don't create connection and session each time. Mine is like
1. create connection
2. create session
3. create producer
4. for (..) { sending message; }
When I killed the second node, exception comes out seconds after. I'll try yours and see if I can reproduce it.
By the way, do you know where the sender code stuck? (the thread dump)
Howard
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/518920#518920
14 years, 3 months