Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2008, 08:16 PM
Member
 
Join Date: Jun 2008
Posts: 2
Aerinai is on a distinguished road
JasperException: Unable to compile
I keep getting this odd Jasper Exception error every time I try to run a JSP page that is calling an outside library. It works fine with the Java default libs but when using a third party library, it gives me a compile error. Here is a sample of my .jsp file:
Code:
<%@page import="com.avaya.phones.*,java.net.*,java.util.HashMap, java.util.StringTokenizer,java.util.ArrayList,java.io.File;" %> <%@page errorPage="error.jsp" %> <html> <body> <% response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server %> <%! String wml="",selected="",audio="",trans_status=""; String message="",alert="",mode="",xml="",title=""; HashMap<String, String> keyValuePair = new HashMap<String, String>(); int j =0,timeout=0; String tempStatus=""; %> <% //Don't make it instance variabe, otherwise it will //remember earlier IP Addresses as well ArrayList<String> phoneIp = new ArrayList<String>(); //Set session attribute selected=session.getAttribute("Selected").toString(); //Set hashmap value keyValuePair.put("Hello", "23"); keyValuePair.put("Hello World", "22"); //phoneip StringTokenizer st = new StringTokenizer(request.getParameter("phoneip")); while(st.hasMoreElements()) { phoneIp.add(st.nextToken()); } if(phoneIp.isEmpty()) { %> .......
The error I get from this code is this:
Code:
HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 11 in the jsp file: /sampleApplication/call_function.jsp Generated servlet error: Syntax error on token "<", delete this token An error occurred at line: 11 in the jsp file: /sampleApplication/call_function.jsp Generated servlet error: Syntax error on token ">", , expected An error occurred at line: 11 in the jsp file: /sampleApplication/call_function.jsp Generated servlet error: Syntax error on token "<", ( expected An error occurred at line: 11 in the jsp file: /sampleApplication/call_function.jsp Generated servlet error: Syntax error on token "(", invalid Expression An error occurred at line: 18 in the jsp file: /sampleApplication/call_function.jsp Generated servlet error: Syntax error on token "<", invalid AssignmentOperator An error occurred at line: 18 in the jsp file: /sampleApplication/call_function.jsp Generated servlet error: Syntax error on token "=", != expected An error occurred at line: 18 in the jsp file: /sampleApplication/call_function.jsp Generated servlet error: Syntax error on token "<", ( expected An error occurred at line: 18 in the jsp file: /sampleApplication/call_function.jsp Generated servlet error: Syntax error on token "(", invalid Expression org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397) org.apache.jasper.compiler.Compiler.compile(Compiler.java:288) org.apache.jasper.compiler.Compiler.compile(Compiler.java:267) org.apache.jasper.compiler.Compiler.compile(Compiler.java:255) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
I am using Tomcat 5.5 as a servlet. It is running on port 8080 and I have the following Environmental variables.
Code:
CATALINA_HOME = C:\Program Files\Apache Software Foundation\Tomcat 5.5\ CLASSPATH = .;.;.;C:\PROGRA~1\JMF21~1.1E\lib\sound.jar; C:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;C:\PROGRA~1\JMF21~1.1E\lib; C:\WINDOWS\java\classes;. JAVA_HOME = C:\Program Files\Java\jdk1.6.0_06 System Variables: path = C:\Program Files\Java\jdk1.6.0_06\bin
I have traced the problem to the java.util.HashMap import. If I comment those out, then it works fine, but of course then my program doesn't run. For some reason it isn't getting the imports. Is there anything I have missed that would make it not be able to import?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to get a XAConnection from the DataSource. Eric Enterprise JavaBeans 3 05-16-2008 01:17 PM
unable to exceute stored procedures geeta_ravikanti Database 1 04-22-2008 04:39 AM
org.apache.jasper.JasperException: null ranjan_ashish26 Java Servlet 1 03-21-2008 07:06 AM
Unable to start WEbSphere server using RAD IDE uppaluru Other IDEs 1 02-13-2008 09:51 AM
Unable to compile gapper New To Java 2 01-14-2008 06:31 PM


All times are GMT +3. The time now is 03:02 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org