[ 
https://issues.apache.org/jira/browse/KARAF-3973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15070763#comment-15070763
 ] 

Amichai Rothman commented on KARAF-3973:
----------------------------------------

Here are the errors I found in the karaf log. The last one looks like it's the 
refresh command. After the karaf restart, when my bundle is activated and works 
properly, I still see the first error, but the second and third one are gone 
and all works well.

{quote}

2015-12-24 10:31:27,642 | ERROR | pool-11-thread-1 | Activator                  
      | 212 - org.ops4j.pax.web.pax-web-runti
me - 4.2.3 | Unable to start pax web server: loader constraint violation: when 
resolving method "org.eclipse.jetty.server.Ser
ver.<init>(Lorg/eclipse/jetty/util/thread/ThreadPool;)V" the class loader 
(instance of org/eclipse/osgi/internal/loader/Equin
oxClassLoader) of the current class, 
org/ops4j/pax/web/service/jetty/internal/JettyServerWrapper, and the class 
loader (insta
nce of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's 
defining class, org/eclipse/jetty/server/Server,
 have different Class objects for the type 
org/eclipse/jetty/util/thread/ThreadPool used in the signature
java.lang.LinkageError: loader constraint violation: when resolving method 
"org.eclipse.jetty.server.Server.<init>(Lorg/eclip
se/jetty/util/thread/ThreadPool;)V" the class loader (instance of 
org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the
 current class, org/ops4j/pax/web/service/jetty/internal/JettyServerWrapper, 
and the class loader (instance of org/eclipse/os
gi/internal/loader/EquinoxClassLoader) for the method's defining class, 
org/eclipse/jetty/server/Server, have different Class
 objects for the type org/eclipse/jetty/util/thread/ThreadPool used in the 
signature
        at 
org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.<init>(JettyServerWrapper.java:144)
        at 
org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.<init>(JettyServerImpl.java:90)
        at 
org.ops4j.pax.web.service.jetty.internal.JettyFactoryImpl.createServer(JettyFactoryImpl.java:99)
        at 
org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Stopped.start(ServerControllerImpl.java:380)
        at 
org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.start(ServerControllerImpl.java:71)
        at 
org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Unconfigured.configure(ServerControllerImpl.java:700
)
        at 
org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.configure(ServerControllerImpl.java:87)
        at 
org.ops4j.pax.web.service.internal.Activator.updateController(Activator.java:351)[212:org.ops4j.pax.web.pax-web-ru
ntime:4.2.3]
        at 
org.ops4j.pax.web.service.internal.Activator$3.run(Activator.java:293)[212:org.ops4j.pax.web.pax-web-runtime:4.2.3
]
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_66]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_66]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_66]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_66]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_66]

{quote}


and


{quote}


2015-12-24 10:31:29,165 | ERROR | pool-1-thread-1  | BootFeaturesInstaller      
      | 9 - org.apache.karaf.features.core - 
4.0.3 | Error installing boot features
org.apache.karaf.features.internal.util.MultiException: Error restarting bundles
        at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:844)[9:org.apache.karaf.features.core:4.0
.3]
        at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1079)[9:org.ap
ache.karaf.features.core:4.0.3]
        at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:975)[9:org.apache.k
araf.features.core:4.0.3]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_66]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_66]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_66]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_66]
Caused by: org.osgi.framework.BundleException: Could not resolve module: 
org.eclipse.jetty.websocket.server [196]
  Bundle was not resolved because of a uses contraint violation.
  org.osgi.service.resolver.ResolutionException: Uses constraint violation. 
Unable to resolve resource org.eclipse.jetty.websocket.server [osgi.identity; 
osgi.identity="org.eclipse.jetty.websocket.server"; type="osgi.bundle"; 
version:Version="9.2.10.v20150310"] because it is exposed to package 
'javax.servlet.http' from resources javax.servlet-api [osgi.identity; 
osgi.identity="javax.servlet-api"; type="osgi.bundle"; version:Version="3.1.0"] 
and javax.servlet [osgi.identity; osgi.identity="javax.servlet"; 
type="osgi.bundle"; version:Version="3.0.0.v201112011016"] via two dependency 
chains.

Chain 1:
  org.eclipse.jetty.websocket.server [osgi.identity; 
osgi.identity="org.eclipse.jetty.websocket.server"; type="osgi.bundle"; 
version:Version="9.2.10.v20150310"]
    import: 
(&(osgi.wiring.package=javax.servlet.http)(&(version>=3.1.0)(!(version>=4.0.0))))
     |
    export: osgi.wiring.package: javax.servlet.http
  javax.servlet-api [osgi.identity; osgi.identity="javax.servlet-api"; 
type="osgi.bundle"; version:Version="3.1.0"]

Chain 2:
  org.eclipse.jetty.websocket.server [osgi.identity; 
osgi.identity="org.eclipse.jetty.websocket.server"; type="osgi.bundle"; 
version:Version="9.2.10.v20150310"]
    import: 
(&(osgi.wiring.package=org.eclipse.jetty.util.component)(&(version>=9.0.0)(!(version>=10.0.0))))
     |
    export: osgi.wiring.package=org.eclipse.jetty.util.component; 
uses:=javax.servlet.http
  org.eclipse.jetty.util [osgi.identity; 
osgi.identity="org.eclipse.jetty.util"; type="osgi.bundle"; 
version:Version="9.2.10.v20150310"]
    import: 
(&(osgi.wiring.package=javax.servlet.http)(&(version>=2.6.0)(!(version>=3.2.0))))
     |
    export: osgi.wiring.package: javax.servlet.http
  javax.servlet [osgi.identity; osgi.identity="javax.servlet"; 
type="osgi.bundle"; version:Version="3.0.0.v201112011016"]
        at 
org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at 
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at 
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:412)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1189)[9:org.apache.karaf.features.core:4.0.3]
        at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:836)[9:org.apache.karaf.features.core:4.0.3]
        ... 6 more
Caused by: org.osgi.framework.BundleException: Could not resolve module: 
org.eclipse.jetty.websocket.javax.websocket.server [195]
  Unresolved requirement: Require-Capability: osgi.extender; 
filter:="(osgi.extender=osgi.serviceloader.registrar)"; resolution:="optional"
  Unresolved requirement: Import-Package: 
org.eclipse.jetty.websocket.server.pathmap; version="[9.0.0,10.0.0)"
    -> Export-Package: org.eclipse.jetty.websocket.server.pathmap; 
bundle-symbolic-name="org.eclipse.jetty.websocket.server"; 
bundle-version="9.2.10.v20150310"; version="9.2.10"
       org.eclipse.jetty.websocket.server [196]
         No resolution report for the bundle.  Unresolved requirement: 
Import-Package: org.eclipse.jetty.websocket.server; version="[9.0.0,10.0.0)"
    -> Export-Package: org.eclipse.jetty.websocket.server; 
bundle-symbolic-name="org.eclipse.jetty.websocket.server"; 
bundle-version="9.2.10.v20150310"; version="9.2.10"
  Bundle was not resolved because of a uses contraint violation.
  org.osgi.service.resolver.ResolutionException: Uses constraint violation. 
Unable to resolve resource org.eclipse.jetty.websocket.javax.websocket.server 
[osgi.identity; 
osgi.identity="org.eclipse.jetty.websocket.javax.websocket.server"; 
type="osgi.bundle"; version:Version="9.2.10.v20150310"] because it is exposed 
to package 'javax.servlet.annotation' from resources javax.servlet-api 
[osgi.identity; osgi.identity="javax.servlet-api"; type="osgi.bundle"; 
version:Version="3.1.0"] and javax.servlet [osgi.identity; 
osgi.identity="javax.servlet"; type="osgi.bundle"; 
version:Version="3.0.0.v201112011016"] via two dependency chains.

Chain 1:
  org.eclipse.jetty.websocket.javax.websocket.server [osgi.identity; 
osgi.identity="org.eclipse.jetty.websocket.javax.websocket.server"; 
type="osgi.bundle"; version:Version="9.2.10.v20150310"]
    import: 
(&(osgi.wiring.package=javax.servlet.annotation)(&(version>=3.1.0)(!(version>=4.0.0))))
     |
    export: osgi.wiring.package: javax.servlet.annotation
  javax.servlet-api [osgi.identity; osgi.identity="javax.servlet-api"; 
type="osgi.bundle"; version:Version="3.1.0"]

Chain 2:
  org.eclipse.jetty.websocket.javax.websocket.server [osgi.identity; 
osgi.identity="org.eclipse.jetty.websocket.javax.websocket.server"; 
type="osgi.bundle"; version:Version="9.2.10.v20150310"]
    import: 
(&(osgi.wiring.package=org.eclipse.jetty.util)(&(version>=9.0.0)(!(version>=10.0.0))))
     |
    export: osgi.wiring.package=org.eclipse.jetty.util; uses:=javax.servlet
  org.eclipse.jetty.util [osgi.identity; 
osgi.identity="org.eclipse.jetty.util"; type="osgi.bundle"; 
version:Version="9.2.10.v20150310"]
    import: 
(&(osgi.wiring.package=javax.servlet)(&(version>=2.6.0)(!(version>=3.2.0))))
     |
    export: osgi.wiring.package: javax.servlet; uses:=javax.servlet.annotation
    export: osgi.wiring.package=javax.servlet.annotation
  javax.servlet [osgi.identity; osgi.identity="javax.servlet"; 
type="osgi.bundle"; version:Version="3.0.0.v201112011016"]
        at 
org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at 
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at 
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:412)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1189)[9:org.apache.karaf.features.core:4.0.3]
        at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:836)[9:org.apache.karaf.features.core:4.0.3]
        ... 6 more


{quote}

and

{quote}


2015-12-24 10:32:28,306 | ERROR | nsole user karaf | ShellUtil                  
      | 137 - org.apache.karaf.shell.core - 4.0.3 | Exception caught while 
executing command
org.apache.karaf.shell.support.MultiException: Error restarting bundles:
        Unable to start bundle 11: Could not resolve module: com.myapp.common 
[11]
  Unresolved requirement: Import-Package: javax.xml.bind.annotation

        at 
org.apache.karaf.shell.support.MultiException.throwIf(MultiException.java:61)
        at 
org.apache.karaf.bundle.command.Restart.doExecute(Restart.java:56)[111:org.apache.karaf.bundle.core:4.0.3]
        at 
org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:54)[111:org.apache.karaf.bundle.core:4.0.3]
        at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[137:org.apache.karaf.shell.core:4.0.3]
        at 
org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:270)[137:org.apache.karaf.shell.core:4.0.3]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_66]
Caused by: java.lang.Exception: Unable to start bundle 11: Could not resolve 
module: com.myapp.common [11]
  Unresolved requirement: Import-Package: javax.xml.bind.annotation

        at 
org.apache.karaf.bundle.command.Restart.doExecute(Restart.java:53)[111:org.apache.karaf.bundle.core:4.0.3]
        ... 12 more
Caused by: org.osgi.framework.BundleException: Could not resolve module: 
com.myapp.common [11]
  Unresolved requirement: Import-Package: javax.xml.bind.annotation

        at 
org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at 
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at 
org.apache.karaf.bundle.command.Restart.doExecute(Restart.java:51)[111:org.apache.karaf.bundle.core:4.0.3]
        ... 12 more

{quote}

> Bundles refresh doesn't work (bundles not resolved)
> ---------------------------------------------------
>
>                 Key: KARAF-3973
>                 URL: https://issues.apache.org/jira/browse/KARAF-3973
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 4.0.1
>            Reporter: Amichai Rothman
>            Priority: Critical
>
> I have a bunch of bundles copied into the deploy folder of a fresh karaf 
> 4.0.1 installation. The first time karaf runs, the bundles are not properly 
> resolved, and apparently this has to do with the order in which they are 
> loaded, i.e. if A depends on B and A is loaded first, then when B is loaded 
> it is properly resolved but A never gets resolved. running the refresh 
> command from console does not help either. However, if karaf itself is 
> restarted, then everything is resolved and activated with no problem.
> In Karaf up to 3.0.3 this was not an issue - the moment B was loaded, even on 
> the first time Karaf is run, A would automatically get resolved/activated as 
> well. on 3.0.4 I get a deadlock on startup, so can't really tell if it works 
> (see KARAF-3941). on 4.0.0 I haven't tried. 4.0.1 is the current reported 
> issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to