Problems with a web application running a PHP script
Hello, I'm trying to run a PHP script under my web application for tomcat, developed wiwith Netbeans 551. Under Netbeans it works. But wen deploy it under Tomcat 5.5.25 I get this error when I try to access at a PHP page: INFO: Marking servlet JSR223Script as unavailable 2-nov-2007 22.56.36 org.apache.catalina.core.StandardWrapperValve invoke GRAVE: Allocate exception for servlet JSR223Script java.lang.NoSuchMethodError: javax.script.ScriptEngineManager.getEngineFactories()[Ljavax/script/ScriptEngineFactory; at com.sun.script.http.ScriptServlet$EngineRepository.(ScriptServlet.java:106) at com.sun.script.http.ScriptServlet.(ScriptServlet.java:27) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:544) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) I cant figure out what I'm missing.. rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems with a web application running a PHP script
> From: Rocco Scappatura [mailto:[EMAIL PROTECTED] > Subject: Problems with a web application running a PHP script > > Under Netbeans it works. But wen deploy it under Tomcat > 5.5.25 I get this error when I try to access at a PHP page: > > java.lang.NoSuchMethodError: > javax.script.ScriptEngineManager.getEngineFactories() > [Ljavax/script/ScriptEngineFactory; > > I cant figure out what I'm missing.. Possibly the correct JRE/JDK for Tomcat. The above class and method exist only in Java SE 6; what JVM are you trying to run Tomcat with? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems with a web application running a PHP script
>> From: Rocco Scappatura [mailto:[EMAIL PROTECTED] >> Subject: Problems with a web application running a PHP script >> >> Under Netbeans it works. But wen deploy it under Tomcat >> 5.5.25 I get this error when I try to access at a PHP page: >> >> java.lang.NoSuchMethodError: >> javax.script.ScriptEngineManager.getEngineFactories() >> [Ljavax/script/ScriptEngineFactory; >> >> I cant figure out what I'm missing.. > > Possibly the correct JRE/JDK for Tomcat. The above class and method > exist only in Java SE 6; what JVM are you trying to run Tomcat with? Thanks Chunck, I'm a newbie with Tomcat and I'm not experencied with Java programming... Anyway, the version of Java I'm using is: C:\Documents and Settings\rocco>java -version java version "1.6.0_02" Java(TM) SE Runtime Environment (build 1.6.0_02-b06) Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode) Moreover, I have noticed that in there is an INFO in catalina logs of both Tomcat - The one used by Netbeans (5.5.17) and the separate one installed by me (5.5.25) - that reports the java.lib.path: - On Tomcat 5.5.17 catalina logs: 2-nov-2007 21.38.51 org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programmi\Java\jdk1.5.0_13\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programmi\PC-Doctor for Windows\services;C:\Programmi\QuickTime\QTSystem\;C:\Programmi\IDM Computer Solutions\UltraEdit-32;C:\Programmi\WinSCP\;C:\Programmi\ZipGenius 6\;C:\php5;C:\Programmi\MySQL\MySQL Server 5.0\bin - On Tomcat 5.5.25 catalina logs: 2-nov-2007 22.03.49 org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Tomcat\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programmi\PC-Doctor for Windows\services;C:\Programmi\QuickTime\QTSystem\;C:\Programmi\IDM Computer Solutions\UltraEdit-32;C:\Programmi\WinSCP\;C:\Programmi\ZipGenius 6\;C:\php5;C:\Programmi\MySQL\MySQL Server 5.0\bin Remember that on Tomcat 5.5.17 PHP works fine while on Tomcat 5.5.25 an error occour whenever I try to access to a PHP page. Please note that 'C:\WINDOWS\Sun\Java\bin' is an inexistent path and that I have tried to set the correct path of java binary in PATH environment variable but get always the same error (indeed it seemes that Tomcat has not read the new value of PATH environment variable. Maybe do I had had to restart my computer?). The last question: how I have to do to take away the message " The Apache Tomcat Native library which allows optimal performance.."? Thanks, rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool pojo application server --- Hi Rocco, listen I'm learning something here as well, I didnt even know Java 6 has a built in scripting engine. I cant solve your coding problem, but I can show you how to fix it yourself. Firstly dont worry too much about the Tomcat Native library message, that is not the cause of the problem. That is telling you that you are missing the tcnative-1.dll file, and what that does is make it run faster with sockets that work in C. I imagine you have unzipped and installed it yourself, I think if you on windows... if you get the Installer Version... then just running setup does all this stuff and gives you a windows service as well, installs the native libs and all that good stuff. so remove that installation and do that, much easier. OR... download tcnative-1.dll yourself and install it in the one of the locations, make sure its the right one for the version you usiing... too much hassle ;) When you install the new application make sure Netbeans is not running. OK, so now you have the new Tomcat installed. + Tell netbeans to use it Go to TOOLS - > SERVER MANAGER and show netbeans where the new Tomcat is. LOOK at the JRE in the NB 5.17 version of TC is using, it may be pointing at your JDK, not the JRE. When you install the new TC, make sure when it asks you that you point at the same one. ie you can have JRE 5 on the machine and TC can be told to use JDK 6 check that. Now in your application project, if your RIGHT CLICK -> RUN you will see you can tell it to use the new TC in that application. Now when you run it, it will probably take you to the line of code that is causing the problem You can swap between different tomcats and experiment. When you work in NB, you can start and stop the tomcats from the RUN tab, you can only have one running at a time. Before you deploy to the new tomcat, in NB RUN tab UNDEPLOY the application, and stop that TC because otherwise even if you drop the WAR into tomcat it will still look at the application in NB NB does not have to use the embedded TC Have fun - Original Message - From: "Rocco Scappatura" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Sunday, November 04, 2007 1:05 PM Subject: RE: Problems with a web application running a PHP script From: Rocco Scappatura [mailto:[EMAIL PROTECTED] Subject: Problems with a web application running a PHP script Under Netbeans it works. But wen deploy it under Tomcat 5.5.25 I get this error when I try to access at a PHP page: java.lang.NoSuchMethodError: javax.script.ScriptEngineManager.getEngineFactories() [Ljavax/script/ScriptEngineFactory; I cant figure out what I'm missing.. Possibly the correct JRE/JDK for Tomcat. The above class and method exist only in Java SE 6; what JVM are you trying to run Tomcat with? Thanks Chunck, I'm a newbie with Tomcat and I'm not experencied with Java programming... Anyway, the version of Java I'm using is: C:\Documents and Settings\rocco>java -version java version "1.6.0_02" Java(TM) SE Runtime Environment (build 1.6.0_02-b06) Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode) Moreover, I have noticed that in there is an INFO in catalina logs of both Tomcat - The one used by Netbeans (5.5.17) and the separate one installed by me (5.5.25) - that reports the java.lib.path: - On Tomcat 5.5.17 catalina logs: 2-nov-2007 21.38.51 org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programmi\Java\jdk1.5.0_13\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programmi\PC-Doctor for Windows\services;C:\Programmi\QuickTime\QTSystem\;C:\Programmi\IDM Computer Solutions\UltraEdit-32;C:\Programmi\WinSCP\;C:\Programmi\ZipGenius 6\;C:\php5;C:\Programmi\MySQL\MySQL Server 5.0\bin - On Tomcat 5.5.25 catalina logs: 2-nov-2007 22.03.49 org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Tomcat\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programmi\PC-Doctor for Windows\services;C:\Programmi\QuickTime\QTSystem\;C:\Programmi\IDM Computer Solutions\UltraEdit-32;C:\Programmi\WinSCP\;C:\Programmi\ZipGenius 6\;C:\php5;C:\Programmi\MySQL\MySQL Server 5.0\bin Remember that on Tomcat 5.5.17 PHP works fine while on Tomcat 5.5.25 an error occour whenever
RE: Problems with a web application running a PHP script
> From: Rocco Scappatura [mailto:[EMAIL PROTECTED] > Subject: RE: Problems with a web application running a PHP script > > Anyway, the version of Java I'm using is: > Java(TM) SE Runtime Environment (build 1.6.0_02-b06) > Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode) That's an appropriate version. > - On Tomcat 5.5.17 catalina logs: 2-nov-2007 21.38.51 > org.apache.catalina.core.AprLifecycleListener lifecycleEvent > INFO: The Apache Tomcat Native library which allows optimal > performance in production environments was not found on the > java.library.path: As Johnny K noted, that message is ignorable. Unless you really need the performance boost that APR provides (not likely), you can get rid of the message just by commenting out the AprLifecycleListener in conf server.xml; that avoids having to install the extra .dll file. > C:\Programmi\Java\jdk1.5.0_13\bin The above entry is coming from another older JDK that you have installed; you should remove it. > C:\Tomcat\bin;.;C:\WINDOWS\Sun\Java\bin; The above is normal and is added automatically during Windows JVM initialization, regardless of whether or not the directory actually exists. > I have tried to set the correct path of java binary in PATH > environment variable but get always the same error If you're running Tomcat as a service the environment variables are meaningless; you control the attributes of the JVM with the Java tab of the tomcat5w.exe program. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
> Firstly dont worry too much about the Tomcat Native library message, that > is not the cause of the problem. OK. For the moment I will ignore it as suggested by Chuck. > OK, so now you have the new Tomcat installed. > > + Tell netbeans to use it Go to TOOLS - > SERVER MANAGER and show > netbeans where the new Tomcat is. I have added the TC 5.5.25 (The one I have installed) as J2EE platform. > LOOK at the JRE in the NB 5.17 version of TC is using, it may be pointing > at your JDK, not the JRE. > When you install the new TC, make sure when it asks you that you point at > the same one. > ie you can have JRE 5 on the machine and TC can be told to use JDK 6 > check that. I have installed: - jdk 1.5.0.13 - jre 1.5.0.13 --> jre 1.6.0.02 In NB, Java platform is set for both TC is 'JDK 1.5 (Default)' whose folder path is 'C:\Programmi\Java\jdk1.5.0_13' (i.e.: The installation path for the jdk 1.5.0.13 that I have installed.) > Now in your application project, if your RIGHT CLICK -> RUN you will see > you can tell it to use the new TC in that application. > Now when you run it, it will probably take you to the line of code that is > causing the problem > You can swap between different tomcats and experiment. Infact.. I'm seeing some problems.. > When you work in NB, you can start and stop the tomcats from the RUN tab, > you can only have one running at a time. > Before you deploy to the new tomcat, in NB RUN tab UNDEPLOY the > application, and stop that TC because otherwise even if you drop the > WAR into tomcat it will still look at the application in NB > > NB does not have to use the embedded TC > Have fun Thanks. I will investigate to solve the problems and I eventually ask you if I still cant run PHP scripts in my application. Bye, rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool pojo application server --- - Original Message - From: "Rocco Scappatura" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Monday, November 05, 2007 9:25 AM Subject: Re: Problems with a web application running a PHP script Firstly dont worry too much about the Tomcat Native library message, that is not the cause of the problem. OK. For the moment I will ignore it as suggested by Chuck. OK, so now you have the new Tomcat installed. + Tell netbeans to use it Go to TOOLS - > SERVER MANAGER and show netbeans where the new Tomcat is. I have added the TC 5.5.25 (The one I have installed) as J2EE platform. LOOK at the JRE in the NB 5.17 version of TC is using, it may be pointing at your JDK, not the JRE. When you install the new TC, make sure when it asks you that you point at the same one. ie you can have JRE 5 on the machine and TC can be told to use JDK 6 check that. I have installed: - jdk 1.5.0.13 - jre 1.5.0.13 --> jre 1.6.0.02 In NB, Java platform is set for both TC is 'JDK 1.5 (Default)' whose folder path is 'C:\Programmi\Java\jdk1.5.0_13' (i.e.: The installation path for the jdk 1.5.0.13 that I have installed.) As Chuck mentioned , this script class is in 1.6 so you need to either change the environment variable or if from service set it to 1.6. Then there is just one other thing, in NB right click->properties->source... Check the source level... ie you can be running on 1.6 but still tell NB to make it 1.5... which will also snooker you ;) Now in your application project, if your RIGHT CLICK -> RUN you will see you can tell it to use the new TC in that application. Now when you run it, it will probably take you to the line of code that is causing the problem You can swap between different tomcats and experiment. Infact.. I'm seeing some problems.. When you work in NB, you can start and stop the tomcats from the RUN tab, you can only have one running at a time. Before you deploy to the new tomcat, in NB RUN tab UNDEPLOY the application, and stop that TC because otherwise even if you drop the WAR into tomcat it will still look at the application in NB NB does not have to use the embedded TC Have fun Thanks. I will investigate to solve the problems and I eventually ask you if I still cant run PHP scripts in my application. Bye, rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
>> I have installed: >> >> - jdk 1.5.0.13 >> - jre 1.5.0.13 --> jre 1.6.0.02 >> >> In NB, Java platform is set for both TC is 'JDK 1.5 (Default)' whose >> folder path is 'C:\Programmi\Java\jdk1.5.0_13' (i.e.: The installation >> path for the jdk 1.5.0.13 that I have installed.) > > As Chuck mentioned , this script class is in 1.6 so you need to either > change the environment variable or if from service set it to 1.6. > Then there is just one other thing, in NB right > click->properties->source... > Check the source level... > ie you can be running on 1.6 but still tell NB to make it 1.5... which > will > also snooker you ;) > Soory but I haven't understood what Chuck said in his first email. However, I can't set a such source level (1.6). Do I have to downgrade JDK to 1.5? rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems with a web application running a PHP script
> From: Rocco Scappatura [mailto:[EMAIL PROTECTED] > Subject: Re: Problems with a web application running a PHP script > > Soory but I haven't understood what Chuck said in his first email. Just as a refresher, here's what I said: >> Possibly the correct JRE/JDK for Tomcat. The above class and method >> exist only in Java SE 6; what JVM are you trying to run Tomcat with? > However, I can't set a such source level (1.6). No one's asking you to set the source level for compilations; you just have to run with a 1.6 JVM, which it appears you're not actually doing (even though you have it installed). If you have other JRE/JDK levels installed, get rid of them to reduce the possibility of confusion. > Do I have to downgrade JDK to 1.5? No, the method you're trying to use exists only in 1.6. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
> As Chuck mentioned , this script class is in 1.6 so you need to either > change the environment variable or if from service set it to 1.6. > Then there is just one other thing, in NB right > click->properties->source... > Check the source level... > ie you can be running on 1.6 but still tell NB to make it 1.5... which > will > also snooker you ;) OK, even if NB doesn't show me the choice to use 1.6 script class. I ve set the 1.5. Other that this, I would like to know how I could solve my initial problem. Moreover I have another question. When I create a new project in NB, do I set the 'Project folder' as the folder where I put webapps (i.e.: suppose that I put every webapps in "C:\tomcat", then I have to set "Project Folder" to "C:\tomcat")?. Infact, otherwise (in particular, I have defined a different engine, host, connector and so on) I can't start the web application after deployment with NB. Thanks, rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool pojo application server --- - Original Message - From: "Rocco Scappatura" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Tuesday, November 06, 2007 2:37 AM Subject: Re: Problems with a web application running a PHP script As Chuck mentioned , this script class is in 1.6 so you need to either change the environment variable or if from service set it to 1.6. Then there is just one other thing, in NB right click->properties->source... Check the source level... ie you can be running on 1.6 but still tell NB to make it 1.5... which will also snooker you ;) OK, even if NB doesn't show me the choice to use 1.6 script class. I ve set the 1.5. That, to me seems to be the problem, if Netbeans is not giving you the choice of 1.6 it can only see JRE 1.5 Scripting is a new feature in JRE 1.6! So you need to tell TC and NB to use the JRE 1.6 If TC running as a service if you double click on the feather in the task bar, and go to the JAVA tab, in the JVM setting you will see something like C:\jdk1.5.0_06\jre\bin\server\jvm.dll must be (find it on your machine) C:\jdk1.6\jre\bin\server\jvm.dll In NB, you go to TOOLS->PLATFORM MANAGER and show it where you have Java JRE/JDK 1.6 installed Then just make sure you existing project uses it at source level, ie it will still give you the option of compiling it as 1.5, but thats no good it must be 1.6. Other that this, I would like to know how I could solve my initial problem. As we understand it, your application is looking for a class that only comes in 1.6 It can find that class because the Java engine you running is 1.5. But as we understood it, it was working in the embedded TC that comes with NB, so that implies that it was working on JRE 1.6 and that the new TC was not... We THINK the problem is that you have things working on different JRE's on your machine... they must all work on the the same 1.6 one, then your DEV environment and various TC's will work together. Moreover I have another question. When I create a new project in NB, do I set the 'Project folder' as the folder where I put webapps (i.e.: suppose that I put every webapps in "C:\tomcat", then I have to set "Project Folder" to "C:\tomcat")?. NO... create a convenient projects folder on your machine and NB will put the files there. When you compile, and run, NB creates a build folder, and then ASKS the TC that you have SET, to run it. So it actually runs in that new TC you installed. When its all debugged... and I imagine now its taking you to a functions that it cant find (because the class is in JRE6), then you stop NB from running that Tomcat compile it and just drop the WAR into any TC the USES JRE 1.6 Infact, otherwise (in particular, I have defined a different engine, host, connector and so on) I can't start the web application after deployment with NB. NO, in the DEV environment you do nat have to deploy, just compile and run it or debug it. When you done you can deploy... but I prefer actually copying the WAR file from the project to WEBAPPS, that what other people will do. If you deploy it the TC wants to use the file now in TC webapps... but while you testing you still want it to use the files in NB BUILD (your test project) because you can debug that easily. Get the JRE the same for everything You may be collecting JRE's automatically on windows... it does that What I always to is get the actual JDK for java, stick that in a special folder, and tell the DEV environment to use it... then everytime browser JRE prompt for updates, it doesnt matter if the user on the machine installs all this stuff. If you install the JDK1.6 Then install TC (on windows its setup)... point at that JDK6 Then install NB (on windows its setup)... point at that JDK6 Then just show NB where the new TC is. You done! Good luck ;) Thanks, rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool pojo application server --- FootNote Having a separate TC, (not using the embedded one in NB) is much better. When you compile and run (just make sure PROPERTIES->RUN) is using the new TC, then your project (even though the files are in your projects) runs in the NEW TC The log files and conf setting and all that stuff that are now in affect... are the ones in the NEW TC, ie that not hiding in weird places like the embedded TC, ie it is exactly the same as any other TC installation. Then I have other ones that I setup for port 80, and for testing clustering and all that stuff. So the one in my NB is purely for testing and I can screw around with server.xml etc without affecting those the production environment ie when it comes time to move to say the port 80 test level, then I literally copy the WAR into those TC's... ie I keep it seperate from the test versions the reason for this is that if you mix them its very easy to think a webapp is working and whats in fact happening is that its still running the webapp in NB... so then when someone deletes it, or changes it, the production server goes ape keep them seperate. Keep going you almost there... if you get this right, developing with TC like this is magic... - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
> > --- > HARBOR: http://coolharbor.100free.com/index.htm > Now Tomcat is also a cool pojo application server > --- > - Original Message - > From: "Rocco Scappatura" <[EMAIL PROTECTED]> > To: "Tomcat Users List" > Sent: Tuesday, November 06, 2007 2:37 AM > Subject: Re: Problems with a web application running a PHP script > > >> >>> As Chuck mentioned , this script class is in 1.6 so you need to either >>> change the environment variable or if from service set it to 1.6. >>> Then there is just one other thing, in NB right >>> click->properties->source... >>> Check the source level... >>> ie you can be running on 1.6 but still tell NB to make it 1.5... which >>> will >>> also snooker you ;) >> >> OK, even if NB doesn't show me the choice to use 1.6 script class. I ve >> set the 1.5. > > That, to me seems to be the problem, if Netbeans is not giving you the > choice of 1.6 > it can only see JRE 1.5 Thanks for you hints. I will disinstall all JDK/JRE versions from my PC. I'm dowloading JDK 6 Update 3 and I will install it. Finally I do so that the Tomcat 5.5.25 (The one installed by hand) is used by projects. Moreover I will do so it is used 1.6 script class. BTW I have a folder (C:/Project) where all the projects are built. When the webapps work, then I will grab the WAR files and I put in the appropriate 'webapps' of my production environment. This seems to me the correct procedure that I infere from your argumentation. Thanks, rocsca Thanks, rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool pojo application server --- Another FootNote Just so you understand where I'm trying to get you to... I'm trying to show you that instead of dropping a WAR into a TC and then looking at errors in a log. You can connect NB to that TC, keep the code in your DEV environment. Then errors are right there when you try run it, it will take you to the line of code that is bitching, you can right click and have a look at the javadocs and learn about the function, you can switch source levels and find it works on 1.6 but not 1.5, you can swap to a different TC and run it if you suspect a server settings. You can help yourself ;) Hope that gets you going... - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool pojo application server --- - Original Message - From: "Rocco Scappatura" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Tuesday, November 06, 2007 9:17 AM Subject: Re: Problems with a web application running a PHP script Thanks for you hints. I will disinstall all JDK/JRE versions from my PC. I'm dowloading JDK 6 Update 3 and I will install it. No problem, you got me curious about scripting... I Tested with this == protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); out.println(""); out.println(""); out.println("Servlet NewServlet"); out.println(""); out.println(""); out.println(); out.println("Stand Back... Script running"); ScriptEngineManager scriptMgr = new ScriptEngineManager(); ScriptEngine jsEngine = scriptMgr.getEngineByName("JavaScript"); try { jsEngine.eval("var meJavaScript = 'Me-Java Script!';"); out.println("" + jsEngine.get("meJavaScript") + ""); } catch (ScriptException ex) { out.println("Oh Damn! Script Crashed " + ex.getMessage() + ""); ex.printStackTrace(); } out.println(""); out.println(""); out.close(); } === Hey it works But in the process I discovered a few things + Even if TC is installed on 1.5. if NB is using 1.6 and its run from the DEV enviroment... it will make TC use 1.6 So... thats probably whats happening to you. Its easy to check because in NB system out it tells you which JRE is used. And when you start TC from the BAT it will tell you... as well... in your case probably 1.5 + The Source level makes no difference in a servlet ie if the JRE is 1.6, you cant bring it down, this is different to normal Java Programs that will do things like tell you it now doesnt understand a template... but in servlets it seems to ignore that. Anyway it works Quite neat the scripting thing May even be the beginning of a new chapter in TC there are always guys saying... "can TC run PHP", I see one can even run stuff like JavaFX Thank u - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with a web application running a PHP script
>> Thanks for you hints. I will disinstall all JDK/JRE versions from my PC. >> I'm dowloading JDK 6 Update 3 and I will install it. > > No problem, you got me curious about scripting... > I Tested with this > == > protected void processRequest(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > response.setContentType("text/html;charset=UTF-8"); > PrintWriter out = response.getWriter(); > > > out.println(""); > out.println(""); > out.println("Servlet NewServlet"); > out.println(""); > out.println(""); > out.println(); > out.println("Stand Back... Script running"); > > ScriptEngineManager scriptMgr = new ScriptEngineManager(); > ScriptEngine jsEngine = scriptMgr.getEngineByName("JavaScript"); > try { > jsEngine.eval("var meJavaScript = 'Me-Java Script!';"); > out.println("" + jsEngine.get("meJavaScript") + ""); > } > catch (ScriptException ex) { > out.println("Oh Damn! Script Crashed " + ex.getMessage() + > ""); > ex.printStackTrace(); > } > > out.println(""); > out.println(""); > out.close(); > } > > === > > Hey it works > But in the process I discovered a few things > > + Even if TC http://webmail.sttspa.it/src/webmail.php Mail for rscappatis installed on 1.5. if NB is using 1.6 and its run from > the DEV enviroment... it will make TC use 1.6 > So... thats probably whats happening to you. > Its easy to check because in NB system out it tells you which JRE is used. > And when you start TC from the BAT it will tell you... as well... in your > case probably 1.5 > > + The Source level makes no difference in a servlet ie if the JRE is > 1.6, you cant bring it down, this is different to normal Java Programs > that > will do things like tell you it now doesnt understand a template... but in > servlets it seems to ignore that. > > Anyway it works OK. I ve tried toaccomplish all the steps I sayd in my previous email. It is a war! Before report you the output at TC starting, I would like to best depict my environment: - Two services: 1) Catalina. With a connector listening on port 8080, with manager and admin bundle application deploied) 2) Rocsca. With a connector listening on port 80, with other two application one of which I have developed (in part) and which I would like to debug and to continue to develop. Moreover I would liketo setup the other application and to setup both so that they can interact. I get get a long series of errors at TC startup, some of which are obvious (but I report as well because I'ld like to correct my trivial errors in setting up my devel environment..): Using CATALINA_BASE: C:\Tomcat Using CATALINA_HOME: C:\Tomcat Using CATALINA_TMPDIR: C:\Tomcat\temp Using JRE_HOME:C:\Programmi\Java\jdk1.6.0_03 6-nov-2007 20.14.23 org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programmi\Java\jdk1.6.0_03\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programmi\PC-Doctor for Windows\services;C:\Programmi\QuickTime\QTSystem\;C:\Programmi\IDM Computer Solutions\UltraEdit-32;C:\Programmi\WinSCP\;C:\Programmi\ZipGenius 6\;C:\php5;C:\Programmi\MySQL\MySQL Server 5.0\bin;C:\Programmi\Java\jdk1.5.0_13\bin 6-nov-2007 20.14.23 org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-80 6-nov-2007 20.14.23 org.apache.coyote.http11.Http11BaseProtocol init GRAVE: Error initializing endpoint java.net.BindException: Address already in use: JVM_Bind:80 at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:298) at org.apache.coyote.http11.Http11BaseProtocol.init(Http11BaseProtocol.java:139) at org.apache.catalina.connector.Connector.initialize(Connector.java:1017) at org.apache.catalina.core.StandardService.initialize(StandardService.java:578) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:782) at org.apache.catalina.startup.Catalina.load(Catalina.java:504) at org.apache.catalina.startup.Catalina.load(Catalina.java:524) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:267) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) 6-nov-2007 20.14.2
Re: Problems with a web application running a PHP script
>> Thanks for you hints. I will disinstall all JDK/JRE versions from my PC. >> I'm dowloading JDK 6 Update 3 and I will install it. > > No problem, you got me curious about scripting... > I Tested with this > == > protected void processRequest(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > response.setContentType("text/html;charset=UTF-8"); > PrintWriter out = response.getWriter(); > > > out.println(""); > out.println(""); > out.println("Servlet NewServlet"); > out.println(""); > out.println(""); > out.println(); > out.println("Stand Back... Script running"); > > ScriptEngineManager scriptMgr = new ScriptEngineManager(); > ScriptEngine jsEngine = scriptMgr.getEngineByName("JavaScript"); > try { > jsEngine.eval("var meJavaScript = 'Me-Java Script!';"); > out.println("" + jsEngine.get("meJavaScript") + ""); > } > catch (ScriptException ex) { > out.println("Oh Damn! Script Crashed " + ex.getMessage() + > ""); > ex.printStackTrace(); > } > > out.println(""); > out.println(""); > out.close(); > } > Hello Chunk, I have a big news. After I have installed: java version "1.6.0_03" Java(TM) SE Runtime Environment (build 1.6.0_03-b05) Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing) and set this new platform for my web appl, I get that the web app does not works under NB bundled Tomcat too (other than unnder Tomcat 5.5.25 installed by hand). At this point, I think that is almost clear that scripting (JSR223Script class) working depends on JDK version (I can't figure out if there is a particular class releases with JDK that is guilty of this incompatibility). If someone has a more technical explanationis welcomed! :-) rocsca - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]