Re: Issue with org.eclipse.jetty.server (9.4.46.v20220331) and Pax Web (8.0.6) in KARAF 4.4.1

2022-11-07 Thread Grzegorz Grzybek
Hello

I found a solution - Pax Web tries to validate whether
etc/org.ops4j.pax.web.cfg matches the runtime-specific configuration

In PID config you have:

org.osgi.service.http.secure.enabled = true
org.osgi.service.http.port.secure = 8443
org.ops4j.pax.web.listening.addresses=127.0.0.1

So Pax Web tries to find a connector in etc/jetty.xml which has 127.0.0.1
as bind address.

However your  is not bound to
127.0.0.1, but to 0.0.0.0.

To fix this, change:



To:



Worked for me ;)

regards
Grzegorz Grzybek

pon., 7 lis 2022 o 14:35 Vamsikrishna Koka
 napisał(a):

> Hi Grzegorz,
>
> Thank you so much for looking into this.
>
> Here is entire information for etc/org.ops4j.pax.web.cfg, etc/jetty.xml
> and logs.
>
>
>
> Entire org.ops4j.pax.web.cfg File :
>
> org.osgi.service.http.port=8181
>
> org.osgi.service.http.secure.enabled=true
>
> org.osgi.service.http.port.secure=8443
>
> org.ops4j.pax.web.listening.addresses=127.0.0.1
>
> org.ops4j.pax.web.config.file = ${karaf.home}/etc/jetty.xml
>
> org.ops4j.pax.web.session.timeout=30
>
>
>
> Entire Jetty.xml File :
>
> 
>
>  http://jetty.mortbay.org/configure.dtd>
>
> 
>
>
>
> 
>
> 
>
> 
>
> 
>
>  class="org.eclipse.jetty.util.thread.QueuedThreadPool">
>
> 300
>
> 
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> karaf
>
> karaf
>
> 
>
> 
>
>
> org.apache.karaf.jaas.boot.principal.RolePrincipal
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> default
>
> karaf
>
> 
>
> 
>
>
> org.apache.karaf.jaas.boot.principal.RolePrincipal
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> adminGod
>
> adminGod
>
> 
>
> 
>
>
> org.apache.karaf.jaas.boot.principal.RolePrincipal
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> admincert
>
> admincert
>
>  name="roleClassNames">
>
> 
>
>
> org.apache.karaf.jaas.boot.principal.RolePrincipal
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> adminGodproperties
>
> adminGodproperties
>
> 
>
> 
>
>
> org.apache.karaf.jaas.boot.principal.RolePrincipal
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> admin-db
>
> admin-db
>
> 
>
> 
>
>
> org.apache.karaf.jaas.boot.principal.RolePrincipal
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
> 
>
> 
>
>
>
>  class="org.eclipse.jetty.util.ssl.SslContextFactory$Server">
>
>  name="jetty.home"/>/etc/keystores/keystores.pfx
>
>  name="jetty.home"/>/etc/keystores/keystores.pfx
>
>
>
> remove sensitive data
>
> remove sensitive data
>
> remove sensitive data
>
> PKCS12
>
> PKCS12
>
> false
>
> adminGodkey
>
>
>
> 
>
> 
>
> TLSv1.1
>
> TLSv1
>
> SSL
>
> SSLv2
>
> SSLv2Hello
>
> SSLv3
>
>
>
> 
>
> 
>
> 
>
>   remove sensitive data
>
> 
>
> 
>
> 
>
>
>
>  class="org.eclipse.jetty.server.HttpConfiguration">
>
> https
>
>  default="8443" />
>
> 32768
>
> 8192
>
> 8192
>
> false
>
> false
>
> 512
>
> 
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>  class="org.eclipse.jetty.server.HttpConfiguration">
>
> 
>
> 
>
> 
>
>  class="org.eclipse.jetty.server.SecureRequestCustomizer">
>
>  name="jetty.ssl.sniHostCheck" default="true"/>
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
> 
>
>  

RE: Issue with org.eclipse.jetty.server (9.4.46.v20220331) and Pax Web (8.0.6) in KARAF 4.4.1

2022-11-07 Thread Vamsikrishna Koka
Hi Grzegorz,

Thank you so much for looking into this.

Here is entire information for etc/org.ops4j.pax.web.cfg, etc/jetty.xml and 
logs.

Entire org.ops4j.pax.web.cfg File :
org.osgi.service.http.port=8181
org.osgi.service.http.secure.enabled=true
org.osgi.service.http.port.secure=8443
org.ops4j.pax.web.listening.addresses=127.0.0.1
org.ops4j.pax.web.config.file = ${karaf.home}/etc/jetty.xml
org.ops4j.pax.web.session.timeout=30

Entire Jetty.xml File :

http://jetty.mortbay.org/configure.dtd>







300












karaf
karaf


org.apache.karaf.jaas.boot.principal.RolePrincipal









default
karaf


org.apache.karaf.jaas.boot.principal.RolePrincipal









adminGod
adminGod


org.apache.karaf.jaas.boot.principal.RolePrincipal









admincert
admincert


org.apache.karaf.jaas.boot.principal.RolePrincipal









adminGodproperties
adminGodproperties


org.apache.karaf.jaas.boot.principal.RolePrincipal









admin-db
admin-db


org.apache.karaf.jaas.boot.principal.RolePrincipal












/etc/keystores/keystores.pfx
/etc/keystores/keystores.pfx

remove sensitive data
remove sensitive data
remove sensitive data
PKCS12
PKCS12
false
adminGodkey



TLSv1.1
TLSv1
SSL
SSLv2
SSLv2Hello
SSLv3
   



  remove sensitive data





https

32768
8192
8192
false
false
512







































127.0.0.1:8443












http/1.1















Logs :  My apologies, For me difficulty to share entire logs on public portal.
18:56:37.664 [paxweb-config-1-thread-1 (change controller)] INFO  
org.eclipse.jetty.server.AbstractConnector - Started 
127.0.0.1:8443@763bf1c8{SSL, (ssl, http/1.1)}{0.0.0.0:8443}
18:56:37.729 [paxweb-config-1-thread-1 (change controller)] INFO  
org.eclipse.jetty.server.AbstractConnector - Started 
default@ef05682{HTTP/1.1, 
(http/1.1)}{127.0.0.1:8181}
18:56:37.750 [paxweb-config-1-thread-1 (change controller)] ERROR 
org.ops4j.pax.web.service.internal.Activator - Unable to start Pax Web server: 
Failed to bind to /127.0.0.1:8443
java.io.IOException: Failed to bind to /127.0.0.1:8443
at 
org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349)
 ~[?:?]
at 
org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310) ~[?:?]
at 
org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
 ~[?:?]
at 

Re: Issue with org.eclipse.jetty.server (9.4.46.v20220331) and Pax Web (8.0.6) in KARAF 4.4.1

2022-11-07 Thread Grzegorz Grzybek
Hello

Please show me your entire:

   - etc/org.ops4j.pax.web.cfg
   - etc/jetty.xml
   - logs

I've just checked with Karaf 4.4.1 and this SSL configuration works fine:

org.osgi.service.http.secure.enabled = true
org.osgi.service.http.port.secure = 8443
org.ops4j.pax.web.ssl.truststore = ${karaf.etc}/server.keystore
org.ops4j.pax.web.ssl.truststore.password = xxx
org.ops4j.pax.web.ssl.truststore.type = JKS
org.ops4j.pax.web.ssl.keystore = ${karaf.etc}/server.keystore
org.ops4j.pax.web.ssl.keystore.password = xxx
org.ops4j.pax.web.ssl.keystore.type = JKS
org.ops4j.pax.web.ssl.key.password = xxx
org.ops4j.pax.web.ssl.key.alias = server

if you want SSL, you seem to be missing keystore configuration.

regards
Grzegorz Grzybek

pon., 7 lis 2022 o 11:31 Vamsikrishna Koka
 napisał(a):

> Hi Team,
>
> I have migrated KARAF (from 4.2.15 to 4.4.1) and JDK (Open JDK 8 to
> OpenJDK 11) along with required dependency also. As per KARAF release NOTE.
>
> There is issue with jetty xml configuration and org.ops4j.pax.web.cfg.
>
>
>
> *Jetty.xml file*
>
>
> 
>
> 
>
>  class="org.eclipse.jetty.server.ServerConnector">
>
> 
>
>  name="jetty.ssl.acceptors" deprecated="ssl.acceptors" default="-1"/>
>
>  name="jetty.ssl.selectors" deprecated="ssl.selectors" default="-1"/>
>
> 
>
>  type="org.eclipse.jetty.server.ConnectionFactory">
>
> 
>
> 
>
> 
>
>  deprecated="jetty.host" />
>
>  deprecated="ssl.port" default="8443"/>
>
> 127.0.0.1:8443
>
>  name="jetty.ssl.idleTimeout" deprecated="ssl.timeout"
> default="3"/>
>
>  name="jetty.ssl.soLingerTime" deprecated="ssl.soLingerTime"
> default="-1"/>
>
>  name="jetty.ssl.acceptorPriorityDelta"
> deprecated="ssl.acceptorPriorityDelta" default="0"/>
>
>  name="jetty.ssl.acceptQueueSize" deprecated="ssl.acceptQueueSize"
> default="0"/>
>
> 
>
> 
>
> 
>
>
>
>
>
> *org.ops4j.pax.web.cfg*
>
>
>
> org.osgi.service.http.port=8181
>
> org.osgi.service.http.secure.enabled=true
>
> org.osgi.service.http.port.secure=8443
>
> org.ops4j.pax.web.listening.addresses=127.0.0.1
>
> org.ops4j.pax.web.config.file = ${karaf.home}/etc/jetty.xml
>
> org.ops4j.pax.web.session.timeout=30
>
>
>
>
>
> The above configuration *perfectly working* on KARAF 4.2.15 version both
> jetty *9.4.43* and pax web *7.2.29. *So, I have migrated jetty and Pax
> web dependency part of the KARAF upgrade 4.4.1 version.
>
>
>
> Tried to start KARAF 4.4.1 server on console logs, I have seen  *More
> than one HttpConfiguration found in external Jetty configuration. Using
> HttpConfiguration and Failed to bind to /127.0.0.1:8443
> . *Understand some where latest PAX Web also
> started container with port 8443*. *If I change port my login page does
> not able to land on browser.
>
>
>
> *Difference b/w Pax-Web 7.2.29 and 8.0.6 version.*
>
> *Pax-Web 7.2.29*
>
>
>
> OPS4J Pax Web - APIorg.ops4j.pax.web.pax-web-api
>
>7.2.29  Active
>
> OPS4J Pax Web - Deployment Descriptor
> Modelorg.ops4j.pax.web.pax-web-descriptor 7.2.29
>  Active
>
> OPS4J Pax Web - Extender -
> WARorg.ops4j.pax.web.pax-web-extender-war
>   7.2.29  Active
>
> OPS4J Pax Web - Extender -
> Whiteboardorg.ops4j.pax.web.pax-web-extender-whiteboard  7.2.29
> Active
>
> OPS4J Pax Web - FileInstall
> Deployerorg.ops4j.pax.web.pax-web-deployer
> 7.2.29  Active
>
> OPS4J Pax Web - Jettyorg.ops4j.pax.web.pax-web-jetty
>
> 7.2.29  Active
>
> OPS4J Pax Web - Jsp Supportorg.ops4j.pax.web.pax-web-jsp
> 7.2.29   Active
>
> OPS4J Pax Web - Runtimeorg.ops4j.pax.web.pax-web-runtime
> 7.2.29   Active
>
> OPS4J Pax Web - Service SPIorg.ops4j.pax.web.pax-web-spi
> 7.2.29   Active
>
>
>
>
>
> *karaf@root()> list -s -t 0 | grep "org.ops4j.pax.web"*
>
>
>
> 252 | Active   |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-api
>
> 253 | Resolved |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-compatibility-el2
>
> 254 | Resolved |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-compatibility-servlet31
>
> 255 | Active   |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-extender-war
>
> 256 | Active   |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-jetty
>
> 257 | Active   |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-jsp
>
> 258 | Active   |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-runtime
>
> 259 | Active   |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-spi
>
> 260 | Active   |  30 | 8.0.6 |
> org.ops4j.pax.web.pax-web-tomcat-common
>
> 261 | Active   |  30 | 8.0.6 

Issue with org.eclipse.jetty.server (9.4.46.v20220331) and Pax Web (8.0.6) in KARAF 4.4.1

2022-11-07 Thread Vamsikrishna Koka
Hi Team,

I have migrated KARAF (from 4.2.15 to 4.4.1) and JDK (Open JDK 8 to OpenJDK 11) 
along with required dependency also. As per KARAF release NOTE.

There is issue with jetty xml configuration and org.ops4j.pax.web.cfg.

Jetty.xml file














127.0.0.1:8443









org.ops4j.pax.web.cfg

org.osgi.service.http.port=8181
org.osgi.service.http.secure.enabled=true
org.osgi.service.http.port.secure=8443
org.ops4j.pax.web.listening.addresses=127.0.0.1
org.ops4j.pax.web.config.file = ${karaf.home}/etc/jetty.xml
org.ops4j.pax.web.session.timeout=30


The above configuration perfectly working on KARAF 4.2.15 version both jetty 
9.4.43 and pax web 7.2.29. So, I have migrated jetty and Pax web dependency 
part of the KARAF upgrade 4.4.1 version.

Tried to start KARAF 4.4.1 server on console logs, I have seen  More than one 
HttpConfiguration found in external Jetty configuration. Using 
HttpConfiguration and Failed to bind to /127.0.0.1:8443. Understand some where 
latest PAX Web also started container with port 8443. If I change port my login 
page does not able to land on browser.

Difference b/w Pax-Web 7.2.29 and 8.0.6 version.

Pax-Web 7.2.29

OPS4J Pax Web - APIorg.ops4j.pax.web.pax-web-api
   7.2.29  Active
OPS4J Pax Web - Deployment Descriptor Modelorg.ops4j.pax.web.pax-web-descriptor 
7.2.29  Active
OPS4J Pax Web - Extender - WARorg.ops4j.pax.web.pax-web-extender-war
 7.2.29  Active
OPS4J Pax Web - Extender - 
Whiteboardorg.ops4j.pax.web.pax-web-extender-whiteboard  7.2.29  Active
OPS4J Pax Web - FileInstall Deployerorg.ops4j.pax.web.pax-web-deployer  
  7.2.29  Active
OPS4J Pax Web - Jettyorg.ops4j.pax.web.pax-web-jetty
7.2.29  Active
OPS4J Pax Web - Jsp Supportorg.ops4j.pax.web.pax-web-jsp7.2.29  
 Active
OPS4J Pax Web - Runtimeorg.ops4j.pax.web.pax-web-runtime   7.2.29   
Active
OPS4J Pax Web - Service SPIorg.ops4j.pax.web.pax-web-spi 7.2.29 
  Active


karaf@root()> list -s -t 0 | grep "org.ops4j.pax.web"

252 | Active   |  30 | 8.0.6 | org.ops4j.pax.web.pax-web-api
253 | Resolved |  30 | 8.0.6 | 
org.ops4j.pax.web.pax-web-compatibility-el2
254 | Resolved |  30 | 8.0.6 | 
org.ops4j.pax.web.pax-web-compatibility-servlet31
255 | Active   |  30 | 8.0.6 | 
org.ops4j.pax.web.pax-web-extender-war
256 | Active   |  30 | 8.0.6 | org.ops4j.pax.web.pax-web-jetty
257 | Active   |  30 | 8.0.6 | org.ops4j.pax.web.pax-web-jsp
258 | Active   |  30 | 8.0.6 | org.ops4j.pax.web.pax-web-runtime
259 | Active   |  30 | 8.0.6 | org.ops4j.pax.web.pax-web-spi
260 | Active   |  30 | 8.0.6 | 
org.ops4j.pax.web.pax-web-tomcat-common
261 | Active   |  30 | 8.0.6 | 
org.ops4j.pax.web.pax-web-websocket

ERROR :  Tried to restart the above bundle 253 AND 254. I got the an error 
Caused by: org.osgi.framework.BundleException: Fragment bundles can not be 
started.

karaf@root()> start 253
15:52:07.302 [Karaf local console user karaf] ERROR 
org.apache.karaf.shell.support.ShellUtil - Exception caught while executing 
command
org.apache.karaf.shell.support.MultiException: Error executing command on 
bundles:
Error starting bundle 253: Fragment bundles can not be started.
at 
org.apache.karaf.shell.support.MultiException.throwIf(MultiException.java:61) 
~[?:?]
at 
org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:70)
 ~[?:?]
at 
org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:55) 
~[?:?]
at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
 ~[?:?]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
 ~[?:?]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
 ~[?:?]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) 
~[?:?]
at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) ~[?:?]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) 
~[?:?]
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)