SCR JavaDoc Tags Deprecated in CQ 5.5

Published on by Dan KlcoPicture of Me Dan Klco
This was also posted on: http://labs.sixdimensions.com/blog/dklco/2012-05-16/scr-javadoc-tags-deprecated-cq-55, however 6D Global Technologies decided to remove my authoring credit, which seems unethical.

Teams migrating to Adobe CQ 5.5 have one more thing to check during the upgrade.  In CQ 5.5, the SCR JavaDoc tags are deprecated, because of this, you can no longer create bundles in CRXDE or CRXDE Lite when the code in the bundles contains SCR JavaDoc tags.  

When Adobe ported CRX over to run inside of the OSGi Container, they created a bundle for the CRXDE functionality.  This includes the remote compiling and bundle builder used by CRXDE and CRXDELite.  In the bundle they set the bundle builder to create bundles using ‘strict mode’, this mode triggers an error when it encounters the deprecated SCR JavaDoc tags and prevents the building of the SCR Descriptor XML.  A JAR will be created, however it will not have the OSGi metadata needed to register services in OSGi. 

How can I tell if my project is affected?

Neither CRXDE nor CRXDE Lite tell you that the SCR JavaDoc tags are causing the issue when you try to build the bundle.  Both indicate an error has occurred, but do not say what caused the error. 

In CRXDE Lite you will see a message “SCR Descriptor parsing had failures (see log)”.  It does tell you which classes had the deprecated javadoc tags however, which will be useful.

CRXDE Lite Deprecated Message

CRXDE will report that the build failed and tell you to check the Remote Build view for details on the errors.  Unfortunately, it will not actually have any error information availabe in the Remote Build view.

CRXDE Build Failure Popup

Finally, if you look in the logs you will see messages like the below:

16.05.2012 20:35:03.789 *WARN* [127.0.0.1 [1337214903288] POST /libs/crxde/build HTTP/1.1] com.day.crx.ide.BundleBuilder Class [...]Process is using deprecated javadoc tags  at jcr:/_/crx.default/apps/public/src/[...]Bundle/src/[...]Process.java:39
16.05.2012 20:35:03.789 *WARN* [127.0.0.1 [1337214903288] POST /libs/crxde/build HTTP/1.1] com.day.crx.ide.BundleBuilder Class [...]Servlet is using deprecated javadoc tags  at jcr:/_/crx.default/apps/public/src/[...]Bundle/src/main/java/[...]Servlet.java:39
16.05.2012 20:35:03.789 *ERROR* [127.0.0.1 [1337214903288] POST /libs/crxde/build HTTP/1.1] com.day.crx.ide.BundleBuilder It is highly recommended to fix these problems, as future versions might not support these features anymore.
16.05.2012 20:35:03.789 *WARN* [127.0.0.1 [1337214903288] POST /libs/crxde/build HTTP/1.1] com.day.crx.ide.BundleBuilder SCR Descriptor parsing had failures (see log) at :0`

How Can I Fix My Project?

The only way to fix your project is to replace all of the SCR JavaDoc Tags with the new SCR Annotations.  The fields and values will be the same or similar, only the syntax changes. 

Once you do this, download and install the Felix SCR Annotations Bundle into your OSGi console.  Without this bundle, you will not be able to compile your project code within CRXDE or CRXDE Lite as the Felix SCR Annotations packages are not currently exported by any bundle in the Generally Available release of CQ 5.5.


Tags

Adobe CQ   CQ 5.5   Apache Felix   CRXDE  

comments powered by Disqus