NPE in grizzly while launching my project with the atmosphere-spade-server

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NPE in grizzly while launching my project with the atmosphere-spade-server

Yanflea
This post has NOT been accepted by the mailing list yet.
I am playing with atmosphere in a GWT/GXT project. Based on the GWTDemo example provided with atmosphere distribution, I managed to get my project working in hosted mode in my IDE.

Versions : gwt 2.4.0, atmosphere 0.9.7

Now I would like to package my war and execute it with the atmosphere-spade-server (version 0.7.2). I build my project with maven (gwt-maven-plugin 2.4.0 + maven-war-plugin 2.2) and then I launch

java -jar atmosphere-spade-server.jar -p 8888 -a mywar.war

and I get

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
10 ao¹t 2012 09:34:17 com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer launch
GRAVE: Error while launching deployer.
com.sun.grizzly.http.deployer.DeployException: Error parsing web.xml for 'file:/C:/WORKSPACE/SANDBOX/GwtExt/war/target/war.war'.
        at com.sun.grizzly.http.servlet.deployer.WarDeployer.parseWebXml(WarDeployer.java:320)
        at com.sun.grizzly.http.servlet.deployer.WarDeployer.fromURI(WarDeployer.java:146)
        at com.sun.grizzly.http.servlet.deployer.WarDeployer.fromURI(WarDeployer.java:84)
        at com.sun.grizzly.http.deployer.FromURIDeployer.deploy(FromURIDeployer.java:68)
        at com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer.deployWar(GrizzlyWebServerDeployer.java:308)
        at com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer.deployWar(GrizzlyWebServerDeployer.java:304)
        at com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer.deployApplication(GrizzlyWebServerDeployer.java:212)
        at com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer.deployApplications(GrizzlyWebServerDeployer.java:190)
        at com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer.launch(GrizzlyWebServerDeployer.java:143)
        at org.atmosphere.grizzly.AtmosphereDeployer.main(AtmosphereDeployer.java:74)
Caused by: java.lang.NullPointerException
        at com.sun.grizzly.http.webxml.parser.JAXBWebXml_3_0Parser.populate(JAXBWebXml_3_0Parser.java:250)
        at com.sun.grizzly.http.webxml.parser.JAXBWebXml_3_0Parser.parse(JAXBWebXml_3_0Parser.java:123)
        at com.sun.grizzly.http.webxml.WebappLoader.extractWebXmlInfo(WebappLoader.java:189)
        at com.sun.grizzly.http.webxml.WebappLoader.load(WebappLoader.java:161)
        at com.sun.grizzly.http.servlet.deployer.WarDeployer.parseWebXml(WarDeployer.java:318)
        ... 9 more

First of all, I don't understand the complain about slf4j as slf4j-api-1.6.6.jar is in the WEB-INF\lib folder of my war. No logger pb when I launch the app in hosted mode.

And second, I can't figure out what's wrong with my web.xml :

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

    <display-name>GWT-Maven-Archetype</display-name>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
   
    <servlet>
        <description>AtmosphereServlet</description>
        <servlet-name>AtmosphereServlet</servlet-name>
        <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
        <init-param>
           
            <param-name>org.atmosphere.disableOnStateEvent</param-name>
            <param-value>true</param-value>
        </init-param>
       
        <load-on-startup>1</load-on-startup>
       
        <async-supported>true</async-supported>
    </servlet>
    <servlet-mapping>
        <servlet-name>AtmosphereServlet</servlet-name>
        <url-pattern>/com.foopackage.myapp/gwtComet/*</url-pattern>
    </servlet-mapping>   
   
</web-app>


Here is the structure of my war :

mywar.war
|- com.foopackage.myapp
| L …
|- META-INF
| |- atmosphere.xml
| L MANIFEST.MF
|- WEB-INF
| |- classes
| | L …
| |- deploy
| | L …
| |- lib
| | |- atmosphere-compat-jbossweb-0.9.7.jar
| | |- atmosphere-compat-tomcat-0.9.7.jar
| | |- atmosphere-compat-tomcat7-0.9.7.jar
| | |- atmosphere-gwt-client-0.9.7.jar
| | |- atmosphere-gwt-common-0.9.7.jar
| | |- atmosphere-gwt-server-0.9.7.jar
| | |- atmosphere-runtime-0.9.7.jar
| | |- gwt-servlet-2.4.0.jar
| | |- gwt-user-2.4.0.jar
| | |- gxt-3.0.0-rc2.jar
| | |- slf4j-api-1.6.6.jar
| | |- slf4j-simple-1.6.6.jar
| | L …
| L web.xml
L index.html

I tried different things, like adding/removing context.xml file from/to META-INF and WEB-INF (the documentation  is unclear about the requirement of this file for grizzly), with no sucess.

I am pretty sure something is wrong in my configuration but I can't figure out what. Thanks for your help.


Loading...