Hi,
I can't launch my streams application: START NON-TRANSLATABLEjava.lang.NoClassDefFoundError: javax.mail.Authenticator The application is compiling without errors (jar included in build-path), copied into application-folder/ressources/impl/lib too - seems to be wrong way...
https://developer.ibm.com/answers/questions/4941/how-do-i-include-external-jars-for-a-java-native-function.html -> says to put jar into impl/lib what I actually did...
Thanks for help
Answer by askene (167) | Jan 12, 2015 at 08:59 AM
Hello, I had to put my dependency jars in impl/lib AND reference the dependencies in the Class-Path in the MANIFEST.MF of the toolkit jar that has the annotated functions in it.
If you code is in foo.bar.jar make sure you have something like this in the META-INF/MANIFEST.MF Manifest-Version: 1.0 Class-Path: javax.mail.jar other.dependency.jar third.dependency.jar
Answer by dev_47 (1) | Jan 12, 2015 at 01:47 PM
Why I have to change the MANIFEST.MF in the jar I just want to use? I downloaded it compiled - this is the only .jar I want to use, So why its not enough to add it in project-settings and copy it to impl/lib?
I really don't understand this...
Ah, I think I misunderstood how you are building/launching things. You do not need to change the javax.mail.jar at all. The jar that I added the MANIFEST.MF to was the jar with all of my custom java code in it. I usually compile my java code into a jar via 3rd party build tools (maven or gradle) instead of using StreamsStudio.
If you are using StreamsStudio and having it build .class files into impl/bin...then I do not know what else you would need to do other then add javax.mail.jar to the impl/lib directory
Answer by Bruce Glassford (912) | Mar 12, 2015 at 11:05 AM
Pulling this to the top to see if we can get to a complete answer:
If you're compiling your custom function to a .jar you have to add the MANIFEST.MF file
What do you need to do if you're just compiling to .class? Looks like you need to have a reference in the javafunction.xml but there's no way to do it.
Adding Third party jars to Native Functions 1 Answer
Java Native Function portability and automated build/move process 2 Answers
Java Native Function external dependencies 2 Answers
Annotation Function does not support parameter type java.util.Map 1 Answer
Problem for retraining a HoltWinters2 model in Streams 4.2.1.1 1 Answer