[Solved] error when added dependency mysql-connector-java 5.1.6 in bundle "weasis-core-api"

1,150 views
Skip to first unread message

杨浩

unread,
Sep 25, 2013, 6:22:37 PM9/25/13
to dcm...@googlegroups.com
I tried to add dependency mysql-connector-java 5.1.6 in bundle "weasis-core-api" in the pom.xml.

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>

ERROR: Bundle weasis-core-api [10] Error starting file:C:/Users/yh2588/.m2/repository/org/weasis/core/weasis-core-api/2.0.0-SNAPSHOT/weasis-core-api-2.0.0-SNAPSHOT.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle weasis-core-api [10]: Unable to resolve 10.0: missing requirement [10.0] osgi.wiring.package; (osgi.wiring.package=com.mchange.v2.c3p0))
org.osgi.framework.BundleException: Unresolved constraint in bundle weasis-core-api [10]: Unable to resolve 10.0: missing requirement [10.0] osgi.wiring.package; (osgi.wiring.package=com.mchange.v2.c3p0)
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Thread.java:722)


ceberni also met this problem(http://forums.dcm4che.org/jiveforums/message.jspa?messageID=21254#21254). And I tried nroduit's solution, but It also did not work.

I searched this problem, there is a solution in the following webpage:

The solution is to change:


<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Import-Package>*;resolution:=optional</Import-Package>
<Embed-Dependency>mysql-connector-java;scope=compile|runtime</Embed-Dependency>
<Bundle-Activator>${bundle.namespace}.internal.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
</plugins>
</build>


Into:



<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Import-Package>*;resolution:=optional</Import-Package>
<Embed-Dependency>mysql-connector-java;scope=compile|runtime</Embed-Dependency>
<Bundle-Activator>${bundle.namespace}.internal.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
</plugins>
</build>


Reply all
Reply to author
Forward
0 new messages