I have written wicket application and locally it works perfectly. But when I deploy it to oracle application server (10g) I get this error:
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)
I use 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>
What should I do? Maybe it is because I use wicket filter?
It appears you have a library that expects Wicket 1.4.x and you use Wicket 1.5.x or newer.
In your provided stack trace it clearly states that the class
Objects
from Wicket doesn't have a method with org.apache.wicket.util.lang.Objects.newInstance(Ljava/lang/String;)Ljava/lang/Object;The last version that features this method is Wicket 1.4.x.
You can't mix jars of libraries that are for an older Wicket version in combination with a newer Wicket version (and vice versa).