[Bug 121] New: ClassNotFoundException exception in Eclipse/RCP unit tests

View: New views
8 Messages — Rating Filter:   Alert me  

[Bug 121] New: ClassNotFoundException exception in Eclipse/RCP unit tests

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=121

           Summary: ClassNotFoundException exception in Eclipse/RCP unit
                    tests
           Product: SLF4J
           Version: 1.5.x
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core API
        AssignedTo: dev@...
        ReportedBy: jacob.x.pezaro@...


Created an attachment (id=54)
 --> (http://bugzilla.slf4j.org/attachment.cgi?id=54)
eclipse project demonstrating the problem

Eclipse RCP classes using slf4j throw the following exception when being unit
tested.  The same classes work correctly when running inside a RCP application.

java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
        at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)
        at test.MyClass.<init>(MyClass.java:8)
        at test.MyTest.testGetString(MyTest.java:8)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
        at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 21 more

To replicate this problem:
1. import the attached test project into eclipse
2. run test/MyTest as a junit test


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 121] ClassNotFoundException exception in Eclipse/RCP unit tests

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=121


Ceki Gulcu <listid@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |listid@...




--- Comment #1 from Ceki Gulcu <listid@...>  2008-12-09 11:49:00 ---
Hello Jake,

When I import your test project according to your instructions, MyClass does
not compile because "Logger" and "LoggerFactory" cannot be resolved. Which kind
of invalidates the whole purpose. What is missing?


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 121] ClassNotFoundException exception in Eclipse/RCP unit tests

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=121





--- Comment #2 from jake pezaro <jacob.x.pezaro@...>  2008-12-09 11:54:00 ---
you are probably missing the slf4j.api bundle from your eclipse target platform
(the Manifest.MF should also indicate that this is missing)


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 121] ClassNotFoundException exception in Eclipse/RCP unit tests

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=121





--- Comment #3 from Ceki Gulcu <listid@...>  2008-12-12 16:08:37 ---


(In reply to comment #2)
> you are probably missing the slf4j.api bundle from your eclipse target platform
> (the Manifest.MF should also indicate that this is missing)

As I don't understand what you mean when you talk about "eclipse target
platform", I can't really help with this bug.



--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 121] ClassNotFoundException exception in Eclipse/RCP unit tests

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=121





--- Comment #4 from jake pezaro <jacob.x.pezaro@...>  2008-12-12 16:21:23 ---
is there perhaps another committer on the project who has some experience with
eclipse plugin development, eclipse RCP development or osgi?  after all,
someone on this project created osgi compliant bundle manifests for the slf4j
jars, perhaps that person could take a look at this problem?


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 121] ClassNotFoundException exception in Eclipse/RCP unit tests

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=121





--- Comment #5 from Ceki Gulcu <listid@...>  2008-12-12 16:26:20 ---
(In reply to comment #4)
> is there perhaps another committer on the project who has some experience with
> eclipse plugin development, eclipse RCP development or osgi?  after all,
> someone on this project created osgi compliant bundle manifests for the slf4j
> jars, perhaps that person could take a look at this problem?

I suggest you send a message on the dev@slf4j or user@slf4j mailing lists.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 121] ClassNotFoundException exception in Eclipse/RCP unit tests

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=121


Thorbjørn Ravn Andersen <ravn@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ravn@...




--- Comment #6 from Thorbjørn Ravn Andersen <ravn@...>  2008-12-22 00:38:23 ---
just a note on a thing that bit me when working with the logger agent, namely
that if I made the logger agent code load the SLF4j api, the api classes could
not see the slf4j backend even if they were available to the instrumented
application classes.  I guess this is a classloader issue.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 121] ClassNotFoundException exception in Eclipse/RCP unit tests

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=121


Eddy <ecorbett@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ecorbett@...




--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev