当前位置: 首页 > 知识库问答 >
问题:

wicket异常启动过滤器wicket

慕冠宇
2023-03-14

我正在尝试使用wicket创建一个web应用程序。以下是我遵循的步骤:

> < li>

我使用以下命令创建了一个maven项目:

mvn原型:generate-DarchetypeGroupId=org.apache。wicket-DarchetypeArtifactId=wicket原型快速启动-DarchetypeVersion=6.6.0-DgroupId=com。mycompany-DartifactId=myproject-DarchetypeRepository=https://repository.apache.org/-DinteractiveMode=假

我导入了项目来日食

这是控制台上的错误消息:

SEVERE: Exception starting filter wicket.myproject
java.lang.ClassNotFoundException: org.apache.wicket.protocol.http.WicketFilter
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4656)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5309)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

现在这是我的绒球。xml格式:

http://maven.apache.org/maven-v4_0_0.xsd"

<licenses>
    <license>
        <name>The Apache Software License, Version 2.0</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        <distribution>repo</distribution>
    </license>
</licenses>
<properties>
    <wicket.version>6.6.0</wicket.version>
    <jetty.version>7.6.3.v20120416</jetty.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
    <!--  WICKET DEPENDENCIES -->
    <!-- <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-core</artifactId>
        <version>${wicket.version}</version>
    </dependency>
    OPTIONAL DEPENDENCY
    <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-extensions</artifactId>
        <version>${wicket.version}</version>
    </dependency>
    -->

    <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-core</artifactId>
        <version>${wicket.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-extensions</artifactId>
        <version>${wicket.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-devutils</artifactId>
        <version>${wicket.version}</version>
    </dependency>


    <!-- LOGGING DEPENDENCIES - LOG4J -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.4</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>


    <!--  JUNIT DEPENDENCY FOR TESTING -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>

    <!--  JETTY DEPENDENCIES FOR TESTING  -->
    <dependency>
        <groupId>org.eclipse.jetty.aggregate</groupId>
        <artifactId>jetty-all-server</artifactId>
        <version>${jetty.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>wicket</groupId>
        <artifactId>wicket</artifactId>
        <version>1.2.7</version>
    </dependency>
</dependencies>
<build>
    <resources>
        <resource>
            <filtering>false</filtering>
            <directory>src/main/resources</directory>
        </resource>
        <resource>
            <filtering>false</filtering>
            <directory>src/main/java</directory>
            <includes>
                <include>**</include>
            </includes>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>
    <testResources>
        <testResource>
            <filtering>false</filtering>
            <directory>src/test/resources</directory>
        </testResource>
        <testResource>
            <filtering>false</filtering>
            <directory>src/test/java</directory>
            <includes>
                <include>**</include>
            </includes>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </testResource>
    </testResources>
    <plugins>
        <plugin>
            <inherited>true</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <encoding>UTF-8</encoding>
                <showWarnings>true</showWarnings>
                <showDeprecation>true</showDeprecation>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>${jetty.version}</version>
            <configuration>
                <connectors>
                    <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                        <port>8080</port>
                        <maxIdleTime>3600000</maxIdleTime>
                    </connector>
                    <connector implementation="org.eclipse.jetty.server.ssl.SslSocketConnector">
                        <port>8443</port>
                        <maxIdleTime>3600000</maxIdleTime>
                        <keystore>${project.build.directory}/test-classes/keystore</keystore>
                        <password>wicket</password>
                        <keyPassword>wicket</keyPassword>
                    </connector>
                </connectors>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <downloadSources>true</downloadSources>
            </configuration>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>Apache Nexus</id>
        <url>https://repository.apache.org/content/repositories/snapshots/</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>
</project>

这是我的web.xml:

<filter>
    <filter-name>wicket.myproject</filter-name>
    <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
    <init-param>
        <param-name>applicationClassName</param-name>
        <param-value>com.mycompany.WicketApplication</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>wicket.myproject</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

任何人都可以帮我????

共有2个答案

东和怡
2023-03-14

你换了你的POM吗?这个类属于< code>wicket-core,快速入门增加了这个:

<dependency>
  <groupId>org.apache.wicket</groupId>
  <artifactId>wicket-core</artifactId>
  <version>6.6.0</version>
</dependency>

检查此声明是否位于pom.xml中。

党博超
2023-03-14

有点晚了,但这是解决问题的方法

右键单击项目-

确保项目的库部署到WEB-INF/lib文件夹中。在我的例子中,根本没有库,所以我必须按添加它们

添加-

并选择库(其中有检票口库)

 类似资料:
  • 异常过滤器 With Nest you can move exception handling logic to special classes called Exception Filters. 你可以使用Nest将异常处理逻辑移动到异常过滤器的特殊类中。 How it works? 怎么运行呢? Let's take a look at the following code: 让我们来看看下面

  • 问题内容: 嗨,我是Struts的新手,试图在Struts中打招呼,但我遇到了错误。我正在尝试将其修复,但无法执行。错误消息是 我的档案是 Web.xml是 那么该代码的解决方案是什么。 问题答案: 从类路径中删除。但是对于管理库的解决方案,您可以使用Maven。 请参阅使用Maven构建的教程:使用Maven 创建Struts 2 Web应用程序以管理工件和构建应用程序 。 随下载的最小依赖项

  • 内置的 异常层负责处理整个应用程序中的所有抛出的异常。当捕获到未处理的异常时,最终用户将收到适当的用户友好响应。 每个异常都由全局异常筛选器处理, 当无法识别时 (既不是 HttpException 也不是继承的类 HttpException ) , 用户将收到以下 JSON 响应: { "statusCode": 500, "message": "Internal server

  • 在multi的filter方法中处理异常的正确方法是什么,因为我们只能返回布尔值,不能传播失败?这就是我的代码现在的样子,我应该如何正确处理过滤器中的异常?

  • 我正在开发一个连接到平板电脑时与USB设备通信的应用程序。为了避免用户接受android访问设备,我设置了一个意图过滤器: 我的问题是,有了这个意图过滤器,每次我插入设备并启动另一个活动时都会调用“onCreate”方法,如果没有意图过滤器,它只会被调用一次。这是“onCreate”方法: 广播接收机: 简单连接到设备的“setDevice”方法: 为什么?

  • org.springframework.boot.autoconfigure.web.servlet.error.errorMVCautoConfiguration需要一个类型为“org.springframework.boot.autoconfigure.web.servlet.dispatcherServletPath”的bean。 pom.xml: http://maven.apache.o