PDA

View Full Version : bundle has already installed error



growing
Aug 17th, 2008, 08:40 AM
When I run the test case which was inherited from AbstractConfigurableBundleCreatorTests class, it always failed. I used spring framework and spring DM. The error information followed:

java.lang.IllegalStateException: Unable to dynamically start generated unit test bundle
at org.springframework.osgi.test.AbstractOnTheFlyBund leCreatorTests.postProcessBundleContext(AbstractOn TheFlyBundleCreatorTests.java:511)
at org.springframework.osgi.test.AbstractConfigurable BundleCreatorTests.postProcessBundleContext(Abstra ctConfigurableBundleCreatorTests.java:223)
at org.springframework.osgi.test.AbstractOsgiTests.st artup(AbstractOsgiTests.java:262)
at org.springframework.osgi.test.AbstractOsgiTests.pr epareTestExecution(AbstractOsgiTests.java:374)
at org.springframework.osgi.test.AbstractOsgiTests.ru nBare(AbstractOsgiTests.java:203)
at org.springframework.osgi.test.AbstractOsgiTests$1. protect(AbstractOsgiTests.java:184)
at junit.framework.TestResult.runProtected(TestResult .java:124)
at org.springframework.osgi.test.AbstractOsgiTests.ru n(AbstractOsgiTests.java:181)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit 3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:460)
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)
Caused by: org.osgi.framework.BundleException: Bundle "com.springsource.junit" version "3.8.2" has already been installed from: file:/e:/jian/maven repository/org/junit/com.springsource.junit/3.8.2/com.springsource.junit-3.8.2.jar
at org.eclipse.osgi.framework.internal.core.Framework .createAndVerifyBundle(Framework.java:642)
at org.eclipse.osgi.framework.internal.core.Framework .installWorkerPrivileged(Framework.java:909)
at org.eclipse.osgi.framework.internal.core.Framework $2.run(Framework.java:824)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.Framework .installWorker(Framework.java:875)
at org.eclipse.osgi.framework.internal.core.Framework .installBundle(Framework.java:819)
at org.eclipse.osgi.framework.internal.core.BundleCon textImpl.installBundle(BundleContextImpl.java:229)
at org.springframework.osgi.test.AbstractOnTheFlyBund leCreatorTests.installAndStartBundle(AbstractOnThe FlyBundleCreatorTests.java:523)
at org.springframework.osgi.test.AbstractOnTheFlyBund leCreatorTests.postProcessBundleContext(AbstractOn TheFlyBundleCreatorTests.java:508)
... 13 more

The bundles added through getTestBundlesNames method are:

"org.objectweb.asm, com.springsource.org.objectweb.asm.attrs, 1.5.3",
"org.objectweb.asm, com.springsource.org.objectweb.asm, 1.5.3",
"javax.xml.stream, com.springsource.javax.xml.stream, 1.0.1",
"org.dom4j, com.springsource.org.dom4j, 1.6.1",
"org.apache.commons, com.springsource.org.apache.commons.collections, 3.2.0",
"net.sourceforge.cglib, com.springsource.net.sf.cglib, 2.1.3",
"org.jboss.javassist, com.springsource.javassist, 3.3.0.ga",
"org.antlr, com.springsource.antlr, 2.7.6",
"javax.persistence, com.springsource.javax.persistence, 1.0.0",
"org.hibernate, com.springsource.org.hibernate, 3.2.6.ga",
"org.springframework, org.springframework.jdbc, 2.5.5.A",
"org.springframework, org.springframework.orm, 2.5.5.A",
"org.springframework, org.springframework.transaction, 2.5.5.A",

I really can't find out the reason. Anybody can help me? Please.

Costin Leau
Aug 25th, 2008, 02:55 AM
Repeating myself, please use [ c o d e ] tags when posting stracktraces or configurations.
What version of Spring-DM are you using and how does your test look like? Try minimizing the test case since somebody is trying to install junit twice (either directly or indirectly by calling the method that causes the framework bundles install).