You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Oleg Taranenko <ot...@key-software.com> on 2007/06/13 11:16:07 UTC

Re[2]: remove test scope for slf4j in pom.xml

Hello Martijn,

Wednesday, June 13, 2007, 10:44:32 AM, you wrote:

> It is in fact the project you are trying to run that is at fault here.
> Wicket doesn't prescribe which logging framework one should use.
> Therefore the examples projects need to choose their own logging
> implementation. This holds for the wicket-examples from Apache as well
> as for wicket stuff related projects.
Hmm... So why slf4j-api not scoped to test?


> Therefore, <scope>test</scope> is correct (for the wicket framework libraries).

> Martijn

> On 6/13/07, Oleg Taranenko <ot...@key-software.com> wrote:
>> Hello, wicket-dev,
>>
>> Now I'm viewing wicket stuffs und some projects not started under
>> mvn jetty:run reason of
>>
>> ...
>> 2007-06-13 09:32:42.952::INFO:  jetty-6.1.4rc1
>> 2007-06-13 09:32:43.687::INFO:  No Transaction manager found - if your webapp requires one, please c
>> onfigure one.
>> 2007-06-13 09:32:44.155::WARN:  failed wicket
>> java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
>>         at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:57)
>>         at org.apache.wicket.protocol.http.WicketFilter.<clinit>(WicketFilter.java:71)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
>> ....
>>
>> I'm using trunk version of the Wicket and jdk 1.5.
>>
>> Artefact slf4j-log4j12-1.3.1.jar is not included into startup
>> classpath for jetty! Removing line 411 in the pom.xml
>> will bug disappear.
>>
>> ${trunk}/pom.xml
>>
>> 408                <dependency>
>> 409                        <groupId>org.slf4j</groupId>
>> 410                        <artifactId>slf4j-log4j12</artifactId>
>> 411                        <scope>test</scope>
>> 412                </dependency>
>>
>>
>> Could this line be removed from pom.xml?
>> May be file a Jira issue?
>>
>> --
>>
>> Oleg Taranenko
>> mailto:olegtaranenko@web.de
>>
>>
>>





-- 
Best regards,
 Oleg                            mailto:otaranenko@key-software.com



Re: remove test scope for slf4j in pom.xml

Posted by Martijn Dashorst <ma...@gmail.com>.
On 6/19/07, Watter <ma...@welchkin.net> wrote:
> This is no big deal to add, but out of curiosity, is this something new? Our
> builds have been running fine without this on all previous 1.3-SNAPSHOTs,
> and if it's a dependency of Wicket now, why is it not indicated in the
> Wicket pom? I assume it's because it might be different depending on which
> logging library one uses, but it is a little unfortunate that this technique
> kind of limits one of the nice benefits of using maven; automatic dependency
> resolution.

Yeah, as a bit of a stab at the maven folks, not you: contrary to
popular belief, Maven doesn't allow one to turn of one's brain. When
you work with dependencies *and* plugins one reallly needs to add all
dependencies to the dependencyManagement part and explicitly tell
maven which versions *you* want. Transitive dependencies are a nice
thing, but they can bite you in the butt much harder than just plain
old dependencies.

Martijn
-- 
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

Re: remove test scope for slf4j in pom.xml

Posted by Watter <ma...@welchkin.net>.

Martijn Dashorst wrote:
> 
> Yes,
> 
> You need to define your own logging implementation. For log4j this is:
> 
> 		<dependency>
> 			<groupId>org.slf4j</groupId>
> 			<artifactId>slf4j-log4j12</artifactId>
> 		</dependency>
> 
> (add version yourself, best put in a dependencyManagement part).
> 
> Martijn
> 
Thanks! That's exactly what we needed to know. 

This is no big deal to add, but out of curiosity, is this something new? Our
builds have been running fine without this on all previous 1.3-SNAPSHOTs,
and if it's a dependency of Wicket now, why is it not indicated in the
Wicket pom? I assume it's because it might be different depending on which
logging library one uses, but it is a little unfortunate that this technique
kind of limits one of the nice benefits of using maven; automatic dependency
resolution.

Anyway, thanks for the the information. Once I manually added that
dependency we were back up and running.

-- 
View this message in context: http://www.nabble.com/remove-test-scope-for-slf4j-in-pom.xml-tf3913261.html#a11203528
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: remove test scope for slf4j in pom.xml

Posted by Martijn Dashorst <ma...@gmail.com>.
Yes,

You need to define your own logging implementation. For log4j this is:

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
		</dependency>

(add version yourself, best put in a dependencyManagement part).

Martijn

On 6/19/07, Watter <ma...@welchkin.net> wrote:
>
>
> Gwyn wrote:
> >
> > On Wednesday, June 13, 2007, 10:21:21 AM, Martijn
> > <ma...@gmail.com> wrote:
> >
> >> On 6/13/07, Oleg Taranenko <ot...@key-software.com> wrote:
> >>> Wednesday, June 13, 2007, 10:44:32 AM, you wrote:
> >>> > It is in fact the project you are trying to run that is at fault here.
> >>> > Wicket doesn't prescribe which logging framework one should use.
> >>> > Therefore the examples projects need to choose their own logging
> >>> > implementation. This holds for the wicket-examples from Apache as well
> >>> > as for wicket stuff related projects.
> >>> Hmm... So why slf4j-api not scoped to test?
> >
> >> Because that is the API to which we program. slf4j-log4j is an
> >> implementation. Read up on the subject here: http://sfl4j.org
> >
> > That's http://www.slf4j.org/ :-)
> >
> > Basically, you program using the -api, then when you deploy, you add
> > one of the implentation jars, e.g. slf4j-nop.jar, slf4j-simple.jar,
> > slf4j-log4j12.jar, slf4j-log4j13.jar, slf4j-jdk14.jar or
> > slf4j-jcl.jar, depending which actual logging implementation you want
> > the logging to end up at.
> >
> > /Gwyn
> >
> I'm not sure I understand what the solution is to the original problem
> presented in this thread. Allof the sudden with today's 1.3-SNAPSHOT jars
> I'm receiving exactly the same error: java.lang.NoClassDefFoundError:
> org/slf4j/impl/StaticLoggerBinder
>
> Nothing has changed in my code. I literally just deleted the
> org/apache/wicket directory in my repository in order to force maven to go
> get the newest jars, restarted my application and bam... this error pops up.
> Is there some change I need to make to my own application's pom.xml to
> accommodate this sl4j dependency?
>
>
>
> --
> View this message in context: http://www.nabble.com/remove-test-scope-for-slf4j-in-pom.xml-tf3913261.html#a11198329
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>


-- 
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

Re: remove test scope for slf4j in pom.xml

Posted by Watter <ma...@welchkin.net>.

Gwyn wrote:
> 
> On Wednesday, June 13, 2007, 10:21:21 AM, Martijn
> <ma...@gmail.com> wrote:
> 
>> On 6/13/07, Oleg Taranenko <ot...@key-software.com> wrote:
>>> Wednesday, June 13, 2007, 10:44:32 AM, you wrote:
>>> > It is in fact the project you are trying to run that is at fault here.
>>> > Wicket doesn't prescribe which logging framework one should use.
>>> > Therefore the examples projects need to choose their own logging
>>> > implementation. This holds for the wicket-examples from Apache as well
>>> > as for wicket stuff related projects.
>>> Hmm... So why slf4j-api not scoped to test?
> 
>> Because that is the API to which we program. slf4j-log4j is an
>> implementation. Read up on the subject here: http://sfl4j.org
> 
> That's http://www.slf4j.org/ :-)
> 
> Basically, you program using the -api, then when you deploy, you add
> one of the implentation jars, e.g. slf4j-nop.jar, slf4j-simple.jar,
> slf4j-log4j12.jar, slf4j-log4j13.jar, slf4j-jdk14.jar or
> slf4j-jcl.jar, depending which actual logging implementation you want
> the logging to end up at.
> 
> /Gwyn
> 
I'm not sure I understand what the solution is to the original problem
presented in this thread. Allof the sudden with today's 1.3-SNAPSHOT jars
I'm receiving exactly the same error: java.lang.NoClassDefFoundError:
org/slf4j/impl/StaticLoggerBinder

Nothing has changed in my code. I literally just deleted the
org/apache/wicket directory in my repository in order to force maven to go
get the newest jars, restarted my application and bam... this error pops up.
Is there some change I need to make to my own application's pom.xml to
accommodate this sl4j dependency?



-- 
View this message in context: http://www.nabble.com/remove-test-scope-for-slf4j-in-pom.xml-tf3913261.html#a11198329
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: remove test scope for slf4j in pom.xml

Posted by Gwyn Evans <gw...@gmail.com>.
On Wednesday, June 13, 2007, 10:21:21 AM, Martijn <ma...@gmail.com> wrote:

> On 6/13/07, Oleg Taranenko <ot...@key-software.com> wrote:
>> Wednesday, June 13, 2007, 10:44:32 AM, you wrote:
>> > It is in fact the project you are trying to run that is at fault here.
>> > Wicket doesn't prescribe which logging framework one should use.
>> > Therefore the examples projects need to choose their own logging
>> > implementation. This holds for the wicket-examples from Apache as well
>> > as for wicket stuff related projects.
>> Hmm... So why slf4j-api not scoped to test?

> Because that is the API to which we program. slf4j-log4j is an
> implementation. Read up on the subject here: http://sfl4j.org

That's http://www.slf4j.org/ :-)

Basically, you program using the -api, then when you deploy, you add
one of the implentation jars, e.g. slf4j-nop.jar, slf4j-simple.jar,
slf4j-log4j12.jar, slf4j-log4j13.jar, slf4j-jdk14.jar or
slf4j-jcl.jar, depending which actual logging implementation you want
the logging to end up at.

/Gwyn


Re: Re[2]: remove test scope for slf4j in pom.xml

Posted by Martijn Dashorst <ma...@gmail.com>.
On 6/13/07, Oleg Taranenko <ot...@key-software.com> wrote:
> Wednesday, June 13, 2007, 10:44:32 AM, you wrote:
> > It is in fact the project you are trying to run that is at fault here.
> > Wicket doesn't prescribe which logging framework one should use.
> > Therefore the examples projects need to choose their own logging
> > implementation. This holds for the wicket-examples from Apache as well
> > as for wicket stuff related projects.
> Hmm... So why slf4j-api not scoped to test?

Because that is the API to which we program. slf4j-log4j is an
implementation. Read up on the subject here: http://sfl4j.org

Martijn

-- 
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org