Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty OSGI with JSP support - Missing Constraint

And I see why you got an old version of the jetty-schemas.jar file - the jetty-distribution build is still pointing at version 3.1.RC0 of that jar, which doesn't contain the proper manifest added in 3.1.M0. As the jetty-distro doesn't need the manifest in any way, that wasn't noticed. I've corrected the build now to make sure its using 3.1.M0 of jetty-schemas.jar


On 12 December 2013 15:44, Jan Bartel <janb@xxxxxxxxxxx> wrote:
Hi Jason et al,

Sorry, my bad again for not updating the jetty documentation.

The jar you need is downloadable here:

This jar has all of the necessary glassfish jsp classes, including ResourceInjector and the JDTJavaCompiler class, along with an osgi manifest that attaches it as a fragment to the  org.eclipse.jetty.osgi.boot bundle.

So you should have these jsp-related bundles installed, in addition to the org.eclipse.jetty.osgi/jetty-osgi-boot/9.1.0.v2013111 bundle (and the jetty bundles listed under "General Setup" on


I'll update the documentation.

Also, please double-check that you have version 3.1 of the servlet-api deployed NOT version 3.0, and the jetty-toolchain jetty-schemas 3.1.M0 jar. So should be:


That version of the jetty-schemas jar has the correct export statements in its manifest.

So, in short, I think I've wasted a bunch of your time by simply forgetting to update the jetty-osgi doco for jsp - sorry about that!


On 12 December 2013 03:31, Jason <jneatherway@xxxxxxxxxxx> wrote:
Thanks Joakim, that set me on the right trail.

I found that org.eclipse.jetty.osgi.boot.jsp fragment activator set org.apache.jasper.compiler.disablejsr199=true
//jsr199 compilation does not work in osgi
System.setProperty("org.apache.jasper.compiler.disablejsr199", Boolean.TRUE.toString());
So I followed through expecting it would need to find both, org.eclipse.jdt.internal.compiler.Compiler and org.apache.jasper.compiler.JDTJavaCompiler
I found that the .jasper.compiler.JDTJavaCompiler was not in the org.glassfish.web.javax.servlet.jsp bundle, but in a separate JAR in Jetty lib/jetty-jsp-jdt-2.3.3.jar
I also found that the jdt packages were not imported by org.glassfish.web.javax.servlet.jsp (they are exported by org.eclipse.jdt.core.compiler.batch).
Adding jetty-jsp-jdt-2.3.3.jar to OSGI, and fixing the jdt imports on org.glassfish.web.javax.servlet.jsp left me with another problem ...
I got a class not found for org.glassfish.jsp.api.ResourceInjector.  To fix this I added org.glassfish.jsp.api to the imports of org.eclipse.jetty.webapp

Then success !!

There was a fair bit of messing around so I'll check over the next few days to see if I captured everything as a reference.

Thanks all for the input

Date: Tue, 10 Dec 2013 05:48:37 -0700
From: joakim@xxxxxxxxxxx

To: jetty-users@xxxxxxxxxxx
Subject: Re: [jetty-users] Jetty OSGI with JSP support - Missing Constraint

PWC63449: Cannot find a java compiler for compilation 

Here's the Jasper logic is to find a compiler it can use.

If you do nothing, and rely on defaults, then org.eclipse.jdt.internal.compiler.Compiler is used (if found)
But if you specify System.setProperty("org.apache.jasper.compiler.disablejsr199","false"), then the JDK built-in compiler is used (Jasper looks for "" class),
Next, if neither of those are found, the "" is looked for.
Finally, if none are found, it throws that error.

I don't use OSGi myself, so I don't know what you need to do, but maybe this little insight into the process will help you address it directly.

Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Tue, Dec 10, 2013 at 12:01 AM, Jason Neatherway <jneatherway@xxxxxxxxxxx> wrote:
Thanks Jan - that cleared up the dependencies.  (note. the jetty-schemas didn't include a bundle manifest so I needed to create a new bundle from the JAR)

I'm now stuck on the error - org.apache.jasper.JasperException: PWC6349: Cannot find a java compiler for compilation.

Date: Tue, 10 Dec 2013 16:21:23 +1100
From: janb@xxxxxxxxxxx
To: jetty-users@xxxxxxxxxxx
Subject: Re: [jetty-users] Jetty OSGI with JSP support - Missing Constraint

Hi Jason,

Ooops, doco is a little out-of-date. You will also need the jetty-schemas-3.1.jar from the jetty distro lib directory.

I'll put updating that page onto my to-do list.


On 10 December 2013 12:27, Jason Neatherway <jneatherway@xxxxxxxxxxx> wrote:
I'm trying to use Jetty as a OSGI bundle in Eclipse (Kepler for RCP and RAP), I'm following the guidance at
I have installed the JARs as bundles, and have been able to launch the jetty-osgi-boot jar and add a web app via another bundle with just a static html page to test.  This all went pretty smoothly and worked.
I used JARs from LIB folder in jetty-distribution-9.1.0.v20131115
jetty-webapp org.eclipse.jetty.webapp
Plus - servlet-api-3.1.jar and jetty-osgi-boot-9.1.0.v20131115.jar

I then tried to add JSP support, and had trouble with the jetty-osgi-boot-jsp fragment.  It failed dependencies.
I imported JSP JARs from lib/jsp folder in the distribution,
- javax.servlet (3.0.0.v201112011016)
- javax.servlet.jsp (3.0.0.v201112011158)
 - jetty-osgi-boot-jsp-9.1.0.v20131115.jar

Bundle validation failed for jetty-osgi-boot with Missing Constraint for
- javax.servlet.jsp.resources_[3.1.0,3.2.0)
- javax.servlet.resources_[3.1.0,3.2.0)
The javax.servlet andjavax.servlet.jsp bundles provide earlier versions of these packages.

Do have have some conflicting versions here ?  I couldn't find any newer packages that would meet these constraints, so wondering if its a error with the jetty-osgi-boot-jsp manifest.  Appreciate any advice.

I did also try modifying the manifest jetty-osgi-boot-jsp to reduce the minimum version for these so that the dependency would be met
 - javax.servlet.resources min 2.1
 - javax.servlet.jsp.resources min 2.1
This allowed the fragment to start, but I then it fails to compile the JSP with
org.apache.jasper.JasperException: PWC6349: Cannot find a java compiler for compilation.

I'm a bit of a novice (hobby programmer) but I'm trying to learn about Jetty and OSGI so would appreciate any guidance

---------------- Console output ---------------------
** Jasper error occurs after making a request for a JSP page
ICommand is registered
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://17.fwk95630655/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://17.fwk95630655:3/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
12:03:24.413 [Start Level Event Dispatcher] DEBUG c.neatherweb.automate.configmgr.impl - ConfigManager service is registered
12:03:24.420 [Start Level Event Dispatcher] INFO  com.neatherweb.jcbus - Logging service started.
2013-12-10 12:03:24.503:INFO:oejobis.DefaultJettyAtJettyHomeHelper:Start Level Event Dispatcher: Configuring jetty from bundle: org.eclipse.jetty.osgi.boot with /jettyhome/etc/jetty.xml
2013-12-10 12:03:24.514:INFO:oejobis.DefaultJettyAtJettyHomeHelper:Start Level Event Dispatcher: Configuring jetty from bundle: org.eclipse.jetty.osgi.boot with /jettyhome/etc/jetty-selector.xml
2013-12-10 12:03:24.517:INFO:oejobis.DefaultJettyAtJettyHomeHelper:Start Level Event Dispatcher: Configuring jetty from bundle: org.eclipse.jetty.osgi.boot with /jettyhome/etc/jetty-deployer.xml
2013-12-10 12:03:24.518:INFO:oejobis.DefaultJettyAtJettyHomeHelper:Start Level Event Dispatcher: Configuring the default jetty server with [file:/C:/Users/ADMIN/Workspace/org.eclipse.jetty.osgi.boot/jettyhome/etc/jetty.xml, file:/C:/Users/ADMIN/Workspace/org.eclipse.jetty.osgi.boot/jettyhome/etc/jetty-selector.xml, file:/C:/Users/ADMIN/Workspace/org.eclipse.jetty.osgi.boot/jettyhome/etc/jetty-deployer.xml]
2013-12-10 12:03:24.518:INFO:oejobis.DefaultJettyAtJettyHomeHelper:Start Level Event Dispatcher: JETTY.HOME=file:/C:/Users/ADMIN/Workspace/org.eclipse.jetty.osgi.boot/jettyhome/
osgi> 2013-12-10 12:03:24.724:INFO:oejs.Server:Start Level Event Dispatcher: jetty-9.1.0.v20131115
2013-12-10 12:03:24.735:WARN:oejsh.RequestLogHandler:Start Level Event Dispatcher: !RequestLog
2013-12-10 12:03:24.775:INFO:oejs.ServerConnector:Start Level Event Dispatcher: Started ServerConnector@14f2245d{HTTP/1.1}{}
2013-12-10 12:03:24.775:INFO:oejobis.DefaultJettyAtJettyHomeHelper:Start Level Event Dispatcher: Default jetty server configured
2013-12-10 12:03:24.930:INFO:oejsh.ContextHandler:Start Level Event Dispatcher: Started o.e.j.w.WebAppContext@370ff791{/sample,file:/C:/Users/ADMIN/Workspace/com.neatherweb.automate.webtest/WebContent/,AVAILABLE}{file:/C:/Users/ADMIN/Workspace/com.neatherweb.automate.webtest/WebContent/}
2013-12-10 12:03:54.043:WARN:oejs.ServletHandler:qtp1513392935-42:
org.apache.jasper.JasperException: PWC6349: Cannot find a java compiler for compilation.  If running with JDK 5 or before, Ant or JDT compiler can be used, if the corresponding jars and bridge classes (org.apache.jasper.compiler.AntJavaCompiler or org.apache.jasper.compiler.JDTJavaCompiler) are included
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(
    at org.apache.jasper.compiler.Compiler.initJavaCompiler(
    at org.apache.jasper.compiler.Compiler.<init>(
    at org.apache.jasper.JspCompilationContext.createCompiler(
    at org.apache.jasper.JspCompilationContext.compile(
    at org.apache.jasper.servlet.JspServletWrapper.service(
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(
    at org.apache.jasper.servlet.JspServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at org.eclipse.jetty.servlet.ServletHolder.handle(
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
    at org.eclipse.jetty.servlet.ServletHandler.doScope(
    at org.eclipse.jetty.server.session.SessionHandler.doScope(
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
    at org.eclipse.jetty.server.Server.handle(
    at org.eclipse.jetty.server.HttpChannel.handle(
    at org.eclipse.jetty.server.HttpConnection.onFillable(
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
    at org.eclipse.jetty.util.thread.QueuedThreadPool$

osgi> ss
"Framework is launched."

id    State       Bundle
0    ACTIVE      org.eclipse.osgi_3.9.1.v20130814-1242
17    ACTIVE      com.neatherweb.logging_1.0.0
19    ACTIVE      com.neatherweb.automate.jcbus.cgate.impl_1.0.0.qualifier
20    ACTIVE      com.neatherweb.automate.configmgr.impl_1.0.0.qualifier
22    ACTIVE      com.neatherweb.automate.configmgr_1.0.0.qualifier
23    ACTIVE      com.neatherweb.automate.jcbus.cgate_1.0.0.qualifier
24    ACTIVE      org.apache.felix.gogo.shell_0.10.0.v201212101605
25    ACTIVE      com.neatherweb.automate.core_1.0.0.qualifier
26    ACTIVE      org.apache.felix.gogo.runtime_0.10.0.v201209301036
28    ACTIVE      com.neatherweb.automate.A4623_1.0.0.qualifier
30    ACTIVE      com.neatherweb.automate.A4623.impl_1.0.0.qualifier
34    ACTIVE      org.apache.felix.gogo.command_0.10.0.v201209301215
160    ACTIVE      org.eclipse.osgi.services_3.3.100.v20130513-1956
161    ACTIVE      org.eclipse.osgi.util_3.2.300.v20130513-1956
162    ACTIVE      org.eclipse.equinox.console_1.0.100.v20130429-0953
184    ACTIVE      com.neatherweb.automate.webtest_1.0.0.qualifier
262    ACTIVE      javax.servlet.jsp-api_2.3.1
263    ACTIVE      org.eclipse.jetty.servlet_9.1.0.v20131115
264    ACTIVE      org.eclipse.jetty.webapp_9.1.0.v20131115
265    ACTIVE      javax.servlet-api_3.1.0
266    ACTIVE      org.apache.taglibs.standard.glassfish_1.2.0.v201112081803
267    ACTIVE      org.eclipse.jetty.http_9.1.0.v20131115
268    ACTIVE      org.glassfish.web.javax.servlet.jsp_2.3.2
269    ACTIVE      org.eclipse.jdt.core.compiler.batch_3.8.2.v20130121-145325
270    ACTIVE      org.eclipse.jetty.deploy_9.1.0.v20131115
272    ACTIVE      org.eclipse.jetty.io_9.1.0.v20131115
273    ACTIVE      org.eclipse.jetty.security_9.1.0.v20131115
274    ACTIVE      com.sun.el.javax.el_3.0.0
275    ACTIVE      org.eclipse.jetty.util_9.1.0.v20131115
276    ACTIVE      org.eclipse.jetty.xml_9.1.0.v20131115
278    ACTIVE      javax.servlet.jsp.jstl_1.2.0.v201105211821
279    ACTIVE      org.eclipse.jetty.server_9.1.0.v20131115
280    ACTIVE      javax.servlet_3.0.0.v201112011016
281    ACTIVE      javax.servlet.jsp_2.2.0.v201112011158
284    ACTIVE      org.eclipse.jetty.osgi.boot_9.1.0.v20131115
285    RESOLVED    org.eclipse.jetty.osgi.boot.jsp_9.1.0.v20131115

jetty-users mailing list

Jan Bartel <janb@xxxxxxxxxxx>
'Expert Jetty/CometD developer,production,operations advice'

_______________________________________________ jetty-users mailing list jetty-users@xxxxxxxxxxx

jetty-users mailing list

_______________________________________________ jetty-users mailing list jetty-users@xxxxxxxxxxx

jetty-users mailing list

Jan Bartel <janb@xxxxxxxxxxx>
'Expert Jetty/CometD developer,production,operations advice'

Jan Bartel <janb@xxxxxxxxxxx>
'Expert Jetty/CometD developer,production,operations advice'

Back to the top