Search code examples
javajartalend

Talend Server External Jar Files


i've got a problem when i try to deploy a job to my talend enterprise server. When i run the job in the talend administration center i get the following error:

java.lang.NoClassDefFoundError: javax/xml/rpc/encoding/SerializerFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

In this job im using some external jar files (axis.jar and jaxrpc.jar) and i added a tLibraryLoad in the job but without any import commands. I used a locate on the Talend Server to ensure that the needed files are located on the server. I found them in different directories and now im not sure if they have to be relocated. The directories are the followed:

  • {Talend-Installation}/cmdline/studio/commandline-workspace/.Java/lib/jaxrpc.jar
  • {Talend-Installation}/cmdline/studio/configuration/lib/java/jaxrpc.jar
  • {Talend-Installation}/cmdline/studio/plugins/javax.xml.rpc_[version]/lib/jaxrpc.jar
  • {Talend-Installation}/studio/plugins/javax.xml.rpc_[version]

On my client the job runs without any errors. Can someone help me with that?

Don't hesitate to ask me for additional content if needed.

Cheers.


Solution

  • External libreries have to be in the same machine where the job will be executed, therefore in order to make it run,

    • Use a context variable in the component tLibraryLoad : context.my_jar_path+"/jaxrpc.jar"
    • Put the jars files in the execution server
    • Depending to how you load your context, make the context variable have the value of the jar path: context.my_jar_path = /Data/Talend/ExtJars/