Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [smila-user] 3rd-party-classe in own pipelet

Hi Patrick,

I think you mean the configuration/config.ini - there you find the bundles to load and the according init-levels in the binary build.


Cheers,

Martin

On 01/11/2011 02:58 PM, Thomas Menzel wrote:

Hi Patrick,

if u experience this issue in the final deployed product but not when run in the IDE it could be a build issue, e.g. the .jar that is part of ur bundle is not included in the build.properties in the binary build.

otherwise this is most likely a class loader issue. The jar is only known to your bundle but not to ODE which starts our code and hence doesn’t know about the imports in the manifest.

Despite not having tested this and assuming everything else is correct (e.g. unit tests for the pipelets work), I suppose that u have to wrap ur code that calls classes of the .jar in statements like these:

*_final_*_ ClassLoader __tcclBackup__ = Thread./currentThread/().getContextClassLoader();_

Thread./currentThread/().setContextClassLoader(this.getClass().getClassLoader());

*try* {

//do the stuff here

//} catch (final Exception e) {

    } *finally* {

//    set the CL back to what is was

      Thread./currentThread/().setContextClassLoader(tcclBackup);

    }

since this is so common when doing bundle dev. I have an eclipse template for this:

*final* ClassLoader tcclBackup = Thread.currentThread().getContextClassLoader();

Thread.currentThread().setContextClassLoader(${enclosing_type}.*class*.${cursor} getClass().getClassLoader());

*try* {

//do the stuff here

//} catch (final Exception e) {

    } *finally* {

//    set the CL back to what is was

      Thread.currentThread().setContextClassLoader(tcclBackup);

    }

Thomas Menzel @ brox IT-Solutions GmbH

*From:* smila-user-bounces@xxxxxxxxxxx [mailto:smila-user-bounces@xxxxxxxxxxx] *On Behalf Of *Patrick Pekczynski
*Sent:* Dienstag, 11. Januar 2011 14:39
*To:* smila-user@xxxxxxxxxxx
*Subject:* [smila-user] 3rd-party-classe in own pipelet

Dear all,

While using SMILA I finally managed to setup a pipeline where I am including my own test “Extraction-Pipelet” which is working fine.

Now I wanted to extend this pipelet using 3^rd party libraries XXX.jar using my own Solr-Client.

In order to have my pipelet compile I added the XXX.jar in a lib-folder in my pipelet and adapted the MANIFEST.MF of my bundle.

However, as soon as I add this extensions to SMILA’s plugins-folder and startup SMILA my bpel-pipeline cannot by instantiated because of class wich nis not found (not loaded)

START EXCEPTION######################

2011-01-11 13:27:07,006 INFO [Component Resolve Thread (Bundle 5) ] jmx.JmxManagementController - SMILA:C0=Processing,C1=Simple Pipelet,C2=AddWebPipeline,Agent=org.eclipse.smila.integration.imc.extractfeed.ExtractFeedPipelet@line-109

2011-01-11 13:27:07,006 ERROR [Component Resolve Thread (Bundle 5) ] bpel.ODEWorkflowProcessor - Start of BPEL workflow service aborted: Unknown fatal error.Service is non-functional, please fix problem and restart bundle

java.lang.NoClassDefFoundError: org/apache/solr/common/SolrInputDocument

                at java.lang.Class.getDeclaredConstructors0(Native Method)

at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)

                at java.lang.Class.getConstructor0(Unknown Source)

                at java.lang.Class.newInstance0(Unknown Source)

                at java.lang.Class.newInstance(Unknown Source)

at org.eclipse.smila.processing.bpel.PipeletManager.initPipeletInstance(PipeletManager.java:275)

at org.eclipse.smila.processing.bpel.PipeletManager.doRegisterActivity(PipeletManager.java:130)

at org.eclipse.smila.processing.bpel.PipeletManager.doRegisterActivity(PipeletManager.java:1)

at org.eclipse.smila.processing.bpel.ExtensionManager.registerActivity(ExtensionManager.java:94)

at org.eclipse.smila.processing.bpel.SMILAExtensionBundle$InvokePipeletActivity.validate(SMILAExtensionBundle.java:105)

at org.apache.ode.bpel.compiler.v2.ExtensionActivtityGenerator.compile(ExtensionActivtityGenerator.java:54)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl$7.run(BpelCompilerImpl.java:899)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:1068)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compileActivity(BpelCompilerImpl.java:895)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:838)

at org.apache.ode.bpel.compiler.v2.SequenceGenerator.compileChildren(SequenceGenerator.java:55)

at org.apache.ode.bpel.compiler.v2.SequenceGenerator.compile(SequenceGenerator.java:46)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl$7.run(BpelCompilerImpl.java:899)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:1068)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compileActivity(BpelCompilerImpl.java:895)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:838)

at org.apache.ode.bpel.compiler.v2.IfGenerator.compile(IfGenerator.java:52)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl$7.run(BpelCompilerImpl.java:899)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:1068)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compileActivity(BpelCompilerImpl.java:895)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:838)

at org.apache.ode.bpel.compiler.v2.SequenceGenerator.compileChildren(SequenceGenerator.java:55)

at org.apache.ode.bpel.compiler.v2.SequenceGenerator.compile(SequenceGenerator.java:46)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl$7.run(BpelCompilerImpl.java:899)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:1068)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compileActivity(BpelCompilerImpl.java:895)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:838)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl$5.run(BpelCompilerImpl.java:744)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl$8.run(BpelCompilerImpl.java:1168)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:1068)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compileScope(BpelCompilerImpl.java:1118)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:724)

at org.apache.ode.bpel.compiler.v2.BpelCompilerImpl.compile(BpelCompilerImpl.java:132)

at org.apache.ode.bpel.compiler.BpelC.compile(BpelC.java:268)

at org.apache.ode.bpel.compiler.BpelC.compile(BpelC.java:338)

at org.apache.ode.store.DeploymentUnitDir.compile(DeploymentUnitDir.java:171)

at org.apache.ode.store.DeploymentUnitDir.compile(DeploymentUnitDir.java:134)

at org.apache.ode.store.ProcessStoreImpl.deploy(ProcessStoreImpl.java:183)

at org.eclipse.smila.ode.ODEServer.deploy(ODEServer.java:175)

at org.eclipse.smila.processing.bpel.ODEWorkflowProcessor.deployPipelines(ODEWorkflowProcessor.java:602)

at org.eclipse.smila.processing.bpel.ODEWorkflowProcessor.initializeBPEL(ODEWorkflowProcessor.java:584)

at org.eclipse.smila.processing.bpel.ODEWorkflowProcessor.activate(ODEWorkflowProcessor.java:523)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:230)

at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:140)

at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:330)

at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:560)

at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:182)

at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:393)

at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:176)

at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:786)

at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:753)

at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:88)

at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)

Caused by: java.lang.ClassNotFoundException: org.apache.solr.common.SolrInputDocument

at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)

at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)

at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)

at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)

                at java.lang.ClassLoader.loadClass(Unknown Source)

                at java.lang.ClassLoader.loadClassInternal(Unknown Source)

                ... 62 more

2011-01-11 13:27:07,022 INFO [Component Resolve Thread (Bundle 5) ] bpel.ODEWorkflowProcessor - Have reference to processing service MimeTypeIdentifyService

END EXCEPTION#######################

My pipelet’s manifest file looks as follows:

Manifest-Version: 1.0

Bundle-ManifestVersion: 2

Bundle-Name: ExtractFeedPipelet

Bundle-SymbolicName: org.eclipse.smila.integration.imc.extractfeed

Bundle-Version: 1.0.3

Bundle-Vendor: de.imc

Bundle-Classpath: lib/solrclient-0.2-dist.jar

Bundle-RequiredExecutionEnvironment: JavaSE-1.6

Import-Package:

  org.apache.commons.logging;version="1.1.1",

  org.eclipse.smila.blackboard;version="0.7.0",

 org.eclipse.smila.blackboard.path;version="0.7.0",

 org.eclipse.smila.datamodel.id;version="0.7.0",

 org.eclipse.smila.datamodel.record;version="0.7.0",

 org.eclipse.smila.processing;version="0.7.0",

 org.eclipse.smila.processing.configuration;version="0.7.0"

SMILA-Pipelets: org.eclipse.smila.integration.imc.extractfeed.ExtractFeedPipelet

The obviously unloaded or missing class (org.apache.solr.common.SolrInputDocument) is part of the huge (all-in-one) 3^rd -party library I’m referencing in the bundle’s classpath.

And I also checked that all the classes are in the Pipelet-JAR-file that I deployed in the plugins-Folder.

I’m getting really frustrated over not getting SMILA loading the 3^rd party stuff ….

It would be a great relief if anyone could help me out. Maybe I just missed some configuration or reference?

Cheers,

Patrick

*Patrick Pekczynski*

P Please consider the environment before printing this e-mail.

--
---------------------------------------------------------------------------------------------------------------------------------------------------
Vorstand / Executive Board: Dr. Wolfgang Kraemer (Vorsitz, Chairman), Frank Milius, Dr. Volker Zimmermann
Vorsitzender des Aufsichtsrats / Chairman of the board: Prof. Dr.Dr. h.c. mult. August-Wilhelm Scheer
Sitz der Gesellschaft / Headquarter Location: Saarbruecken
Ust Id. DE 812 187 208
Handelsregister / Registration: Amtsgericht Saarbrücken HRB 13 338
--------------------------------------------------------------------------------------------------------------------------------------------------
Der Inhalt dieser E-Mail ist ausschliesslich fuer den bezeichneten Adressaten bestimmt.
Jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail durch unberechtigte Dritte ist unzulaessig.
Wir bitten Sie, sich mit dem Absender der E-Mail in Verbindung zu setzen, falls Sie nicht der Adressat dieser E-Mail sind und das Material von Ihrem
Computer zu loeschen.
The information contained in this transmission is intended only for the person or entity to which it is directly addressed or copied.
It may contain material of confidential and/or private nature. Any review, retransmission, dissemination or other use of, or taking
of any action in reliance upon, this information by persons or entities other than the intended recipient is not allowed.
If you received this message and the information contained therein by error, please contact the sender and delete the material
from your/any storage medium.
IMC supports the United Nations’ Global Compact principles: www.unglobalcompact.org


_______________________________________________
smila-user mailing list
smila-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/smila-user


--

* Martin Röbert *
Java Developer Semantic Web

Unister GmbH
Barfußgässchen 11 | 04109 Leipzig

Telefon: +49 (0)341 49288 5083
martin.roebert@xxxxxxxxxxxxxxx <mailto:%20%20martin.roebert@xxxxxxxxxxxxxxx>
www.unister.de <http://www.unister.de/>

Vertretungsberechtigter Geschäftsführer: Thomas Wagner
Amtsgericht Leipzig, HRB: 19056



Back to the top