Hi,
> import javax.servlet.*;
> import javax.servlet.http.*;
[quoted text clipped - 9 lines]
>
> What is this warning message mean?
You need a serialVersionId, if your class implements "Serializable".
HttpServlet does so, and so you need such an id. (It is used, if the
Servlet-Context is relaunched and your sessions should be made
persistant / restored. If you do not need this feature, you do not need
a serialVersionId.)
> How do I get rid it?
There is some switch to disable the warning (e.g. in Eclipse...)
> P.S. I know a warning message is NOT an error, but
> someday, sometime may be cause run time failure.
Yes, its better not to ignore warnings (although that's not possible
with Java5 :-()
Ciao,
ingo
blaine@worldweb.com - 29 Jun 2005 15:41 GMT
You'll need to add a serialVersionUID to your class eg:
public class MyClass extends HttpServlet{
public static final long serialVersionUID = 1L;
public MyClass(){
}
}
Skip - 29 Jun 2005 15:53 GMT
> You'll need to add a serialVersionUID to your class eg:
>
[quoted text clipped - 4 lines]
> }
> }
That static field may be private too.
Bryce - 29 Jun 2005 16:06 GMT
>Hi,
>
[quoted text clipped - 27 lines]
>Yes, its better not to ignore warnings (although that's not possible
>with Java5 :-()
Added note:
If you are using Eclipse, it can generate the id for you. Click on the
yellow lightbulb.
--
now with more cowbell
>serialVersionUID
see http://mindprod.com/jgloss/serialization.html

Signature
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm
Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
>serialVersionUID
>public class MyClass extends HttpServlet {
>
>What is this warning message mean?
>How do I get rid it?
see http://mindprod.com/jgloss/serialization.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.