Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JSPs throwing incorrect compiler warnings
JSPs throwing incorrect compiler warnings [message #505263] Tue, 29 December 2009 01:50 Go to next message
David Kerber is currently offline David KerberFriend
Messages: 100
Registered: July 2009
Senior Member
I'm seeing problems with the compiler warnings on my Eclipse Galileo JEE
webapp.

Every single jsp is showing the following warnings in the "problems"
tab:

Null pointer access: The variable out can only be null at this
location.

Null pointer access: The variable session can only be null at this
location.

The import javax.servlet is never used.



These errors persist despite complete cleanings of the projects and
servers, and deleting and creating new servers. I'm configured with
Apache Tomcat 6.0 as the server library, and have 6.0.20 installed on
the machine.

Any suggestions, other than just suppressing the warnings?

D
Re: JSPs throwing incorrect compiler warnings [message #505279 is a reply to message #505263] Tue, 29 December 2009 08:53 Go to previous messageGo to next message
Wolfgang Knauf is currently offline Wolfgang KnaufFriend
Messages: 63
Registered: July 2009
Member
Hi,

could you post the snippet of your JSP which causes the "Null pointer access"
warnings?


Best regards

Wolfgang
Re: JSPs throwing incorrect compiler warnings [message #505301 is a reply to message #505263] Tue, 29 December 2009 12:43 Go to previous messageGo to next message
David Kerber is currently offline David KerberFriend
Messages: 100
Registered: July 2009
Senior Member
In article <MPG.25a32a72f515c387989686@news.eclipse.org>,
ns_dkerber@ns_WarrenRogersAssociates.com says...
>
> I'm seeing problems with the compiler warnings on my Eclipse Galileo JEE
> webapp.
>
> Every single jsp is showing the following warnings in the "problems"
> tab:
>
> Null pointer access: The variable out can only be null at this
> location.
>
> Null pointer access: The variable session can only be null at this
> location.
>
> The import javax.servlet is never used.
>
>
>
> These errors persist despite complete cleanings of the projects and
> servers, and deleting and creating new servers. I'm configured with
> Apache Tomcat 6.0 as the server library, and have 6.0.20 installed on
> the machine.
>
> Any suggestions, other than just suppressing the warnings?
>
> D

This is the entire text of one of my .jsp files. This particular one is
throwing the following (incorrect) errors (I know the line breaks make
it hard to read):

Description Resource Path Location Type

Null pointer access: The variable session can only be null at this
location Logout.jsp /SiteData/WebContent line 12 JSP Problem

The import javax.servlet is never used Logout.jsp
/SiteData/WebContent line 1 JSP Problem

The import javax.servlet.http is never used Logout.jsp
/SiteData/WebContent line 1 JSP Problem

The import javax.servlet.jsp is never used Logout.jsp
/SiteData/WebContent line 1 JSP Problem



<%@ page language="java" contentType="text/html; charset=ISO-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title>Logged out of WRA WebSIRA</title>
</head>

<body BGCOLOR="#000000" TEXT="#FFD700" LINK="#FFFFFF" VLINK="#9F9F9F">

<%
session.invalidate();
%>

<font face="verdana, Arial, Helvetica" size=3>
<b>You have successfully logged out of WRA WebSIRA.</b>
<font size=4>
<br><br><a href="Login.jsp">Log in to WRA WebSIRA
</a>
</font>
</font>

</body>
</html>
Re: JSPs throwing incorrect compiler warnings [message #505407 is a reply to message #505301] Wed, 30 December 2009 12:29 Go to previous messageGo to next message
Wolfgang Knauf is currently offline Wolfgang KnaufFriend
Messages: 63
Registered: July 2009
Member
Hi David,

I think I see the reason: your JSP validation settings are not the default ones,
and you switched some from "ignore" to "warning".

The settings are (either project specific through "Properties" => "Validation"
or global through "Preferences" => "Web" => "JSP files" => "Validation"): Group
"Java", options "Null pointer access" and "Unused import".
By default, the full group "Java" is set to "Ignore".

But it does not make sense that those errors appear. So, maybe someone with
conceptual knowledge of validation can comment on this.

Hope this helps

Wolfgang
Re: JSPs throwing incorrect compiler warnings [message #505421 is a reply to message #505407] Wed, 30 December 2009 13:24 Go to previous message
David Kerber is currently offline David KerberFriend
Messages: 100
Registered: July 2009
Senior Member
In article <hhfh31$pdv$1@build.eclipse.org>, wknauf_NO_@_INSIDE_hg-
online.de says...
>
> Hi David,
>
> I think I see the reason: your JSP validation settings are not the default ones,
> and you switched some from "ignore" to "warning".
>
> The settings are (either project specific through "Properties" => "Validation"
> or global through "Preferences" => "Web" => "JSP files" => "Validation"): Group
> "Java", options "Null pointer access" and "Unused import".
> By default, the full group "Java" is set to "Ignore".

But I want it to check MY code in a .jsp, just not the generated, so I
don't want to turn off jsp checking.

Even with that, why does it think "Session" can only be null at some
point? It obviously cannot be null in a jsp, so why does it think it
is? Sounds like a true bug in null checker, wrt .jsp files.


> But it does not make sense that those errors appear. So, maybe someone
with
> conceptual knowledge of validation can comment on this.

Yes, that is the root of my question.

d
Previous Topic:Disable XML Comment Autocompletion
Next Topic:eclipse with glassfish
Goto Forum:
  


Current Time: Thu Nov 27 23:38:22 GMT 2014

Powered by FUDForum. Page generated in 0.01733 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software