You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2007/04/18 11:00:34 UTC
[jira] Updated: (SM-781) Re: Bug in ScritpComponent when using
"script" attribute
[ 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.