You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by DEMOTTIE Christophe ROSI/DPS <ch...@francetelecom.com> on 2005/04/06 14:04:13 UTC

NullPointerException in CoyoteRequestFacade in tomcat 5.0.28

Hi,

I have a null exception in CoyoteRequestFacade with Tomcat 5.0.28 and 4.1.27


==> org.apache.coyote.tomcat5.CoyoteRequestFacade
java.lang.NullPointerException
	at org.apache.coyote.tomcat5.CoyoteRequestFacade.isSecure(CoyoteRequestFacade.java:379)
	at myPackage.MyServlet.baseURL(WServlet.java:87)
	at myPackage.MyPage.getBaseURL(WPage.java:193)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at myPackage.MethodBinder.get(MethodBinder.java:26)

I look source code and it seem it correspond to a null request attribute in
the class CoyoteRequestFacade.java
-------------------------------------------
    public boolean isSecure() {
        return request.isSecure();		// line 379
    }
-------------------------------------------

Here is the code of the method in my servlet :
  public String baseURL(ServletRequest request) {
    System.out.println("==> " + ((request == null)? "null" : request.getClass().getName()));
    if (request.isSecure())
        return securedURL(request);
      else
        return normalURL(request);
  }

My servlet method is called with the invoke method
in my MethodBinder class like that :

   protected java.lang.Object get(java.lang.Object object) throws Throwable 
   {
	try {
	  return method.invoke(object,null);
	}
      catch (InvocationTargetException e0) {
        throw e0.getTargetException();
      }
   }


why request is null in CoyoteRequestFacade ?

Thanks in advance,

Christophe.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org