stefanaichholzer
asked on
Kiranhk, I still need you help, please...
Continued from question: https://www.experts-exchange.com/questions/21201663/Problems-with-JSP.html
I need to know how to make changes to my .jsp pages. When I first start the server (Tomcat) it all works fine, but as soon as I change the pages I get the same errors as on question Q_21201663.html (Compiler not found, etc.) I only can get around this problem if I run the startup.bat file and leave the DOS window alive all the time, then it will allow me to modify and run my .jsp files...
When Tomcat starts isn't it supposed to run startup.bat and allow me to change my .jsp pages as needed??
OK, basically that's the question, how can I run, modify & run my .jsp pages without having to restart the server all te time and also not to have the startup.bat file window alive all the time??
Thank you, hope to hear from you ASAP
;)
P.S. Why can't they make something as easy and fast as PHP?, there you never have to restart the server... ;)
I need to know how to make changes to my .jsp pages. When I first start the server (Tomcat) it all works fine, but as soon as I change the pages I get the same errors as on question Q_21201663.html (Compiler not found, etc.) I only can get around this problem if I run the startup.bat file and leave the DOS window alive all the time, then it will allow me to modify and run my .jsp files...
When Tomcat starts isn't it supposed to run startup.bat and allow me to change my .jsp pages as needed??
OK, basically that's the question, how can I run, modify & run my .jsp pages without having to restart the server all te time and also not to have the startup.bat file window alive all the time??
Thank you, hope to hear from you ASAP
;)
P.S. Why can't they make something as easy and fast as PHP?, there you never have to restart the server... ;)
tomcat 5 can run as a windows service so u should not need to start bat manually
> P.S. Why can't they make something as easy and fast as PHP?, there you never have to restart the server... ;)
Because it's a scripting language... ;-)
Because it's a scripting language... ;-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also add this in your %CATALINA_HOME%\conf\web.x
and put the following after this line
<servlet-class>org.apache.
<init-param>
<param-name>compiler</para
<param-value>your path to JAVAC.exe</param-value>
</init-param>
also pl tell clearly what u r doing with Tomcat moitor and if you have made any changes.
ASKER
1) I did not change the startup fils
2) Tomcat is already installed and running as a Windows service, I don't need to start the server using startup.bat
3) Isn't PHP a scripting language as well??
4) I added following to the %CATALINA_HOME%\conf\web.x ml file:
<servlet-class>org.apache. jasper.ser vlet.JspSe rvlet</ser vlet-class >
<init-param>
<param-name>compiler</para m-name>
<param-value>C:\Global\Jav a\jdk1.4\b in\javac.e xe</param- value>
</init-param>
5) I use Tomcat monitor only to "monitor" my server and to stop and start it. I haven't made any changes on it
--> Still not working, when I start the computer, Windows starts Tomcat as a service, and all works, fine, for example I get my pages at http://localhost/jsp/test.jsp - Works all good. As soon as I make any changes to the test.jsp page I get errors (compiler not found and so on).
Now, when I don't have Windows to start the service and I start it manually using the startup.bat I can make as many changes as I want to the test.jsp page and I never get errors.
What's going on there?, it seems to me that Tomcat run as a service is making something wrong and I don't know what it is, do you experts know?, if you do, please tell me as it's driving me nuts...
;)
2) Tomcat is already installed and running as a Windows service, I don't need to start the server using startup.bat
3) Isn't PHP a scripting language as well??
4) I added following to the %CATALINA_HOME%\conf\web.x
<servlet-class>org.apache.
<init-param>
<param-name>compiler</para
<param-value>C:\Global\Jav
</init-param>
5) I use Tomcat monitor only to "monitor" my server and to stop and start it. I haven't made any changes on it
--> Still not working, when I start the computer, Windows starts Tomcat as a service, and all works, fine, for example I get my pages at http://localhost/jsp/test.jsp - Works all good. As soon as I make any changes to the test.jsp page I get errors (compiler not found and so on).
Now, when I don't have Windows to start the service and I start it manually using the startup.bat I can make as many changes as I want to the test.jsp page and I never get errors.
What's going on there?, it seems to me that Tomcat run as a service is making something wrong and I don't know what it is, do you experts know?, if you do, please tell me as it's driving me nuts...
;)
did you check if there is anything in the logs. since tomcat is started as a windows service it will be writing all the output to the logs. can you check out and post if there is any details in the logs when u get this error
ASKER
Nothing at all in the logs :(
what exactly do you mean by nothing?
ASKER
I was reading the wrong log file.
I started Tomcat, actually Windows did, then went to my .jsp file and all was working fine. Changed the .jsp file, reloaded the browser and got errors as usual (Can't find compiler and so on). There log file ( localhost_log.2004-11-13.t xt ) was created and here are the contents:
2004-11-13 10:21:50 StandardContext[/stefan]Se ssionListe ner: sessionCreated('1F0F1C0537 A584FB1339 124A5FF0BC AE')
2004-11-13 10:22:42 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
at org.apache.tools.ant.taskd efs.compil ers.Compil erAdapterF actory.get Compiler(C ompilerAda pterFactor y.java:106 )
at org.apache.tools.ant.taskd efs.Javac. compile(Ja vac.java:9 35)
at org.apache.tools.ant.taskd efs.Javac. execute(Ja vac.java:7 64)
at org.apache.jasper.compiler .Compiler. generateCl ass(Compil er.java:38 2)
at org.apache.jasper.compiler .Compiler. compile(Co mpiler.jav a:472)
at org.apache.jasper.compiler .Compiler. compile(Co mpiler.jav a:451)
at org.apache.jasper.compiler .Compiler. compile(Co mpiler.jav a:439)
at org.apache.jasper.JspCompi lationCont ext.compil e(JspCompi lationCont ext.java:5 11)
at org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:2 95)
at org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:292)
at org.apache.jasper.servlet. JspServlet .service(J spServlet. java:236)
at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 802)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:237 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:1 57)
at org.apache.catalina.core.S tandardWra pperValve. invoke(Sta ndardWrapp erValve.ja va:214)
at org.apache.catalina.core.S tandardVal veContext. invokeNext (StandardV alveContex t.java:104 )
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:520)
at org.apache.catalina.core.S tandardCon textValve. invokeInte rnal(Stand ardContext Valve.java :198)
at org.apache.catalina.core.S tandardCon textValve. invoke(Sta ndardConte xtValve.ja va:152)
at org.apache.catalina.core.S tandardVal veContext. invokeNext (StandardV alveContex t.java:104 )
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:520)
at org.apache.catalina.core.S tandardHos tValve.inv oke(Standa rdHostValv e.java:137 )
at org.apache.catalina.core.S tandardVal veContext. invokeNext (StandardV alveContex t.java:104 )
at org.apache.catalina.valves .ErrorRepo rtValve.in voke(Error ReportValv e.java:118 )
at org.apache.catalina.core.S tandardVal veContext. invokeNext (StandardV alveContex t.java:102 )
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:520)
at org.apache.catalina.core.S tandardEng ineValve.i nvoke(Stan dardEngine Valve.java :109)
at org.apache.catalina.core.S tandardVal veContext. invokeNext (StandardV alveContex t.java:104 )
at org.apache.catalina.core.S tandardPip eline.invo ke(Standar dPipeline. java:520)
at org.apache.catalina.core.C ontainerBa se.invoke( ContainerB ase.java:9 29)
at org.apache.coyote.tomcat5. CoyoteAdap ter.servic e(CoyoteAd apter.java :160)
at org.apache.jk.server.JkCoy oteHandler .invoke(Jk CoyoteHand ler.java:3 00)
at org.apache.jk.common.Handl erRequest. invoke(Han dlerReques t.java:374 )
at org.apache.jk.common.Chann elSocket.i nvoke(Chan nelSocket. java:743)
at org.apache.jk.common.Chann elSocket.p rocessConn ection(Cha nnelSocket .java:675)
at org.apache.jk.common.Socke tConnectio n.runIt(Ch annelSocke t.java:866 )
at org.apache.tomcat.util.thr eads.Threa dPool$Cont rolRunnabl e.run(Thre adPool.jav a:683)
at java.lang.Thread.run(Unkno wn Source)
I wonder why it says "JAVA_HOME does not point to the JDK" after I change a .jsp page, if JAVA_HOME does point to the JDK when the server is started why would it change after? strange :(
Thanx
I started Tomcat, actually Windows did, then went to my .jsp file and all was working fine. Changed the .jsp file, reloaded the browser and got errors as usual (Can't find compiler and so on). There log file ( localhost_log.2004-11-13.t
2004-11-13 10:21:50 StandardContext[/stefan]Se
2004-11-13 10:22:42 StandardWrapperValve[jsp]:
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
at org.apache.tools.ant.taskd
at org.apache.tools.ant.taskd
at org.apache.tools.ant.taskd
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.compiler
at org.apache.jasper.JspCompi
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at javax.servlet.http.HttpSer
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.valves
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.apache.catalina.core.C
at org.apache.coyote.tomcat5.
at org.apache.jk.server.JkCoy
at org.apache.jk.common.Handl
at org.apache.jk.common.Chann
at org.apache.jk.common.Chann
at org.apache.jk.common.Socke
at org.apache.tomcat.util.thr
at java.lang.Thread.run(Unkno
I wonder why it says "JAVA_HOME does not point to the JDK" after I change a .jsp page, if JAVA_HOME does point to the JDK when the server is started why would it change after? strange :(
Thanx
For starting the server it doesnt require JDK, if you just have a JRE installed it will start the server. but when you are accessing the jsp pages which have been modified then it requires a javac.exe on its path which is available in JDK installation. so pl check out again whether you have put the path to the JDK properly.
also pl check out in your windows PATH environment variable if it has JDK path before any of your JRE path.
The JDK path needs to be first!!!!!!!!!!!!!!!!!
check this out and try again. The PATH env variable might be pointing to a JRE first and then your JDK.
also pl check out in your windows PATH environment variable if it has JDK path before any of your JRE path.
The JDK path needs to be first!!!!!!!!!!!!!!!!!
check this out and try again. The PATH env variable might be pointing to a JRE first and then your JDK.
ASKER
I have the JDK in the path and the path variable in the system does not have a JRE path, only the JDK one.
Drives me nuts... ;)
Drives me nuts... ;)
ASKER
I guess it's not a PATH issue. When I start the server using the startup.bat all works fine, I can change all my .jsp pages without any problems, all works as it has to.
The problem is when Windows start the server, as a service...
Why is this happening and how can I solve it?
Paths are all fine because if it was a path issue no .jsp could be changed at all, but as I said, it works just fine when I launch the server using the startup.bat
Thanx ;)
The problem is when Windows start the server, as a service...
Why is this happening and how can I solve it?
Paths are all fine because if it was a path issue no .jsp could be changed at all, but as I said, it works just fine when I launch the server using the startup.bat
Thanx ;)
>>>>I guess it's not a PATH issue. When I start the server using the startup.bat all works fine
this is becoz you have set the JAVA_HOME to the JDK path in your startup.bat.
can you post your path variable contents here
open a command prompt and execute this command and post the contents here
set path
this is becoz you have set the JAVA_HOME to the JDK path in your startup.bat.
can you post your path variable contents here
open a command prompt and execute this command and post the contents here
set path
also can you check out your Registry and see where your java is pointing to.
To get more into go thro' this Thread
https://www.experts-exchange.com/questions/21157924/java-installation.html
To get more into go thro' this Thread
https://www.experts-exchange.com/questions/21157924/java-installation.html
ASKER
set path produced:
Path=C:\Global\Java\jdk1.4 ;%SystemRo ot%\system 32;%System Root%;%Sys temRoot%\S ystem32\Wb em;C:\Prog ram Files\ATI Control Panel;C:\Global\Apache\Ora cle\bin
PATHEXT=.COM;.EXE;.BAT;.CM D;.VBS;.VB E;.JS;.JSE ;.WSF;.WSH
From regedit:
you can type regedit from start->run.
from the Registry editor u can check out the HKEY_LOCAL_MACHINE-->SOFTW ARE-->Java Soft-->Jav a Development Kit
you can check out where this is pointing to, if it is wrong you can change the same and try running java -version on your command prompt.
I don't have the "Java Development Kit" folder in my JavaSoft folder in the registry
Path=C:\Global\Java\jdk1.4
PATHEXT=.COM;.EXE;.BAT;.CM
From regedit:
you can type regedit from start->run.
from the Registry editor u can check out the HKEY_LOCAL_MACHINE-->SOFTW
you can check out where this is pointing to, if it is wrong you can change the same and try running java -version on your command prompt.
I don't have the "Java Development Kit" folder in my JavaSoft folder in the registry
ASKER
OK, I fixed it, following link: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html
It said that if the path is wrong in the installation, the server won't be able to compile .jsp files at runtime, so it suggested to copy the lib\tools.jar file from a JDK installation to the common\lib path of the Tomcat installation, that's what I did and the problem is fixed.
Still is there any way to change the path the installer created?
Point go to kiranhk for the link
Thanx
;)
It said that if the path is wrong in the installation, the server won't be able to compile .jsp files at runtime, so it suggested to copy the lib\tools.jar file from a JDK installation to the common\lib path of the Tomcat installation, that's what I did and the problem is fixed.
Still is there any way to change the path the installer created?
Point go to kiranhk for the link
Thanx
;)
Was JAVA_HOME set correctly when you did the install?
ASKER
Well, that I don't know, I know PATH was set right:
Path=C:\Global\Java\jdk1.4 ;%SystemRo ot%\system 32;%System Root%;%Sys temRoot%\S ystem32\Wb em;C:\Prog ram Files\ATI Control Panel;C:\Global\Apache\Ora cle\bin
But I guess I had a mistake in the PATH as well, because I had a previous JDK installation...
Thank you for your time
Path=C:\Global\Java\jdk1.4
But I guess I had a mistake in the PATH as well, because I had a previous JDK installation...
Thank you for your time
what exactly did u move in the 1st place?