[
http://issues.ops4j.org/browse/PAXWEB-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14126#action_14126
]
Caspar MacRae edited comment on PAXWEB-264 at 4/7/11 8:30 PM:
--------------------------------------------------------------
@Achim re: package import - thanks, it'd be nice and I think the limiting to
org.eclipse.jetty.* wouldn't adversely impact performance (and has the upside
of not requiring users to wrap other jetty libs as fragments).
Couple of things i've noticed;
1) the Jetty instance does start listening on the port defined in
${KARAF_HOME}/etc/jetty.xml though the comment states that this is overridden
by pax-web configuration - however the webapps deployed are only available on
the org.osgi.service.http.port.
terminal 1:
cd ${KARAF_HOME}
./bin/karaf
features:install war
terminal 2:
sudo lsof -p <PID_OF_KARAF> | egrep '(8080|8181|http)'
Setting the etc/jetty.xml port to 8181 (Karaf default
org.osgi.service.http.port) and the Karaf/PaxWeb stops listening to 8080
2) There appears to be an issue with using the root context-path, apps deploy
and function but resources such as CSS and images aren't found (I tested this
with simple wars using the maven-jetty-plugin and the resources are found
fine). I've tried defining the root as "/" and also "//"
Should I create 2) as a separate issue?
was (Author: earcam):
@Achim re: package import - thanks, it'd be nice and I think the limiting
to org.eclipse.jetty.* wouldn't adversely impact performance (and has the
upside of not requiring users to wrap other jetty libs as fragments).
Couple of things i've noticed;
1) the Jetty instance does start listening on the port defined in
${KARAF_HOME}/etc/jetty.xml though the comment states that this is overridden
by pax-web configuration - however the webapps deployed are only available on
the org.osgi.service.http.port.
terminal 1:
cd ${KARAF_HOME}
./bin/karaf
features:install war
terminal 2:
sudo lsof -p <PID_OF_KARAF> | egrep '(8080|8181|http)'
Setting the etc/jetty.xml port to 8181 (Karaf default
org.osgi.service.http.port) and the Karaf/PaxWeb stops listening to 8080
2) There appears to be an issue with using the root context-path, apps deploy
and function but resources such as CSS and images aren't found (I tested this
with simple wars using the maven-jetty-plugin and the resources are found
fine). I've tried defining the root as "/" and also "//"
> jetty fragment bundle fails due to lack of package import
> ---------------------------------------------------------
>
> Key: PAXWEB-264
> URL: http://issues.ops4j.org/browse/PAXWEB-264
> Project: Pax Web
> Issue Type: Bug
> Affects Versions: 1.0.1
> Environment: Karaf 2.2.0 (using Felix 3.0.8), Hotspot 64bit 1.6.0_24
> on Ubuntu
> Reporter: Caspar MacRae
>
> In the logs:
> {{6:25:12,470 | ERROR | FelixStartLevel | JettyServerImpl |
> e.jetty.internal.JettyServerImpl 98 | 54 - org.ops4j.pax.web.pax-web-jetty
> - 1.0.1 | java.lang.IllegalArgumentException: Object is not of type class
> org.eclipse.jetty.server.handler.MovedContextHandler}}
> bundle 54 is mvn:org.ops4j.pax.web/pax-web-jetty/1.0.1 to which my fragment
> correctly attaches
> bundle 47 is packages:imports | grep org.eclipse.jetty.server.handler
> Running {{packages:imports | grep org.eclipse.jetty.server.handler}} shows
> that only bundle 47 imports the package for the ContextHandler I'm trying to
> use
> {code:title=jetty.xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
> "http://jetty.mortbay.org/configure.dtd">
> <Configure class="org.eclipse.jetty.server.handler.MovedContextHandler">
> <Set name="ContextPath">/old-context-root</Set>
> <Set name="NewContextURL">/new-context-root</Set>
> <Set name="Permanent">true</Set>
> <Set name="DiscardPathInfo">false</Set>
> <Set name="DiscardQuery">false</Set>
> </Configure>
> {code}
> The jetty.xml is located in the root of the bundle jar
> {code:title=snippet_of_pom.xml}
> ...
> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
>
> <version>${version.plugin.felix.bundle}</version>
> <configuration>
> <instructions>
>
> <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
>
> <Bundle-ContactAddress>${project.organization.url}</Bundle-ContactAddress>
>
> <Bundle-Description>${project.description}</Bundle-Description>
>
> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
>
> <Bundle-Version>${project.version}</Bundle-Version>
>
> <Fragment-Host>org.ops4j.pax.web.pax-web-jetty</Fragment-Host>
>
> <Import-Package>org.eclipse.jetty.server.handler</Import-Package>
> </instructions>
> </configuration>
> </plugin>
> ...
> {code}
> I tried using {{dev:dynamic-import 54}} but this doesn't seem to help, so
> may be I'm wrong in thinking that org.ops4j.pax.web/pax-web-jetty/1.0.1
> should import org.eclipse.jetty.server.handler.
> Another thing, when the above log message is seen none of the contexts are
> available, but requests don't 404 they just spin endlessly until timeout.
> The attachment of the fragment causes a refresh of the attached-to bundle
> AFAIK - I suspect that this is causing the port from etc/jetty.xml to be
> picked up instead of that defined by org.osgi.service.http.port - if I set
> them to be the same the the contexts are accessible and the logged error
> doesn't appear but the MovedContextHandler has no effect.
> I think this issue relates to PAXWEB-186 and apologize if this issue should
> really be created on the Karaf Jira.
> thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general