Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail

Pages

Showing posts with label JBoss. Show all posts
Showing posts with label JBoss. Show all posts

Wednesday, December 11, 2013

JBoss 7.1.1 + GeoServer 2.2.5: logging

To enable correct logging of GeoServer in a JBoss 7.1.1 installation we'll need to modify the previously defined jboss-deployment-structure.xml


<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
    <deployment>
        <exclusions>
            <module name="org.apache.log4j" />
            <module name="org.slf4j" />
        </exclusions>
        <dependencies>
            <system>
                <paths>
                    <path name="com/sun/imageio/spi"/>
                    <path name="com/sun/imageio/plugins/common"/>
                </paths>
            </system>
            <module name="com.oracle" />
            <module name="org.jboss.ironjacamar.jdbcadapters" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>


Than you need to set the following jvm-option in the host.xml file: GEOSERVER_LOG_LOCATION


 <server name="geo1" group="geo-server-group" auto-start="true">
            <jvm name="default">
                <heap size="128m" max-size="512m"/>
                 <jvm-options>
                    <option value="-DGEOSERVER_DATA_DIR=/home/jbossas/geoserver_data,-DGEOSERVER_LOG_LOCATION=/var/log/jboss-as/geoserver.log"/>
                </jvm-options>
            </jvm>
        </server>

In the example you also see that is possible to define a data dir in the same way.

Monday, March 18, 2013

GeoServer 2.2.5 + JBoss 7.1.1 and Oracle

As I posted some time ago, I'm using GeoServer version 2.2.5 on a JBoss 7.1.1 installation; now I'm working with an Oracle Database so I've added the Oracle extension. And added it in the "$WAR/WEB-INF/lib/" the jar that is downloaded as a separate package (mind to download the same version for the GeoServer you are using).

I had this problem accessing oracle tables:


09:23:34,911 ERROR [org.geoserver.ows] (http--10.20.1.50-8280-17) : java.lang.NoClassDefFoundError: oracle/jdbc/OracleConnection
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:544) [gt-jdbc-oracle-8.7.jar:]
at org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:517) [gt-jdbc-oracle-8.7.jar:]
at org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:3168) [gt-jdbc-8.7.jar:]
at org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:3147) [gt-jdbc-8.7.jar:]
at org.geotools.jdbc.JDBCDataStore.selectAggregateSQLPS(JDBCDataStore.java:3372) [gt-jdbc-8.7.jar:]
at org.geotools.jdbc.JDBCDataStore.getAggregateValue(JDBCDataStore.java:1292) [gt-jdbc-8.7.jar:]
at org.geotools.jdbc.JDBCDataStore.getCount(JDBCDataStore.java:1250) [gt-jdbc-8.7.jar:]
at org.geotools.jdbc.JDBCFeatureSource.getCountInternal(JDBCFeatureSource.java:432) [gt-jdbc-8.7.jar:]
at org.geotools.data.store.ContentFeatureSource.getCount(ContentFeatureSource.java:451) [gt-data-8.7.jar:]
at org.geotools.jdbc.JDBCFeatureStore.getCountInternal(JDBCFeatureStore.java:183) [gt-jdbc-8.7.jar:]
at org.geotools.data.store.ContentFeatureSource.getCount(ContentFeatureSource.java:451) [gt-data-8.7.jar:]
at org.geotools.data.store.ContentFeatureCollection.size(ContentFeatureCollection.java:356) [gt-data-8.7.jar:]
at org.geoserver.wms.GetFeatureInfo.execute(GetFeatureInfo.java:297) [wms-2.2.5.jar:2.2.5]
at org.geoserver.wms.GetFeatureInfo.execute(GetFeatureInfo.java:168) [wms-2.2.5.jar:2.2.5]
at org.geoserver.wms.GetFeatureInfo.run(GetFeatureInfo.java:117) [wms-2.2.5.jar:2.2.5]
at org.geoserver.wms.DefaultWebMapService.getFeatureInfo(DefaultWebMapService.java:374) [wms-2.2.5.jar:2.2.5]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_25]
at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_25]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]


The problem is due to a classloading mechanism of the AS.

Monday, February 25, 2013

Testing a datasource on JBoss 7.1.1 in domain mode

I'm trying to test a deployed datasource in JBoss 7.1.1 in a domain configuration.

No info found around help in doing this job, also the web console is not working as expected (I also use TEIID 8.2 and probably the new web console mangled up a few things) and surely having a domain installation does not help things up.


All the things found around suggest to use this command

/subsystem=datasources/data-source=reportsDS:test-connection-in-pool


Being in a domain mode I do not have /subsystem so I tryed to get the subsystem from somewhere.

Getting it from profile ...

/profile=ha/subsystem=datasources/data-source=reportsDS:test-connection-in-pool


But the result are below and are not the expected

{
"outcome" => "failed",
"failure-description" => "JBAS010850: No handler for operation test-connection-in-pool at address [
(\"profile\" => \"ha\"),
(\"subsystem\" => \"datasources\"),
(\"data-source\" => \"reportsDS\")
]",
"rolled-back" => true
}


So I tryed with the following (that is logical since the previous was issued on a definition (profile) and not something truly running) against the host/server

/host=master/server=teiid1/subsystem=datasources/data-source=reportsDS:test-connection-in-pool


This time the result is successful

{
"outcome" => "success",
"result" => [true]
}

If needed by anyone.

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.