Coder Social home page Coder Social logo

ops4j / org.ops4j.pax.web Goto Github PK

View Code? Open in Web Editor NEW
141.0 56.0 183.0 33.72 MB

OSGi R7 Http Service, Whiteboard and Web Applications (OSGi CMPN Release chapters 102, 140 and 128) implementation using Jetty 9, Tomcat 9 or Undertow 2.

Home Page: https://ops4j1.jira.com/wiki/display/paxweb/Pax+Web

License: Other

Java 99.93% HTML 0.05% CSS 0.02%

org.ops4j.pax.web's Introduction

OPS4j Pax Web

CircleCI Maven Central License

What is Pax Web

Pax Web extends OSGi Http Service with better servlet support, filters, listeners, error pages and JSPs and some others in order to meet the latest versions of Servlet specs. Pax Web facilitates an easy installation of WAR bundles as well as discovery of web elements published as OSGi services. All of this beside the, standard, programmatic registration as detailed in the HTTP Service specs.

There are 3 equivalent (in terms of functionality) implementations in Pax Web:

  • pax-web-jetty bundle uses Jetty 9.4.x
  • pax-web-tomcat bundle uses Tomcat 9.0.x
  • pax-web-undertow bundle uses Undertow 2.2.x

Documentation

Contributing

In OPS4J, everyone is invited to contribute. We don't require any paperwork or community reputation. All we ask you is to move carefully and to clean up after yourself:

  • Describe your problem or enhancement request before submitting a solution.
  • Submit a GitHub issue before creating a pull request. This is required for the release notes.
  • For discussions, the mailing list is more suitable than GH issues.
  • Any bugfix or new feature must be covered by regression tests.

Building Pax Web

mvn clean install

NB: if you want to avoid test execution: mvn clean install -DskipTests

Releasing Pax Web

mvn -Prelease -Darguments="-Prelease" release:prepare -DautoVersionSubmodules=true

mvn -Prelease -Darguments="-Prelease" -Dgoals=deploy release:perform

Go to oss.sonatype.org and push pax-web to central.

If you want more information about releasing, please take a look on:

https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060688/Releasing

org.ops4j.pax.web's People

Contributors

anierbeck avatar anpieber avatar cmoulliard avatar cschneider avatar damiri-ts avatar dannmartens avatar dependabot[bot] avatar ffang avatar garethcollins avatar gnodet avatar grgrzybek avatar hwellmann avatar janstey avatar jbonofre avatar kalcramer avatar knisterpeter avatar laeubi avatar lostiniceland avatar maurice-betzel avatar mklinger avatar nandanreddy avatar netudima avatar oliverlietz avatar orpiske avatar rgilles avatar sergehuber avatar stsiano avatar tcharl avatar tuomaskiviaho avatar wb459 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

org.ops4j.pax.web's Issues

java.lang.ClassNotFoundException: org.slf4j.Logger when not using Pax Logger [PAXWEB-51]

Alin Dreghiciu created PAXWEB-51

From Guillaume Nodet:

My previous attempt to build the pax-web trunk was about trying to solve this exception:
java.lang.ClassNotFoundException: org.slf4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged (Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.mortbay.log.Slf4jLog.<init>(Slf4jLog.java:51)
at org.mortbay.log.Slf4jLog.getLogger(Slf4jLog.java:138)
at org.mortbay.log.Log.getLogger (Log.java:196)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:475)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerWrapper.doStart (HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:210)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.ops4j.pax.web.service.internal.JettyServerImpl.start (JettyServerImpl.java:54)
at org.ops4j.pax.web.service.internal.ServerControllerImpl$Stopped.start(ServerControllerImpl.java:208)
at org.ops4j.pax.web.service.internal.ServerControllerImpl.start(ServerControllerImpl.java :55)
at org.ops4j.pax.web.service.internal.ServerControllerImpl$Started.configure(ServerControllerImpl.java:166)
at org.ops4j.pax.web.service.internal.ServerControllerImpl.configure(ServerControllerImpl.java :78)
at org.ops4j.pax.web.service.internal.HttpServiceConfigurerImpl.configure(HttpServiceConfigurerImpl.java:38)
at org.ops4j.pax.web.service.ConfigAdminConfigurationSynchronizer$ConfigurationTarget.updated (ConfigAdminConfigurationSynchronizer.java:196)
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:888)
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java :89)

This happens when starting pax-web when pax-logging is already installed.
I'm not sure if the problem is in jetty (I suppose the "at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)" line means that it does not really use the correct classloader, or if pax-web should fix that somehow.


Affects: 0.2.0, 0.2.1
Fixed in: 0.2.2
Votes: 0, Watches: 0

Pax-Web doesn't correctly handle file: URLs for the javax.servlet.context.tempdir property [PAXWEB-52]

Stuart McCulloch created PAXWEB-52

Currently the Pax-Web service treats the javax.servlet.context.tempdir as a plain filename, and passes it straight to the File constructor. However, it appears from the tests that it should also handle file: URLs, as there is a test where a file: URL is passed in. At the moment this creates a local "file:" directory, which is why the test passes, but it should really try to interpret the string as a URI and use that to create the File.


Affects: 0.2.1
Fixed in: 0.2.2
Votes: 0, Watches: 0

ssl parameters not taking effect [PAXWEB-44]

David Leangen created PAXWEB-44

Despite setting the options:

-Dorg.osgi.pax.web.ssl.password=password
-Dorg.osgi.pax.web.ssl.keypassword=password

I am still getting prompted for a password, which implies that these configurations are not taking effect.


Fixed in: 0.2.1
Votes: 0, Watches: 0

Cannot connect to port 8443, even though pax web appears to have started correctly [PAXWEB-45]

David Leangen created PAXWEB-45

As per log message below, pax web appears to have started correctly.

However, I am not able to connect to port 8443 via my browser.

2007-10-02 13:45:19.233::INFO: Logging to STDERR via org.mortbay.log.StdErrLogorg.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : http secure enabled not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : http secure port not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : http secure port not set. fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : ssl keystore not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : ssl keystore not set. fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : ssl password not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : ssl password not set. fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : ssl keystore password not set. Fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : ssl keystore password not set. Fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
jetty.ssl.password :
edited by dleangen: user entry replaces text
jetty.ssl.keypassword : edited by dleangen: user entry replaces text
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.JettyServer : adding connectorSslSocketConnector @ 0.0.0.0:8443
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.JettyServer : adding context
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.JettyServer : added context: org.ops4j.pax.web.service.internal.HttpServiceContext@50988 {/,null}

org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.JettyServer : starting org.ops4j.pax.web.service.internal.JettyServerImpl@b4e29b
2007-10-02 13:45:37.358::INFO: jetty-6.1.3
2007-10-02 13:45:37.424::INFO: Started SocketConnectorWrapper @ 0.0.0.0:8080
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.JettyServer : started org.ops4j.pax.web.service.internal.JettyServerImpl@b4e29b
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.ServerControllerImpl : started server: org.ops4j.pax.web.service.internal.ServerControllerImpl@c39a20. current state: org.ops4j.pax.web.service.internal.ServerControllerImpl$Started@e66f56
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.ServerControllerImpl : configuring server: org.ops4j.pax.web.service.internal.ServerControllerImpl@c39a20 -> org.ops4j.pax.web.service.SimpleHttpServiceConfiguration@1bbd23f
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.ServerControllerImpl : stopping server: org.ops4j.pax.web.service.internal.ServerControllerImpl@c39a20. current state: org.ops4j.pax.web.service.internal.ServerControllerImpl$Started@e66f56
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.JettyServer : stopping org.ops4j.pax.web.service.internal.JettyServerImpl@b4e29b
2007-10-02 13:45:37.793::INFO: Started SslSocketConnector @ 0.0.0.0:8443
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.JettyServer : stopped org.ops4j.pax.web.service.internal.JettyServerImpl@b4e29b
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.ServerControllerImpl : stopped server: org.ops4j.pax.web.service.internal.ServerControllerImpl@c39a20. current state: org.ops4j.pax.web.service.internal.ServerControllerImpl$Stopped@979e8b
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.ServerControllerImpl : starting server: org.ops4j.pax.web.service.internal.ServerControllerImpl@c39a20. current state: org.ops4j.pax.web.service.internal.ServerControllerImpl$Stopped@979e8b
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : http enabled not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : http enabled not set. fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : http port not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.internal.JettyServer : adding connectorSocketConnectorWrapper @ 0.0.0.0:8080
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : http secure enabled not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : http secure port not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : http secure port not set. fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : ssl keystore not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : ssl keystore not set. fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : ssl password not set. fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : ssl password not set. fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SimpleHttpServiceConfiguration : ssl keystore password not set. Fallback to class org.ops4j.pax.web.service.SysPropsHttpServiceConfiguration
org.ops4j.pax.logging.apiorg.ops4j.pax.web.service.SysPropsHttpServiceConfiguration : ssl keystore password not set. Fallback to class org.ops4j.pax.web.service.DefaultHttpServiceConfiguration
jetty.ssl.password : org.ops4j.pax.logging.api


Affects: 0.2.0
Fixed in: 0.2.1
Votes: 0, Watches: 0

Documentation [PAXWEB-1]

Alin Dreghiciu created PAXWEB-1

Write documentation.
There is not to much to write about the functionality since it can be read from the compendium but it should contain:

  • how to install and run (via pax runner)
  • what to include as dependencies in maven
  • how to configure with different configuration options (system properties, configuration admin)
  • what is the priority of configuration options (fist config admin, then fall back to system props)

Fixed in: 0.2.2
Votes: 1, Watches: 1

SocketTimeoutException: Read timed out [PAXWEB-20]

Toni Menzel created PAXWEB-20

Just encountered the following leak in paxweb:
530016 btpool0-2 DEBUG org.mortbay.log - EXCEPTION
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.mortbay.io.ByteArrayBuffer.readFrom(ByteArrayBuffer.java:168)
at org.mortbay.io.bio.StreamEndPoint.fill(StreamEndPoint.java:99)
at org.mortbay.jetty.bio.SocketConnector$Connection.fill(SocketConnector.java:196)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:281)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:202)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
530019 btpool0-2 DEBUG org.mortbay.log - EOF

the exception occures if i just register a static resource (say html file) and (successfully) request it in a browser.
The problem is reproducable. I will have a look at it later today but maybe someone already solved that..:wink:

Toni


Fixed in: 0.2.0
Votes: 0, Watches: 0

support adding HttpSessionListeners and setting session timeouts [PAXWEB-50]

matthew hawthorne created PAXWEB-50

In order to upgrade Jetty, I attempted to use the "org.ops4j.pax.web.pax.web.service" bundle to replace our existing "org.ungoverned.osgi.bundle.http" bundle, which runs with an embedded Jetty4.

In our Jetty4 environment, we were able to use reflection on the SessionContext to get a Jetty ServletHandler, which allowed us to add and remove HttpSessionListners, as well as set the session timeout value.

However, using the Pax Web bundle I was unable to find a clear path to do this. The provided to me in the SessionContext is of type org.ops4j.pax.web.service.internal.HttpServiceContext$SContext, which extends org.mortbay.jetty.servlet.Context$SContext. The parent class of the latter has the getServletHandler() method, but I can't get it reflectively since I am passed an inner class.

I'm unsure whether there is anything that can be done about this in Pax Web, or if I need to push the Jetty developers to provide better programmatic access to configure things that are typically found in web.xml.

Your feedback and ideas on this would be appreciated.


Affects: 0.2.1
Fixed in: 0.2.2
Votes: 0, Watches: 2

Isolate servlet context per http contexts used in registration [PAXWEB-21]

Alin Dreghiciu created PAXWEB-21

This task is a presumption based on specs requirement: 102.11.3.3: the servlets registered with the same http context must share the same servlet context. The presumption is that the shared servlet context is only shared by those servlets that share the same http context.
This implies that the attributes stored in servlet context are isolated per http context.


Affects: 0.2.0, 0.2.1
Fixed in: 0.2.2
Votes: 0, Watches: 0


Referenced issues

aggregation of:

  • #367 - OSGi TCK test failure: Verification of ServletContext sharing [PAXWEB-55]

Disable prompt when ssl password not set [PAXWEB-43]

David Leangen created PAXWEB-43

If https is enabled (by setting org.osgi.service.http.secure.enabled to "true"), and if no password is set in either org.ops4j.pax.web.ssl.password or org.ops4j.pax.web.ssl.keypassword, then the bundle halts and waits for command-line input from the user.

This halts bundle startup, which completely messes up platform startup.

In this situation, https should be disabled, with an error logged.


Fixed in: 0.2.2
Votes: 0, Watches: 0

Servlets can not be registered again under the same alias after unregistration [PAXWEB-35]

Alin Dreghiciu created PAXWEB-35

It seems like if:

  1. register a servlet
    2. unregister the servlet
    3. register the servlet again with the same alias

the step 3 will crash with an exception pointing out that the alias is already in use, which is not the case.

This could be exemplified by using the pax-samples extender.whiteboard and then stopping the extender.whitboard bundle and starting it again.


Affects: 0.2.0
Fixed in: 0.2.1
Votes: 0, Watches: 0

Honor org.osgi.service.http.port property [PAXWEB-18]

Toni Menzel created PAXWEB-18

it turns out that paxweb always uses port 80 for http which prevents it from working on almost every unix based system.

looks like SysPropsHttpServiceConfiguration is going to be the responsible class.. but not currently.
Instead it asks for the OS-Properties.

as of compendium 102.9 it should look for OSGI-Env. properties.

if its ok I can do it.. ??
everyone?


Fixed in: 0.2.0
Votes: 0, Watches: 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.