You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Andrea Zoppello (JIRA)" <ji...@apache.org> on 2006/12/18 14:06:02 UTC
[jira] Created: (SM-781) Re: Bug in ScritpComponent when using
"script" attribute
Re: Bug in ScritpComponent when using "script" attribute
--------------------------------------------------------
Key: SM-781
URL: https://issues.apache.org/activemq/browse/SM-781
Project: ServiceMix
Issue Type: Bug
Components: servicemix-components
Affects Versions: 3.0
Reporter: Andrea Zoppello
When the script component is configured using the "script" attribute instead of "scriptText" attribute the components doesn't work.
For example:
<sm:activationSpec componentName="myGenericGroovymioGroovy" service="foo:myGenericGroovymioGroovy"
destinationService="*foo:myScreenOutputmioGroovy*">
<sm:component>
<bean
class="org.apache.servicemix.components.groovy.GroovyComponent">
<property name="script"
value="c:/tmp/sm/groovy/testsmx.groovy" />
</bean>
</sm:component>
</sm:activationSpec>
fails with message: "If no 'compiledScript' is specified you must specify the 'scriptText'
The problems seems to be in the start() method of org.apache.servicemix.components.script.ScriptComponent class.
in the following lines:
....
if (compiledScript == null) {
checkScriptTextAvailable();
}
if (compiledScript == null) {
if (engine instanceof Compilable) {
Compilable compilable = (Compilable) engine;
compileScript(compilable);
}
}
....
I've replaced this code with the code below and it works correctly:
.....
if ((compiledScript == null) && (script != null)) {
if (engine instanceof Compilable) {
Compilable compilable = (Compilable) engine;
compileScript(compilable);
}
}
if (compiledScript == null) {
checkScriptTextAvailable();
}
.....
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (SM-781) Re: Bug in ScritpComponent when using
"script" attribute
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SM-781?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guillaume Nodet updated SM-781:
-------------------------------
Patch Info: [Patch Available]
> Re: Bug in ScritpComponent when using "script" attribute
> --------------------------------------------------------
>
> Key: SM-781
> URL: https://issues.apache.org/activemq/browse/SM-781
> Project: ServiceMix
> Issue Type: Bug
> Components: servicemix-components
> Affects Versions: 3.0
> Reporter: Andrea Zoppello
> Assigned To: Guillaume Nodet
> Fix For: 3.1
>
> Attachments: ScriptComponent.java.diff
>
>
> When the script component is configured using the "script" attribute instead of "scriptText" attribute the components doesn't work.
> For example:
> <sm:activationSpec componentName="myGenericGroovymioGroovy" service="foo:myGenericGroovymioGroovy"
> destinationService="*foo:myScreenOutputmioGroovy*">
> <sm:component>
> <bean
> class="org.apache.servicemix.components.groovy.GroovyComponent">
> <property name="script"
> value="c:/tmp/sm/groovy/testsmx.groovy" />
> </bean>
> </sm:component>
> </sm:activationSpec>
> fails with message: "If no 'compiledScript' is specified you must specify the 'scriptText'
> The problems seems to be in the start() method of org.apache.servicemix.components.script.ScriptComponent class.
> in the following lines:
> ....
> if (compiledScript == null) {
> checkScriptTextAvailable();
> }
> if (compiledScript == null) {
> if (engine instanceof Compilable) {
> Compilable compilable = (Compilable) engine;
> compileScript(compilable);
> }
> }
> ....
> I've replaced this code with the code below and it works correctly:
> .....
> if ((compiledScript == null) && (script != null)) {
> if (engine instanceof Compilable) {
> Compilable compilable = (Compilable) engine;
> compileScript(compilable);
> }
> }
> if (compiledScript == null) {
> checkScriptTextAvailable();
> }
> .....
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SM-781) Re: Bug in ScritpComponent when using
"script" attribute
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SM-781?page=all ]
Guillaume Nodet resolved SM-781.
--------------------------------
Fix Version/s: 3.1
Resolution: Fixed
Assignee: Guillaume Nodet
Author: gnodet
Date: Fri Dec 29 03:14:34 2006
New Revision: 490980
URL: http://svn.apache.org/viewvc?view=rev&rev=490980
Log:
SM-781: Bug in ScriptComponent when using "script" attribute
Added:
incubator/servicemix/trunk/common/servicemix-components/src/test/resources/org/apache/servicemix/components/groovy/script.groovy
Modified:
incubator/servicemix/trunk/common/servicemix-components/src/main/java/org/apache/servicemix/components/script/ScriptComponent.java
incubator/servicemix/trunk/common/servicemix-components/src/test/resources/org/apache/servicemix/components/groovy/groovy-chain.xml
> Re: Bug in ScritpComponent when using "script" attribute
> --------------------------------------------------------
>
> Key: SM-781
> URL: https://issues.apache.org/activemq/browse/SM-781
> Project: ServiceMix
> Issue Type: Bug
> Components: servicemix-components
> Affects Versions: 3.0
> Reporter: Andrea Zoppello
> Assigned To: Guillaume Nodet
> Fix For: 3.1
>
> Attachments: ScriptComponent.java.diff
>
>
> When the script component is configured using the "script" attribute instead of "scriptText" attribute the components doesn't work.
> For example:
> <sm:activationSpec componentName="myGenericGroovymioGroovy" service="foo:myGenericGroovymioGroovy"
> destinationService="*foo:myScreenOutputmioGroovy*">
> <sm:component>
> <bean
> class="org.apache.servicemix.components.groovy.GroovyComponent">
> <property name="script"
> value="c:/tmp/sm/groovy/testsmx.groovy" />
> </bean>
> </sm:component>
> </sm:activationSpec>
> fails with message: "If no 'compiledScript' is specified you must specify the 'scriptText'
> The problems seems to be in the start() method of org.apache.servicemix.components.script.ScriptComponent class.
> in the following lines:
> ....
> if (compiledScript == null) {
> checkScriptTextAvailable();
> }
> if (compiledScript == null) {
> if (engine instanceof Compilable) {
> Compilable compilable = (Compilable) engine;
> compileScript(compilable);
> }
> }
> ....
> I've replaced this code with the code below and it works correctly:
> .....
> if ((compiledScript == null) && (script != null)) {
> if (engine instanceof Compilable) {
> Compilable compilable = (Compilable) engine;
> compileScript(compilable);
> }
> }
> if (compiledScript == null) {
> checkScriptTextAvailable();
> }
> .....
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (SM-781) Re: Bug in ScritpComponent when using
"script" attribute
Posted by "Andrea Zoppello (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SM-781?page=all ]
Andrea Zoppello updated SM-781:
-------------------------------
Attachment: ScriptComponent.java.diff
The file attached is the patch proposed to resolve the problem described
> Re: Bug in ScritpComponent when using "script" attribute
> --------------------------------------------------------
>
> Key: SM-781
> URL: https://issues.apache.org/activemq/browse/SM-781
> Project: ServiceMix
> Issue Type: Bug
> Components: servicemix-components
> Affects Versions: 3.0
> Reporter: Andrea Zoppello
> Attachments: ScriptComponent.java.diff
>
>
> When the script component is configured using the "script" attribute instead of "scriptText" attribute the components doesn't work.
> For example:
> <sm:activationSpec componentName="myGenericGroovymioGroovy" service="foo:myGenericGroovymioGroovy"
> destinationService="*foo:myScreenOutputmioGroovy*">
> <sm:component>
> <bean
> class="org.apache.servicemix.components.groovy.GroovyComponent">
> <property name="script"
> value="c:/tmp/sm/groovy/testsmx.groovy" />
> </bean>
> </sm:component>
> </sm:activationSpec>
> fails with message: "If no 'compiledScript' is specified you must specify the 'scriptText'
> The problems seems to be in the start() method of org.apache.servicemix.components.script.ScriptComponent class.
> in the following lines:
> ....
> if (compiledScript == null) {
> checkScriptTextAvailable();
> }
> if (compiledScript == null) {
> if (engine instanceof Compilable) {
> Compilable compilable = (Compilable) engine;
> compileScript(compilable);
> }
> }
> ....
> I've replaced this code with the code below and it works correctly:
> .....
> if ((compiledScript == null) && (script != null)) {
> if (engine instanceof Compilable) {
> Compilable compilable = (Compilable) engine;
> compileScript(compilable);
> }
> }
> if (compiledScript == null) {
> checkScriptTextAvailable();
> }
> .....
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira