[JBoss AOP] - Re: JBoss6 AOP Load-Time-Weaving
by Fabian Engels
Fabian Engels [http://community.jboss.org/people/nemesis7705] created the discussion
"Re: JBoss6 AOP Load-Time-Weaving"
To view the discussion, visit: http://community.jboss.org/message/580157#580157
--------------------------------------------------------------
Thanks for the fast answers,
yea the problem was somewhere else.. I tried the same setup on my other machine and it runs very well.
For people how wanna know these were my 5 steps to get it work.
1.) copy the JBoss_6.0.0-M5\server\default\deployers\jboss-aop-jboss5.deployer\pluggable-instrumentor.jar
to JBoss_6.0.0-M5\bin
2.) setting loadtimeweaving at JBoss_6.0.0-M5\server\default\conf\bootstrap\aop.xml to *true*
**
<property name="enableLoadtimeWeaving">true</property>
3.) put your jboss-aop.xml to JBoss_6.0.0-M5\server\default\deploy\
4.) put your aspect class in your webproject
5.) don't forget to add the -javaagent:pluggable-instrumentor.jar to the runntime if you use eclipse you find this
on Server View under Open launch configuration
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/580157#580157]
Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 3 months
[jBPM] - bpmtoesbvars and esbtobpmvars...
by Gary Pinkham
Gary Pinkham [http://community.jboss.org/people/garyp] created the discussion
"bpmtoesbvars and esbtobpmvars..."
To view the discussion, visit: http://community.jboss.org/message/580078#580078
--------------------------------------------------------------
I'm using 5.0.2 of the SOA-P (and therefore jBPM3)
I have a workflow that calls an ESBActionHandler.. like this (yes the exception handler is missing):
<node name="create pdf">
<action name="action"
class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
<esbCategoryName>GeneratePDFApplicationService</esbCategoryName>
<esbServiceName>GeneratePDFApplicationService</esbServiceName>
<bpmToEsbVars>
<mapping bpm="message" esb="BODY_CONTENT" />
<mapping bpm="masterCaseId" esb="masterCaseId" />
</bpmToEsbVars>
<esbToBpmVars>
<mapping esb="body.pdffile" bpm="attachment" />
</esbToBpmVars>
</action>
<timer duedate="10 seconds" name="timeout" transition="save pdf"/>
<transition name="save pdf" to="save pdf">
</transition>
</node>
the GeneratePDFAccplicationService is an ESB Service that runs an XSLT and a custom FOP action.. The custom action adds a variable called pdffile to the body of the message.. like so:
message.getBody().add(this.attachmentName, baos.toByteArray());
I put in a couple of displays.. One in the custom ESB Action:
11:07:14,585 INFO [STDOUT] body variable names:
11:07:14,585 INFO [STDOUT] org.jboss.soa.esb.message.defaultEntry
11:07:14,585 INFO [STDOUT] masterCaseId
11:07:14,585 INFO [STDOUT] xslfo
11:07:14,585 INFO [STDOUT] pdffile
And we leave that node and go onto another node
11:07:21,536 INFO [STDOUT] this script is leaving node Node(create pdf)
11:07:21,545 INFO [STDOUT] this script is entering node Node(save pdf)
In this node I printed the BPM variables:
11:07:21,627 INFO [STDOUT] BPM variables:
11:07:21,627 INFO [STDOUT] message
11:07:21,627 INFO [STDOUT] jbpmProcessNodeVersionCounter21_27
11:07:21,627 INFO [STDOUT] masterCaseId
No variable called attachment.. So what happened to this:
<mapping esb="body.pdffile" bpm="attachment" />
I know the body.pdffile variable is there (as seen above).. Amd I referring to it wrong? is it not "body."???
thanks for the help!!!
Gary
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/580078#580078]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 3 months
[JBoss Cache] - Re: Unable to acquire lock on Fqn error
by Ryan Hochstetler
Ryan Hochstetler [http://community.jboss.org/people/ryanhos] created the discussion
"Re: Unable to acquire lock on Fqn error"
To view the discussion, visit: http://community.jboss.org/message/580136#580136
--------------------------------------------------------------
Those of you stuck on JBoss Cache 3.2.x that are running into this bug can use the following work-around to eliminate this issue.
The root of the problem is as previously mentioned, the "acquire lock lock on modification, but only acquire the remote lock on commit" pattern. (actually, it's acquired on prepare(), but JBoss Cache's prepare() is called during JTA's commit()). The answer is to prevent the deadlock from ever occurring by denying lock requests that would create such a deadlock.
1. Determine which LockManager your configuration uses. Inspect LockManagerFactory and your current <jbosscache> XML or runtime configuration to determine which one gets constructed for you.
2. MyCompanyCustomLockManager extends JBCLockManagerFromStepOne.
3. Intercept every visible lock() method.
4. Implement shouldLockBeGranted(Object, GlobalTransaction) throws CacheException, call it during each of the intercepted methods. Throw CacheException when the lock should not be granted.
5. Install your custom Lock Manager.
On installing your custom lock manager: If you are permitted to modify and repackage OSS code on your project, you're home free. If not, keep reading. JBoss Cache contains a homegrown DI framework. You can abuse this DI framework to inject your own LockManager.
1. Implement MyCompanyCacheFactory extends DefaultCacheFactory. Update your configuration/code to use this cache factory instead.
2. Make sure this is called before cache start(): componentRegistry.registerComponent(new MyCompanyCustomLockManager(), LockManager.class);
3. Annotate MyCompanyCustomLockManager as @NonVolatile. This is a violation of the spirit of that annotation, but the component registry purges all volatile components during the cache start() phase. The caveat here is that the LockManager will be fixed, regardless of changes to the <locking> portion of the configuration. Remember, we're just trying to duct-tape a broken bit of software that we're stuck with, not make durable, maintainable software.
As for the algorithm of shouldLockBeGranted(Object, GlobalTransaction), I cannot give you the code. It must be deterministic. Each node must be able to calculate the superiority of one lock request over another without communicating with the other nodes. You must create some artificial method of ordering GlobalTransactions. The primary key of a GlobalTransaction is a JGroups Address and a java.lang.Long transaction ID. That artificial ordering may not be fair, but it does at least allow one process to win, while the other one is told that it requested a write which would have ended in a deadlock. (e.g. WriteLockDeniedException extends CacheException).
3 Cluster Nodes: A, B, and C. 2 Transactions: X and Y. 1 Cache node: "foo".
Assume that the artificial ordering of GlobalTransactions places Y before X (Y < X).
*A*: cache.put(foo, bar, bat); "foo" is now locally locked for TX X.
*A*: Create GlobalTransaction X, associate with JTA transaction.
*C*: cache.put(foo, bar, boo); "foo is now locally locked for TX Y.
*C*: Create GlobalTransaction Y, associate with JTA transaction.
(remember, time ordering doesn't matter here. The TX ordering is artificial and not fair, just deterministic).
*A*: commit();
*B*: received request for lock on "foo" for TX X. shouldLockBeGranted == X < null == true. Granted. (a lock request is always considred superior to "no existing lock", i.e. getWriteOwner() == null).
*C*: commit();
*B*: received request for lock on "foo" for TX Y. shouldLockBeGranted == Y < X == true. Granted, but waiting lockAcquisitionTimeout millis until lock is available.
*A*: received request for lock on "foo" for TX Y. shouldLockBeGranted == Y < X == true. Granted, but waiting.
*C*: received request for lock on "foo" from TX X. shouldLockBeGranted == X < Y == FALSE. Not granted.
*A*: prepare() failed on C. Okay, tell everybody to abort, unlocking "foo"
*B*: got abort for TX X. unlock "foo".
*B*: lock foo is now available for TX Y
*A*: everybody aborted, time for me to abort. lock is now available for TX Y.
*C*: Got locks for TX Y from every other Node (A, B). prepare() done. commit().
*Caveats and notes: *
* All of our transactions only involve a single cache node. It's a cache, not a database...
* We use MVCC locking. If you're not, YMMV.
* This was my best effort within the constraints of my project. It works for me with 4 JBoss cluster nodes, 40 cache writes per second per cluster node, performed randomly on a pool of 500 cache nodes. Some nodes win, some nodes get the WriteLockDeniedException. It's better than everybody waiting 15 seconds for a TimeoutException.
* The inherent unfairness of the artificial ordering of transactions is mitigated by the fact that we use node.replace(key, oldValue, newValue) to guarantee that good cache state is not overwritten.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/580136#580136]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 3 months
[Datasource Configuration] - JBoss "forgets" MSSQL password
by Fred Huelsbeck
Fred Huelsbeck [http://community.jboss.org/people/fhuelsbeck] created the discussion
"JBoss "forgets" MSSQL password"
To view the discussion, visit: http://community.jboss.org/message/580120#580120
--------------------------------------------------------------
I am running JBoss 4.0.5 GA on Windows 2008 32bit. During a 29 minute period connection to my MSSQL server was non-funtional. The server log shows login failed and the MSSQL log indicates the password being supplied was invalid.
Server.log
org.jboss.resource.connectionmanager.JBossManagedConnectionPool -- Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Login failed for user <DBO>
MSSQL
Login failed for user <DBO>. Reason: Password did not match that for the login provided.
There were no JBoss or MSSQL process or sever restarts during this period for either server. Also, I have verified the password in all datasources is set correctly. It truly appears the password was "forgotten" for 29 minutes. Any ideas on how to troubleshoot/identify a root cause will be greatly appreciated.
Cheers... Fred
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/580120#580120]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 3 months
[jBPM] - jBPM4.4 and jbpm-console: obtaining user
by Paweł Gutowski
Paweł Gutowski [http://community.jboss.org/people/pawel.gutowski] created the discussion
"jBPM4.4 and jbpm-console: obtaining user"
To view the discussion, visit: http://community.jboss.org/message/580070#580070
--------------------------------------------------------------
I would like to display in the task form the information who has started the recent process instance.
Moreover I'd like to run this porcess on jbpm-console...
My idea was to make an EventListner which was supposed to set the process variable with the user id.
My process jPDL looks like this:
<process name="myprocess" xmlns="http://jbpm.org/4.4/jpdl">
<on event="start">
<event-listener class="org.gutek.helpers.InitProcessDataListener"/>
</on>
<start g="126,22,48,48" name="start1">
<transition to="business creation"/>
</start>
<task candidate-users="user_a,user_b" form="org/gutek/view1.ftl" g="83,96,132,52" name="business creation">
<transition to="end1"/>
</task>
<end g="127,291,48,48" name="end1"/>
</process>
The task form:
Process created by:
And the listener (org.gutek.helpers.InitProcessDataListener):
public class InitProcessDataListener implements EventListener {
@Override public void notify(EventListenerExecution execution) throws Exception {
execution.setVariable("business_created_by", "User-X");
}
}
My questions:
1. How to find the real user creating the process, not "User-X" as above?
2. Is it possible to find not only the process creator, but also who made the last change in the process?
Jbpm-console is nice for prototyping and modelling simple processes.
But I suppose that case shown above is too "complex" for running in the jbpm-console, so question 3:
3. Could somebody describe in a few sentences where is the border of process complexity for running in the jbpm-console?
Environment:
jbpm-4.4
jbpm-console: 2.1
JBoss v.5.1.0.GA
Best regards,
Pawel Gutowski
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/580070#580070]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 3 months
[jBPM] - Problem deploying a process
by scurvo
scurvo [http://community.jboss.org/people/scurvo] created the discussion
"Problem deploying a process"
To view the discussion, visit: http://community.jboss.org/message/580052#580052
--------------------------------------------------------------
Hi all,
I currently am trying to deploy a process into the DB using jbpm 4.4. I can see i can open the DB and export the jbpm schema to it, but when i try to deploy a process it gives the following error :
DEBUG org.jbpm.internal.log.Log4jLog.debug(Log4jLog.java:62) - ----- beginning hibernate tx 20791853 --------------------------------------------------------
INFO org.jbpm.internal.log.Log4jLog.info(Log4jLog.java:50) - jBPM version info: library[4.4-SNAPSHOT], schema[null]
DEBUG org.jbpm.internal.log.Log4jLog.debug(Log4jLog.java:62) - ----- committing hibernate tx 4070693 -------------------------------------------------------
DEBUG org.jbpm.internal.log.Log4jLog.debug(Log4jLog.java:62) - ----- beginning hibernate tx 27147812 --------------------------------------------------------
INFO org.jbpm.internal.log.Log4jLog.info(Log4jLog.java:50) - loading schema resource: jpdl-4.0.xsd
INFO org.jbpm.internal.log.Log4jLog.info(Log4jLog.java:50) - loading schema resource: jpdl-4.2.xsd
INFO org.jbpm.internal.log.Log4jLog.info(Log4jLog.java:50) - loading schema resource: jpdl-4.3.xsd
INFO org.jbpm.internal.log.Log4jLog.info(Log4jLog.java:50) - loading schema resource: jpdl-4.4.xsd
DEBUG org.jbpm.internal.log.Log4jLog.debug(Log4jLog.java:62) - last id -2 was consumed. acquiring new block...
DEBUG org.jbpm.internal.log.Log4jLog.debug(Log4jLog.java:62) - ----- beginning hibernate tx 12833564 --------------------------------------------------------
DEBUG org.jbpm.internal.log.Log4jLog.debug(Log4jLog.java:62) - ----- committing hibernate tx 5169649 -------------------------------------------------------
DEBUG org.jbpm.internal.log.Log4jLog.debug(Log4jLog.java:62) - acquired new id block [1-10000]
INFO org.jbpm.internal.log.Log4jLog.info(Log4jLog.java:50) - errors during deployment of deployment(1):
error: failed to parse xml : org.xml.sax.SAXException: http://java.sun.com/xml/jaxp/properties/schemaSource http://java.sun.com/xml/jaxp/properties/schemaSource
INFO org.jbpm.internal.log.Log4jLog.info(Log4jLog.java:54) - exception while executing command org.jbpm.pvm.internal.cmd.DeployCmd@ef2e7c
org.jbpm.api.JbpmException:
error: failed to parse xml : org.xml.sax.SAXException: http://java.sun.com/xml/jaxp/properties/schemaSource http://java.sun.com/xml/jaxp/properties/schemaSource
at org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:175)
at org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:141)
at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:50)
at org.jbpm.pvm.internal.repository.RepositorySessionImpl.deploy(RepositorySessionImpl.java:62)
at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:47)
at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:33)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.repository.DeploymentImpl.deploy(DeploymentImpl.java:90)
at pt.utl.ist.repox.repox_jbpm.ProcessManager.deployProcess(ProcessManager.java:61)
at pt.utl.ist.repox.repox_jbpm.ProcessManager.createProcess(ProcessManager.java:54)
at pt.utl.ist.repox.repox_jbpm.Main.main(Main.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: org.xml.sax.SAXException: http://java.sun.com/xml/jaxp/properties/schemaSource http://java.sun.com/xml/jaxp/properties/schemaSource
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:281)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
at org.jbpm.pvm.internal.xml.Parser.buildDocument(Parser.java:455)
at org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:425)
at org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:158)
at org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:68)
at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46)
... 18 more
My process is:
<?xml version="1.0" encoding="UTF-8"?>
<process name="helloWorld" xmlns=" http://jbpm.org/4.0/jpdl http://jbpm.org/4.0/jpdl">
<start g="24,72,80,40">
<transition to="printHelloWorld"/>
</start>
<java class="pt.utl.ist.repox.repox_jbpm.Printer" method="printHelloWorld" name="printHelloWorld" g="132,72,138,40">
<transition to="theEnd"/>
</java>
<end name="theEnd" g="339,70,80,40"/>
</process>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/580052#580052]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 3 months