Sometimes on a project you know that you just have to write a blogpost, because you struggled too long with an issue to get it resolved.
The goal :
We wanted to use the twitter4j api inside on our Java-classes in the CQ5.4 installation.
The development was ok, and via maven we used the following dependency to make the code work :
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>[2.2,)</version>
</dependency>
So far so good, deployment is then the next step. We use the “maven-bundle-plugin” to generate the manifest file for the OSGi-bundle.
After the deployment, the following errors showed up in the system-console (http://localhost:4502/system/console/bundles/)
twitter4j — Cannot be resolved
twitter4j.conf — Cannot be resolved
And the status of the bundle was set to “Installed” and not “Resolved”
These errors were caused because I didn’t put the twitter4j packages in the <Export-Package> element of the “maven-bundle-plugin”.
Continue reading →