Hi all,

I've done some test with Groovy Component and i've noticed that when i tried to use it
using the "script" attribute instead of the "scritText" attribute as follow

<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>

it doesn't work....

Looking at the source of the component in the ScriptComponent.java file the problems seems to be in the start() method in the lines:
.....
if (compiledScript == null) {
           checkScriptTextAvailable();
       }
       if (compiledScript == null) {
           if (engine instanceof Compilable) {
               Compilable compilable = (Compilable) engine;
               compileScript(compilable);
           }
       }
....

I've replaced this code with this and it works:

.....
if ((compiledScript == null) && (script != null)) {
           if (engine instanceof Compilable) {
               Compilable compilable = (Compilable) engine;
               compileScript(compilable);
           }
       }
       if (compiledScript == null) {
           checkScriptTextAvailable();
       }
.....

Thanks
Andrea Zoppello
Engineering Ing. Informatica

Reply via email to