[ 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

        

Reply via email to