1

Error: Webappinit

asked 2014-04-21 09:38:23 +0800

wigberto gravatar image wigberto
52 4

updated 2014-04-21 14:19:45 +0800

sitansu gravatar image sitansu
2254 13
http://java91.blogspot.in...

I have the error when I start an application and i don't know because.

Grave: Failed to invoke class org.zkoss.zkmax.init.WebAppInit
java.lang.NoSuchMethodError: javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljava/lang/Class;)Ljavax/servlet/ServletRegistration$Dynamic;
    at org.zkoss.zkmax.ui.comet.CometAsyncServlet.install(CometAsyncServlet.java:56)
    at org.zkoss.zkmax.init.WebAppInit.init(WebAppInit.java:32)
    at org.zkoss.zk.ui.util.Configuration.invokeWebAppInits(Configuration.java:732)
    at org.zkoss.zk.ui.impl.AbstractWebApp.init(AbstractWebApp.java:204)
    at org.zkoss.zk.ui.http.SimpleWebApp.init(SimpleWebApp.java:58)
    at org.zkoss.zk.ui.http.WebManager.<init>(WebManager.java:228)
    at org.zkoss.zk.ui.http.HttpSessionListener23.contextInitialized(HttpSessionListener23.java:140)
    at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:540)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
    at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:110)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    at org.mortbay.jetty.plugin.AbstractJettyRunMojo$1.filesChanged(AbstractJettyRunMojo.java:409)
    at org.mortbay.util.Scanner.reportBulkChanges(Scanner.java:493)
    at org.mortbay.util.Scanner.reportDifferences(Scanner.java:359)
    at org.mortbay.util.Scanner.scan(Scanner.java:286)
    at org.mortbay.util.Scanner$1.run(Scanner.java:246)
    at java.util.TimerThread.mainLoop(Unknown Source)
    at java.util.TimerThread.run(Unknown Source)
delete flag offensive retag edit

Comments

isMavenProject?"Show pom":"Show your zk dependencies with version"; Greetz chill

chillworld ( 2014-04-21 22:30:58 +0800 )edit

The version is 7.0.0. I don't see any error in pom.xml. Thank you.

wigberto ( 2014-04-22 12:05:32 +0800 )edit

can you still plz post the pom? I think its something missing or maybe a version conflict

chillworld ( 2014-04-22 12:26:52 +0800 )edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2014-04-22 15:54:44 +0800

wigberto gravatar image wigberto
52 4

<properties> <java.version>1.7</java.version> <project.build.sourceencoding>UTF-8</project.build.sourceencoding> <project.reporting.outputencoding>UTF-8</project.reporting.outputencoding>

    <zk.version>7.0.0</zk.version>
    <commons-io>1.3.1</commons-io>
    <maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
    <packname>-${project.version}-FL-${maven.build.timestamp}</packname>
</properties>

<packaging>war</packaging>
<name>Carrusel</name>
<description>Carrusel</description>
<licenses>
    <license>
        <name>GNU LESSER GENERAL PUBLIC LICENSE, Version 3</name>
        <url>http://www.gnu.org/licenses/lgpl.html</url>
        <distribution>repo</distribution>
    </license>
</licenses>
<repositories>

    <repository>
        <id>ZK CE</id>
        <url>http://mavensync.zkoss.org/maven2</url>
    </repository>
    <repository>
        <id>ZK EE</id>
        <url>https://maven.zkoss.org/repo/zk/ee</url>
    </repository>
    <repository>
        <id>ZK PE</id>
        <url>https://maven.zkoss.org/repo/zk/pe</url>
    </repository>


    <repository>
        <id>com.asual.maven.public</id>
        <name>Asual Public Repository</name>
        <url>http://www.asual.com/maven/content/groups/public</url>
    </repository>

</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>zkmaven</id>
        <name>ZK Maven Plugin Repository</name>
        <url>http://mavensync.zkoss.org/maven2/</url>
    </pluginRepository>
</pluginRepositories>

<dependencies>

    <!-- Client Jersey -->
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-client</artifactId>
        <version>1.18</version>
    </dependency>

    <!-- Server Jersey -->
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-server</artifactId>
        <version>1.18</version>
    </dependency>

    <!-- ZK CE -->
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zkbind</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zul</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zkplus</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zhtml</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.common</groupId>
        <artifactId>zweb</artifactId>
        <version>${zk.version}</version>
    </dependency>

    <!-- ZK PE / EE -->
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zkex</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.zk</groupId>
        <artifactId>zkmax</artifactId>
        <version>${zk.version}</version>
    </dependency>

    <!-- javax activation -->
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1-rev-1</version>
    </dependency>

    <!-- ZK Themes -->
    <dependency>
        <groupId>org.zkoss.theme</groupId>
        <artifactId>sapphire</artifactId>
        <version>${zk.version}</version>
    </dependency>
    <dependency>
        <groupId>org.zkoss.theme</groupId>
        <artifactId>silvertail</artifactId>
        <version>${zk.version}</version>
    </dependency>

    <!-- Java servlet Version 3.0  -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>

    <!-- Java servlet Version 2.5 
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>
    -->

    <!-- commons -->
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
    </dependency>
    <dependency>
        <groupId>commons-digester</groupId>
        <artifactId>commons-digester</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>

    <!-- Log4j -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.6.4</version>
    </dependency>

    <dependency>
        <groupId>org.apache.geronimo.ext.tomcat</groupId>
        <artifactId>juli</artifactId>
        <version>7.0.23.1</version>
        <scope>test</scope>
    </dependency>

    <!-- Rome -->
    <dependency>
        <groupId>rome</groupId>
        <artifactId>rome</artifactId>
        <version>1.0</version>
    </dependency>

    <!-- Junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
    </dependency>

    <!-- JtOpen -->
    <dependency>
        <groupId>net.sf.jt400</groupId>
        <artifactId>jt400-full</artifactId>
        <version>6.0</version>
    </dependency>

    <!-- CDI api -->
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
    </dependency>
    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>

    <!-- CDI api -->
    <dependency>
        <groupId>org.jboss.spec</groupId>
        <artifactId>jboss-javaee-6.0</artifactId>
        <version>1.0.0.Final</version>
        <type>pom</type>
        <scope>provided</scope>
    </dependency>

    <!-- CDI Weld -->
    <dependency>
        <groupId>org.jboss.weld</groupId>
        <artifactId>weld-core</artifactId>
        <version>2.2.0.CR2</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.weld.servlet</groupId>
        <artifactId>weld-servlet</artifactId>
        <version>2.2.0.CR2</version>
    </dependency>


    <!-- HttpClient -->
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.3.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpasyncclient</artifactId>
        <version>4.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.3.2</version>
    </dependency>
</dependencies>
link publish delete flag offensive edit
0

answered 2014-04-22 17:11:52 +0800

chillworld gravatar image chillworld flag of Belgium
5337 4 9
https://github.com/chillw...

updated 2014-04-24 07:29:21 +0800

change this in your pom. :

 <!-- Java servlet Version 3.0 -->
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
</dependency>

Try remove the provided cause your error is that the method isn't found so I guess you are running runtime at a lower version.

Just one thing more :

 <dependency>        
     <groupId>commons-digester</groupId>        
     <artifactId>commons-digester</artifactId>        
     <version>2.1</version>    
 </dependency>

This version is required by jasperReports, you have ATM version 2.0

Is your problem resolved with removing the provided?

Greetz chill.

link publish delete flag offensive edit
0

answered 2014-04-29 11:23:25 +0800

wigberto gravatar image wigberto
52 4

Thank you chillworld. After the changes I continue with the same error... Grave: Failed to invoke class org.zkoss.zkmax.init.WebAppInit java.lang.NoSuchMethodError: javax.servlet.ServletContext.addServlet(Ljava/lang/String;Ljava/lang/Class;)Ljavax/servlet/ServletRegistration$Dynamic; at org.zkoss.zkmax.ui.comet.CometAsyncServlet.install(CometAsyncServlet.java:56) at org.zkoss.zkmax.init.WebAppInit.init(WebAppInit.java:32) at org.zkoss.zk.ui.util.Configuration.invokeWebAppInits(Configuration.java:732) at org.zkoss.zk.ui.impl.AbstractWebApp.init(AbstractWebApp.java:204) at org.zkoss.zk.ui.http.SimpleWebApp.init(SimpleWebApp.java:58) at org.zkoss.zk.ui.http.WebManager.<init>(WebManager.java:228) at org.zkoss.zk.ui.http.HttpSessionListener23.contextInitialized(HttpSessionListener23.java:140) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:540) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:110) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.plugin.AbstractJettyRunMojo$1.filesChanged(AbstractJettyRunMojo.java:409) at org.mortbay.util.Scanner.reportBulkChanges(Scanner.java:493) at org.mortbay.util.Scanner.reportDifferences(Scanner.java:359) at org.mortbay.util.Scanner.scan(Scanner.java:286) at org.mortbay.util.Scanner$1.run(Scanner.java:246) at java.util.TimerThread.mainLoop(Unknown Source) at java.util.TimerThread.run(Unknown Source)

link publish delete flag offensive edit

Comments

1

Did you run the project with Run-Jetty-Run? If so, please change the run configuration to using Jetty 8 that support Servlet 3.

vincentjian ( 2014-04-30 04:48:23 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-04-21 09:38:23 +0800

Seen: 61 times

Last updated: Apr 29 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More