On Sat, Aug 13, 2011 at 1:17 PM, bvahdat <babak.vah...@swissonline.ch> wrote:
> Claus,
>
>>>>Well frankly it is the other way around. End users should be able to
> specify exactly which log4j version they want to use.
>
> If camel users (2.8.0) instrucht camel to use log4j through slf4j by
> declaring a DIRECT dependency to the slf4j-log4j12, then indeed they will
> get stucked to log4j 1.2.16. See the example here for a version conflict of
> log4j caused through slf4j
> http://camel.465427.n5.nabble.com/file/n4695940/foo.zip foo.zip  and do a
>
> mvn org.apache.maven.plugins:maven-dependency-plugin:2.3:tree -Dverbose=true
>
> And in maven's output see the line
>
> (log4j:log4j:jar:1.2.16:compile - omitted for conflict with 1.1.3)
>
> And we all know that at RUNTIME the application's routing logic will most
> probably crash with a "NoSuchMethodError" if camel calls a slf4j's
> LOGGER.xyz() method which gets delegated to log4j logging API. However the
> method signature slf4j Logger calls on log4j API was not available at the
> time by log4j API version 1.1.3. On the other hand this was the version the
> developer decided to use! Well in an OSGi environment things would seem
> different, but that's not our concern by this discussion.
>
> @Christian I've never used freemarker but they seem to use a Ant+Ivy build
> and not maven, see https://github.com/freemarker/freemarker. At least their
> maven pom claims to have no dependencies! see
> http://repo1.maven.org/maven2/org/freemarker/freemarker/2.3.18/freemarker-2.3.18.pom
>
> I'll wait to see what Claus thinks before opening a JIRA-ticket. There are
> two fixes I can see
> 1- remove the compile-scope dependency to log4j by camel-freemarker, see
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-freemarker/pom.xml

Ah yeah i dont see a reason to have that. freemarker dont depend on log4j.
I tried removing log4j from the pom.xml and got this tree now:


[INFO] ------------------------------------------------------------------------
[INFO] Building Camel :: Freemarker 2.9-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ camel-freemarker ---
[INFO] org.apache.camel:camel-freemarker:bundle:2.9-SNAPSHOT
[INFO] +- org.apache.camel:camel-core:jar:2.9-SNAPSHOT:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- org.freemarker:freemarker:jar:2.3.18:compile
[INFO] +- org.apache.camel:camel-test:jar:2.9-SNAPSHOT:test
[INFO] |  \- org.apache.camel:camel-spring:jar:2.9-SNAPSHOT:test
[INFO] |     +- org.springframework:spring-context:jar:3.0.5.RELEASE:test
[INFO] |     |  +- org.springframework:spring-beans:jar:3.0.5.RELEASE:test
[INFO] |     |  +- org.springframework:spring-core:jar:3.0.5.RELEASE:test
[INFO] |     |  |  \- commons-logging:commons-logging:jar:1.1.1:test
[INFO] |     |  +- org.springframework:spring-expression:jar:3.0.5.RELEASE:test
[INFO] |     |  \- org.springframework:spring-asm:jar:3.0.5.RELEASE:test
[INFO] |     +- org.springframework:spring-aop:jar:3.0.5.RELEASE:test
[INFO] |     |  \- aopalliance:aopalliance:jar:1.0:test
[INFO] |     \- org.springframework:spring-tx:jar:3.0.5.RELEASE:test
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:test
[INFO] |  \- log4j:log4j:jar:1.2.16:test
[INFO] \- junit:junit:jar:4.8.1:test
[INFO] ------------------------------------------------------------------------




> 2- remove of all those DIRECT log4j dependencies of the scope test by all
> camel's poms. Please note that this's NOT critical for the camel users, and
> is just relevant while running camel's own test cases. Nevertheless it's not
> nice.
>

Yeah that may be nicer. JIRA and patch is welcome.



> Regards, Babak
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-freemarker-tp4693216p4695940.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to