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)
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>