Achim,
Setting the property org.osgi.service.http.port worked.  Now Cave is listening 
on one port, 9191.

karaf@repository()> config
karaf@repository(config)> edit org.ops4j.pax.web
karaf@repository(config)> property-set org.osgi.service.http.port 9191
karaf@repository(config)> property-list
   org.osgi.service.http.port = 9191
karaf@repository(config)> update
karaf@repository(config)> exit


Paul Spencer

> On May 1, 2015, at 3:54 PM, Achim Nierbeck <[email protected]> wrote:
> 
> Hi, 
> 
> creating an additional connector via the jetty.xml isn't a bug. 
> The port for pax-web is set in the org.ops4j.pax.web.cfg
> which doesn't necessarily be in a configuration file. 
> You'll find this configuration with the config:* commands. 
> There you'll find the config
> org.osgi.service.http.port=8181
> 
> regards, Achim 
> 
> 2015-05-01 18:53 GMT+02:00 Paul Spencer <[email protected]>:
> JB,
> In my use case etc/jetty.xml was created by feature:install cave-server and 
> org.osgi.service.http.port does not exist in etc/*.
> 
> What is interesting, when the port in etc/jetty.xml is changed to 9191, cave 
> http wrapper responds on port 8181 and 9191.  Bug?
> 
> ***
> * From Karaf.log
> ***
> 2015-05-01 11:28:52,175 | INFO  | FelixStartLevel  | Activator                
>         | 85 - org.ops4j.pax.web.pax-web-runtime - 3.1.4 | EventAdmin support 
> is not available, no servlet events will be posted!
> 2015-05-01 11:28:52,186 | INFO  | FelixStartLevel  | Activator                
>         | 85 - org.ops4j.pax.web.pax-web-runtime - 3.1.4 | LogService support 
> enabled, log events will be created.
> 2015-05-01 11:28:52,195 | INFO  | FelixStartLevel  | Activator                
>         | 85 - org.ops4j.pax.web.pax-web-runtime - 3.1.4 | Pax Web started
> 2015-05-01 11:28:52,495 | INFO  | pool-6-thread-1  | Server                   
>         | 77 - org.eclipse.jetty.aggregate.jetty-all-server - 
> 8.1.15.v20140411 | jetty-8.1.15.v20140411
> 2015-05-01 11:28:52,659 | INFO  | pool-6-thread-1  | AbstractConnector        
>         | 77 - org.eclipse.jetty.aggregate.jetty-all-server - 
> 8.1.15.v20140411 | Started [email protected]:9191
> 2015-05-01 11:28:52,660 | INFO  | pool-6-thread-1  | JettyServerImpl          
>         | 86 - org.ops4j.pax.web.pax-web-jetty - 3.1.4 | Pax Web available at 
> [0.0.0.0]:[9191]
> 2015-05-01 11:28:52,661 | INFO  | pool-6-thread-1  | JettyServerImpl          
>         | 86 - org.ops4j.pax.web.pax-web-jetty - 3.1.4 | Pax Web available at 
> [0.0.0.0]:[8181]
> 2015-05-01 11:28:52,668 | INFO  | pool-6-thread-1  | AbstractConnector        
>         | 77 - org.eclipse.jetty.aggregate.jetty-all-server - 
> 8.1.15.v20140411 | Started [email protected]:8181
> 2015-05-01 11:28:53,446 | INFO  | FelixStartLevel  | HttpServiceFactoryImpl   
>         | 85 - org.ops4j.pax.web.pax-web-runtime - 3.1.4 | Binding bundle: 
> [org.apache.karaf.cave.server.http [111]] to http service
> 
> ***
> * Grep for port number in etc/*
> ***
> [etc]$ grep 8181 *
> [etc]$ grep 9191 *
> jetty.xml:                    <Property name="jetty.port" default="9191" />
> [etc]$
> 
> 
> ***
> * Steps to recreate
> ***
> Steps to I used to install a cave instance and "app_patching" repostory in 
> Karaf 3.0.3.
> - Connect to the root instance of Karaf
> bin/client -u karaf
> 
> - Create and start an instance called repository while connected to the root 
> instance.
> instance:create --location ${user.home}/cave-repository --ssh-port 8106 
> repository
> instance:start repository
> 
> - Connect to the repository instance and install cave then create a 
> repository.
> instance:connect -u karaf -p karaf repository
> feature:repo-add 
> mvn:org.apache.karaf.cave/apache-karaf-cave/3.0.0/xml/features
> feature:install cave-server
> cave:repository-create app_patching
> cave:repositories
> 
> At this point you can shutdown the repository instance and update the port in 
> ${user.home}/cave-repository/etc/jetty.xml
> 
> Paul Spencer
> 
> 
> 
> > On May 1, 2015, at 12:09 PM, Jean-Baptiste Onofré <[email protected]> wrote:
> >
> > Hi Paul,
> >
> > both are possible: it depends of the org.ops4j.pax.web.cfg file.
> >
> > The org.osgi.service.http.port contains the port.
> >
> > For instance, containing 8888.
> >
> > In the jetty.xml, you have something like:
> >
> >              <Set name="port">
> >                  <Property name="jetty.port" default="8181"/>
> >              </Set>
> >
> > In that case, the 8181 port number is not used, instead it's the 8888 (as 
> > defined in the property).
> >
> > Anyway, Cave server itself doesn't provision etc/jetty.xml (just a CXF 
> > config file).
> >
> > Can you check that this jetty.xml doesn't come from another feature (or 
> > your provisioning) ?
> >
> > Thanks,
> > Regards
> > JB
> >
> > On 04/30/2015 11:35 PM, Paul Spencer wrote:
> >> I noticed the TCP port opened by the Cave HTTP server is defined in 
> >> /etc/jetty.xml instead of a configured property.
> >>
> >> Is this:
> >>  1 - Bug, because it should be configurable property
> >>  2 - Bug, because it should us the pax-web port ( pid = org.ops4j.pax.web 
> >> property = org.osgi.service.http.port)
> >>  3 - Documentation bug
> >>  4 - Enhancement with the expected behavior of ___ (1 or 2)
> >>
> >> Paul Spencer
> >>
> >>
> >
> > --
> > Jean-Baptiste Onofré
> > [email protected]
> > http://blog.nanthrax.net
> > Talend - http://www.talend.com
> 
> 
> 
> 
> -- 
> 
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & 
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
> 
> Software Architect / Project Manager / Scrum Master 
> 

Reply via email to