Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Have problem when I run jsp on server.

 
Auttapol Pipatpatama
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
|---jsp
....|---Test.jsp
|---WEB-INF
....|---classes
....|---lib
........|---util.jar
............|---MTHelper (in jar file)
............|---javax.mail.* (in jar file)
............|---com.sun.mail.util.* (in jar file)


=== Test.jsp =================================================
<HTML>
<HEAD>
<%@page import="MTHelper" %>
<%@page import="javax.mail.*" %>
<TITLE>Test.jsp</TITLE>
</HEAD>
<BODY>
<P>Place content here.</P>
<%
String s = MTHelper.formatStringToPrint("122");
System.out.println("Value " + s);
%>
</BODY>
</HTML>

=== Screen Result ============================================
Error 500: Unable to compile class for JSP D:\workspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\IngeniumEar\Test.war\jsp\_Test.java:3: '.' expected import MTHelper; ^ An error occurred between lines: 9 and 12 in the jsp file: /jsp/Test.jsp Generated servlet error: D:\workspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\IngeniumEar\Test.war\jsp\_Test.java:80: cannot resolve symbol symbol : variable MTHelper location: class org.apache.jsp._Test String s = MTHelper.formatStringToPrint("122"); ^ 2 errors

=== Console Result ============================================
[10/11/04 14:14:56:484 ICT] 59cd11e7 WebGroup E SRVE0026E: [Servlet Error]-[Unable to compile class for JSP
D:\workspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\IngeniumEar\Test.war\jsp\_Test.java:3: '.' expected
import MTHelper;
^


An error occurred between lines: 9 and 12 in the jsp file: /jsp/Test.jsp

Generated servlet error:
D:\workspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\IngeniumEar\Test.war\jsp\_Test.java:80: cannot resolve symbol
symbol : variable MTHelper
location: class org.apache.jsp._Test
String s = MTHelper.formatStringToPrint("122");
^
2 errors
]: org.apache.jasper.JasperException: Unable to compile class for JSP
D:\workspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\IngeniumEar\Test.war\jsp\_Test.java:3: '.' expected
import MTHelper;
^


An error occurred between lines: 9 and 12 in the jsp file: /jsp/Test.jsp

Generated servlet error:
D:\workspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\IngeniumEar\Test.war\jsp\_Test.java:80: cannot resolve symbol
symbol : variable MTHelper
location: class org.apache.jsp._Test
String s = MTHelper.formatStringToPrint("122");
^
2 errors

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:129)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.loadJSP(JspServlet.java:941)

----------------------------------------------
How can I run it work? I use websphere 5.1.2
[ October 12, 2004: Message edited by: Auttapol Pipatpatama ]
 
Rr Kumaran
Ranch Hand
Posts: 548
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if MTHelper is java class in default package then you needn't import it explicitly using import statement and it should be available under classes folder or in a jar file in WEB-INF/lib folder.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Auttapol,
In the future, you can edit your posts by clicking on the page icon with a pencil.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Auttapol,
Do you have the jar containing MTHelper as a "java jar dependency" for your web project? You can check this by looking at the properties for the web project. "java jar dependencies" are used at runtime while the build path is used at compile time.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic