Skip to content

Running Quercus On GlassFish Server 4

August 16, 2014

I tried to migrate one of my Quercus-powered web applications to a new GlassFish Server 4 instance, but failed at first.  GlassFish complained with a server log entry like the following:

The lifecycle method [init] must not throw a checked exception. Related annotation information: annotation [@javax.annotation.PostConstruct()]…

So what was a checked exception, I thought and got an answer in a few minutes.

To explain a checked exception in short, it is an exception (java.lang.Throwable and its descendants) that is not an unchecked exception (java.lang.RuntimeException and its descendants). The @javax.annotation.PostConstruct annotation simply requires the annotated method does not throw a checked exception, but Quercus violates the requirements.

It became clear that I could not use Quercus on GlassFish Server 4 without modifications, so I decided to build Quercus myself from the source code.

I made a Maven project for Quercus, but the first apparent issue was its dependencies are not clear. I tried to add possible dependency to resolve errors, but a few remained. One of the causes was Quercus happened to use a draft version of the Java Caching API that is not compatible to the final release. I decided to go with the final release and made trivial changes to the Quercus source code. Another one is a bug in the Java EE API available from the Maven repository. I finally added explicit dependency on the CDI APIs to work around it.

(To be continued to Episode 2)


From → Java

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: