[JBoss JIRA] Created: (JBESB-1683) ScriptingAction donation to support more languages
by David Ward (JIRA)
ScriptingAction donation to support more languages
--------------------------------------------------
Key: JBESB-1683
URL: http://jira.jboss.com/jira/browse/JBESB-1683
Project: JBoss ESB
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Build and Release, Examples, Rosetta, Testing
Affects Versions: 4.2.1
Environment: agnostic
Reporter: David Ward
This is a donation to add a greater scripting capability to JBoss ESB. Currently, only Groovy is supported via the GroovyActionProcessor. This new donation, the ScriptingAction, uses the Apache Jakarta Bean Scripting Framework (BSF) to support any of the 23 scripting languages it supports, Groovy being one of them. Yes, I thought of the Java 6 javax.script package, but everything in JBoss ESB 4.2 needs to work with JDK 5, thus my choice.
Everything has been built against http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk as of 2008-04-19 03:45:28 -0400 (Sat, 19 Apr 2008).
Please see the attached jbossesb-scripting.zip file, with the following contents:
jbossesb/trunk/product/build-distr.xml
jbossesb/trunk/product/.classpath
jbossesb/trunk/product/lib/ext/bsf-2.4.0.jar
jbossesb/trunk/product/lib/ext/bsh-2.0b4.jar
jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/ScriptingAction.java
jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/ScriptingActionUnitTest.java
jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.bsh
jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
jbossesb/trunk/product/samples/quickstarts/conf/quickstarts.properties-example
jbossesb/trunk/product/samples/quickstarts/scripting/build.xml
jbossesb/trunk/product/samples/quickstarts/scripting/deployment.xml
jbossesb/trunk/product/samples/quickstarts/scripting/jbmq-queue-service.xml
jbossesb/trunk/product/samples/quickstarts/scripting/jbm-queue-service.xml
jbossesb/trunk/product/samples/quickstarts/scripting/jbossesb-properties.xml
jbossesb/trunk/product/samples/quickstarts/scripting/jboss-esb.xml
jbossesb/trunk/product/samples/quickstarts/scripting/jndi.properties
jbossesb/trunk/product/samples/quickstarts/scripting/juddi.properties
jbossesb/trunk/product/samples/quickstarts/scripting/lib/js-14.jar
jbossesb/trunk/product/samples/quickstarts/scripting/lib/js.jar
jbossesb/trunk/product/samples/quickstarts/scripting/lib/jython.jar
jbossesb/trunk/product/samples/quickstarts/scripting/log4j.xml
jbossesb/trunk/product/samples/quickstarts/scripting/readme.txt
jbossesb/trunk/product/samples/quickstarts/scripting/scripts/helloworld.bsh
jbossesb/trunk/product/samples/quickstarts/scripting/scripts/helloworld.gy
jbossesb/trunk/product/samples/quickstarts/scripting/scripts/helloworld.js
jbossesb/trunk/product/samples/quickstarts/scripting/scripts/helloworld.py
jbossesb/trunk/product/samples/quickstarts/scripting/src/org/jboss/soa/esb/samples/quickstart/scripting/test/SendJMSMessage.java
First off, I made some config/build fixes. Here is a diff:
Index: product/build-distr.xml
===================================================================
--- product/build-distr.xml (revision 19660)
+++ product/build-distr.xml (working copy)
@@ -63,6 +63,10 @@
<delete dir="${esbserver.dist.dir}"/>
<unzip src="${installation.files.dir}/standalone/jbossesb-server-base.zip" dest="${build.dir}"/>
<chmod dir="${build.dir}/jbossesb-server/bin" perm="ugo+rx" includes="*.sh"/>
+ <!-- upgrade BeanShell from 1.3.0 to 2.0b4 -->
+ <copy file="${lib.ext.dir}/bsh-2.0b4.jar" tofile="${build.dir}/jbossesb-server/server/default/lib/bsh.jar" overwrite="true"/>
+ <!-- introduce Apache Bean Scripting Framework -->
+ <copy file="${lib.ext.dir}/bsf-2.4.0.jar" tofile="${build.dir}/jbossesb-server/server/default/lib/bsf.jar"/>
<move file="${build.dir}/jbossesb-server" tofile="${esbserver.dist.dir}"/>
</target>
Index: product/.classpath
===================================================================
--- product/.classpath (revision 19660)
+++ product/.classpath (working copy)
@@ -12,14 +12,16 @@
<classpathentry kind="lib" path="lib/ext/commons-lang-2.1.jar"/>
<classpathentry kind="lib" path="lib/ext/emma_ant.jar"/>
<classpathentry kind="lib" path="lib/ext/emma.jar"/>
+ <classpathentry kind="lib" path="lib/ext/bsf-2.4.0.jar"/>
+ <classpathentry kind="lib" path="lib/ext/bsh-2.0b4.jar"/>
<classpathentry kind="lib" path="lib/ext/groovy-all-1.0.jar"/>
<classpathentry kind="lib" path="lib/ext/hsqldb.jar"/>
<classpathentry kind="lib" path="lib/ext/jbossall-client.jar"/>
<classpathentry kind="lib" path="lib/ext/jboss-system.jar"/>
<classpathentry kind="lib" path="lib/ext/jbossts-common.jar"/>
<classpathentry kind="lib" path="lib/ext/jsch-0.1.jar"/>
- <classpathentry kind="lib" path="lib/ext/juddi-1.0-SNAPSHOT.jar"/>
- <classpathentry kind="lib" path="lib/ext/juddi-client-1.0-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="lib/ext/juddi-2.0rc5.jar"/>
+ <classpathentry kind="lib" path="lib/ext/juddi-client-2.0rc5.jar"/>
<classpathentry kind="lib" path="lib/ext/junit-4.1.jar"/>
<classpathentry kind="lib" path="lib/ext/log4j.jar"/>
<classpathentry kind="lib" path="lib/ext/mail.jar"/>
@@ -33,9 +35,10 @@
<classpathentry kind="lib" path="lib/ext/xercesImpl-2.7.1.jar"/>
<classpathentry kind="lib" path="lib/ext/xml-apis-1.3.02.jar"/>
<classpathentry kind="lib" path="lib/ext/xmlpublic.jar"/>
- <classpathentry kind="lib" path="lib/ext/xstream-1.1.3.jar"/>
+ <classpathentry kind="lib" path="lib/ext/xstream-1.2.2.jar"/>
<classpathentry kind="lib" path="lib/ext/jboss.jar"/>
<classpathentry kind="lib" path="lib/ext/commons-io-1.3.jar"/>
+ <classpathentry kind="lib" path="lib/ext/commons-codec-1.3.jar"/>
<classpathentry kind="lib" path="lib/ext/edtftpj-1.5.4.jar"/>
<classpathentry kind="lib" path="ftp/lib/backport-util-concurrent-2.2.jar"/>
<classpathentry kind="lib" path="ftp/lib/ftplet-api-1.0-incubator-SNAPSHOT.jar"/>
Index: product/samples/quickstarts/conf/quickstarts.properties-example
===================================================================
--- product/samples/quickstarts/conf/quickstarts.properties-example (revision 19660)
+++ product/samples/quickstarts/conf/quickstarts.properties-example (working copy)
@@ -5,7 +5,7 @@
##############################################################################################
# Location of your JBoss Application Server installation.
# Will override the same property name from install/deployment.properties
-#org.jboss.esb.server.home=${product.dir}/build/jbossesb-server-4.2GA
+#org.jboss.esb.server.home=${product.dir}/build/jbossesb-server-4.2.1GA
# JBossAS server name. If not set defaults to 'default'
# Will override the same property name from install/deployment.properties
Index: product/samples/quickstarts/conf/base-build.xml
===================================================================
--- product/samples/quickstarts/conf/base-build.xml (revision 19660)
+++ product/samples/quickstarts/conf/base-build.xml (working copy)
@@ -271,6 +271,7 @@
<pathelement location="${basedir}/src" />
<fileset dir="${org.jboss.esb.server.server}/lib" includes="jboss-remoting.jar jboss-j2ee.jar jboss-messaging-client.jar" /> <!-- Required for JMS Client Code. -->
<fileset dir="${org.jboss.esb.server.server}/lib" includes="hibernate3.jar commons-collections.jar hsqldb.jar" /> <!-- Required for jbpm Client Code. -->
+ <fileset dir="${org.jboss.esb.server.server}/lib" includes="bsf.jar" /> <!-- Required for scripting Client Code. -->
<fileset dir="${org.jboss.esb.server.server}/lib" includes="bsh.jar" /> <!-- Required for scripting Client Code. -->
<fileset dir="${org.jboss.esb.server.home}/lib/endorsed" includes="*.jar" /> <!-- Required for JMS Client Code. -->
<fileset dir="${org.jboss.esb.server.server}/deploy/jboss-aop-jdk50.deployer" includes="jboss-aop-jdk50.jar" /> <!-- Required for JMS Client Code. -->
Please note in .classpath I had to fix the juddi, xstream and commons-codec jars because someone else busted them. 'twasn't me! ;) You will also notice the addition of BSF 2.4.0, and the upgrade of BeanShell from 1.3.0 to 2.0b4 in AS (something I've wanted for a long time). Last, I fixed the quickstarts.properties-example file to reflect the change to jbossesb-server-4.2.1GA.
Now, for the meat. The relatively simple code lives in ScriptingAction.java, which was modeled after GroovyActionProcessor.java.
There is also a test case, ScriptingActionUnitTest, which exercises both BeanShell and Groovy scripts:
[java] [junit] Running org.jboss.soa.esb.actions.scripting.ScriptingActionUnitTest
[java] [junit] Testsuite: org.jboss.soa.esb.actions.scripting.ScriptingActionUnitTest
[java] [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 1.392 sec
[java] [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 1.392 sec
[java] [junit] ------------- Standard Output ---------------
[java] [junit] EMMA: collecting runtime coverage data ...
[java] [junit] ------------- ---------------- ---------------
[java] [junit]
[java] [junit] Testcase: test_groovy_file took 0.932 sec
[java] [junit] Testcase: test_bsh_file took 0.1 sec
[java] [junit] Testcase: test_groovy_inlined took 0.05 sec
[java] [junit] Testcase: test_bsh_inlined took 0.012 sec
[java] [junit] Testcase: test_beanshell_inlined took 0.012 sec
I also created a quickstart, called "scripting". It has an action pipeline which calls out to BeanShell, Groovy, Python, and JavaScript. (Note: bsf.jar and bsh.jar are in the server's lib directory because older versions were already there. Python uses the jython library, and JavaScript uses the Mozilla Rhino library - both of which have different licenses. Thus, I did not included them in the server's lib directory. I only put them in just the quickstart's lib directory.)
ANYwho, it runs fine in both '.esb' archive mode:
01:13:11,865 INFO [STDOUT] Hello World from BeanShell!
01:13:11,926 INFO [STDOUT] Hello World from Groovy!
01:13:11,960 INFO [STDOUT] Hello World from Python!
01:13:11,968 INFO [STDOUT] Hello World from JavaScript!
as well as in standalone mode:
[qsjava] Hello World from BeanShell!
[qsjava] Hello World from Groovy!
[qsjava] Hello World from Python!
[qsjava] Hello World from JavaScript!
Hopefully this can make it into an upcoming version of the ESB. Any questions, feel free to ask. Comments welcome. Enjoy!
David
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 5 months
[JBoss JIRA] Created: (JBESB-1926) Services Guide typos
by Jaroslaw Kijanowski (JIRA)
Services Guide typos
--------------------
Key: JBESB-1926
URL: https://jira.jboss.org/jira/browse/JBESB-1926
Project: JBoss ESB
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Documentation
Affects Versions: 4.4
Reporter: Jaroslaw Kijanowski
Fix For: 4.4 CP1
W.r.t. Rule Services there are following typos in the docs:
BusinessRuleProcessor (several times)
should be BusinessRulesProcessor
and BTW some minor in Chpater4, page 24:
rules can be accessed as part of a action chain or orchestarted business process
... of an action ... or orchestrated business ...
other than JBoss Drool, only JBoss Drools is supported out the the box.
... JBoss Drools, only ... out of the ...
tells the rule service to dispose of the statefull session working memory
... the stateful session ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 5 months
[JBoss JIRA] Created: (JBESB-1927) The variables from services started in forked branches are lsot
by Jiri Pechanec (JIRA)
The variables from services started in forked branches are lsot
---------------------------------------------------------------
Key: JBESB-1927
URL: https://jira.jboss.org/jira/browse/JBESB-1927
Project: JBoss ESB
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Process flow
Affects Versions: 4.4
Environment: IR1 on FC8
Reporter: Jiri Pechanec
Assignee: Kevin Conner
Priority: Critical
Fix For: 4.4 CP1
The bpm_orchestartion2 qs provides different results in 4.2 and 4.3 versions. The problem is the the message modifications done in forked branches are not propagated back to the process. There are two possible explanations for this behaviour
1) The ProcessInstance.setVaribale method in jBPM does not set variable on root context - which means that there is bug in jBPM
2) Or behaviour with default configuration has changed
I am attaching modified jboss-esb.xml and process definiton file that stores the service outcome under different variables in different branches so they are not overwritten in join node.
You will see that in 4.3 the branch slots are not progpagated after the join node.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 5 months
[JBoss JIRA] Created: (JBESB-1925) Tansactional InVM listener is never enabled
by Kevin Conner (JIRA)
Tansactional InVM listener is never enabled
-------------------------------------------
Key: JBESB-1925
URL: https://jira.jboss.org/jira/browse/JBESB-1925
Project: JBoss ESB
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Transports
Affects Versions: 4.4
Reporter: Kevin Conner
Assignee: Kevin Conner
Fix For: 4.5, 4.4 CP1
The following is from an email from Martin Vecera
unfortunatelly it doesn't work with 4.4.
The output of jms_transacted QS with InVM set to GLOBAL is:
runtest:
[echo] Runs Test JMS Sender
[java] Connection Started
select:
[echo] Select * from jms_transacted_table
[sql] Executing commands
[sql] DATA_COLUMN
[sql] Hello Transacted JMS World] counter[1]
[sql]
[sql] 0 rows affected
[sql] 1 of 1 SQL statements executed successfully
truncate:
[echo] (clean up) Delete from jms_transacted_table
[sql] Executing commands
[sql] 1 rows affected
[sql] 1 of 1 SQL statements executed successfully
This indicates that the first try succeeded (Hello Transacted JMS World]
counter[1]). There should be "counter[5]".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 5 months