Whenever I am trying to compute serialversionUID from the command prompt, I am getting "Exception in thread "main" java.lang.NoClassDefFoundError: javax.servlet.http.HttpS开发者_JAVA技巧ervletRequest".
classpath is set correctly.I have j2ee.jar in my classpath.
Can anyone help me out.
You only really need to do this if you have already-serialized instances of the class and you've changed it and want to maintain serialization-compatibility with the existing serializations. Otherwise just use 1L or -1L.
Make sure that the JAR file containing javax.servlet.* is in your CLASSPATH.
精彩评论