Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
fred271828
Contributor
Contributor

tLibraryLoad of Maven artifact with a `classifier` to resolve NoClassDefFoundError

I'm trying to find a *single* location where I can configure a runtime classpath in Talend.

 

For standalone jobs I've been able to modify the `@3rdPartyLibIncludes@` section of the Maven assembly.xml (Project Settings > Maven > Standalone Job > Assembly) and then also updated the classpath in the .bat/.ps1/.sh scripts to include everything in the standalone zip's `lib` folder.  I've also modified the project's pom.xml to specify my external jar (a jar-with-dependencies) as a dependency of my Talend project.

 

But this doesn't work when running jobs directly from Talend Studio itself.  In that case I get a NoClassDefFoundError:

"Exception in thread "Thread-1" java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/config/ConfigurationFactory"

 

So I modified my external code to build a jar-with-dependencies/uber-jar thinking that I could load that with a tLibraryLoad.  The problem is that tLibraryLoad expects a Maven URI of the form `mvn:<groupid>/<artifactId>/<version>/<type>` while Maven typically specifies its URIs with a different form `maven:<groupid>:<artifactId>:<type>:<classifier>:<version>`.  Note the inclusion of `<classifier>` in the second form (and colons in place of slashes).  In my case I need a "jar-with-dependencies" classifier.  How do I specify this in tLibraryLoad?  I already tried appending the <version-classifier> in place of the <version> string but this gives an error: "This jar is not installed in the artifact repository, [sic] please install it !" 

 

Ideally I'd prefer the tLibraryLoad to simply use the JAR version I've specified in the project's pom as I've done in assembly.xml with the following include: `<include>com.mygroupId:myArtifactId:jar:jar-with-dependencies</include>` which uses a proper Maven URI and which doesn't require specific artifact version number.  Is this possible?

 

Labels (3)
1 Reply
Anonymous
Not applicable

Hello,

Regarding classifier, you should have a try with:
mvn:groupId/artifactId/version/type/classifier
(using the format from OPS4J Pax URL)

Best would be to not have to modify any pom / assembly.
Indeed the tLibraryLoad should be able to setup this. (more easy on 7.1.1 than 7.0 here)

Nicolas.