aspose file tools*
The moose likes Servlets and the fly likes JML (java modeling languge): how to verify servlets with JML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JML (java modeling languge): how to verify servlets with JML" Watch "JML (java modeling languge): how to verify servlets with JML" New topic
Author

JML (java modeling languge): how to verify servlets with JML

nikhil rupanawar
Greenhorn

Joined: Mar 04, 2011
Posts: 2
jmlServlets

I used JML annotations for servlet classes. In order to verify those i used ESC/Java2 static verification tool
Problem is that When i go for simple java classes it's working fine but wen i go for servlets it showing error messages for import statements "No such type javax.servlet..."
and its also not resolving type 'HttpServlet'
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

You need to add the servlets jar into the classpath.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
nikhil rupanawar
Greenhorn

Joined: Mar 04, 2011
Posts: 2
ok i did this .... thanks


but i am getting this errors. i am using jre1.6 is there any problem ?
i am not much experienced programmer in jsp.



D:\nikesc\ESCJava>escj BannerServlet.java

D:\nikesc\ESCJava>"java" -Dsimplify=D:\nikesc

\ESCJava\Simplify-1.5.4.exe -cl
path "D:\nikesc\ESCJava\esctools2.jar;D:\nikesc

\ESCJava\Utils\BCEL\bcel-5.2\b
-5.2.jar;D:\nikesc\ESCJava\Utils\Javafe

\Javafe2.0.5b.jar" escjava.Main -class
h D:\nikesc\ESCJava\jmlspecs.jar -classpath \D:

\nikesc\ESCJava\servlet-2.4.
. -nowarn Deadlock -specs D:\nikesc\ESCJava\specs

BannerServlet.java
ESC/Java version ESCJava-2.0b2
BannerServlet.java: Caution: Using given file as

the .java file, even though
is not the java file for servlets.BannerServlet on

the classpath
[0.052 s 15540408 bytes]

servlets.BannerServlet ...
BannerServlet.java:64: Error: No such method

getWriter() in type javax.servle
ttp.HttpServletResponse
PrintWriter out = response.getWriter();
^
BannerServlet.java:70: Error: No such method

getContextPath() in type javax.s
let.http.HttpServletRequest
request.getContextPath() +
^
BannerServlet.java:70: Error: No method valueOf

(error) matching given argumen
ypes
request.getContextPath() +
^
BannerServlet.java:69: Error: No method

_infixConcat_(java.lang.String, error
atching given argument types
... 0066\">Duke's </font> <img src=\"" +
^
BannerServlet.java:69: Error: No method valueOf

(error) matching given argumen
ypes
... 0066\">Duke's </font> <img src=\"" +
^
BannerServlet.java:70: Error: No method

_infixConcat_(error, java.lang.String
atching given argument types
request.getContextPath() +
^
BannerServlet.java:70: Error: No method valueOf

(error) matching given argumen
ypes
request.getContextPath() +
^
BannerServlet.java:71: Error: No method

_infixConcat_(error, java.lang.String
atching given argument types
... f\" alt=\"Duke holding books\"\">" +
^
BannerServlet.java:71: Error: No method valueOf

(error) matching given argumen
ypes
... f\" alt=\"Duke holding books\"\">" +
^
BannerServlet.java:72: Error: No method

_infixConcat_(error, java.lang.String
atching given argument types
... color=\"black\">Bookstore</font>" + "</h1>" +
^
BannerServlet.java:72: Error: No method valueOf

(error) matching given argumen
ypes
... color=\"black\">Bookstore</font>" + "</h1>" +
^
BannerServlet.java:72: Error: No method

_infixConcat_(error, java.lang.String
atching given argument types
... lack\">Bookstore</font>" + "</h1>" +
^
BannerServlet.java:72: Error: No method valueOf

(error) matching given argumen
ypes
... lack\">Bookstore</font>" + "</h1>" +
^
BannerServlet.java:73: Error: No method

_infixConcat_(error, java.lang.String
atching given argument types
"</center>" + "<br>   <hr>

<br> ");
^
C:\Program Files\Java\jre6\lib

\rt.jar:java/io/Writer.class: Error: Different
incompatible return types on overridden(hidden) and

overriding(hiding) method
C:\Program Files\Java\jre6\lib

\rt.jar:java/io/Writer.class: Error: Different
incompatible return types on overridden(hidden) and

overriding(hiding) method
C:\Program Files\Java\jre6\lib

\rt.jar:java/io/Writer.class: Error: Different
incompatible return types on overridden(hidden) and

overriding(hiding) method
C:\Program Files\Java\jre6\lib

\rt.jar:java/io/PrintWriter.class: Error: Diffe
t or incompatible return types on overridden

(hidden) and overriding(hiding) m
ods
C:\Program Files\Java\jre6\lib

\rt.jar:java/io/PrintWriter.class: Error: Diffe
t or incompatible return types on overridden

(hidden) and overriding(hiding) m
ods
C:\Program Files\Java\jre6\lib

\rt.jar:java/io/PrintWriter.class: Error: Diffe
t or incompatible return types on overridden

(hidden) and overriding(hiding) m
ods
BannerServlet.java:67: Error: No method println

(error) matching given argumen
ypes
out.println("<body bgcolor=\"#ffffff\">" +

"<center>" +
^
Caution: Turning off extended static checking due

to type error(s)
[0.772 s 22282144 bytes total] (aborted)
2 cautions
21 errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JML (java modeling languge): how to verify servlets with JML