You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Steiner, Stephan" <St...@nextiraone.ch> on 2005/04/07 09:49:30 UTC

Moving jsp from development environment (v 5.0.28) to production environment (5.5.7) leads to complilation problems

Hi

I'm developing JSP applications on Netbeans 4.0, running on JDK
1.5.0_02-b09. I have no problem running my applications inside Netbeans on
my development Box (WinXP), yet when I move them to the productive
environment (W2K3 server with the latest Tomcat), some of the scripts can no
longer be compiled.

Here is one sample compilation message I get:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 2 in the jsp file: /index.jsp
Generated servlet error:
Syntax error on token "<", ( expected

An error occurred at line: 2 in the jsp file: /index.jsp
Generated servlet error:
Syntax error, insert ")" to complete Expression

An error occurred at line: 2 in the jsp file: /index.jsp
Generated servlet error:
Syntax error on token ":", ; expected

An error occurred at line: 2 in the jsp file: /index.jsp
Generated servlet error:
Syntax error on token ")", ; expected after this token

The jsp file starts with the following two lines:
<%@page language="java" import="java.net.InetAddress, java.util.*,
ldapsearch.Searcher" %><%
String thisServer = InetAddress.getLocalHost().getHostAddress();

Note however, that the error message is wrong. If I strip a lot of the code
at the bottom of the jsp file, it'll compile with the exact same first
couple of lines.

I also have Tomcat 5.5.7 installed on my development box, but the same thing
happens there. As a workaround, I compiled the jsp inside Netbeans, then put
the generated .java and .class files in the appropriate path on the
productive system, and that takes care of the problem, yet it means for the
slightest change of the jsp page, I have to recompile and move all 3 files
over to the productive machine.

Is there a solution to this? I figure for some wicked reason, Tomcat has
problems with certain .jsp files but so far I have not been able to find
anything that the files that cannot be compiled have in common with the ones
that can be compiled.. Depending on how much I remove from the jsp, it will
compile on Tomcat 5.5.7, but I'm afraid I cannot find the logic behind when
it'll compile and when it won't so I'm hoping somebody else has an idea.

Regards
Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Moving jsp from development environment (v 5.0.28) to production environment (5.5.7) leads to complilation problems

Posted by Navneet Karnani <na...@myrealbox.com>.
> Note however, that the error message is wrong. If I strip a lot of the code
> at the bottom of the jsp file, it'll compile with the exact same first
> couple of lines.
I figure this to be the problem with the compilet that Tomcat is using. 
Try and make the JDK (sun compiler) as the default for tomcat. This was 
the default in 5.0 in 5.5 they moved to the JDT compilet. This may fix 
the problem.

- Navneet
> 
> I also have Tomcat 5.5.7 installed on my development box, but the same thing
> happens there. As a workaround, I compiled the jsp inside Netbeans, then put
> the generated .java and .class files in the appropriate path on the
> productive system, and that takes care of the problem, yet it means for the
> slightest change of the jsp page, I have to recompile and move all 3 files
> over to the productive machine.
> 
> Is there a solution to this? I figure for some wicked reason, Tomcat has
> problems with certain .jsp files but so far I have not been able to find
> anything that the files that cannot be compiled have in common with the ones
> that can be compiled.. Depending on how much I remove from the jsp, it will
> compile on Tomcat 5.5.7, but I'm afraid I cannot find the logic behind when
> it'll compile and when it won't so I'm hoping somebody else has an idea.
> 
> Regards
> Stephan


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org