Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WLS throws AbstractMethodError for Filter

1 view
Skip to first unread message

Barry F

unread,
Feb 12, 2002, 9:38:41 PM2/12/02
to

I'm using "WebLogic Server 6.1 with J2EE 1.2 and J2EE 1.3 Functionality", which
supposedly includes support for
servlets 2.3, including filters. However, any inclusion of a <filter> element
in the web.xml for my application
results in a java.lang.AbstractMethodError at weblogic.servlet.internal.WebAppServletContext.registerFilter(
WebAppServletContext.java:1945) during startup of WLS. If I deploy the web app
in a .war file, I instead get the
message:

<Error> <Management> <Error deploying application .\config\mydomain\applications\filtertest.war:
java.lang.reflect.UndeclaredThrowableException>

which may have the same underlying cause, I don't know. The same app works fine
under Tomcat 4.0.1, filter
and all.

One thing I noticed that seemed funny was that, even though I'm using the WLS
version that's supposed to have
servlet 2.3, ServletContext.getMinorVersion() returns 2 instead of 3.

Has anyone had any luck using filters with this version of WLS? My app is absolutely
trivial, just something to
try a filter, and as I said, it works as expected on Tomcat. Here is the web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<filter>
<filter-name>myfilter</filter-name>
<filter-class>filtertest.MyFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>myfilter</filter-name>
<servlet-name>myservlet</servlet-name>
</filter-mapping>


<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>filtertest.MyServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/myservlet</url-pattern>
</servlet-mapping>

</web-app>

Thanks,
Barry

Eugene Zhou

unread,
Feb 14, 2002, 8:55:34 AM2/14/02
to

Barry,

WL 6.1 does not fully support J2EE 1.3 features, which could be the reason that
you could not deploy your filter. I've found out that interface HttpSession is
not compliant with the latest Servlet spec, which is also confirmed (see post
#7434 Re: HttpSession Interface not up-to-date? - Patrick Bumpus ). To make sure
that you can actually deploy your filter, you'd better re-compile your code with
weblogic.jar. I suspect that you will get compilation errors on your filter classes.

Eugene

Barry F.

unread,
Feb 14, 2002, 5:54:33 PM2/14/02
to

Eugene,

Thanks for the reply, your suggestion was right on the mark.
WLS 6.1 apparently uses an outdated version of the Filter
interface -- it includes two methods (getFilterConfig and
setFilterConfig) that aren't in the final servlet 2.3 spec.
This must have caused the AbstractMethodError at startup.
I wasn't getting a compile-time error because I wasn't
compiling with weblogic.jar. I added the two gratuitous
methods, and everything works fine now.

Thanks again for the great advice!

Barry

0 new messages