Posts Tagged “Apache Felix”

Escaping the Dreaded VerifyError

Recently (read early this afternoon) I was doing my best to beat my head against the desk until something useful spilled out.  The problem I was having was with a relatively old, but frequently updated codebase where recently certain random services would not start. The project had recently updated from Java 1.6 to Java 1.8 and at some point, the problem occurred but had not been noticed immediately as it only affected a small subset of...

Simple Web Console Templates

Awhile back, I wrote a blog post about [creating Apache Felix Web Console Plugins](/blog/2013-09-11/service-boss-level-part-2-custom-web-console-plugins/). It's a pretty great technique for creating a diagnostic configuration panel for complex services or applications, however the process for rendering HTML for the consoles is still somewhat stuck in the dark ages. Since servlets are used to render the HTML, you'll generally see HTML being written to the response in the Java code of the Web Console...

Service Boss Level Part 2: Custom Web Console Plugins

You've got your awesome service.  It performs all sorts of complex tasks and maybe even uses a Sling Service Factory to provide multiple configurations.  But how do you know what it's doing?  Well, of course you need to have appropriate logging, but another tool you can leverage is the Apache Felix Web Console, by creating a custom Web Console Plugin.  Your plugin can be accessed through Adobe CQ and Apache Sling's Web Console and can display...

Service Boss Level: Service Factories

I've always wondered how the Apache Sling Logging Logger Configuration worked.  I like the idea of being able to configure multiple configuration instances through the OSGi Console and could see how this would cut down on the UI code I'd need to write in many circumstances.Since working on the Apache Sling project, I have taken the time to peruse the code for the Sling logger.  Unfortunately, the Sling logging code uses a fairly arcane method for registering the...

Beware of Export-Package

Quick - without checking the documentation, what does the Export-Package instruction do in the Maven Bundle Plugin?Did you say "sets what packages are exported by the bundle"?  If so, you're only half right.Recently, I was trying to diagnose some issues with a SOAP Web Services implementation in an existing code base.   Theoretically, everything was in place, however I was getting a ClassCastException when attempting to retrieve the OSGi Service for accessing the SOAP Web...

Increasing Recent Requests in the Felix Console

I argued with myself for some time before commiting to writing this post.  Part of me thought it kind of silly to post such a thing.  Then I reflected on the hour or so I wandered around trying to figure out how to get this darned thing to do what I needed it to.  So, now you won't have to wonder how the heck to get this to work properly.  This was tested on CQ...

MessageGatewayService vs MessageGateway

When creating services which use the CQ5's MessageGateway API to send emails, it can be tempting to use the following to directly reference the MessageGateway you need in your service: @ReferenceMessageGateway<HtmlEmail> messageGateway; Unfortunately, this can cause issues as the MessageGateway will not be available if the Day CQ Mail Service is not configured.   If the Day CQ Mail Service is not configured the MessageGateway service will not be registered in OSGi.  This will mean...

SCR JavaDoc Tags Deprecated in CQ 5.5

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