Team Elements

Status: Caution PostgreSQL Open Source Initiative (OSI) Java
PUBLIC PROFILE

Back to topics

Issues and Open Discussion

Feeds

You need to be logged in to post messages

Feeds

7/5/2007 1:29 PM EDT

In Glassfish (sorry I haven't tried in other app server), feeds are not working.
The error received is:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: org.apache.catalina.servlets.DefaultServlet.generateNonce()Ljava/lang/String;
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:300)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

root cause

java.lang.NoSuchMethodError: org.apache.catalina.servlets.DefaultServlet.generateNonce()Ljava/lang/String;
com.zeroio.webdav.WebdavManager.askForAuthentication(Unknown Source)
com.zeroio.feed.FeedServlet.service(Unknown Source)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

1. 7/5/2007 1:34 PM EDT

As I could see the DefaultServer class exists in the appserv-rt.jar file, but curiously Netbeans doesn't show the generateNonce() and generateOpaque() static methods. I'm trying to solve the problem by editing the askForAuthentication and validateUser methods.

No light yet at the end of the tunnel. I'll share my solution if I get to one.

2. 7/5/2007 4:11 PM EDT

Just realized there's an internal implementation of DefaultServlet, with both static methods (blush)

It seems there's a kind of a ClassLoader issue. Glassfish is not recognizing this implementation but the one on its appserv-rt.jar file.
I'm trying to solve this issue making some refactoring. Don't know how much will it take me to trace the whole problem.

3. 7/5/2007 6:08 PM EDT

Solved, but the solution wasn't clean in any way. The problem was the ClassLoader, just as I said before. Overwriting/Reimplementing/Implementing some of the org.apache.catalina.* packages isn't a good idea, at least for Glassfish.

The dirty work I did was copying the DefaultServlet to another package (I chose com.zeroio.webdav) and trimming all the "unnecessary" methods, I left only the generateNonce and generateOpaque methods. The same for the MD5Encoder class.

Before doing this I got a java.lang.IncompatibleClassChangeError when calling the MD5Encoder.encode method.

Hope this helps someone else than me.

3 results found