Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail

Pages

Sunday, December 09, 2012

JBoss 7.1.1 + GeoServer 2.2.2

I'm deploying GeoServer 2.2.2 into JBoss 7.1.1 and there are not many hint around on how to solve some issues.

If you download the WAR version of GeoServer and just deploy it into the standalone/deployments folders you get the following errors:



14:47:26,944 ERROR [stderr] (MSC service thread 1-5) java.lang.NoClassDefFoundError: com/sun/imageio/plugins/common/BogusColorSpace

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi.onRegistration(TIFFImageReaderSpi.java:168)

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.SubRegistry.registerServiceProvider(ServiceRegistry.java:698)

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.ServiceRegistry.registerServiceProvider(ServiceRegistry.java:285)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:191)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.(IIORegistry.java:121)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:142)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.geoserver.GeoserverInitStartupListener.contextDestroyed(GeoserverInitStartupListener.java:236)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3489)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3999)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.start(StandardContext.java:3917)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at java.lang.Thread.run(Thread.java:662)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5) Caused by: java.lang.ClassNotFoundException: com.sun.imageio.plugins.common.BogusColorSpace from [Module "deployment.geoserver.war:main" from Service Module Loader]

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     ... 16 more

14:47:27,006 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.web.deployment.default-host./geoserver: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./geoserver: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_35]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]



To solve the problem you have to  create two files:
jboss-classloading.xml

<classloading xmlns="urn:jboss:classloading:1.0"
name="geoserver.war"
domain="GeoServerDomain"
export-all="NON_EMPTY"
import-all="true">
</classloading>


jboss-deployment-structure.xml

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
    <deployment>
        <dependencies>
            <system>
                <paths>
                    <path name="com/sun/imageio/spi"/>
                    <path name="com/sun/imageio/plugins/common"/>
                </paths>
            </system>
        </dependencies>
    </deployment>
</jboss-deployment-structure>


These files have to be added inside the WAR in the \WEB-INF\

This solves the problem and you get a nice and working GeoServer inside the JBoss application server.

4 commenti:

mschwery said...

I did that but I am getting an "Message: Unexpected content of type 'element start' named '{urn:jboss:deployment-structure:1.1}path'" error

Unknown said...

Sorry there is a typo in the XML code posted it should read:
<path name="com/sun/imageio/spi"/>
<path name="com/sun/imageio/plugins/common"/>

Unknown said...

Fixed also in the post

Unknown said...

Thanks!
This still works like a charm for "JBoss 7.1.1 + GeoServer 2.7.2".