Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] ClassNotFound Exception in Runtime

Hi,

I am using tInitLog4J/tLog4jRow components in my jobs which I got from Exchange, it works fine under TOS 6.1, however it throws out ClassNotFound exception as below when I call my routes in Runtime. How to resolve this issue?
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/BasicConfigurator
at org.courtine.talend.log4j.TalendLog4JConfigurator.configureLog4J(TalendLog4JConfigurator.java:36)
at servicerequest.newservicerequestrouter_0_1.NewServiceRequestRouter.tInitLog4J_1Process(NewServiceRequestRouter.java:2607)
at servicerequest.newservicerequestrouter_0_1.NewServiceRequestRouter.tRunJob_2Process(NewServiceRequestRouter.java:2520)
at servicerequest.newservicerequestrouter_0_1.NewServiceRequestRouter.tLibraryLoad_2Process(NewServiceRequestRouter.java:2160)
at servicerequest.newservicerequestrouter_0_1.NewServiceRequestRouter.tPrejob_1Process(NewServiceRequestRouter.java:2049)
at servicerequest.newservicerequestrouter_0_1.NewServiceRequestRouter.runJobInTOS(NewServiceRequestRouter.java:3383)
at org.talend.camel.TalendProducer.invokeTalendJob(TalendProducer.java:109)[56:camel-talendjob:6.1.1]
at org.talend.camel.TalendProducer.process(TalendProducer.java:65)[56:camel-talendjob:6.1.1]
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
... 29 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.BasicConfigurator cannot be found by servicerequest.NewServiceRequestRouter_0.1.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:389)[org.eclipse.osgi-3.10.2.jar:]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)[org.eclipse.osgi-3.10.2.jar:]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)[org.eclipse.osgi-3.10.2.jar:]
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)[org.eclipse.osgi-3.10.2.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_79]
... 38 more
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I have to use tLiberaryLoad to embed log4j jar for my jobs. After that, it runs fine in Runtime.

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi,
Did you export your job as  osgi bundle jar file or  export ("build route") the route to the kar file?
[font=Verdana, Helvetica, Arial, sans-serif] It seems there is a missing jar for [/font] log4j custom components( log4j-X.X.XX.jar   ) when you  call your routes in Runtime.
Could you please give us more information about your operation?
Best regards
Sabrina
Anonymous
Not applicable
Author

I have the same issue.
Do you find a solution?
Anonymous
Not applicable
Author

PAX Logging used as logging frontend in Runtime and provides limited API for Log4j; to have all required classes in classpath log4j jar should be embded into the job bundle ATM.
Anonymous
Not applicable
Author

I have to use tLiberaryLoad to embed log4j jar for my jobs. After that, it runs fine in Runtime.
Anonymous
Not applicable
Author

seanzhang1212 wrote:
I have to use tLiberaryLoad to embed log4j jar for my jobs. After that, it runs fine in Runtime.

I use a similar solution.

Is it possible to configure pom file to embded jar?
Anonymous
Not applicable
Author

Even you config jar in pom, you still need to use tLiberaryLoad...I don't know why, but it is the behavior i am experiencing.