Error while deploying Grails 2.5.1 war on Tomcat 9 and Java 8

1k views Asked by At

I've created folder with my app Name in tomcat9 directry and pasted its war there and restarted tomcat. Below is logs Error

05-Jan-2017 19:52:21.249 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
05-Jan-2017 19:52:21.249 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
05-Jan-2017 19:52:21.346 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
05-Jan-2017 19:52:21.446 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
05-Jan-2017 19:52:21.481 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
05-Jan-2017 19:52:21.496 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
05-Jan-2017 19:52:21.496 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-83"]
05-Jan-2017 19:52:21.626 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service advantage
05-Jan-2017 19:52:21.626 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-83"]
05-Jan-2017 19:52:21.626 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
05-Jan-2017 19:52:21.626 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
05-Jan-2017 19:52:21.626 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-83"]
05-Jan-2017 19:52:27.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/9.0.0.M15
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Dec 5 2016 13:44:25 UTC
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         9.0.0.0
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 8.1
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.3
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jdk1.8.0_112\jre
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_112-b15
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Tomcat\apache-tomcat-9.0.0.M15
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\Tomcat\apache-tomcat-9.0.0.M15
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Tomcat\apache-tomcat-9.0.0.M15\conf\logging.properties
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Tomcat\apache-tomcat-9.0.0.M15
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Tomcat\apache-tomcat-9.0.0.M15
05-Jan-2017 19:52:27.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Tomcat\apache-tomcat-9.0.0.M15\temp

----Removed unwanted log----

INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
     org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null object
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.NullPointerException: Cannot invoke method getAt() on null object
        ... 5 more

    05-Jan-2017 19:52:41.108 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
    05-Jan-2017 19:52:41.108 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/appName] startup failed due to previous errors
    05-Jan-2017 19:52:41.162 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive C:\Tomcat\apache-tomcat-9.0.0.M15\appName\appName.war has finished in 11,583 ms
    05-Jan-2017 19:52:41.162 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-83]

Below is an entry in server.xml

<Service name="appName">
    <Connector port="83" protocol="org.apache.coyote.http11.Http11NioProtocol" />
    <Engine name="Catalina81" defaultHost="localhost">
        <Host name="localhost" appBase="appName" unpackWARs="true" autoDeploy="true" />
    </Engine>
</Service>

Below is ApplicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

    <bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
        <description>Grails application factory bean</description>
        <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
        <property name="grailsResourceLoader" ref="grailsResourceLoader" />
    </bean>

    <bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
        <description>A bean that manages Grails plugins</description>
        <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
        <property name="application" ref="grailsApplication" />
    </bean>

    <bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
        <constructor-arg>
            <ref bean="grailsApplication" />
        </constructor-arg>
        <property name="pluginManager" ref="pluginManager" />
    </bean>

    <bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean">
        <property name="grailsResourceHolder" ref="grailsResourceHolder" />
    </bean>

    <bean id="grailsResourceHolder" scope="prototype" class="org.codehaus.groovy.grails.commons.spring.GrailsResourceHolder">
        <property name="resources">
              <value>**/grails-app/**/*.groovy</value>
        </property>
    </bean>    

   <bean id="characterEncodingFilter"
      class="org.springframework.web.filter.CharacterEncodingFilter">
        <property name="encoding">
          <value>utf-8</value>
        </property>
   </bean>      
</beans>

I've tried with tomcat 8 too but get same thing. Please help!

0

There are 0 answers