nexus/atlassian classpath conflict?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

nexus/atlassian classpath conflict?

Russ Tremain-2
Hi,

I've been doing some configuration testing and note the following
regression (see log) starting with 2.8.1-01, when nexus is
co-resident with Confluence 5.4.1 under JDK 7.21 and tomcat 6.3.7.

Nexus 2.8+ starts up okay without confluence in the same container.
Confluence starts up okay in either case.  Confluence is getting
loaded first.

I'm having difficulty understanding why there would be a conflict,
since both webapps have separate classpath loaders.
I see nothing in the tomcat base classes that would cause issue.

I understand that in a production environment, the standard advise is
to run everything in a different container.  However, I am working in
a development environment and I expect classpath isolation to work.

It seems that 2.8 was a significant upgrade.  See below for
third-party war differences; notably, the addition of
org.eclipse.sisu.* classes, which are present in the exception chain
below.

Has anyone run into a similar issue?

thanks,
-Russ


Initializing Sonatype Nexus 2.8.1-01

-------------------------------------------------
2014-10-30 11:29:25,295-0700 INFO  [main]
org.sonatype.nexus.NxApplication - Activating locally installed
plugins...
2014-10-30 11:30:34,159-0700 INFO  [main]
org.sonatype.nexus.kazuki.KazukiPlugin - Kazuki version: 0.1.8
2014-10-30 11:30:41,528-0700 WARN  [main]
org.sonatype.nexus.NxApplication - Plugin manager request "ACTIVATE"
on plugin
"org.sonatype.nexus.plugins:nexus-plugin-console-plugin:2.8.1-01"
FAILED!
The following plugins were processed:
... org.sonatype.nexus.plugins:nexus-webresources-plugin:2.8.1-01 ::
action=ACTIVATE result=ACTIVATED
... org.sonatype.nexus.plugins:nexus-ui-extjs3-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
        Reason: Guice creation errors:

1) Error injecting constructor, java.lang.IllegalStateException:
Stream handler unavailable due to: null
   at
org.sonatype.nexus.guice.StaticWebResourceBundle.<init>(StaticWebResourceBundle.java:40)
   at
org.sonatype.nexus.guice.StaticWebResourceBundle.class(StaticWebResourceBundle.java:37)
   while locating org.sonatype.nexus.guice.StaticWebResourceBundle
   at
org.sonatype.nexus.guice.NexusModules$PluginModule.configure(NexusModules.java:125)
(via modules: org.eclipse.sisu.wire.WireModule ->
org.sonatype.nexus.guice.NexusModules$PluginModule)
   while locating org.sonatype.nexus.web.WebResourceBundle annotated
with @com.google.inject.name.Named(value=static)

1 error
... org.sonatype.nexus.plugins:nexus-content-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
        Reason: Guice creation errors:

1) Error injecting constructor, java.lang.IllegalStateException:
Stream handler unavailable due to: null
   at
org.sonatype.nexus.guice.StaticWebResourceBundle.<init>(StaticWebResourceBundle.java:40)
   at
org.sonatype.nexus.guice.StaticWebResourceBundle.class(StaticWebResourceBundle.java:37)
   while locating org.sonatype.nexus.guice.StaticWebResourceBundle
   at
org.sonatype.nexus.guice.NexusModules$PluginModule.configure(NexusModules.java:125)
(via modules: org.eclipse.sisu.wire.WireModule ->
org.sonatype.nexus.guice.NexusModules$PluginModule)
   while locating org.sonatype.nexus.web.WebResourceBundle annotated
with @com.google.inject.name.Named(value=static)

1 error
... org.sonatype.nexus.plugins:nexus-restlet1x-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
... org.sonatype.nexus.plugins:nexus-plugin-console-plugin:2.8.1-01
:: action=ACTIVATE result=BROKEN

[repeats for each plugin]

----------------
WAR DIFFERENCES:
----------------
### In /tmp/comparejars.3260/nexus-2.7.2.war but not in
/tmp/comparejars.3260/nexus-2.8.1.war:
        ./WEB-INF/lib/goodies-common-1.7.4.jar
        ./WEB-INF/lib/goodies-eventbus-1.7.4.jar
        ./WEB-INF/lib/goodies-i18n-1.7.4.jar
        ./WEB-INF/lib/goodies-inject-1.7.4.jar
        ./WEB-INF/lib/goodies-lifecycle-1.7.4.jar
        ./WEB-INF/lib/goodies-template-1.7.4.jar
        ./WEB-INF/lib/guava-14.0.1.jar
        ./WEB-INF/lib/guice-assistedinject-3.1.4.jar
        ./WEB-INF/lib/guice-multibindings-3.1.4.jar
        ./WEB-INF/lib/guice-servlet-3.1.4.1.jar
        ./WEB-INF/lib/httpclient-4.2.6.jar
        ./WEB-INF/lib/httpcore-4.2.5.jar
        ./WEB-INF/lib/jackson-annotations-2.1.1.jar
        ./WEB-INF/lib/jackson-core-2.1.1.jar
        ./WEB-INF/lib/jackson-core-asl-1.9.12.jar
        ./WEB-INF/lib/jackson-databind-2.1.1.jar
        ./WEB-INF/lib/jackson-mapper-asl-1.9.12.jar
        ./WEB-INF/lib/jcl-over-slf4j-1.7.5.jar
        ./WEB-INF/lib/jul-to-slf4j-1.7.5.jar
        ./WEB-INF/lib/log4j-over-slf4j-1.7.5.jar
        ./WEB-INF/lib/logback-classic-1.0.13.jar
        ./WEB-INF/lib/logback-core-1.0.13.jar
        ./WEB-INF/lib/mime-util-2.1.2.jar
        ./WEB-INF/lib/nexus-plugin-bundle-model-1.1.jar
        ./WEB-INF/lib/sisu-guice-3.1.4.jar
        ./WEB-INF/lib/sisu-inject-bean-2.3.4.jar
        ./WEB-INF/lib/sisu-inject-plexus-2.3.4.jar
        ./WEB-INF/lib/sisu-mailer-1.7.2.jar
        ./WEB-INF/lib/sisu-resource-scanner-1.0.1.jar
        ./WEB-INF/lib/sisu-velocity-1.2.jar
        ./WEB-INF/lib/slf4j-api-1.7.5.jar
        ./WEB-INF/lib/xstream-1.4.6-SONATYPE-02.jar
### In /tmp/comparejars.3260/nexus-2.8.1.war but not in
/tmp/comparejars.3260/nexus-2.7.2.war:
        ./WEB-INF/bundles/bcprov-jdk15on-1.48.jar
        ./WEB-INF/lib/cdi-api-1.0.jar
        ./WEB-INF/lib/goodies-common-1.9.jar
        ./WEB-INF/lib/goodies-eventbus-1.9.jar
        ./WEB-INF/lib/goodies-i18n-1.9.jar
        ./WEB-INF/lib/goodies-inject-1.9.jar
        ./WEB-INF/lib/goodies-lifecycle-1.9.jar
        ./WEB-INF/lib/goodies-template-1.9.jar
        ./WEB-INF/lib/guava-16.0.1.jar
        ./WEB-INF/lib/guice-assistedinject-3.1.10.jar
        ./WEB-INF/lib/guice-multibindings-3.1.10.jar
        ./WEB-INF/lib/guice-servlet-3.1.10.jar
        ./WEB-INF/lib/httpclient-4.3.3.jar
        ./WEB-INF/lib/httpcore-4.3.2.jar
        ./WEB-INF/lib/jackson-annotations-2.3.1.jar
        ./WEB-INF/lib/jackson-core-2.3.1.jar
        ./WEB-INF/lib/jackson-databind-2.3.1.jar
        ./WEB-INF/lib/jcl-over-slf4j-1.7.6.jar
        ./WEB-INF/lib/jsr250-api-1.0.jar
        ./WEB-INF/lib/jul-to-slf4j-1.7.6.jar
        ./WEB-INF/lib/log4j-over-slf4j-1.7.6.jar
        ./WEB-INF/lib/logback-classic-1.1.2.jar
        ./WEB-INF/lib/logback-core-1.1.2.jar
        ./WEB-INF/lib/nexus-plugin-bundle-model-1.2.jar
        ./WEB-INF/lib/org.apache.felix.framework-4.2.1.jar
        ./WEB-INF/lib/org.eclipse.sisu.inject-0.2.0.jar
        ./WEB-INF/lib/org.eclipse.sisu.plexus-0.2.0.jar
        ./WEB-INF/lib/sisu-guice-3.1.10.jar
        ./WEB-INF/lib/sisu-mailer-1.8.jar
        ./WEB-INF/lib/sisu-resource-scanner-1.1.jar
        ./WEB-INF/lib/slf4j-api-1.7.6.jar
        ./WEB-INF/lib/tika-core-1.5.jar
        ./WEB-INF/lib/xstream-1.4.6-SONATYPE-03.jar
### In both /tmp/comparejars.3260/nexus-2.7.2.war and
/tmp/comparejars.3260/nexus-2.8.1.war:
        ./WEB-INF/lib/UserAgentUtils-1.12.jar
        ./WEB-INF/lib/aether-api-1.13.1.jar
        ./WEB-INF/lib/aether-impl-1.13.1.jar
        ./WEB-INF/lib/aether-spi-1.13.1.jar
        ./WEB-INF/lib/aether-util-1.13.1.jar
        ./WEB-INF/lib/annotations-12.0.jar
        ./WEB-INF/lib/aopalliance-1.0.jar
        ./WEB-INF/lib/commons-beanutils-core-1.8.3-SONATYPE.jar
        ./WEB-INF/lib/commons-codec-1.8.jar
        ./WEB-INF/lib/commons-collections-3.2.1.jar
        ./WEB-INF/lib/commons-io-2.4.jar
        ./WEB-INF/lib/commons-lang-2.6.jar
        ./WEB-INF/lib/ehcache-core-2.5.1.jar
        ./WEB-INF/lib/gossip-bootstrap-1.8.jar
        ./WEB-INF/lib/gossip-support-1.8.jar
        ./WEB-INF/lib/javax.inject-1.jar
        ./WEB-INF/lib/joda-time-2.2.jar
        ./WEB-INF/lib/jsoup-1.7.2.jar
        ./WEB-INF/lib/jsr305-2.0.1.jar
        ./WEB-INF/lib/mail-1.4.7.jar
        ./WEB-INF/lib/maven-model-3.0.5.jar
        ./WEB-INF/lib/maven-repository-metadata-3.0.5.jar
        ./WEB-INF/lib/metrics-annotation-2.2.0.jar
        ./WEB-INF/lib/metrics-core-2.2.0.jar
        ./WEB-INF/lib/metrics-guice-2.2.0.jar
        ./WEB-INF/lib/metrics-httpclient-2.2.0.jar
        ./WEB-INF/lib/metrics-logback-2.2.0.jar
        ./WEB-INF/lib/metrics-servlet-2.2.0.jar
        ./WEB-INF/lib/metrics-web-2.2.0.jar
        ./WEB-INF/lib/plexus-cipher-1.7.jar
        ./WEB-INF/lib/plexus-classworlds-2.4.jar
        ./WEB-INF/lib/plexus-component-annotations-1.5.5.jar
        ./WEB-INF/lib/plexus-interpolation-1.16.jar
        ./WEB-INF/lib/plexus-slf4j-logging-1.1.jar
        ./WEB-INF/lib/plexus-utils-3.0.10.jar
        ./WEB-INF/lib/shiro-core-1.2.2.jar
        ./WEB-INF/lib/shiro-ehcache-1.2.2.jar
        ./WEB-INF/lib/shiro-guice-1.2.2.jar
        ./WEB-INF/lib/shiro-web-1.2.2.jar
        ./WEB-INF/lib/statemap-6.0.1-java.jar
        ./WEB-INF/lib/velocity-1.7.jar
        ./WEB-INF/lib/xmlpull-1.1.3.1.jar
        ./WEB-INF/lib/xpp3_min-1.1.4c.jar


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: nexus/atlassian classpath conflict?

Stuart McCulloch-2
The "Stream handler unavailable due to: message comes from Apache Felix, which is now used inside Nexus 2.8.

Specifically this message comes from the URLHandlersStreamHandlerProxy that Felix registers with the JVM via URL’s URLStreamHandlerFactory - unfortunately due to an old design decision in the JVM, the URLStreamHandlerFactory is a static across the whole process. I believe that Confluence also embeds an OSGi runtime, which means you are ending up with two competing frameworks fighting to control the URLStreamHandlerFactory static setting. Note that Apache Felix needs to install its handler to support “bundle:” URL resources, which are returned when searching for resources inside Apache Felix such as in the StaticWebResourceBundle.

Since Confluence always starts first, it gets first dibs at the URLStreamHandlerFactory so always starts ok - when you then start Nexus it finds the other application has taken over the URLStreamHandlerFactory which is why you then get errors from StaticWebResourceBundle.

The recommended solution is to use the bundle distribution rather than the WAR; the bundle distribution has numerous advantages over the WAR such as easier to get up and running, better use of system resources, ability to install as a service.

On Thursday, 30 October 2014 at 20:11, Russ Tremain wrote:

Hi,

I've been doing some configuration testing and note the following
regression (see log) starting with 2.8.1-01, when nexus is
co-resident with Confluence 5.4.1 under JDK 7.21 and tomcat 6.3.7.

Nexus 2.8+ starts up okay without confluence in the same container.
Confluence starts up okay in either case. Confluence is getting
loaded first.

I'm having difficulty understanding why there would be a conflict,
since both webapps have separate classpath loaders.
I see nothing in the tomcat base classes that would cause issue.

I understand that in a production environment, the standard advise is
to run everything in a different container. However, I am working in
a development environment and I expect classpath isolation to work.

It seems that 2.8 was a significant upgrade. See below for
third-party war differences; notably, the addition of
org.eclipse.sisu.* classes, which are present in the exception chain
below.

Has anyone run into a similar issue?

thanks,
-Russ


Initializing Sonatype Nexus 2.8.1-01

-------------------------------------------------
2014-10-30 11:29:25,295-0700 INFO [main]
org.sonatype.nexus.NxApplication - Activating locally installed
plugins...
2014-10-30 11:30:34,159-0700 INFO [main]
org.sonatype.nexus.kazuki.KazukiPlugin - Kazuki version: 0.1.8
2014-10-30 11:30:41,528-0700 WARN [main]
org.sonatype.nexus.NxApplication - Plugin manager request "ACTIVATE"
on plugin
"org.sonatype.nexus.plugins:nexus-plugin-console-plugin:2.8.1-01"
FAILED!
The following plugins were processed:
... org.sonatype.nexus.plugins:nexus-webresources-plugin:2.8.1-01 ::
action=ACTIVATE result=ACTIVATED
... org.sonatype.nexus.plugins:nexus-ui-extjs3-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
Reason: Guice creation errors:

1) Error injecting constructor, java.lang.IllegalStateException:
Stream handler unavailable due to: null
at
org.sonatype.nexus.guice.StaticWebResourceBundle.<init>(StaticWebResourceBundle.java:40)
at
org.sonatype.nexus.guice.StaticWebResourceBundle.class(StaticWebResourceBundle.java:37)
while locating org.sonatype.nexus.guice.StaticWebResourceBundle
at
org.sonatype.nexus.guice.NexusModules$PluginModule.configure(NexusModules.java:125)
(via modules: org.eclipse.sisu.wire.WireModule ->
org.sonatype.nexus.guice.NexusModules$PluginModule)
while locating org.sonatype.nexus.web.WebResourceBundle annotated
with @com.google.inject.name.Named(value=static)

1 error
... org.sonatype.nexus.plugins:nexus-content-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
Reason: Guice creation errors:

1) Error injecting constructor, java.lang.IllegalStateException:
Stream handler unavailable due to: null
at
org.sonatype.nexus.guice.StaticWebResourceBundle.<init>(StaticWebResourceBundle.java:40)
at
org.sonatype.nexus.guice.StaticWebResourceBundle.class(StaticWebResourceBundle.java:37)
while locating org.sonatype.nexus.guice.StaticWebResourceBundle
at
org.sonatype.nexus.guice.NexusModules$PluginModule.configure(NexusModules.java:125)
(via modules: org.eclipse.sisu.wire.WireModule ->
org.sonatype.nexus.guice.NexusModules$PluginModule)
while locating org.sonatype.nexus.web.WebResourceBundle annotated
with @com.google.inject.name.Named(value=static)

1 error
... org.sonatype.nexus.plugins:nexus-restlet1x-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
... org.sonatype.nexus.plugins:nexus-plugin-console-plugin:2.8.1-01
:: action=ACTIVATE result=BROKEN

[repeats for each plugin]

----------------
WAR DIFFERENCES:
----------------
### In /tmp/comparejars.3260/nexus-2.7.2.war but not in
/tmp/comparejars.3260/nexus-2.8.1.war:
./WEB-INF/lib/goodies-common-1.7.4.jar
./WEB-INF/lib/goodies-eventbus-1.7.4.jar
./WEB-INF/lib/goodies-i18n-1.7.4.jar
./WEB-INF/lib/goodies-inject-1.7.4.jar
./WEB-INF/lib/goodies-lifecycle-1.7.4.jar
./WEB-INF/lib/goodies-template-1.7.4.jar
./WEB-INF/lib/guava-14.0.1.jar
./WEB-INF/lib/guice-assistedinject-3.1.4.jar
./WEB-INF/lib/guice-multibindings-3.1.4.jar
./WEB-INF/lib/guice-servlet-3.1.4.1.jar
./WEB-INF/lib/httpclient-4.2.6.jar
./WEB-INF/lib/httpcore-4.2.5.jar
./WEB-INF/lib/jackson-annotations-2.1.1.jar
./WEB-INF/lib/jackson-core-2.1.1.jar
./WEB-INF/lib/jackson-core-asl-1.9.12.jar
./WEB-INF/lib/jackson-databind-2.1.1.jar
./WEB-INF/lib/jackson-mapper-asl-1.9.12.jar
./WEB-INF/lib/jcl-over-slf4j-1.7.5.jar
./WEB-INF/lib/jul-to-slf4j-1.7.5.jar
./WEB-INF/lib/log4j-over-slf4j-1.7.5.jar
./WEB-INF/lib/logback-classic-1.0.13.jar
./WEB-INF/lib/logback-core-1.0.13.jar
./WEB-INF/lib/mime-util-2.1.2.jar
./WEB-INF/lib/nexus-plugin-bundle-model-1.1.jar
./WEB-INF/lib/sisu-guice-3.1.4.jar
./WEB-INF/lib/sisu-inject-bean-2.3.4.jar
./WEB-INF/lib/sisu-inject-plexus-2.3.4.jar
./WEB-INF/lib/sisu-mailer-1.7.2.jar
./WEB-INF/lib/sisu-resource-scanner-1.0.1.jar
./WEB-INF/lib/sisu-velocity-1.2.jar
./WEB-INF/lib/slf4j-api-1.7.5.jar
./WEB-INF/lib/xstream-1.4.6-SONATYPE-02.jar
### In /tmp/comparejars.3260/nexus-2.8.1.war but not in
/tmp/comparejars.3260/nexus-2.7.2.war:
./WEB-INF/bundles/bcprov-jdk15on-1.48.jar
./WEB-INF/lib/cdi-api-1.0.jar
./WEB-INF/lib/goodies-common-1.9.jar
./WEB-INF/lib/goodies-eventbus-1.9.jar
./WEB-INF/lib/goodies-i18n-1.9.jar
./WEB-INF/lib/goodies-inject-1.9.jar
./WEB-INF/lib/goodies-lifecycle-1.9.jar
./WEB-INF/lib/goodies-template-1.9.jar
./WEB-INF/lib/guava-16.0.1.jar
./WEB-INF/lib/guice-assistedinject-3.1.10.jar
./WEB-INF/lib/guice-multibindings-3.1.10.jar
./WEB-INF/lib/guice-servlet-3.1.10.jar
./WEB-INF/lib/httpclient-4.3.3.jar
./WEB-INF/lib/httpcore-4.3.2.jar
./WEB-INF/lib/jackson-annotations-2.3.1.jar
./WEB-INF/lib/jackson-core-2.3.1.jar
./WEB-INF/lib/jackson-databind-2.3.1.jar
./WEB-INF/lib/jcl-over-slf4j-1.7.6.jar
./WEB-INF/lib/jsr250-api-1.0.jar
./WEB-INF/lib/jul-to-slf4j-1.7.6.jar
./WEB-INF/lib/log4j-over-slf4j-1.7.6.jar
./WEB-INF/lib/logback-classic-1.1.2.jar
./WEB-INF/lib/logback-core-1.1.2.jar
./WEB-INF/lib/nexus-plugin-bundle-model-1.2.jar
./WEB-INF/lib/org.apache.felix.framework-4.2.1.jar
./WEB-INF/lib/org.eclipse.sisu.inject-0.2.0.jar
./WEB-INF/lib/org.eclipse.sisu.plexus-0.2.0.jar
./WEB-INF/lib/sisu-guice-3.1.10.jar
./WEB-INF/lib/sisu-mailer-1.8.jar
./WEB-INF/lib/sisu-resource-scanner-1.1.jar
./WEB-INF/lib/slf4j-api-1.7.6.jar
./WEB-INF/lib/tika-core-1.5.jar
./WEB-INF/lib/xstream-1.4.6-SONATYPE-03.jar
### In both /tmp/comparejars.3260/nexus-2.7.2.war and
/tmp/comparejars.3260/nexus-2.8.1.war:
./WEB-INF/lib/UserAgentUtils-1.12.jar
./WEB-INF/lib/aether-api-1.13.1.jar
./WEB-INF/lib/aether-impl-1.13.1.jar
./WEB-INF/lib/aether-spi-1.13.1.jar
./WEB-INF/lib/aether-util-1.13.1.jar
./WEB-INF/lib/annotations-12.0.jar
./WEB-INF/lib/aopalliance-1.0.jar
./WEB-INF/lib/commons-beanutils-core-1.8.3-SONATYPE.jar
./WEB-INF/lib/commons-codec-1.8.jar
./WEB-INF/lib/commons-collections-3.2.1.jar
./WEB-INF/lib/commons-io-2.4.jar
./WEB-INF/lib/commons-lang-2.6.jar
./WEB-INF/lib/ehcache-core-2.5.1.jar
./WEB-INF/lib/gossip-bootstrap-1.8.jar
./WEB-INF/lib/gossip-support-1.8.jar
./WEB-INF/lib/javax.inject-1.jar
./WEB-INF/lib/joda-time-2.2.jar
./WEB-INF/lib/jsoup-1.7.2.jar
./WEB-INF/lib/jsr305-2.0.1.jar
./WEB-INF/lib/mail-1.4.7.jar
./WEB-INF/lib/maven-model-3.0.5.jar
./WEB-INF/lib/maven-repository-metadata-3.0.5.jar
./WEB-INF/lib/metrics-annotation-2.2.0.jar
./WEB-INF/lib/metrics-core-2.2.0.jar
./WEB-INF/lib/metrics-guice-2.2.0.jar
./WEB-INF/lib/metrics-httpclient-2.2.0.jar
./WEB-INF/lib/metrics-logback-2.2.0.jar
./WEB-INF/lib/metrics-servlet-2.2.0.jar
./WEB-INF/lib/metrics-web-2.2.0.jar
./WEB-INF/lib/plexus-cipher-1.7.jar
./WEB-INF/lib/plexus-classworlds-2.4.jar
./WEB-INF/lib/plexus-component-annotations-1.5.5.jar
./WEB-INF/lib/plexus-interpolation-1.16.jar
./WEB-INF/lib/plexus-slf4j-logging-1.1.jar
./WEB-INF/lib/plexus-utils-3.0.10.jar
./WEB-INF/lib/shiro-core-1.2.2.jar
./WEB-INF/lib/shiro-ehcache-1.2.2.jar
./WEB-INF/lib/shiro-guice-1.2.2.jar
./WEB-INF/lib/shiro-web-1.2.2.jar
./WEB-INF/lib/statemap-6.0.1-java.jar
./WEB-INF/lib/velocity-1.7.jar
./WEB-INF/lib/xmlpull-1.1.3.1.jar
./WEB-INF/lib/xpp3_min-1.1.4c.jar


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: nexus/atlassian classpath conflict?

Russ Tremain-2
Re: [nexus-user] nexus/atlassian classpath conflict?
Thanks Stuart - a very clear explanation for a very sad situation.
-Russ

At 9:48 PM +0000 10/30/14, Stuart McCulloch wrote:
The "Stream handler unavailable due to:" message comes from Apache Felix, which is now used inside Nexus 2.8.

Specifically this message comes from the URLHandlersStreamHandlerProxy that Felix registers with the JVM via URL's URLStreamHandlerFactory - unfortunately due to an old design decision in the JVM, the URLStreamHandlerFactory is a static across the whole process. I believe that Confluence also embeds an OSGi runtime, which means you are ending up with two competing frameworks fighting to control the URLStreamHandlerFactory static setting. Note that Apache Felix needs to install its handler to support "bundle:" URL resources, which are returned when searching for resources inside Apache Felix such as in the StaticWebResourceBundle.

Since Confluence always starts first, it gets first dibs at the URLStreamHandlerFactory so always starts ok - when you then start Nexus it finds the other application has taken over the URLStreamHandlerFactory which is why you then get errors from StaticWebResourceBundle.

The recommended solution is to use the bundle distribution rather than the WAR; the bundle distribution has numerous advantages over the WAR such as easier to get up and running, better use of system resources, ability to install as a service.
On Thursday, 30 October 2014 at 20:11, Russ Tremain wrote:
Hi,

I've been doing some configuration testing and note the following
regression (see log) starting with 2.8.1-01, when nexus is
co-resident with Confluence 5.4.1 under JDK 7.21 and tomcat 6.3.7.

Nexus 2.8+ starts up okay without confluence in the same container.
Confluence starts up okay in either case. Confluence is getting
loaded first.

I'm having difficulty understanding why there would be a conflict,
since both webapps have separate classpath loaders.
I see nothing in the tomcat base classes that would cause issue.

I understand that in a production environment, the standard advice is
to run everything in a different container. However, I am working in
a development environment and I expect classpath isolation to work.

It seems that 2.8 was a significant upgrade. See below for
third-party war differences; notably, the addition of
org.eclipse.sisu.* classes, which are present in the exception chain
below.

Has anyone run into a similar issue?

thanks,
-Russ


Initializing Sonatype Nexus 2.8.1-01

-------------------------------------------------
2014-10-30 11:29:25,295-0700 INFO [main]
org.sonatype.nexus.NxApplication - Activating locally installed
plugins...
2014-10-30 11:30:34,159-0700 INFO [main]
org.sonatype.nexus.kazuki.KazukiPlugin - Kazuki version: 0.1.8
2014-10-30 11:30:41,528-0700 WARN [main]
org.sonatype.nexus.NxApplication - Plugin manager request "ACTIVATE"
on plugin
"org.sonatype.nexus.plugins:nexus-plugin-console-plugin:2.8.1-01"
FAILED!
The following plugins were processed:
... org.sonatype.nexus.plugins:nexus-webresources-plugin:2.8.1-01 ::
action=ACTIVATE result=ACTIVATED
... org.sonatype.nexus.plugins:nexus-ui-extjs3-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
Reason: Guice creation errors:

1) Error injecting constructor, java.lang.IllegalStateException:
Stream handler unavailable due to: null
at
org.sonatype.nexus.guice.StaticWebResourceBundle.<init>(StaticWebResourceBundle.java:40)
at
org.sonatype.nexus.guice.StaticWebResourceBundle.class(StaticWebResourceBundle.java:37)
while locating org.sonatype.nexus.guice.StaticWebResourceBundle
at
org.sonatype.nexus.guice.NexusModules$PluginModule.configure(NexusModules.java:125)
(via modules: org.eclipse.sisu.wire.WireModule ->
org.sonatype.nexus.guice.NexusModules$PluginModule)
while locating org.sonatype.nexus.web.WebResourceBundle annotated
with @com.google.inject.name.Named(value=static)

1 error
... org.sonatype.nexus.plugins:nexus-content-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
Reason: Guice creation errors:

1) Error injecting constructor, java.lang.IllegalStateException:
Stream handler unavailable due to: null
at
org.sonatype.nexus.guice.StaticWebResourceBundle.<init>(StaticWebResourceBundle.java:40)
at
org.sonatype.nexus.guice.StaticWebResourceBundle.class(StaticWebResourceBundle.java:37)
while locating org.sonatype.nexus.guice.StaticWebResourceBundle
at
org.sonatype.nexus.guice.NexusModules$PluginModule.configure(NexusModules.java:125)
(via modules: org.eclipse.sisu.wire.WireModule ->
org.sonatype.nexus.guice.NexusModules$PluginModule)
while locating org.sonatype.nexus.web.WebResourceBundle annotated
with @com.google.inject.name.Named(value=static)

1 error
... org.sonatype.nexus.plugins:nexus-restlet1x-plugin:2.8.1-01 ::
action=ACTIVATE result=BROKEN
... org.sonatype.nexus.plugins:nexus-plugin-console-plugin:2.8.1-01
:: action=ACTIVATE result=BROKEN

[repeats for each plugin]

----------------
WAR DIFFERENCES:
----------------
### In /tmp/comparejars.3260/nexus-2.7.2.war but not in
/tmp/comparejars.3260/nexus-2.8.1.war:
        ./WEB-INF/lib/goodies-common-1.7.4.jar
        ./WEB-INF/lib/goodies-eventbus-1.7.4.jar
        ./WEB-INF/lib/goodies-i18n-1.7.4.jar
        ./WEB-INF/lib/goodies-inject-1.7.4.jar
        ./WEB-INF/lib/goodies-lifecycle-1.7.4.jar
        ./WEB-INF/lib/goodies-template-1.7.4.jar
        ./WEB-INF/lib/guava-14.0.1.jar
        ./WEB-INF/lib/guice-assistedinject-3.1.4.jar
        ./WEB-INF/lib/guice-multibindings-3.1.4.jar
        ./WEB-INF/lib/guice-servlet-3.1.4.1.jar
        ./WEB-INF/lib/httpclient-4.2.6.jar
        ./WEB-INF/lib/httpcore-4.2.5.jar
        ./WEB-INF/lib/jackson-annotations-2.1.1.jar
        ./WEB-INF/lib/jackson-core-2.1.1.jar
        ./WEB-INF/lib/jackson-core-asl-1.9.12.jar
        ./WEB-INF/lib/jackson-databind-2.1.1.jar
        ./WEB-INF/lib/jackson-mapper-asl-1.9.12.jar
        ./WEB-INF/lib/jcl-over-slf4j-1.7.5.jar
        ./WEB-INF/lib/jul-to-slf4j-1.7.5.jar
        ./WEB-INF/lib/log4j-over-slf4j-1.7.5.jar
        ./WEB-INF/lib/logback-classic-1.0.13.jar
        ./WEB-INF/lib/logback-core-1.0.13.jar
        ./WEB-INF/lib/mime-util-2.1.2.jar
        ./WEB-INF/lib/nexus-plugin-bundle-model-1.1.jar
        ./WEB-INF/lib/sisu-guice-3.1.4.jar
        ./WEB-INF/lib/sisu-inject-bean-2.3.4.jar
        ./WEB-INF/lib/sisu-inject-plexus-2.3.4.jar
        ./WEB-INF/lib/sisu-mailer-1.7.2.jar
        ./WEB-INF/lib/sisu-resource-scanner-1.0.1.jar
        ./WEB-INF/lib/sisu-velocity-1.2.jar
        ./WEB-INF/lib/slf4j-api-1.7.5.jar
        ./WEB-INF/lib/xstream-1.4.6-SONATYPE-02.jar
### In /tmp/comparejars.3260/nexus-2.8.1.war but not in
/tmp/comparejars.3260/nexus-2.7.2.war:
        ./WEB-INF/bundles/bcprov-jdk15on-1.48.jar
        ./WEB-INF/lib/cdi-api-1.0.jar
        ./WEB-INF/lib/goodies-common-1.9.jar
        ./WEB-INF/lib/goodies-eventbus-1.9.jar
        ./WEB-INF/lib/goodies-i18n-1.9.jar
        ./WEB-INF/lib/goodies-inject-1.9.jar
        ./WEB-INF/lib/goodies-lifecycle-1.9.jar
        ./WEB-INF/lib/goodies-template-1.9.jar
        ./WEB-INF/lib/guava-16.0.1.jar
        ./WEB-INF/lib/guice-assistedinject-3.1.10.jar
        ./WEB-INF/lib/guice-multibindings-3.1.10.jar
        ./WEB-INF/lib/guice-servlet-3.1.10.jar
        ./WEB-INF/lib/httpclient-4.3.3.jar
        ./WEB-INF/lib/httpcore-4.3.2.jar
        ./WEB-INF/lib/jackson-annotations-2.3.1.jar
        ./WEB-INF/lib/jackson-core-2.3.1.jar
        ./WEB-INF/lib/jackson-databind-2.3.1.jar
        ./WEB-INF/lib/jcl-over-slf4j-1.7.6.jar
        ./WEB-INF/lib/jsr250-api-1.0.jar
        ./WEB-INF/lib/jul-to-slf4j-1.7.6.jar
        ./WEB-INF/lib/log4j-over-slf4j-1.7.6.jar
        ./WEB-INF/lib/logback-classic-1.1.2.jar
        ./WEB-INF/lib/logback-core-1.1.2.jar
        ./WEB-INF/lib/nexus-plugin-bundle-model-1.2.jar
        ./WEB-INF/lib/org.apache.felix.framework-4.2.1.jar
        ./WEB-INF/lib/org.eclipse.sisu.inject-0.2.0.jar
        ./WEB-INF/lib/org.eclipse.sisu.plexus-0.2.0.jar
        ./WEB-INF/lib/sisu-guice-3.1.10.jar
        ./WEB-INF/lib/sisu-mailer-1.8.jar
        ./WEB-INF/lib/sisu-resource-scanner-1.1.jar
        ./WEB-INF/lib/slf4j-api-1.7.6.jar
        ./WEB-INF/lib/tika-core-1.5.jar
        ./WEB-INF/lib/xstream-1.4.6-SONATYPE-03.jar
### In both /tmp/comparejars.3260/nexus-2.7.2.war and
/tmp/comparejars.3260/nexus-2.8.1.war:
        ./WEB-INF/lib/UserAgentUtils-1.12.jar
        ./WEB-INF/lib/aether-api-1.13.1.jar
        ./WEB-INF/lib/aether-impl-1.13.1.jar
        ./WEB-INF/lib/aether-spi-1.13.1.jar
        ./WEB-INF/lib/aether-util-1.13.1.jar
        ./WEB-INF/lib/annotations-12.0.jar
        ./WEB-INF/lib/aopalliance-1.0.jar
        ./WEB-INF/lib/commons-beanutils-core-1.8.3-SONATYPE.jar
        ./WEB-INF/lib/commons-codec-1.8.jar
        ./WEB-INF/lib/commons-collections-3.2.1.jar
        ./WEB-INF/lib/commons-io-2.4.jar
        ./WEB-INF/lib/commons-lang-2.6.jar
        ./WEB-INF/lib/ehcache-core-2.5.1.jar
        ./WEB-INF/lib/gossip-bootstrap-1.8.jar
        ./WEB-INF/lib/gossip-support-1.8.jar
        ./WEB-INF/lib/javax.inject-1.jar
        ./WEB-INF/lib/joda-time-2.2.jar
        ./WEB-INF/lib/jsoup-1.7.2.jar
        ./WEB-INF/lib/jsr305-2.0.1.jar
        ./WEB-INF/lib/mail-1.4.7.jar
        ./WEB-INF/lib/maven-model-3.0.5.jar
        ./WEB-INF/lib/maven-repository-metadata-3.0.5.jar
        ./WEB-INF/lib/metrics-annotation-2.2.0.jar
        ./WEB-INF/lib/metrics-core-2.2.0.jar
        ./WEB-INF/lib/metrics-guice-2.2.0.jar
        ./WEB-INF/lib/metrics-httpclient-2.2.0.jar
        ./WEB-INF/lib/metrics-logback-2.2.0.jar
        ./WEB-INF/lib/metrics-servlet-2.2.0.jar
        ./WEB-INF/lib/metrics-web-2.2.0.jar
        ./WEB-INF/lib/plexus-cipher-1.7.jar
        ./WEB-INF/lib/plexus-classworlds-2.4.jar
        ./WEB-INF/lib/plexus-component-annotations-1.5.5.jar
        ./WEB-INF/lib/plexus-interpolation-1.16.jar
        ./WEB-INF/lib/plexus-slf4j-logging-1.1.jar
        ./WEB-INF/lib/plexus-utils-3.0.10.jar
        ./WEB-INF/lib/shiro-core-1.2.2.jar
        ./WEB-INF/lib/shiro-ehcache-1.2.2.jar
        ./WEB-INF/lib/shiro-guice-1.2.2.jar
        ./WEB-INF/lib/shiro-web-1.2.2.jar
        ./WEB-INF/lib/statemap-6.0.1-java.jar
        ./WEB-INF/lib/velocity-1.7.jar
        ./WEB-INF/lib/xmlpull-1.1.3.1.jar
        ./WEB-INF/lib/xpp3_min-1.1.4c.jar


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]