1

我已经编写了检票口应用程序,并且在本地运行良好。但是当我将它部署到 oracle 应用程序服务器(10g)时,我得到了这个错误:

14/01/28 09:49:29.481 NTDB: Servlet error
java.lang.NoSuchMethodError: org.apache.wicket.util.lang.Objects.newInstance(Ljava/lang/String;)Ljava/lang/Object;
       at org.apache.wicket.Application.addInitializer(Application.java:864)
       at org.apache.wicket.Application.load(Application.java:938)
       at org.apache.wicket.Application.initializeComponents(Application.java:715)
       at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:732)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpApplication.getFilterConfig(HttpApplication.java:7767)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:563)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.handleNotFound(HttpRequestHandler.java:1087)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:948)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
       at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
       at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
       at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
       at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
       at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
       at java.lang.Thread.run(Thread.java:662)

我用 Wicket + Shiro

WEB.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app 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_2_5.xsd"
    version="2.5">

    <display-name>myapp</display-name>
    <session-config>
            <session-timeout>36000</session-timeout>
    </session-config>

  <filter>
    <filter-name>ShiroFilter</filter-name>
    <filter-class>org.apache.shiro.web.servlet.IniShiroFilter</filter-class>
    <init-param><param-name>config</param-name><param-value>
            [main]
            authc.loginUrl = /login
            [urls]
            /login = anon
            [users]
            admin=admin, NT_ADMIN
    </param-value></init-param>
  </filter>

    <filter-mapping>
        <filter-name>ShiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>wicket.myapp</filter-name>
        <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
        <init-param>
            <param-name>applicationClassName</param-name>
            <param-value>eu.peter.stats.pages.WicketApplication</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>wicket.myapp</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>wicket.myapp</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <error-page>
        <error-code>404</error-code>
        <location>/404</location>
    </error-page>
</web-app>

我应该怎么办?也许是因为我使用检票口过滤器?

4

1 回答 1

0

看来您有一个需要 Wicket 1.4.x 的库,并且您使用的是 Wicket 1.5.x 或更高版本。

在您提供的堆栈跟踪中,它清楚地指出Objects来自 Wicket 的类没有使用 org.apache.wicket.util.lang.Objects.newInstance(Ljava/lang/String;)Ljava/lang/Object; 的方法

采用此方法的最后一个版本是 Wicket 1.4.x。

您不能将旧 Wicket 版本的库 jar 与较新的 Wicket 版本混合使用(反之亦然)。

于 2014-11-30T23:16:20.640 回答