Is it possible to exclude one or more jars from a build?

One Star

Is it possible to exclude one or more jars from a build?

Hi all. I have a question. Ik have a project containing several jobs, child jobs and custom routines and components. When I run the job in Talend (Open Studio 5.4.1), everything is working as expected: the console stays empty when no errors or warnings occur.
However, when I build the job as an autonomous job and execute the job from a shell (cmd in my case), the console contains the following lines:
--
log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient
.params.DefaultHttpParams).
log4j:WARN Please initialize the log4j system properly.
--
This seems to be caused by either the existence of log4j-1.2.15.jar or the absence of a log4j.properties file.
Without the Log4j jar, everything is working fine.
As far as I can see, there are two possible solutions:
1. Somehow mark the log4j jar for exclusion in the job build;
2. Somehow add a log4j.properties file to the job build;
Of course, both solutions can be performed manually, but I want to make sure every new build is working correctly without performing any manual steps afterwards.
As an extra question: I would like to know which component causes the log4j jar to be there. Is there any way to find out?
Any help is much appreciated!
Moderator

Re: Is it possible to exclude one or more jars from a build?

Hi,
We will make a investigation on your first issue.
As an extra question: I would like to know which component causes the log4j jar to be there. Is there any way to find out?

Please check the online document TalendHelpCenter:Identify required external modules.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Is it possible to exclude one or more jars from a build?

Thanks, Sabrina. Interestingly enough, I'm using none of the components which are listed next to log4j-*.jar in the Modules tab. Any idea why it is still there in the build?
And, is there any news on the first issue?
Seventeen Stars

Re: Is it possible to exclude one or more jars from a build?

This message occurse if a Logger will be instantiated and found no configuration. Only the presence of the log4j library does not cause an initialization process.
If you are not sure which component needs these classes:
Export your job as jobscript and remove this library. You will get some ClassNotFoundException and in its statck trace you will find the job names.
One Star

Re: Is it possible to exclude one or more jars from a build?

Hi all!
I have the same problem after building and running my job from CMD.
I found a Jira-Ticket which tells me that log4j.xml should be included when the job is exported. But it is not included in the ZIP-File after building and exporting the job.
https://jira.talendforge.org/browse/TDI-27172
I´m using Talend Open Studio for Data Integration Version 5.4.1.

Re: Is it possible to exclude one or more jars from a build?

So I'm still not clear whether it's possible or not to exclude jars from a build process?
I have a situation where I"m deploying a job to hdfs (cloudera cdh5) and wanted to exclude some jars since talend 5.4 uses some packages that aren't compatible with cdh5. I would like to remove those jars during build process. Is that possible?
I know when using maven you can exclude as many jars as you want but not sure whether same principles would be apply here.
Thanks.
One Star

Re: Is it possible to exclude one or more jars from a build?

Hello,
I have a similar issue : 
I exporting a job as a web service (.war) and the libs used in the user routines are embedded whereas I'm not using any user routine in my job.
I'd like to exclude these libs from the war file.
How can I do, unless modifying the war "by hand" ?
Thank you
One Star

Re: Is it possible to exclude one or more jars from a build?

Hello, please do not ignore these questions.  There are many of us struggling with this issue and need assistance asap.
Thank you.
One Star

Re: Is it possible to exclude one or more jars from a build?

How do we exclude java source when exporting job as a war?
Moderator

Re: Is it possible to exclude one or more jars from a build?

Hi,
How do we exclude java source when exporting job as a war?

So far, you have to modify the exported war file by hand.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Is it possible to exclude one or more jars from a build?

Hello,
I have a collision between guava versions. One comed from guava.jar itself and one comes from com.google.guava...jar when 
using tRESTClient palette.
I can't seem to exclude this jar using mavan xmls.
Is there another way?
Thank you
Moderator

Re: Is it possible to exclude one or more jars from a build?

Hi sysmq,
Have you tried to exclude JAR files from the ClassPath?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Is it possible to exclude one or more jars from a build?

Hi @xdshi,
I have the same sysmq's problem!!! I tried to exclude JAR files, as you suggested but I had thi Exception: Unresolved requirement: Require-Bundle: com.google.guava; bundle-version="[14.0.1,16.0.0)".
I need to use tRESTClient palette and I need to use GUAVA version 20.
I'd like a reply as soon as possible. Thank you.

Anna