You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Jeffrey Huang <mi...@gmail.com> on 2012/05/31 10:01:11 UTC

JSP support on Felix

I tried a lot of ways to let Felix support JSP. Pax Web seems still can not
work on my try. Does any one know any way to let Felix support JSP? Which
bundles should be installed ?  Thanks.

Re: JSP support on Felix

Posted by Caspar MacRae <ea...@gmail.com>.
Hi Jeffrey,

If you launch a Karaf instance and type "features:install war" then look at
the list of installed bundles it will show you what's necessary for getting
pax-web running with JSP support.

Alternatively the stuff below works for me (recently) in getting Jetty
running on Felix.

Jetty didn't work out-of-the-box with Felix when using mvn: url handler - I
submitted a patch to jetty which fixes this
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372656 (not yet merged).

Pick out the two classes from the attachment on that bug ticket and add
them to a fragment bundle (see references to "org.eclipse.jetty.osgi.boot"
in http://wiki.eclipse.org/Jetty/Feature/Jetty_OSGi), also in this fragment
bundle you also specify a property that tells Jetty where to find the
jetty.xml

As for a list of all the bundles needed, just copy out the mvn: bundle urls
from the features file below (sorry it's quite long).  Note we're not using
the expression language so you'll need to add a bundle for javax.el if you
intend to use that.


Felix devs - please note; the patch was accepted largely because it relies
on the behaviour documented here
http://felix.apache.org/site/apache-felix-framework-bundle-cache.html


HTH,
cheers,
Caspar


<?xml version="1.0" encoding="UTF-8"?>
<features name="mim-jetty" xmlns="
http://karaf.apache.org/xmlns/features/v1.0.0">


    <feature name="jetty-all" version="8.1.1.v20120215">
        <feature version="8.1.1.v20120215">jetty-spec-dependencies</feature>
        <feature version="8.1.1.v20120215">jetty-web-dependencies</feature>
        <feature version="8.1.1.v20120215">jetty-core</feature>
            <feature version="8.1.1.v20120215">jetty-osgi</feature>
            <feature version="2.4.0">cometd</feature>
    </feature>


    <feature name="felix-webconsole" version="3.1.8">
        <!-- webconsole needs OSGi's HttpService -->
        <bundle
start-level="70">mvn:org.eclipse.equinox.http/servlet/1.0.0-v20070606</bundle>
        <bundle
start-level="70">mvn:org.eclipse.jetty.osgi/jetty-httpservice/8.1.1.v20120215</bundle>
        <bundle
start-level="75">mvn:org.apache.felix/org.apache.felix.webconsole/3.1.8</bundle>
    </feature>

    <feature name="jetty-core" version="8.1.1.v20120215">
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-annotations/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-util/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-io/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-http/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-client/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-continuation/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-jmx/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-server/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-security/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-servlet/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-servlets/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-xml/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-webapp/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-jndi/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-plus/8.1.1.v20120215</bundle>
        <bundle
start-level="65">mvn:org.eclipse.jetty/jetty-websocket/8.1.1.v20120215</bundle>

    </feature>


    <feature name="jetty-osgi" version="8.1.1.v20120215">
        <bundle
start-level="70">mvn:org.eclipse.jetty/jetty-deploy/8.1.1.v20120215</bundle>
        <bundle start-level="75">mvn: YOUR JETTY OSGI BOOT BUNDLE GOES HERE
</bundle>
        <bundle
start-level="75">mvn:org.eclipse.jetty.osgi/jetty-osgi-boot-jsp/8.1.1.v20120215</bundle>
        <bundle
start-level="85">mvn:org.eclipse.jetty.osgi/jetty-osgi-boot/8.1.1.v20120215</bundle>
    </feature>



    <feature name="jetty-spec-dependencies" version="8.1.1.v20120215">
        <bundle start-level="60"
dependency="true">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.apache.geronimo.specs/geronimo-atinject_1.0_spec/1.0</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.1</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.1.2</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.apache.geronimo.specs/geronimo-servlet_3.0_spec/1.0</bundle>
        <bundle start-level="60"
dependency="true">mvn:javax.mail/mail/1.4.4</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.eclipse.jetty.orbit/javax.annotation/1.1.0.v201108011116</bundle>
        <bundle start-level="60"
dependency="true">mvn:javax.servlet.jsp/javax.servlet.jsp/2.0.0</bundle>

    </feature>

    <feature name="jetty-web-dependencies" version="8.1.1.v20120215">
        <bundle start-level="60"
dependency="true">wrap:mvn:org.eclipse.jetty.orbit/org.eclipse.jdt.core/3.7.1</bundle>
        <bundle start-level="60"
dependency="true">mvn:javax.el/javax.el/2.2.0.v201105051105</bundle>
            <bundle start-level="60"
dependency="true">mvn:org.apache.commons/org.apache.commons.el/1.0.0.v200706111724</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.eclipse.jetty.orbit/javax.servlet.jsp.jstl/1.2.0.v201105211821</bundle>
            <bundle start-level="60"
dependency="true">mvn:org.eclipse.jetty.orbit/org.apache.taglibs.standard.glassfish/1.2.0.v201112081803</bundle>
            <bundle start-level="60"
dependency="true">mvn:org.eclipse.equinox/org.eclipse.equinox.jsp.jasper/1.0.201</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.eclipse.jetty.orbit/javax.servlet/3.0.0.v201112011016</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.eclipse.jetty.orbit/javax.servlet.jsp/2.2.0.v201112011158</bundle>
        <bundle start-level="60"
dependency="true">mvn:org.eclipse.jetty.orbit/org.apache.jasper.glassfish/2.2.2.v201112011158</bundle>
    </feature>

    <feature name="cometd" version="2.4.0">
        <feature version="8.1.1.v20120215">jetty-core</feature>
        <bundle
start-level="70">mvn:org.apache.geronimo.specs/geronimo-atinject_1.0_spec/1.0</bundle>
        <bundle
start-level="70">mvn:org.cometd.java/bayeux-api/2.4.0</bundle>
        <bundle
start-level="70">mvn:org.cometd.java/cometd-java-common/2.4.0</bundle>
        <bundle
start-level="70">mvn:org.cometd.java/cometd-websocket-jetty/2.4.0</bundle>
         <bundle
start-level="70">mvn:org.cometd.java/cometd-java-client/2.4.0</bundle>
        <bundle
start-level="70">mvn:org.cometd.java/cometd-java-annotations/2.4.0</bundle>
        <bundle
start-level="70">mvn:org.cometd.java/cometd-java-oort/2.4.0</bundle>
        <bundle
start-level="70">mvn:org.cometd.java/cometd-java-server/2.4.0</bundle>
    </feature>

</features>










On 31 May 2012 15:08, Marcel Offermans <ma...@luminis.nl> wrote:

> On May 31, 2012, at 10:01 , Jeffrey Huang wrote:
>
> > I tried a lot of ways to let Felix support JSP. Pax Web seems still can
> not
> > work on my try. Does any one know any way to let Felix support JSP? Which
> > bundles should be installed ?  Thanks.
>
> Just to add to the list of already mentioned alternatives, within the
> Amdatu open source project we also have a JSP engine that is built on top
> of the Jetty based implementation available in Apache Felix. It is part of
> a stack of components, which you can read about on the Amdatu Web [1] page.
> If you have specific questions, it's probably best to point those to the
> user list there [2]. Before anybody asks, Amdatu is also Apache licensed. :)
>
> Greetings, Marcel
>
> [1] http://www.amdatu.org/confluence/display/Amdatu/Amdatu+Web
> [2] http://www.amdatu.org/confluence/display/Amdatu/Mailing+lists
>
>

Re: JSP support on Felix

Posted by Marcel Offermans <ma...@luminis.nl>.
On May 31, 2012, at 10:01 , Jeffrey Huang wrote:

> I tried a lot of ways to let Felix support JSP. Pax Web seems still can not
> work on my try. Does any one know any way to let Felix support JSP? Which
> bundles should be installed ?  Thanks.

Just to add to the list of already mentioned alternatives, within the Amdatu open source project we also have a JSP engine that is built on top of the Jetty based implementation available in Apache Felix. It is part of a stack of components, which you can read about on the Amdatu Web [1] page. If you have specific questions, it's probably best to point those to the user list there [2]. Before anybody asks, Amdatu is also Apache licensed. :)

Greetings, Marcel

[1] http://www.amdatu.org/confluence/display/Amdatu/Amdatu+Web
[2] http://www.amdatu.org/confluence/display/Amdatu/Mailing+lists


Re: JSP support on Felix

Posted by Kirk Knoernschild <pr...@kirkk.com>.
Jeffrey,

I did this quite a while back on some blog posts for demonstration purposes. The code is old, but perhaps it'll serve as a useful starting point. Here's a couple of posts you might find worthwhile (both support JSP):

OSGi and Embedded Jetty - http://techdistrict.kirkk.com/2009/02/02/osgi-and-embedded-jetty/

And an alternative:

Embedding OSGi in Tomcat - http://techdistrict.kirkk.com/2009/02/16/embedding-osgi-in-tomcat/ 

Kirk Knoernschild
Author of "Java Application Architecture: Modularity Patterns with Examples Using OSGi"
http://www.kirkk.com
http://techdistrict.kirkk.com





On May 31, 2012, at May 31, 3:01 AM, Jeffrey Huang wrote:

> I tried a lot of ways to let Felix support JSP. Pax Web seems still can not
> work on my try. Does any one know any way to let Felix support JSP? Which
> bundles should be installed ?  Thanks.


Re: JSP support on Felix

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

let me pick this up :)

yes you need to take the full stack of pax-web. And JSP is suppoted by Pax Web
especially if you use Web Application Bundles
I suggest taking a look at [1].
If you think something is missing feel free to add a feature request at [2]
or just get in contact with the ops4j community.
We are there to help :)

Regards, Achim

[1] - http://team.ops4j.org/wiki/display/paxweb/Pax+Web
[2] - http://team.ops4j.org/browse/PAXWEB

2012/5/31 Felix Meschberger <fm...@adobe.com>:
> Hi,
>
> Am 31.05.2012 um 10:01 schrieb Jeffrey Huang:
>
>> I tried a lot of ways to let Felix support JSP. Pax Web seems still can not
>> work on my try. Does any one know any way to let Felix support JSP? Which
>> bundles should be installed ?  Thanks.
>
> I cannot comment on Pax Web (I don't use it but I expect it to work) -- but you would probably have to use the full Pax Web stack and not mix with the Felix Http Service functionality.
>
> And no, the Felix HTTP Service implementation currently neither supports JSPs nor Web Application Bundles.
>
> Regards
> Felix
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
OPS4J Pax for Vaadin
<http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project
Lead
blog <http://notizblog.nierbeck.de/>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: JSP support on Felix

Posted by Felix Meschberger <fm...@adobe.com>.
Hi,

Am 31.05.2012 um 10:01 schrieb Jeffrey Huang:

> I tried a lot of ways to let Felix support JSP. Pax Web seems still can not
> work on my try. Does any one know any way to let Felix support JSP? Which
> bundles should be installed ?  Thanks.

I cannot comment on Pax Web (I don't use it but I expect it to work) -- but you would probably have to use the full Pax Web stack and not mix with the Felix Http Service functionality.

And no, the Felix HTTP Service implementation currently neither supports JSPs nor Web Application Bundles.

Regards
Felix


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org