Hello,
I developed a custom Kettle plugin, which defines 3 transformation steps for use in several transformations. I copied the plugin jar and its dependency libraries in <PDI-HOME>/plugins/steps, and if I run the transformation with the custrom transformation step inside the Kettle GUI environment everything goes ok. But I have problems when I try to run the transformation in embedded mode inside of a Java project, I have the next error:
The custom plugin jar is added as a dependency to the project, but seems that the application classloader can't find the annotated classes for the step "OfaiSimpleConverter".
I found that if I copy the custom plugin jar and its dependencies inside the folder <USER-HOME>/.kettle/plugins then the project runs ok, but this is not a valid solution for me (the intention is to run the project as a library inside a Java EE application server).
Any ideas of how to manage the classloading of custom plugins jars by code?
Thanks in advance.
P.S.: I'm using the version 5.1.0.0-752
I developed a custom Kettle plugin, which defines 3 transformation steps for use in several transformations. I copied the plugin jar and its dependency libraries in <PDI-HOME>/plugins/steps, and if I run the transformation with the custrom transformation step inside the Kettle GUI environment everything goes ok. But I have problems when I try to run the transformation in embedded mode inside of a Java project, I have the next error:
Code:
java.lang.AssertionError: org.pentaho.di.core.exception.KettleMissingPluginsException:
Missing plugins found while loading a transformation
Step : OfaiSimpleConverter
at EjecucionCargaOFAICompletaTest.ejecucionCargaOFAICompletaTest(EjecucionCargaOFAICompletaTest.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: es.jclm.agri.sga.ofai.adminlib.etl.exception.EtlException: org.pentaho.di.core.exception.KettleMissingPluginsException:
Missing plugins found while loading a transformation
Step : OfaiSimpleConverter
at EjecutorEtlServicioImpl.execute(EjecutorEtlServicioImpl.java:57)
at EjecucionCargaOFAICompletaTest.ejecucionCargaOFAICompletaTest(EjecucionCargaOFAICompletaTest.java:76)
... 29 more
Caused by: org.pentaho.di.core.exception.KettleMissingPluginsException:
Missing plugins found while loading a transformation
Step : OfaiSimpleConverter
at org.pentaho.di.trans.TransMeta.loadXML(TransMeta.java:2840)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2676)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2628)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2605)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2585)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2566)
at EtlTransformacion.loadFromFile(EtlTransformacion.java:35)
at FactoriaEtl.build(FactoriaEtl.java:63)
at FactoriaEtl.build(FactoriaEtl.java:46)
at EjecutorEtlServicioImpl.execute(EjecutorEtlServicioImpl.java:53)
... 30 more
I found that if I copy the custom plugin jar and its dependencies inside the folder <USER-HOME>/.kettle/plugins then the project runs ok, but this is not a valid solution for me (the intention is to run the project as a library inside a Java EE application server).
Any ideas of how to manage the classloading of custom plugins jars by code?
Thanks in advance.
P.S.: I'm using the version 5.1.0.0-752