You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by John Taylor <jt...@gmail.com> on 2020/11/09 20:35:14 UTC

karaf 4.3.0 - unable to install hawtio-core with pax-http-undertow

Hi All,
I'm testing karaf 4.3.0 on Windows 10, Java 11.
I can't install hawtio-core with pax-http-undertow.

It looks like 
org.ops4j.pax.web.pax-web-undertow imports javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
and also imports
io.undertow.servlet which has a uses of    javax.servlet(version>=4.0.0)(!(version>=5.0.0)))



2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf | ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0 | Exception caught while executing command
org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.

Chain 1:
  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
    import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
     |
    export: osgi.wiring.package: javax.servlet
  javax.servlet-api [javax.servlet-api/3.1.0]

Chain 2:
  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
    import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
     |
    export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
    import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
     |
    export: osgi.wiring.package: javax.servlet
  javax.servlet-api [javax.servlet-api/4.0.0]
	at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444) ~[?:?]
	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463) ~[?:?]
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]







karaf@root()> feature:list --installed
Name                | Version      | Required | State   | Repository               | Description
--------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
wrap                | 2.6.2        | x        | Started | standard-4.2.9           | Wrap URL handler
feature             | 4.3.0        | x        | Started | standard-4.3.0           | Features Support
shell               | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Shell
deployer            | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Deployer
bundle              | 4.3.0        | x        | Started | standard-4.3.0           | Provide Bundle support
config              | 4.3.0        | x        | Started | standard-4.3.0           | Provide OSGi ConfigAdmin support
diagnostic          | 4.3.0        | x        | Started | standard-4.3.0           | Provide Diagnostic support
instance            | 4.3.0        | x        | Started | standard-4.3.0           | Provide Instance support
jaas                | 4.3.0        | x        | Started | standard-4.3.0           | Provide JAAS support
log                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide Log support
package             | 4.3.0        | x        | Started | standard-4.3.0           | Package commands and mbeans
service             | 4.3.0        | x        | Started | standard-4.3.0           | Provide Service support
system              | 4.3.0        | x        | Started | standard-4.3.0           | Provide System support
kar                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide KAR (KARaf archive) support
ssh                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide a SSHd server on Karaf
management          | 4.3.0        | x        | Started | standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
eventadmin          | 4.3.0        | x        | Started | standard-4.3.0           | OSGi Event Admin service specification for event-
scr                 | 4.3.0        |          | Started | standard-4.3.0           | Declarative Service support
wrap                | 2.6.2        | x        | Started | standard-4.3.0           | Wrap URL handler
pax-web-core        | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
pax-http            | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
undertow            | 2.0.31.Final |          | Started | org.ops4j.pax.web-7.3.9  |
pax-http-undertow   | 7.3.9        | x        | Started | org.ops4j.pax.web-7.3.9  |
jdbc                | 4.3.0        | x        | Started | enterprise-4.3.0         | JDBC service and commands
pax-jdbc-spec       | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
pax-jdbc            | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
pax-jdbc-config     | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory



-John

Re: Karaf 4.3.6 - still unable to install hawtio-core with pax-http-undertow

Posted by Gerald Kallas <ca...@mailbox.org>.
The deletion of the bundle "Java Servlet APIjavax.servlet-api" 3.1.0 doesn't help either.

> Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 19:32 geschrieben:
> 
>  
> I did add the following lines to the file org.apache.karaf.features.xml
> 
>     <blacklistedBundles>
>         <Bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</Bundle>
>     </blacklistedBundles>
> 
> as suggested before running
> 
> feature:install pax-http-undertow
> feature:install hawtio
> 
> The error remains the same.
> 
> org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> 
> Chain 1:
>   org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>     import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>      |
>     export: osgi.wiring.package: javax.servlet
>   javax.servlet-api [javax.servlet-api/3.1.0]
> 
> Chain 2:
>   org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>     import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>      |
>     export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
>   io.undertow.servlet [io.undertow.servlet/2.0.33.Final]
>     import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>      |
>     export: osgi.wiring.package: javax.servlet
>   javax.servlet-api [javax.servlet-api/4.0.0]
>         at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2467)
>         at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:462)
>         at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>         at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>         at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>         at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>         at java.base/java.lang.Thread.run(Thread.java:829)
> 
> 
> Any suggestions?
> 
> > Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 15:58 geschrieben:
> > 
> >  
> > Hi JB,
> > 
> > I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and got the same error.
> > 
> > Are there any updates when this might be fixed?
> > 
> > Best
> > Gerald
> > 
> > > Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37 geschrieben:
> > > 
> > >  
> > > Hi,
> > > 
> > > That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
> > > 
> > > It upgraded to undertow.
> > > 
> > > Here, you have two javax.servlet version:
> > > - 3.1.0 coming with pax-web-undertow
> > > - 4.0.0 coming with io.undertow.servlet
> > > 
> > > As workaround you can blacklist javax.servlet 3.1.0 coming from pax-web-undertow.
> > > 
> > > Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x version).
> > > 
> > > Regards
> > > JB
> > > 
> > > > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
> > > > 
> > > > Hi All,
> > > > I'm testing karaf 4.3.0 on Windows 10, Java 11.
> > > > I can't install hawtio-core with pax-http-undertow.
> > > > 
> > > > It looks like 
> > > > org.ops4j.pax.web.pax-web-undertow imports javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
> > > > and also imports
> > > > io.undertow.servlet which has a uses of    javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
> > > > 
> > > > 
> > > > 
> > > > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf | ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0 | Exception caught while executing command
> > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> > > > 
> > > > Chain 1:
> > > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > > >    import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
> > > >     |
> > > >    export: osgi.wiring.package: javax.servlet
> > > >  javax.servlet-api [javax.servlet-api/3.1.0]
> > > > 
> > > > Chain 2:
> > > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > > >    import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
> > > >     |
> > > >    export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
> > > >  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
> > > >    import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
> > > >     |
> > > >    export: osgi.wiring.package: javax.servlet
> > > >  javax.servlet-api [javax.servlet-api/4.0.0]
> > > > 	at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444) ~[?:?]
> > > > 	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463) ~[?:?]
> > > > 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
> > > > 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
> > > > 	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
> > > > 	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392) ~[?:?]
> > > > 	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
> > > > 	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
> > > > 	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> > > > 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
> > > > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
> > > > 	at java.lang.Thread.run(Thread.java:834) [?:?]
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > karaf@root()> feature:list --installed
> > > > Name                | Version      | Required | State   | Repository               | Description
> > > > --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
> > > > wrap                | 2.6.2        | x        | Started | standard-4.2.9           | Wrap URL handler
> > > > feature             | 4.3.0        | x        | Started | standard-4.3.0           | Features Support
> > > > shell               | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Shell
> > > > deployer            | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Deployer
> > > > bundle              | 4.3.0        | x        | Started | standard-4.3.0           | Provide Bundle support
> > > > config              | 4.3.0        | x        | Started | standard-4.3.0           | Provide OSGi ConfigAdmin support
> > > > diagnostic          | 4.3.0        | x        | Started | standard-4.3.0           | Provide Diagnostic support
> > > > instance            | 4.3.0        | x        | Started | standard-4.3.0           | Provide Instance support
> > > > jaas                | 4.3.0        | x        | Started | standard-4.3.0           | Provide JAAS support
> > > > log                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide Log support
> > > > package             | 4.3.0        | x        | Started | standard-4.3.0           | Package commands and mbeans
> > > > service             | 4.3.0        | x        | Started | standard-4.3.0           | Provide Service support
> > > > system              | 4.3.0        | x        | Started | standard-4.3.0           | Provide System support
> > > > kar                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide KAR (KARaf archive) support
> > > > ssh                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide a SSHd server on Karaf
> > > > management          | 4.3.0        | x        | Started | standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
> > > > eventadmin          | 4.3.0        | x        | Started | standard-4.3.0           | OSGi Event Admin service specification for event-
> > > > scr                 | 4.3.0        |          | Started | standard-4.3.0           | Declarative Service support
> > > > wrap                | 2.6.2        | x        | Started | standard-4.3.0           | Wrap URL handler
> > > > pax-web-core        | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
> > > > pax-http            | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
> > > > undertow            | 2.0.31.Final |          | Started | org.ops4j.pax.web-7.3.9  |
> > > > pax-http-undertow   | 7.3.9        | x        | Started | org.ops4j.pax.web-7.3.9  |
> > > > jdbc                | 4.3.0        | x        | Started | enterprise-4.3.0         | JDBC service and commands
> > > > pax-jdbc-spec       | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
> > > > pax-jdbc            | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
> > > > pax-jdbc-config     | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
> > > > pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
> > > > 
> > > > 
> > > > 
> > > > -John

Re: Karaf 4.3.6 - still unable to install hawtio-core with pax-http-undertow

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi guys

I will try this afternoon using blacklist. I will keep you posted.

Regards
JB

Le sam. 19 févr. 2022 à 11:24, Gerald Kallas - mailbox.org <
catshout@mailbox.org> a écrit :

> Hi John, thanks for the reply. We decided to use undertow some time ago to
> configure properly
>
> - TLS inbound
> - Basic Auth inbound
> - multiple base paths for APIs inbound
>
> Did you made this with pax-jetty as well?
>
> Sent by my mobile device
> - Gerald Kallas
>
> Am 19.02.2022 um 05:56 schrieb John Taylor <jt...@gmail.com>:
>
> 
>
> Hi Gerald,
> Sorry for not responding sooner, this went to my spam.
> I haven't been able to look at this anymore, and have settled (for now) on
> using pax-jetty
>
> -John
>
>
>
> On Wed, Feb 9, 2022 at 6:33 PM Gerald Kallas <ca...@mailbox.org> wrote:
>
>> I did add the following lines to the file org.apache.karaf.features.xml
>>
>>     <blacklistedBundles>
>>         <Bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</Bundle>
>>     </blacklistedBundles>
>>
>> as suggested before running
>>
>> feature:install pax-http-undertow
>> feature:install hawtio
>>
>> The error remains the same.
>>
>> org.apache.felix.resolver.reason.ReasonException: Uses constraint
>> violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.23] because it is exposed to
>> package 'javax.servlet' from resources javax.servlet-api
>> [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0]
>> via two dependency chains.
>>
>> Chain 1:
>>   org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>>     import:
>> (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>>      |
>>     export: osgi.wiring.package: javax.servlet
>>   javax.servlet-api [javax.servlet-api/3.1.0]
>>
>> Chain 2:
>>   org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>>     import:
>> (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>>      |
>>     export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
>>   io.undertow.servlet [io.undertow.servlet/2.0.33.Final]
>>     import:
>> (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>>      |
>>     export: osgi.wiring.package: javax.servlet
>>   javax.servlet-api [javax.servlet-api/4.0.0]
>>         at
>> org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2467)
>>         at
>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:462)
>>         at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>>         at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>>         at
>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>         at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>         at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>         at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>         at
>> java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>>         at
>> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>>         at
>> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>>         at java.base/java.lang.Thread.run(Thread.java:829)
>>
>>
>> Any suggestions?
>>
>> > Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 15:58
>> geschrieben:
>> >
>> >
>> > Hi JB,
>> >
>> > I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and
>> got the same error.
>> >
>> > Are there any updates when this might be fixed?
>> >
>> > Best
>> > Gerald
>> >
>> > > Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37
>> geschrieben:
>> > >
>> > >
>> > > Hi,
>> > >
>> > > That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
>> > >
>> > > It upgraded to undertow.
>> > >
>> > > Here, you have two javax.servlet version:
>> > > - 3.1.0 coming with pax-web-undertow
>> > > - 4.0.0 coming with io.undertow.servlet
>> > >
>> > > As workaround you can blacklist javax.servlet 3.1.0 coming from
>> pax-web-undertow.
>> > >
>> > > Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x
>> version).
>> > >
>> > > Regards
>> > > JB
>> > >
>> > > > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
>> > > >
>> > > > Hi All,
>> > > > I'm testing karaf 4.3.0 on Windows 10, Java 11.
>> > > > I can't install hawtio-core with pax-http-undertow.
>> > > >
>> > > > It looks like
>> > > > org.ops4j.pax.web.pax-web-undertow imports
>> javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
>> > > > and also imports
>> > > > io.undertow.servlet which has a uses of
>> javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
>> > > >
>> > > >
>> > > >
>> > > > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf |
>> ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0
>> | Exception caught while executing command
>> > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint
>> violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package
>> 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0]
>> and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
>> > > >
>> > > > Chain 1:
>> > > >  org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.9]
>> > > >    import:
>> (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package: javax.servlet
>> > > >  javax.servlet-api [javax.servlet-api/3.1.0]
>> > > >
>> > > > Chain 2:
>> > > >  org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.9]
>> > > >    import:
>> (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package=io.undertow.servlet;
>> uses:=javax.servlet
>> > > >  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
>> > > >    import:
>> (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package: javax.servlet
>> > > >  javax.servlet-api [javax.servlet-api/4.0.0]
>> > > >   at
>> org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444)
>> ~[?:?]
>> > > >   at
>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463)
>> ~[?:?]
>> > > >   at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
>> > > >   at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
>> > > >   at
>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>> ~[?:?]
>> > > >   at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392)
>> ~[?:?]
>> > > >   at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
>> ~[?:?]
>> > > >   at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
>> ~[?:?]
>> > > >   at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
>> > > >   at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>> ~[?:?]
>> > > >   at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>> ~[?:?]
>> > > >   at java.lang.Thread.run(Thread.java:834) [?:?]
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > karaf@root()> feature:list --installed
>> > > > Name                | Version      | Required | State   |
>> Repository               | Description
>> > > >
>> --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
>> > > > wrap                | 2.6.2        | x        | Started |
>> standard-4.2.9           | Wrap URL handler
>> > > > feature             | 4.3.0        | x        | Started |
>> standard-4.3.0           | Features Support
>> > > > shell               | 4.3.0        | x        | Started |
>> standard-4.3.0           | Karaf Shell
>> > > > deployer            | 4.3.0        | x        | Started |
>> standard-4.3.0           | Karaf Deployer
>> > > > bundle              | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Bundle support
>> > > > config              | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide OSGi ConfigAdmin support
>> > > > diagnostic          | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Diagnostic support
>> > > > instance            | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Instance support
>> > > > jaas                | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide JAAS support
>> > > > log                 | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Log support
>> > > > package             | 4.3.0        | x        | Started |
>> standard-4.3.0           | Package commands and mbeans
>> > > > service             | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Service support
>> > > > system              | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide System support
>> > > > kar                 | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide KAR (KARaf archive) support
>> > > > ssh                 | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide a SSHd server on Karaf
>> > > > management          | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
>> > > > eventadmin          | 4.3.0        | x        | Started |
>> standard-4.3.0           | OSGi Event Admin service specification for event-
>> > > > scr                 | 4.3.0        |          | Started |
>> standard-4.3.0           | Declarative Service support
>> > > > wrap                | 2.6.2        | x        | Started |
>> standard-4.3.0           | Wrap URL handler
>> > > > pax-web-core        | 7.3.9        |          | Started |
>> org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
>> > > > pax-http            | 7.3.9        |          | Started |
>> org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
>> > > > undertow            | 2.0.31.Final |          | Started |
>> org.ops4j.pax.web-7.3.9  |
>> > > > pax-http-undertow   | 7.3.9        | x        | Started |
>> org.ops4j.pax.web-7.3.9  |
>> > > > jdbc                | 4.3.0        | x        | Started |
>> enterprise-4.3.0         | JDBC service and commands
>> > > > pax-jdbc-spec       | 1.4.4        |          | Started |
>> org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
>> > > > pax-jdbc            | 1.4.4        |          | Started |
>> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
>> > > > pax-jdbc-config     | 1.4.4        |          | Started |
>> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
>> > > > pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started |
>> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
>> > > >
>> > > >
>> > > >
>> > > > -John
>>
>

Re: Karaf 4.3.6 - still unable to install hawtio-core with pax-http-undertow

Posted by Gerald Kallas <ca...@mailbox.org>.
Ah ye, the mvn:org.apache.geronimo.components/geronimo-jaspi/2.0.0 thing you did mention. Will try to get this fixed.

Best
Gerald

> Gerald Kallas <ca...@mailbox.org> hat am 20.02.2022 14:11 geschrieben:
> 
>  
> Hi John, all.
> 
> 1st, John, many thanks for you reply. It helps a lot for understanding. I'm  trying to move to pax-jetty and camel-servlet now. So far I'm struggling again with basic authentication.
> 
> 
> My jetty.xml looks like (excerpt)
> 
> ...
>     <Call name="addBean">
>         <Arg>
>             <New class="org.eclipse.jetty.jaas.JAASLoginService">
>                 <Set name="name">karaf</Set>
>                 <Set name="loginModuleName">karaf</Set>
>                 <Set name="roleClassNames">
>                     <Array type="java.lang.String">
>                         <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
>                         </Item>
>                     </Array>
>                 </Set>
>             </New>
>         </Arg>
>     </Call>
> ...
> 
> (I removed the 2nd entry.)
> 
> 
> My blueprint sample looks like
> 
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>            xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>            xsi:schemaLocation="
>            http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
> 
>         <reference id="httpService" interface="org.osgi.service.http.HttpService" />
> 
>         <bean id="camelServlet" class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>
> 
>         <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
>               init-method="register"
>               destroy-method="unregister">
>                 <property name="servletName" value="servlet1" />
>                 <property name="alias" value="/test" />
>                 <property name="httpService" ref="httpService" />
>                 <property name="servlet" ref="camelServlet" />
>         </bean>
> 
>     <camelContext id="sample" xmlns="http://camel.apache.org/schema/blueprint">
>         <route>
>             <from uri="servlet://hello?servletName=servlet1" />
>             <log message="Hello Camel!" />
>         </route>
>     </camelContext>
> 
> </blueprint>
> 
> 
> I defined further a file in the etc folder
> 
> org.ops4j.pax.web.context-admin.sample.cfg
> 
> with the content
> 
> bundle.symbolicName=sample.xml
> login.config.authMethod=BASIC
> login.config.realmName=karaf
> context.id=default
> 
> security.constraint.1.url = /test/hello/*
> security.constraint.1.roles = testrole
> 
> 
> The user.properties contains a line
> 
> testuser = passw0rd:testrole
> 
> 
> Finally I'm getting an error below, am I missing something here?
> 
> Exception in thread "paxweb-context-3-thread-1" java.lang.SecurityException: AuthConfigFactory error: java.lang.ClassNotFoundException: org.apache.geronimo.components.jaspi.AuthConfigFactoryImpl not found by org.apache.geronimo.specs.geronimo-jaspic_1.0_spec [54]
>         at javax.security.auth.message.config.AuthConfigFactory.getFactory(AuthConfigFactory.java:77)
>         at org.eclipse.jetty.security.jaspi.JaspiAuthenticatorFactory.getAuthenticator(JaspiAuthenticatorFactory.java:90)
>         at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:394)
>         at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:417)
> ...
> 
> 
> Many thanks in advance for any hint.
> 
> Best
> Gerald
> 
> 
> > John Taylor <jt...@gmail.com> hat am 19.02.2022 20:23 geschrieben:
> > 
> > 
> > HI Gerald,
> > 
> > - TLS inbound
> > I haven't had to do that yet. So far everything is internal and just http. I will be doing something to provide an api externally, but I plan on doing that through an https reverse proxy in front.
> > 
> > - Basic Auth inbound
> > My Karaf install is mostly for running camel routes, and I use camel-servlet to expose endpoints. I have basic auth working on them with pax jetty using its http context processing where you can configure web contexts, including security constraints, with Configuration Admin. I know there has been discussion about that on this mailing list not working correctly with jetty, but the workaround of removing the second JAASLoginService in jetty.xml works for me. I will add that I also had to install mvn:org.apache.geronimo.components/geronimo-jaspi/2.0.0 for it to work. 
> > 
> > - Multiple base paths for APIs inbound
> > I have a shared camel servlet across contexts that use camel-karaf's OsgiServletRegisterer so they have the same base path. That's how I'm doing it, but having separate servlets that are on different base paths is possible, i.e. it's the pax web extender / whiteboard pattern and it works. Sorry don't know if that answers your question.
> > 
> > Hope that helps.
> > -John
> > 
> > 
> > On Sat, Feb 19, 2022 at 10:24 AM Gerald Kallas - mailbox.org (http://mailbox.org) <ca...@mailbox.org> wrote:
> > > Hi John, thanks for the reply. We decided to use undertow some time ago to configure properly
> > > 
> > > - TLS inbound
> > > - Basic Auth inbound
> > > - multiple base paths for APIs inbound
> > > 
> > > Did you made this with pax-jetty as well?
> > > 
> > > 
> > > Sent by my mobile device
> > > - Gerald Kallas
> > > 
> > > 
> > > > Am 19.02.2022 um 05:56 schrieb John Taylor <jt...@gmail.com>:
> > > > 
> > > > Hi Gerald,
> > > > Sorry for not responding sooner, this went to my spam. 
> > > > I haven't been able to look at this anymore, and have settled (for now) on using pax-jetty 
> > > > 
> > > > -John
> > > > 
> > > > 
> > > > 
> > > > 
> > > > On Wed, Feb 9, 2022 at 6:33 PM Gerald Kallas <ca...@mailbox.org> wrote:
> > > > > I did add the following lines to the file org.apache.karaf.features.xml
> > > > > 
> > > > >  <blacklistedBundles>
> > > > >  <Bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</Bundle>
> > > > >  </blacklistedBundles>
> > > > > 
> > > > > as suggested before running
> > > > > 
> > > > > feature:install pax-http-undertow
> > > > > feature:install hawtio
> > > > > 
> > > > > The error remains the same.
> > > > > 
> > > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> > > > > 
> > > > > Chain 1:
> > > > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
> > > > >  import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
> > > > >  |
> > > > >  export: osgi.wiring.package: javax.servlet
> > > > >  javax.servlet-api [javax.servlet-api/3.1.0]
> > > > > 
> > > > > Chain 2:
> > > > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
> > > > >  import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
> > > > >  |
> > > > >  export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
> > > > >  io.undertow.servlet [io.undertow.servlet/2.0.33. (http://2.0.33.)Final]
> > > > >  import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
> > > > >  |
> > > > >  export: osgi.wiring.package: javax.servlet
> > > > >  javax.servlet-api [javax.servlet-api/4.0.0]
> > > > >  at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2467)
> > > > >  at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:462)
> > > > >  at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
> > > > >  at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
> > > > >  at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
> > > > >  at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
> > > > >  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
> > > > >  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
> > > > >  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> > > > >  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> > > > >  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> > > > >  at java.base/java.lang.Thread.run(Thread.java:829)
> > > > > 
> > > > > 
> > > > > Any suggestions?
> > > > > 
> > > > > > Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 15:58 geschrieben:
> > > > > > 
> > > > > > 
> > > > > > Hi JB,
> > > > > > 
> > > > > > I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and got the same error.
> > > > > > 
> > > > > > Are there any updates when this might be fixed?
> > > > > > 
> > > > > > Best
> > > > > > Gerald
> > > > > > 
> > > > > > > Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37 geschrieben:
> > > > > > > 
> > > > > > > 
> > > > > > > Hi,
> > > > > > > 
> > > > > > > That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
> > > > > > > 
> > > > > > > It upgraded to undertow.
> > > > > > > 
> > > > > > > Here, you have two javax.servlet version:
> > > > > > > - 3.1.0 coming with pax-web-undertow
> > > > > > > - 4.0.0 coming with io.undertow.servlet
> > > > > > > 
> > > > > > > As workaround you can blacklist javax.servlet 3.1.0 coming from pax-web-undertow.
> > > > > > > 
> > > > > > > Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x version).
> > > > > > > 
> > > > > > > Regards
> > > > > > > JB
> > > > > > > 
> > > > > > > > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
> > > > > > > > 
> > > > > > > > Hi All,
> > > > > > > > I'm testing karaf 4.3.0 on Windows 10, Java 11.
> > > > > > > > I can't install hawtio-core with pax-http-undertow.
> > > > > > > > 
> > > > > > > > It looks like 
> > > > > > > > org.ops4j.pax.web.pax-web-undertow imports javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
> > > > > > > > and also imports
> > > > > > > > io.undertow.servlet which has a uses of javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf | ShellUtil | 43 - org.apache.karaf.shell.core - 4.3.0 | Exception caught while executing command
> > > > > > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> > > > > > > > 
> > > > > > > > Chain 1:
> > > > > > > > org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > > > > > > > import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
> > > > > > > > |
> > > > > > > > export: osgi.wiring.package: javax.servlet
> > > > > > > > javax.servlet-api [javax.servlet-api/3.1.0]
> > > > > > > > 
> > > > > > > > Chain 2:
> > > > > > > > org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > > > > > > > import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
> > > > > > > > |
> > > > > > > > export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
> > > > > > > > io.undertow.servlet [io.undertow.servlet/2.0.31. (http://2.0.31.)Final]
> > > > > > > > import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
> > > > > > > > |
> > > > > > > > export: osgi.wiring.package: javax.servlet
> > > > > > > > javax.servlet-api [javax.servlet-api/4.0.0]
> > > > > > > > at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444) ~[?:?]
> > > > > > > > at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463) ~[?:?]
> > > > > > > > at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
> > > > > > > > at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
> > > > > > > > at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
> > > > > > > > at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392) ~[?:?]
> > > > > > > > at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
> > > > > > > > at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
> > > > > > > > at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> > > > > > > > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
> > > > > > > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
> > > > > > > > at java.lang.Thread.run(Thread.java:834) [?:?]
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > karaf@root()> feature:list --installed
> > > > > > > > Name | Version | Required | State | Repository | Description
> > > > > > > > --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
> > > > > > > > wrap | 2.6.2 | x | Started | standard-4.2.9 | Wrap URL handler
> > > > > > > > feature | 4.3.0 | x | Started | standard-4.3.0 | Features Support
> > > > > > > > shell | 4.3.0 | x | Started | standard-4.3.0 | Karaf Shell
> > > > > > > > deployer | 4.3.0 | x | Started | standard-4.3.0 | Karaf Deployer
> > > > > > > > bundle | 4.3.0 | x | Started | standard-4.3.0 | Provide Bundle support
> > > > > > > > config | 4.3.0 | x | Started | standard-4.3.0 | Provide OSGi ConfigAdmin support
> > > > > > > > diagnostic | 4.3.0 | x | Started | standard-4.3.0 | Provide Diagnostic support
> > > > > > > > instance | 4.3.0 | x | Started | standard-4.3.0 | Provide Instance support
> > > > > > > > jaas | 4.3.0 | x | Started | standard-4.3.0 | Provide JAAS support
> > > > > > > > log | 4.3.0 | x | Started | standard-4.3.0 | Provide Log support
> > > > > > > > package | 4.3.0 | x | Started | standard-4.3.0 | Package commands and mbeans
> > > > > > > > service | 4.3.0 | x | Started | standard-4.3.0 | Provide Service support
> > > > > > > > system | 4.3.0 | x | Started | standard-4.3.0 | Provide System support
> > > > > > > > kar | 4.3.0 | x | Started | standard-4.3.0 | Provide KAR (KARaf archive) support
> > > > > > > > ssh | 4.3.0 | x | Started | standard-4.3.0 | Provide a SSHd server on Karaf
> > > > > > > > management | 4.3.0 | x | Started | standard-4.3.0 | Provide a JMX MBeanServer and a set of MBeans in
> > > > > > > > eventadmin | 4.3.0 | x | Started | standard-4.3.0 | OSGi Event Admin service specification for event-
> > > > > > > > scr | 4.3.0 | | Started | standard-4.3.0 | Declarative Service support
> > > > > > > > wrap | 2.6.2 | x | Started | standard-4.3.0 | Wrap URL handler
> > > > > > > > pax-web-core | 7.3.9 | | Started | org.ops4j.pax.web-7.3.9 | Provide Core pax-web bundles
> > > > > > > > pax-http | 7.3.9 | | Started | org.ops4j.pax.web-7.3.9 | Implementation of the OSGI HTTP Service
> > > > > > > > undertow | 2.0.31.Final | | Started | org.ops4j.pax.web-7.3.9 |
> > > > > > > > pax-http-undertow | 7.3.9 | x | Started | org.ops4j.pax.web-7.3.9 |
> > > > > > > > jdbc | 4.3.0 | x | Started | enterprise-4.3.0 | JDBC service and commands
> > > > > > > > pax-jdbc-spec | 1.4.4 | | Started | org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
> > > > > > > > pax-jdbc | 1.4.4 | | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
> > > > > > > > pax-jdbc-config | 1.4.4 | | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
> > > > > > > > pax-jdbc-pool-dbcp2 | 1.4.4 | x | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > -John

Re: Karaf 4.3.6 - still unable to install hawtio-core with pax-http-undertow

Posted by Gerald Kallas <ca...@mailbox.org>.
Hi John, all.

1st, John, many thanks for you reply. It helps a lot for understanding. I'm  trying to move to pax-jetty and camel-servlet now. So far I'm struggling again with basic authentication.


My jetty.xml looks like (excerpt)

...
    <Call name="addBean">
        <Arg>
            <New class="org.eclipse.jetty.jaas.JAASLoginService">
                <Set name="name">karaf</Set>
                <Set name="loginModuleName">karaf</Set>
                <Set name="roleClassNames">
                    <Array type="java.lang.String">
                        <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
                        </Item>
                    </Array>
                </Set>
            </New>
        </Arg>
    </Call>
...

(I removed the 2nd entry.)


My blueprint sample looks like

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="
           http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

        <reference id="httpService" interface="org.osgi.service.http.HttpService" />

        <bean id="camelServlet" class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>

        <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
              init-method="register"
              destroy-method="unregister">
                <property name="servletName" value="servlet1" />
                <property name="alias" value="/test" />
                <property name="httpService" ref="httpService" />
                <property name="servlet" ref="camelServlet" />
        </bean>

    <camelContext id="sample" xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="servlet://hello?servletName=servlet1" />
            <log message="Hello Camel!" />
        </route>
    </camelContext>

</blueprint>


I defined further a file in the etc folder

org.ops4j.pax.web.context-admin.sample.cfg

with the content

bundle.symbolicName=sample.xml
login.config.authMethod=BASIC
login.config.realmName=karaf
context.id=default

security.constraint.1.url = /test/hello/*
security.constraint.1.roles = testrole


The user.properties contains a line

testuser = passw0rd:testrole


Finally I'm getting an error below, am I missing something here?

Exception in thread "paxweb-context-3-thread-1" java.lang.SecurityException: AuthConfigFactory error: java.lang.ClassNotFoundException: org.apache.geronimo.components.jaspi.AuthConfigFactoryImpl not found by org.apache.geronimo.specs.geronimo-jaspic_1.0_spec [54]
        at javax.security.auth.message.config.AuthConfigFactory.getFactory(AuthConfigFactory.java:77)
        at org.eclipse.jetty.security.jaspi.JaspiAuthenticatorFactory.getAuthenticator(JaspiAuthenticatorFactory.java:90)
        at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:394)
        at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:417)
...


Many thanks in advance for any hint.

Best
Gerald


> John Taylor <jt...@gmail.com> hat am 19.02.2022 20:23 geschrieben:
> 
> 
> HI Gerald,
> 
> - TLS inbound
> I haven't had to do that yet. So far everything is internal and just http. I will be doing something to provide an api externally, but I plan on doing that through an https reverse proxy in front.
> 
> - Basic Auth inbound
> My Karaf install is mostly for running camel routes, and I use camel-servlet to expose endpoints. I have basic auth working on them with pax jetty using its http context processing where you can configure web contexts, including security constraints, with Configuration Admin. I know there has been discussion about that on this mailing list not working correctly with jetty, but the workaround of removing the second JAASLoginService in jetty.xml works for me. I will add that I also had to install mvn:org.apache.geronimo.components/geronimo-jaspi/2.0.0 for it to work. 
> 
> - Multiple base paths for APIs inbound
> I have a shared camel servlet across contexts that use camel-karaf's OsgiServletRegisterer so they have the same base path. That's how I'm doing it, but having separate servlets that are on different base paths is possible, i.e. it's the pax web extender / whiteboard pattern and it works. Sorry don't know if that answers your question.
> 
> Hope that helps.
> -John
> 
> 
> On Sat, Feb 19, 2022 at 10:24 AM Gerald Kallas - mailbox.org (http://mailbox.org) <ca...@mailbox.org> wrote:
> > Hi John, thanks for the reply. We decided to use undertow some time ago to configure properly
> > 
> > - TLS inbound
> > - Basic Auth inbound
> > - multiple base paths for APIs inbound
> > 
> > Did you made this with pax-jetty as well?
> > 
> > 
> > Sent by my mobile device
> > - Gerald Kallas
> > 
> > 
> > > Am 19.02.2022 um 05:56 schrieb John Taylor <jt...@gmail.com>:
> > > 
> > > Hi Gerald,
> > > Sorry for not responding sooner, this went to my spam. 
> > > I haven't been able to look at this anymore, and have settled (for now) on using pax-jetty 
> > > 
> > > -John
> > > 
> > > 
> > > 
> > > 
> > > On Wed, Feb 9, 2022 at 6:33 PM Gerald Kallas <ca...@mailbox.org> wrote:
> > > > I did add the following lines to the file org.apache.karaf.features.xml
> > > > 
> > > >  <blacklistedBundles>
> > > >  <Bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</Bundle>
> > > >  </blacklistedBundles>
> > > > 
> > > > as suggested before running
> > > > 
> > > > feature:install pax-http-undertow
> > > > feature:install hawtio
> > > > 
> > > > The error remains the same.
> > > > 
> > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> > > > 
> > > > Chain 1:
> > > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
> > > >  import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
> > > >  |
> > > >  export: osgi.wiring.package: javax.servlet
> > > >  javax.servlet-api [javax.servlet-api/3.1.0]
> > > > 
> > > > Chain 2:
> > > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
> > > >  import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
> > > >  |
> > > >  export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
> > > >  io.undertow.servlet [io.undertow.servlet/2.0.33. (http://2.0.33.)Final]
> > > >  import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
> > > >  |
> > > >  export: osgi.wiring.package: javax.servlet
> > > >  javax.servlet-api [javax.servlet-api/4.0.0]
> > > >  at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2467)
> > > >  at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:462)
> > > >  at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
> > > >  at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
> > > >  at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
> > > >  at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
> > > >  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
> > > >  at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
> > > >  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> > > >  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> > > >  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> > > >  at java.base/java.lang.Thread.run(Thread.java:829)
> > > > 
> > > > 
> > > > Any suggestions?
> > > > 
> > > > > Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 15:58 geschrieben:
> > > > > 
> > > > > 
> > > > > Hi JB,
> > > > > 
> > > > > I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and got the same error.
> > > > > 
> > > > > Are there any updates when this might be fixed?
> > > > > 
> > > > > Best
> > > > > Gerald
> > > > > 
> > > > > > Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37 geschrieben:
> > > > > > 
> > > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
> > > > > > 
> > > > > > It upgraded to undertow.
> > > > > > 
> > > > > > Here, you have two javax.servlet version:
> > > > > > - 3.1.0 coming with pax-web-undertow
> > > > > > - 4.0.0 coming with io.undertow.servlet
> > > > > > 
> > > > > > As workaround you can blacklist javax.servlet 3.1.0 coming from pax-web-undertow.
> > > > > > 
> > > > > > Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x version).
> > > > > > 
> > > > > > Regards
> > > > > > JB
> > > > > > 
> > > > > > > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
> > > > > > > 
> > > > > > > Hi All,
> > > > > > > I'm testing karaf 4.3.0 on Windows 10, Java 11.
> > > > > > > I can't install hawtio-core with pax-http-undertow.
> > > > > > > 
> > > > > > > It looks like 
> > > > > > > org.ops4j.pax.web.pax-web-undertow imports javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
> > > > > > > and also imports
> > > > > > > io.undertow.servlet which has a uses of javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf | ShellUtil | 43 - org.apache.karaf.shell.core - 4.3.0 | Exception caught while executing command
> > > > > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> > > > > > > 
> > > > > > > Chain 1:
> > > > > > > org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > > > > > > import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
> > > > > > > |
> > > > > > > export: osgi.wiring.package: javax.servlet
> > > > > > > javax.servlet-api [javax.servlet-api/3.1.0]
> > > > > > > 
> > > > > > > Chain 2:
> > > > > > > org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > > > > > > import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
> > > > > > > |
> > > > > > > export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
> > > > > > > io.undertow.servlet [io.undertow.servlet/2.0.31. (http://2.0.31.)Final]
> > > > > > > import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
> > > > > > > |
> > > > > > > export: osgi.wiring.package: javax.servlet
> > > > > > > javax.servlet-api [javax.servlet-api/4.0.0]
> > > > > > > at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444) ~[?:?]
> > > > > > > at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463) ~[?:?]
> > > > > > > at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
> > > > > > > at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
> > > > > > > at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
> > > > > > > at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392) ~[?:?]
> > > > > > > at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
> > > > > > > at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
> > > > > > > at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> > > > > > > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
> > > > > > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
> > > > > > > at java.lang.Thread.run(Thread.java:834) [?:?]
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > karaf@root()> feature:list --installed
> > > > > > > Name | Version | Required | State | Repository | Description
> > > > > > > --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
> > > > > > > wrap | 2.6.2 | x | Started | standard-4.2.9 | Wrap URL handler
> > > > > > > feature | 4.3.0 | x | Started | standard-4.3.0 | Features Support
> > > > > > > shell | 4.3.0 | x | Started | standard-4.3.0 | Karaf Shell
> > > > > > > deployer | 4.3.0 | x | Started | standard-4.3.0 | Karaf Deployer
> > > > > > > bundle | 4.3.0 | x | Started | standard-4.3.0 | Provide Bundle support
> > > > > > > config | 4.3.0 | x | Started | standard-4.3.0 | Provide OSGi ConfigAdmin support
> > > > > > > diagnostic | 4.3.0 | x | Started | standard-4.3.0 | Provide Diagnostic support
> > > > > > > instance | 4.3.0 | x | Started | standard-4.3.0 | Provide Instance support
> > > > > > > jaas | 4.3.0 | x | Started | standard-4.3.0 | Provide JAAS support
> > > > > > > log | 4.3.0 | x | Started | standard-4.3.0 | Provide Log support
> > > > > > > package | 4.3.0 | x | Started | standard-4.3.0 | Package commands and mbeans
> > > > > > > service | 4.3.0 | x | Started | standard-4.3.0 | Provide Service support
> > > > > > > system | 4.3.0 | x | Started | standard-4.3.0 | Provide System support
> > > > > > > kar | 4.3.0 | x | Started | standard-4.3.0 | Provide KAR (KARaf archive) support
> > > > > > > ssh | 4.3.0 | x | Started | standard-4.3.0 | Provide a SSHd server on Karaf
> > > > > > > management | 4.3.0 | x | Started | standard-4.3.0 | Provide a JMX MBeanServer and a set of MBeans in
> > > > > > > eventadmin | 4.3.0 | x | Started | standard-4.3.0 | OSGi Event Admin service specification for event-
> > > > > > > scr | 4.3.0 | | Started | standard-4.3.0 | Declarative Service support
> > > > > > > wrap | 2.6.2 | x | Started | standard-4.3.0 | Wrap URL handler
> > > > > > > pax-web-core | 7.3.9 | | Started | org.ops4j.pax.web-7.3.9 | Provide Core pax-web bundles
> > > > > > > pax-http | 7.3.9 | | Started | org.ops4j.pax.web-7.3.9 | Implementation of the OSGI HTTP Service
> > > > > > > undertow | 2.0.31.Final | | Started | org.ops4j.pax.web-7.3.9 |
> > > > > > > pax-http-undertow | 7.3.9 | x | Started | org.ops4j.pax.web-7.3.9 |
> > > > > > > jdbc | 4.3.0 | x | Started | enterprise-4.3.0 | JDBC service and commands
> > > > > > > pax-jdbc-spec | 1.4.4 | | Started | org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
> > > > > > > pax-jdbc | 1.4.4 | | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
> > > > > > > pax-jdbc-config | 1.4.4 | | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
> > > > > > > pax-jdbc-pool-dbcp2 | 1.4.4 | x | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > -John

Re: Karaf 4.3.6 - still unable to install hawtio-core with pax-http-undertow

Posted by John Taylor <jt...@gmail.com>.
HI Gerald,

- TLS inbound
I haven't had to do that yet. So far everything is internal and just http.
I will be doing something to provide an api externally, but I plan on doing
that through an https reverse proxy in front.

- Basic Auth inbound
My Karaf install is mostly for running camel routes, and I use
camel-servlet to expose endpoints. I have basic auth working on them with
pax jetty using its http context processing where you can configure web
contexts, including security constraints, with Configuration Admin. I know
there has been discussion about that on this mailing list not working
correctly with jetty, but the workaround of removing the second
JAASLoginService in jetty.xml works for me.  I will add that I also had to
install mvn:org.apache.geronimo.components/geronimo-jaspi/2.0.0 for it to
work.

- Multiple base paths for APIs inbound
I have a shared camel servlet across contexts that use camel-karaf's
OsgiServletRegisterer so they have the same base path. That's how I'm doing
it, but having separate servlets that are on different base paths is
possible, i.e. it's the pax web extender / whiteboard pattern and it works.
Sorry don't know if that answers your question.

Hope that helps.
-John

On Sat, Feb 19, 2022 at 10:24 AM Gerald Kallas - mailbox.org <
catshout@mailbox.org> wrote:

> Hi John, thanks for the reply. We decided to use undertow some time ago to
> configure properly
>
> - TLS inbound
> - Basic Auth inbound
> - multiple base paths for APIs inbound
>
> Did you made this with pax-jetty as well?
>
> Sent by my mobile device
> - Gerald Kallas
>
> Am 19.02.2022 um 05:56 schrieb John Taylor <jt...@gmail.com>:
>
> 
> Hi Gerald,
> Sorry for not responding sooner, this went to my spam.
> I haven't been able to look at this anymore, and have settled (for now) on
> using pax-jetty
>
> -John
>
>
>
> On Wed, Feb 9, 2022 at 6:33 PM Gerald Kallas <ca...@mailbox.org> wrote:
>
>> I did add the following lines to the file org.apache.karaf.features.xml
>>
>>     <blacklistedBundles>
>>         <Bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</Bundle>
>>     </blacklistedBundles>
>>
>> as suggested before running
>>
>> feature:install pax-http-undertow
>> feature:install hawtio
>>
>> The error remains the same.
>>
>> org.apache.felix.resolver.reason.ReasonException: Uses constraint
>> violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.23] because it is exposed to
>> package 'javax.servlet' from resources javax.servlet-api
>> [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0]
>> via two dependency chains.
>>
>> Chain 1:
>>   org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>>     import:
>> (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>>      |
>>     export: osgi.wiring.package: javax.servlet
>>   javax.servlet-api [javax.servlet-api/3.1.0]
>>
>> Chain 2:
>>   org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>>     import:
>> (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>>      |
>>     export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
>>   io.undertow.servlet [io.undertow.servlet/2.0.33.Final]
>>     import:
>> (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>>      |
>>     export: osgi.wiring.package: javax.servlet
>>   javax.servlet-api [javax.servlet-api/4.0.0]
>>         at
>> org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2467)
>>         at
>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:462)
>>         at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>>         at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>>         at
>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>         at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>         at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>         at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>         at
>> java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>>         at
>> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>>         at
>> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>>         at java.base/java.lang.Thread.run(Thread.java:829)
>>
>>
>> Any suggestions?
>>
>> > Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 15:58
>> geschrieben:
>> >
>> >
>> > Hi JB,
>> >
>> > I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and
>> got the same error.
>> >
>> > Are there any updates when this might be fixed?
>> >
>> > Best
>> > Gerald
>> >
>> > > Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37
>> geschrieben:
>> > >
>> > >
>> > > Hi,
>> > >
>> > > That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
>> > >
>> > > It upgraded to undertow.
>> > >
>> > > Here, you have two javax.servlet version:
>> > > - 3.1.0 coming with pax-web-undertow
>> > > - 4.0.0 coming with io.undertow.servlet
>> > >
>> > > As workaround you can blacklist javax.servlet 3.1.0 coming from
>> pax-web-undertow.
>> > >
>> > > Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x
>> version).
>> > >
>> > > Regards
>> > > JB
>> > >
>> > > > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
>> > > >
>> > > > Hi All,
>> > > > I'm testing karaf 4.3.0 on Windows 10, Java 11.
>> > > > I can't install hawtio-core with pax-http-undertow.
>> > > >
>> > > > It looks like
>> > > > org.ops4j.pax.web.pax-web-undertow imports
>> javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
>> > > > and also imports
>> > > > io.undertow.servlet which has a uses of
>> javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
>> > > >
>> > > >
>> > > >
>> > > > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf |
>> ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0
>> | Exception caught while executing command
>> > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint
>> violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package
>> 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0]
>> and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
>> > > >
>> > > > Chain 1:
>> > > >  org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.9]
>> > > >    import:
>> (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package: javax.servlet
>> > > >  javax.servlet-api [javax.servlet-api/3.1.0]
>> > > >
>> > > > Chain 2:
>> > > >  org.ops4j.pax.web.pax-web-undertow
>> [org.ops4j.pax.web.pax-web-undertow/7.3.9]
>> > > >    import:
>> (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package=io.undertow.servlet;
>> uses:=javax.servlet
>> > > >  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
>> > > >    import:
>> (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package: javax.servlet
>> > > >  javax.servlet-api [javax.servlet-api/4.0.0]
>> > > >   at
>> org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444)
>> ~[?:?]
>> > > >   at
>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463)
>> ~[?:?]
>> > > >   at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
>> > > >   at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
>> > > >   at
>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>> ~[?:?]
>> > > >   at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392)
>> ~[?:?]
>> > > >   at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
>> ~[?:?]
>> > > >   at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
>> ~[?:?]
>> > > >   at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
>> > > >   at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>> ~[?:?]
>> > > >   at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>> ~[?:?]
>> > > >   at java.lang.Thread.run(Thread.java:834) [?:?]
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > karaf@root()> feature:list --installed
>> > > > Name                | Version      | Required | State   |
>> Repository               | Description
>> > > >
>> --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
>> > > > wrap                | 2.6.2        | x        | Started |
>> standard-4.2.9           | Wrap URL handler
>> > > > feature             | 4.3.0        | x        | Started |
>> standard-4.3.0           | Features Support
>> > > > shell               | 4.3.0        | x        | Started |
>> standard-4.3.0           | Karaf Shell
>> > > > deployer            | 4.3.0        | x        | Started |
>> standard-4.3.0           | Karaf Deployer
>> > > > bundle              | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Bundle support
>> > > > config              | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide OSGi ConfigAdmin support
>> > > > diagnostic          | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Diagnostic support
>> > > > instance            | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Instance support
>> > > > jaas                | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide JAAS support
>> > > > log                 | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Log support
>> > > > package             | 4.3.0        | x        | Started |
>> standard-4.3.0           | Package commands and mbeans
>> > > > service             | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide Service support
>> > > > system              | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide System support
>> > > > kar                 | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide KAR (KARaf archive) support
>> > > > ssh                 | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide a SSHd server on Karaf
>> > > > management          | 4.3.0        | x        | Started |
>> standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
>> > > > eventadmin          | 4.3.0        | x        | Started |
>> standard-4.3.0           | OSGi Event Admin service specification for event-
>> > > > scr                 | 4.3.0        |          | Started |
>> standard-4.3.0           | Declarative Service support
>> > > > wrap                | 2.6.2        | x        | Started |
>> standard-4.3.0           | Wrap URL handler
>> > > > pax-web-core        | 7.3.9        |          | Started |
>> org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
>> > > > pax-http            | 7.3.9        |          | Started |
>> org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
>> > > > undertow            | 2.0.31.Final |          | Started |
>> org.ops4j.pax.web-7.3.9  |
>> > > > pax-http-undertow   | 7.3.9        | x        | Started |
>> org.ops4j.pax.web-7.3.9  |
>> > > > jdbc                | 4.3.0        | x        | Started |
>> enterprise-4.3.0         | JDBC service and commands
>> > > > pax-jdbc-spec       | 1.4.4        |          | Started |
>> org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
>> > > > pax-jdbc            | 1.4.4        |          | Started |
>> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
>> > > > pax-jdbc-config     | 1.4.4        |          | Started |
>> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
>> > > > pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started |
>> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
>> > > >
>> > > >
>> > > >
>> > > > -John
>>
>

Re: Karaf 4.3.6 - still unable to install hawtio-core with pax-http-undertow

Posted by "Gerald Kallas - mailbox.org" <ca...@mailbox.org>.
Hi John, thanks for the reply. We decided to use undertow some time ago to configure properly

- TLS inbound
- Basic Auth inbound
- multiple base paths for APIs inbound

Did you made this with pax-jetty as well?

Sent by my mobile device
- Gerald Kallas

> Am 19.02.2022 um 05:56 schrieb John Taylor <jt...@gmail.com>:
> 
> 
> Hi Gerald,
> Sorry for not responding sooner, this went to my spam. 
> I haven't been able to look at this anymore, and have settled (for now) on using pax-jetty 
> 
> -John
> 
> 
> 
>> On Wed, Feb 9, 2022 at 6:33 PM Gerald Kallas <ca...@mailbox.org> wrote:
>> I did add the following lines to the file org.apache.karaf.features.xml
>> 
>>     <blacklistedBundles>
>>         <Bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</Bundle>
>>     </blacklistedBundles>
>> 
>> as suggested before running
>> 
>> feature:install pax-http-undertow
>> feature:install hawtio
>> 
>> The error remains the same.
>> 
>> org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
>> 
>> Chain 1:
>>   org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>>     import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>>      |
>>     export: osgi.wiring.package: javax.servlet
>>   javax.servlet-api [javax.servlet-api/3.1.0]
>> 
>> Chain 2:
>>   org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>>     import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>>      |
>>     export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
>>   io.undertow.servlet [io.undertow.servlet/2.0.33.Final]
>>     import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>>      |
>>     export: osgi.wiring.package: javax.servlet
>>   javax.servlet-api [javax.servlet-api/4.0.0]
>>         at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2467)
>>         at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:462)
>>         at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>>         at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>>         at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>         at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>>         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>>         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>>         at java.base/java.lang.Thread.run(Thread.java:829)
>> 
>> 
>> Any suggestions?
>> 
>> > Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 15:58 geschrieben:
>> > 
>> >  
>> > Hi JB,
>> > 
>> > I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and got the same error.
>> > 
>> > Are there any updates when this might be fixed?
>> > 
>> > Best
>> > Gerald
>> > 
>> > > Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37 geschrieben:
>> > > 
>> > >  
>> > > Hi,
>> > > 
>> > > That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
>> > > 
>> > > It upgraded to undertow.
>> > > 
>> > > Here, you have two javax.servlet version:
>> > > - 3.1.0 coming with pax-web-undertow
>> > > - 4.0.0 coming with io.undertow.servlet
>> > > 
>> > > As workaround you can blacklist javax.servlet 3.1.0 coming from pax-web-undertow.
>> > > 
>> > > Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x version).
>> > > 
>> > > Regards
>> > > JB
>> > > 
>> > > > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
>> > > > 
>> > > > Hi All,
>> > > > I'm testing karaf 4.3.0 on Windows 10, Java 11.
>> > > > I can't install hawtio-core with pax-http-undertow.
>> > > > 
>> > > > It looks like 
>> > > > org.ops4j.pax.web.pax-web-undertow imports javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
>> > > > and also imports
>> > > > io.undertow.servlet which has a uses of    javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
>> > > > 
>> > > > 
>> > > > 
>> > > > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf | ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0 | Exception caught while executing command
>> > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
>> > > > 
>> > > > Chain 1:
>> > > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
>> > > >    import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package: javax.servlet
>> > > >  javax.servlet-api [javax.servlet-api/3.1.0]
>> > > > 
>> > > > Chain 2:
>> > > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
>> > > >    import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
>> > > >  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
>> > > >    import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>> > > >     |
>> > > >    export: osgi.wiring.package: javax.servlet
>> > > >  javax.servlet-api [javax.servlet-api/4.0.0]
>> > > >   at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444) ~[?:?]
>> > > >   at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463) ~[?:?]
>> > > >   at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
>> > > >   at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
>> > > >   at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
>> > > >   at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392) ~[?:?]
>> > > >   at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
>> > > >   at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
>> > > >   at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
>> > > >   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
>> > > >   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
>> > > >   at java.lang.Thread.run(Thread.java:834) [?:?]
>> > > > 
>> > > > 
>> > > > 
>> > > > 
>> > > > 
>> > > > 
>> > > > 
>> > > > karaf@root()> feature:list --installed
>> > > > Name                | Version      | Required | State   | Repository               | Description
>> > > > --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
>> > > > wrap                | 2.6.2        | x        | Started | standard-4.2.9           | Wrap URL handler
>> > > > feature             | 4.3.0        | x        | Started | standard-4.3.0           | Features Support
>> > > > shell               | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Shell
>> > > > deployer            | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Deployer
>> > > > bundle              | 4.3.0        | x        | Started | standard-4.3.0           | Provide Bundle support
>> > > > config              | 4.3.0        | x        | Started | standard-4.3.0           | Provide OSGi ConfigAdmin support
>> > > > diagnostic          | 4.3.0        | x        | Started | standard-4.3.0           | Provide Diagnostic support
>> > > > instance            | 4.3.0        | x        | Started | standard-4.3.0           | Provide Instance support
>> > > > jaas                | 4.3.0        | x        | Started | standard-4.3.0           | Provide JAAS support
>> > > > log                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide Log support
>> > > > package             | 4.3.0        | x        | Started | standard-4.3.0           | Package commands and mbeans
>> > > > service             | 4.3.0        | x        | Started | standard-4.3.0           | Provide Service support
>> > > > system              | 4.3.0        | x        | Started | standard-4.3.0           | Provide System support
>> > > > kar                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide KAR (KARaf archive) support
>> > > > ssh                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide a SSHd server on Karaf
>> > > > management          | 4.3.0        | x        | Started | standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
>> > > > eventadmin          | 4.3.0        | x        | Started | standard-4.3.0           | OSGi Event Admin service specification for event-
>> > > > scr                 | 4.3.0        |          | Started | standard-4.3.0           | Declarative Service support
>> > > > wrap                | 2.6.2        | x        | Started | standard-4.3.0           | Wrap URL handler
>> > > > pax-web-core        | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
>> > > > pax-http            | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
>> > > > undertow            | 2.0.31.Final |          | Started | org.ops4j.pax.web-7.3.9  |
>> > > > pax-http-undertow   | 7.3.9        | x        | Started | org.ops4j.pax.web-7.3.9  |
>> > > > jdbc                | 4.3.0        | x        | Started | enterprise-4.3.0         | JDBC service and commands
>> > > > pax-jdbc-spec       | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
>> > > > pax-jdbc            | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
>> > > > pax-jdbc-config     | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
>> > > > pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
>> > > > 
>> > > > 
>> > > > 
>> > > > -John

Re: Karaf 4.3.6 - still unable to install hawtio-core with pax-http-undertow

Posted by John Taylor <jt...@gmail.com>.
Hi Gerald,
Sorry for not responding sooner, this went to my spam.
I haven't been able to look at this anymore, and have settled (for now) on
using pax-jetty

-John



On Wed, Feb 9, 2022 at 6:33 PM Gerald Kallas <ca...@mailbox.org> wrote:

> I did add the following lines to the file org.apache.karaf.features.xml
>
>     <blacklistedBundles>
>         <Bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</Bundle>
>     </blacklistedBundles>
>
> as suggested before running
>
> feature:install pax-http-undertow
> feature:install hawtio
>
> The error remains the same.
>
> org.apache.felix.resolver.reason.ReasonException: Uses constraint
> violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow
> [org.ops4j.pax.web.pax-web-undertow/7.3.23] because it is exposed to
> package 'javax.servlet' from resources javax.servlet-api
> [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0]
> via two dependency chains.
>
> Chain 1:
>   org.ops4j.pax.web.pax-web-undertow
> [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>     import:
> (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>      |
>     export: osgi.wiring.package: javax.servlet
>   javax.servlet-api [javax.servlet-api/3.1.0]
>
> Chain 2:
>   org.ops4j.pax.web.pax-web-undertow
> [org.ops4j.pax.web.pax-web-undertow/7.3.23]
>     import:
> (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>      |
>     export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
>   io.undertow.servlet [io.undertow.servlet/2.0.33.Final]
>     import:
> (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>      |
>     export: osgi.wiring.package: javax.servlet
>   javax.servlet-api [javax.servlet-api/4.0.0]
>         at
> org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2467)
>         at
> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:462)
>         at
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>         at
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>         at
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>         at
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>         at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>         at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>         at
> java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>         at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>         at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>         at java.base/java.lang.Thread.run(Thread.java:829)
>
>
> Any suggestions?
>
> > Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 15:58
> geschrieben:
> >
> >
> > Hi JB,
> >
> > I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and
> got the same error.
> >
> > Are there any updates when this might be fixed?
> >
> > Best
> > Gerald
> >
> > > Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37
> geschrieben:
> > >
> > >
> > > Hi,
> > >
> > > That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
> > >
> > > It upgraded to undertow.
> > >
> > > Here, you have two javax.servlet version:
> > > - 3.1.0 coming with pax-web-undertow
> > > - 4.0.0 coming with io.undertow.servlet
> > >
> > > As workaround you can blacklist javax.servlet 3.1.0 coming from
> pax-web-undertow.
> > >
> > > Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x
> version).
> > >
> > > Regards
> > > JB
> > >
> > > > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
> > > >
> > > > Hi All,
> > > > I'm testing karaf 4.3.0 on Windows 10, Java 11.
> > > > I can't install hawtio-core with pax-http-undertow.
> > > >
> > > > It looks like
> > > > org.ops4j.pax.web.pax-web-undertow imports
> javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
> > > > and also imports
> > > > io.undertow.servlet which has a uses of
> javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
> > > >
> > > >
> > > >
> > > > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf |
> ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0
> | Exception caught while executing command
> > > > org.apache.felix.resolver.reason.ReasonException: Uses constraint
> violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow
> [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package
> 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0]
> and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> > > >
> > > > Chain 1:
> > > >  org.ops4j.pax.web.pax-web-undertow
> [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > > >    import:
> (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
> > > >     |
> > > >    export: osgi.wiring.package: javax.servlet
> > > >  javax.servlet-api [javax.servlet-api/3.1.0]
> > > >
> > > > Chain 2:
> > > >  org.ops4j.pax.web.pax-web-undertow
> [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > > >    import:
> (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
> > > >     |
> > > >    export: osgi.wiring.package=io.undertow.servlet;
> uses:=javax.servlet
> > > >  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
> > > >    import:
> (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
> > > >     |
> > > >    export: osgi.wiring.package: javax.servlet
> > > >  javax.servlet-api [javax.servlet-api/4.0.0]
> > > >   at
> org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444)
> ~[?:?]
> > > >   at
> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463)
> ~[?:?]
> > > >   at
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
> > > >   at
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
> > > >   at
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
> ~[?:?]
> > > >   at
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392)
> ~[?:?]
> > > >   at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
> ~[?:?]
> > > >   at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
> ~[?:?]
> > > >   at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> > > >   at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> ~[?:?]
> > > >   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> ~[?:?]
> > > >   at java.lang.Thread.run(Thread.java:834) [?:?]
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > karaf@root()> feature:list --installed
> > > > Name                | Version      | Required | State   |
> Repository               | Description
> > > >
> --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
> > > > wrap                | 2.6.2        | x        | Started |
> standard-4.2.9           | Wrap URL handler
> > > > feature             | 4.3.0        | x        | Started |
> standard-4.3.0           | Features Support
> > > > shell               | 4.3.0        | x        | Started |
> standard-4.3.0           | Karaf Shell
> > > > deployer            | 4.3.0        | x        | Started |
> standard-4.3.0           | Karaf Deployer
> > > > bundle              | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide Bundle support
> > > > config              | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide OSGi ConfigAdmin support
> > > > diagnostic          | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide Diagnostic support
> > > > instance            | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide Instance support
> > > > jaas                | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide JAAS support
> > > > log                 | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide Log support
> > > > package             | 4.3.0        | x        | Started |
> standard-4.3.0           | Package commands and mbeans
> > > > service             | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide Service support
> > > > system              | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide System support
> > > > kar                 | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide KAR (KARaf archive) support
> > > > ssh                 | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide a SSHd server on Karaf
> > > > management          | 4.3.0        | x        | Started |
> standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
> > > > eventadmin          | 4.3.0        | x        | Started |
> standard-4.3.0           | OSGi Event Admin service specification for event-
> > > > scr                 | 4.3.0        |          | Started |
> standard-4.3.0           | Declarative Service support
> > > > wrap                | 2.6.2        | x        | Started |
> standard-4.3.0           | Wrap URL handler
> > > > pax-web-core        | 7.3.9        |          | Started |
> org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
> > > > pax-http            | 7.3.9        |          | Started |
> org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
> > > > undertow            | 2.0.31.Final |          | Started |
> org.ops4j.pax.web-7.3.9  |
> > > > pax-http-undertow   | 7.3.9        | x        | Started |
> org.ops4j.pax.web-7.3.9  |
> > > > jdbc                | 4.3.0        | x        | Started |
> enterprise-4.3.0         | JDBC service and commands
> > > > pax-jdbc-spec       | 1.4.4        |          | Started |
> org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
> > > > pax-jdbc            | 1.4.4        |          | Started |
> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
> > > > pax-jdbc-config     | 1.4.4        |          | Started |
> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
> > > > pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started |
> org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
> > > >
> > > >
> > > >
> > > > -John
>

Karaf 4.3.6 - still unable to install hawtio-core with pax-http-undertow

Posted by Gerald Kallas <ca...@mailbox.org>.
I did add the following lines to the file org.apache.karaf.features.xml

    <blacklistedBundles>
        <Bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</Bundle>
    </blacklistedBundles>

as suggested before running

feature:install pax-http-undertow
feature:install hawtio

The error remains the same.

org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.

Chain 1:
  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
    import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
     |
    export: osgi.wiring.package: javax.servlet
  javax.servlet-api [javax.servlet-api/3.1.0]

Chain 2:
  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.23]
    import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
     |
    export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
  io.undertow.servlet [io.undertow.servlet/2.0.33.Final]
    import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
     |
    export: osgi.wiring.package: javax.servlet
  javax.servlet-api [javax.servlet-api/4.0.0]
        at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2467)
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:462)
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)


Any suggestions?

> Gerald Kallas <ca...@mailbox.org> hat am 09.02.2022 15:58 geschrieben:
> 
>  
> Hi JB,
> 
> I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and got the same error.
> 
> Are there any updates when this might be fixed?
> 
> Best
> Gerald
> 
> > Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37 geschrieben:
> > 
> >  
> > Hi,
> > 
> > That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
> > 
> > It upgraded to undertow.
> > 
> > Here, you have two javax.servlet version:
> > - 3.1.0 coming with pax-web-undertow
> > - 4.0.0 coming with io.undertow.servlet
> > 
> > As workaround you can blacklist javax.servlet 3.1.0 coming from pax-web-undertow.
> > 
> > Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x version).
> > 
> > Regards
> > JB
> > 
> > > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
> > > 
> > > Hi All,
> > > I'm testing karaf 4.3.0 on Windows 10, Java 11.
> > > I can't install hawtio-core with pax-http-undertow.
> > > 
> > > It looks like 
> > > org.ops4j.pax.web.pax-web-undertow imports javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
> > > and also imports
> > > io.undertow.servlet which has a uses of    javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
> > > 
> > > 
> > > 
> > > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf | ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0 | Exception caught while executing command
> > > org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> > > 
> > > Chain 1:
> > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > >    import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
> > >     |
> > >    export: osgi.wiring.package: javax.servlet
> > >  javax.servlet-api [javax.servlet-api/3.1.0]
> > > 
> > > Chain 2:
> > >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> > >    import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
> > >     |
> > >    export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
> > >  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
> > >    import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
> > >     |
> > >    export: osgi.wiring.package: javax.servlet
> > >  javax.servlet-api [javax.servlet-api/4.0.0]
> > > 	at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444) ~[?:?]
> > > 	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463) ~[?:?]
> > > 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
> > > 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
> > > 	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
> > > 	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392) ~[?:?]
> > > 	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
> > > 	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
> > > 	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> > > 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
> > > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
> > > 	at java.lang.Thread.run(Thread.java:834) [?:?]
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > karaf@root()> feature:list --installed
> > > Name                | Version      | Required | State   | Repository               | Description
> > > --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
> > > wrap                | 2.6.2        | x        | Started | standard-4.2.9           | Wrap URL handler
> > > feature             | 4.3.0        | x        | Started | standard-4.3.0           | Features Support
> > > shell               | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Shell
> > > deployer            | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Deployer
> > > bundle              | 4.3.0        | x        | Started | standard-4.3.0           | Provide Bundle support
> > > config              | 4.3.0        | x        | Started | standard-4.3.0           | Provide OSGi ConfigAdmin support
> > > diagnostic          | 4.3.0        | x        | Started | standard-4.3.0           | Provide Diagnostic support
> > > instance            | 4.3.0        | x        | Started | standard-4.3.0           | Provide Instance support
> > > jaas                | 4.3.0        | x        | Started | standard-4.3.0           | Provide JAAS support
> > > log                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide Log support
> > > package             | 4.3.0        | x        | Started | standard-4.3.0           | Package commands and mbeans
> > > service             | 4.3.0        | x        | Started | standard-4.3.0           | Provide Service support
> > > system              | 4.3.0        | x        | Started | standard-4.3.0           | Provide System support
> > > kar                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide KAR (KARaf archive) support
> > > ssh                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide a SSHd server on Karaf
> > > management          | 4.3.0        | x        | Started | standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
> > > eventadmin          | 4.3.0        | x        | Started | standard-4.3.0           | OSGi Event Admin service specification for event-
> > > scr                 | 4.3.0        |          | Started | standard-4.3.0           | Declarative Service support
> > > wrap                | 2.6.2        | x        | Started | standard-4.3.0           | Wrap URL handler
> > > pax-web-core        | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
> > > pax-http            | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
> > > undertow            | 2.0.31.Final |          | Started | org.ops4j.pax.web-7.3.9  |
> > > pax-http-undertow   | 7.3.9        | x        | Started | org.ops4j.pax.web-7.3.9  |
> > > jdbc                | 4.3.0        | x        | Started | enterprise-4.3.0         | JDBC service and commands
> > > pax-jdbc-spec       | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
> > > pax-jdbc            | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
> > > pax-jdbc-config     | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
> > > pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
> > > 
> > > 
> > > 
> > > -John

Re: karaf 4.3.0 - unable to install hawtio-core with pax-http-undertow

Posted by Gerald Kallas <ca...@mailbox.org>.
Hi JB,

I did just test this with a vanilla Karaf 4.3.6 and hawtio 2.14.4 and got the same error.

Are there any updates when this might be fixed?

Best
Gerald

> Jean-Baptiste Onofre <jb...@nanthrax.net> hat am 10.11.2020 05:37 geschrieben:
> 
>  
> Hi,
> 
> That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.
> 
> It upgraded to undertow.
> 
> Here, you have two javax.servlet version:
> - 3.1.0 coming with pax-web-undertow
> - 4.0.0 coming with io.undertow.servlet
> 
> As workaround you can blacklist javax.servlet 3.1.0 coming from pax-web-undertow.
> 
> Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x version).
> 
> Regards
> JB
> 
> > Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
> > 
> > Hi All,
> > I'm testing karaf 4.3.0 on Windows 10, Java 11.
> > I can't install hawtio-core with pax-http-undertow.
> > 
> > It looks like 
> > org.ops4j.pax.web.pax-web-undertow imports javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
> > and also imports
> > io.undertow.servlet which has a uses of    javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
> > 
> > 
> > 
> > 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf | ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0 | Exception caught while executing command
> > org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> > 
> > Chain 1:
> >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> >    import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
> >     |
> >    export: osgi.wiring.package: javax.servlet
> >  javax.servlet-api [javax.servlet-api/3.1.0]
> > 
> > Chain 2:
> >  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
> >    import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
> >     |
> >    export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
> >  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
> >    import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
> >     |
> >    export: osgi.wiring.package: javax.servlet
> >  javax.servlet-api [javax.servlet-api/4.0.0]
> > 	at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444) ~[?:?]
> > 	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463) ~[?:?]
> > 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
> > 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
> > 	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
> > 	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392) ~[?:?]
> > 	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
> > 	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
> > 	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> > 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
> > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
> > 	at java.lang.Thread.run(Thread.java:834) [?:?]
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > karaf@root()> feature:list --installed
> > Name                | Version      | Required | State   | Repository               | Description
> > --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
> > wrap                | 2.6.2        | x        | Started | standard-4.2.9           | Wrap URL handler
> > feature             | 4.3.0        | x        | Started | standard-4.3.0           | Features Support
> > shell               | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Shell
> > deployer            | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Deployer
> > bundle              | 4.3.0        | x        | Started | standard-4.3.0           | Provide Bundle support
> > config              | 4.3.0        | x        | Started | standard-4.3.0           | Provide OSGi ConfigAdmin support
> > diagnostic          | 4.3.0        | x        | Started | standard-4.3.0           | Provide Diagnostic support
> > instance            | 4.3.0        | x        | Started | standard-4.3.0           | Provide Instance support
> > jaas                | 4.3.0        | x        | Started | standard-4.3.0           | Provide JAAS support
> > log                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide Log support
> > package             | 4.3.0        | x        | Started | standard-4.3.0           | Package commands and mbeans
> > service             | 4.3.0        | x        | Started | standard-4.3.0           | Provide Service support
> > system              | 4.3.0        | x        | Started | standard-4.3.0           | Provide System support
> > kar                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide KAR (KARaf archive) support
> > ssh                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide a SSHd server on Karaf
> > management          | 4.3.0        | x        | Started | standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
> > eventadmin          | 4.3.0        | x        | Started | standard-4.3.0           | OSGi Event Admin service specification for event-
> > scr                 | 4.3.0        |          | Started | standard-4.3.0           | Declarative Service support
> > wrap                | 2.6.2        | x        | Started | standard-4.3.0           | Wrap URL handler
> > pax-web-core        | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
> > pax-http            | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
> > undertow            | 2.0.31.Final |          | Started | org.ops4j.pax.web-7.3.9  |
> > pax-http-undertow   | 7.3.9        | x        | Started | org.ops4j.pax.web-7.3.9  |
> > jdbc                | 4.3.0        | x        | Started | enterprise-4.3.0         | JDBC service and commands
> > pax-jdbc-spec       | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
> > pax-jdbc            | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
> > pax-jdbc-config     | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
> > pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
> > 
> > 
> > 
> > -John

Re: karaf 4.3.0 - unable to install hawtio-core with pax-http-undertow

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

That’s related to the Pax Web 7.3 update we did for Karaf 4.3.0.

It upgraded to undertow.

Here, you have two javax.servlet version:
- 3.1.0 coming with pax-web-undertow
- 4.0.0 coming with io.undertow.servlet

As workaround you can blacklist javax.servlet 3.1.0 coming from pax-web-undertow.

Anyway, for Karaf 4.3.1, I will fix that at Pax Web (with new 7.3.x version).

Regards
JB

> Le 9 nov. 2020 à 21:35, John Taylor <jt...@gmail.com> a écrit :
> 
> Hi All,
> I'm testing karaf 4.3.0 on Windows 10, Java 11.
> I can't install hawtio-core with pax-http-undertow.
> 
> It looks like 
> org.ops4j.pax.web.pax-web-undertow imports javax.servlet(version>=3.1.0)(!(version>=5.0.0)))
> and also imports
> io.undertow.servlet which has a uses of    javax.servlet(version>=4.0.0)(!(version>=5.0.0)))
> 
> 
> 
> 2020-11-09T14:03:25,743 | ERROR | Karaf ssh console user karaf | ShellUtil                        | 43 - org.apache.karaf.shell.core - 4.3.0 | Exception caught while executing command
> org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9] because it is exposed to package 'javax.servlet' from resources javax.servlet-api [javax.servlet-api/3.1.0] and javax.servlet-api [javax.servlet-api/4.0.0] via two dependency chains.
> 
> Chain 1:
>  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
>    import: (&(osgi.wiring.package=javax.servlet)(version>=3.1.0)(!(version>=5.0.0)))
>     |
>    export: osgi.wiring.package: javax.servlet
>  javax.servlet-api [javax.servlet-api/3.1.0]
> 
> Chain 2:
>  org.ops4j.pax.web.pax-web-undertow [org.ops4j.pax.web.pax-web-undertow/7.3.9]
>    import: (&(osgi.wiring.package=io.undertow.servlet)(version>=2.0.0)(!(version>=2.1.0)))
>     |
>    export: osgi.wiring.package=io.undertow.servlet; uses:=javax.servlet
>  io.undertow.servlet [io.undertow.servlet/2.0.31.Final]
>    import: (&(osgi.wiring.package=javax.servlet)(version>=4.0.0)(!(version>=5.0.0)))
>     |
>    export: osgi.wiring.package: javax.servlet
>  javax.servlet-api [javax.servlet-api/4.0.0]
> 	at org.apache.felix.resolver.ResolverImpl$UseConstraintError.toException(ResolverImpl.java:2444) ~[?:?]
> 	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:463) ~[?:?]
> 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421) ~[?:?]
> 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) ~[?:?]
> 	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
> 	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392) ~[?:?]
> 	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
> 	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
> 	at java.lang.Thread.run(Thread.java:834) [?:?]
> 
> 
> 
> 
> 
> 
> 
> karaf@root()> feature:list --installed
> Name                | Version      | Required | State   | Repository               | Description
> --------------------+--------------+----------+---------+--------------------------+--------------------------------------------------
> wrap                | 2.6.2        | x        | Started | standard-4.2.9           | Wrap URL handler
> feature             | 4.3.0        | x        | Started | standard-4.3.0           | Features Support
> shell               | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Shell
> deployer            | 4.3.0        | x        | Started | standard-4.3.0           | Karaf Deployer
> bundle              | 4.3.0        | x        | Started | standard-4.3.0           | Provide Bundle support
> config              | 4.3.0        | x        | Started | standard-4.3.0           | Provide OSGi ConfigAdmin support
> diagnostic          | 4.3.0        | x        | Started | standard-4.3.0           | Provide Diagnostic support
> instance            | 4.3.0        | x        | Started | standard-4.3.0           | Provide Instance support
> jaas                | 4.3.0        | x        | Started | standard-4.3.0           | Provide JAAS support
> log                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide Log support
> package             | 4.3.0        | x        | Started | standard-4.3.0           | Package commands and mbeans
> service             | 4.3.0        | x        | Started | standard-4.3.0           | Provide Service support
> system              | 4.3.0        | x        | Started | standard-4.3.0           | Provide System support
> kar                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide KAR (KARaf archive) support
> ssh                 | 4.3.0        | x        | Started | standard-4.3.0           | Provide a SSHd server on Karaf
> management          | 4.3.0        | x        | Started | standard-4.3.0           | Provide a JMX MBeanServer and a set of MBeans in
> eventadmin          | 4.3.0        | x        | Started | standard-4.3.0           | OSGi Event Admin service specification for event-
> scr                 | 4.3.0        |          | Started | standard-4.3.0           | Declarative Service support
> wrap                | 2.6.2        | x        | Started | standard-4.3.0           | Wrap URL handler
> pax-web-core        | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Provide Core pax-web bundles
> pax-http            | 7.3.9        |          | Started | org.ops4j.pax.web-7.3.9  | Implementation of the OSGI HTTP Service
> undertow            | 2.0.31.Final |          | Started | org.ops4j.pax.web-7.3.9  |
> pax-http-undertow   | 7.3.9        | x        | Started | org.ops4j.pax.web-7.3.9  |
> jdbc                | 4.3.0        | x        | Started | enterprise-4.3.0         | JDBC service and commands
> pax-jdbc-spec       | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides OSGi JDBC Service spec
> pax-jdbc            | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Service support
> pax-jdbc-config     | 1.4.4        |          | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Config support
> pax-jdbc-pool-dbcp2 | 1.4.4        | x        | Started | org.ops4j.pax.jdbc-1.4.4 | Provides JDBC Pooling DataSourceFactory
> 
> 
> 
> -John