First let me say that my initial reaction to the STS and its tutorials is to think really great stuff guys! I managed to work through all 7 OSGi tutorials and was really looking forward to getting into the meat of things with the Spring Framework tutorials, but then I ran across a bit of a snag in the first Spring Framework tutorial entitled "Adding Declarative Transaction Management to Your Spring Applications" involving what appears to be a missing commons-logging jar in the project's classpath.
The error occurs late in the tutorial around the "" step towards the end during the JUnit testing of the TransferServiceTransactionManagementTests class in the "Verify Transactional Behavior" step, and consists of the following Classpath not found on LogFactory error :
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.<clinit>(SpringJUnit4ClassRunner.jav a:62) at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Construc tor.java:494) at org.junit.internal.requests.ClassRequest.buildRunn er(ClassRequest.java:33) at org.junit.internal.requests.ClassRequest.getRunner (ClassRequest.java:28) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.<init>(JUnit4TestReference.java:28) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestC lassReference.<init>(JUnit4TestClassReference.java :24) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestL oader.createTest(JUnit4TestLoader.java:40) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestL oader.loadTests(JUnit4TestLoader.java:30) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:445) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)
---------------
I was able to get around this error by downloading and placing a copy of the latest commons-logging jar (commons-logging-1.1.1.jar) into the classpath of the BankApp project's launch config for this test, but now I am seeing another error which is an apparent inability for the test application to find the applicationContext :
java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Cla ss.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.getDeclaredConstructor(Class.java: 1953)
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:74)
at org.springframework.test.context.TestContext.<init >(TestContext.java:107)
at org.springframework.test.context.TestContextManage r.<init>(TestContextManager.java:103)
at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.createTestContextManager(SpringJUnit 4ClassRunner.java:102)
at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.<init>(SpringJUnit4ClassRunner.java: 79)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:494)
at org.junit.internal.requests.ClassRequest.buildRunn er(ClassRequest.java:33)
at org.junit.internal.requests.ClassRequest.getRunner (ClassRequest.java:28)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.<init>(JUnit4TestReference.java:28)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestC lassReference.<init>(JUnit4TestClassReference.java :24)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestL oader.createTest(JUnit4TestLoader.java:40)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestL oader.loadTests(JUnit4TestLoader.java:30)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:445)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)
---------------
Before I continue hacking away at this thing, I figured I ought to do the unmanly thing and stop and ask for directions...First of all, is it just me, or is anyone else seeing this problem? And, is there maybe some bigger problem anyone can think of going on here which may be causing all of these hassles?
Thanks!


First of all, is it just me, or is anyone else seeing this problem? And, is there maybe some bigger problem anyone can think of going on here which may be causing all of these hassles?
Reply With Quote

