From: <php...@li...> - 2010-07-06 19:39:25
|
Hi - (Sorry if this gets posted multiple times, but I have had a horrid time trying to subscribe/post to this mail list and apparently cannot contact the list administrator either, (no replies to my attempts to do so) so I have tried to unsubscribe, resubscribe and repost...) I am following the instructions found at - http://php-java-bridge.sourceforge.net/doc/tomcat6.php to integrate PHP with my Tomcat6 server and have ran into a snag which I don't quite understand. I got through the first two parts ok - Download and install Java, Tomcat and PHP Install a PHP web application into Tomcat and ran the test examples fine. But when I tried to follow the instructions for the third section to make PHP available to all web apps - PHP support for all existing Tomcat web applications and tried to execute the small test example I am getting the following stack walkback error reported via an HTTP Status 500 web page - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Error instantiating servlet class php.java.servlet.fastcgi.FastCGIServlet org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) java.lang.Thread.run(Thread.java:619) root cause java.lang.InstantiationException sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30) java.lang.reflect.Constructor.newInstance(Constructor.java:513) java.lang.Class.newInstance0(Class.java:355) java.lang.Class.newInstance(Class.java:308) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) java.lang.Thread.run(Thread.java:619) I have placed the jar files in the Tomcat lib directory and they appear to be fine with same ownership and permissions as the rest of the jar files. Some additional info - Running under SuSE 11.2 x86_64 Tomcat6 ver 6.0.20-24.6.2 noarch Java-1_6_0-sun x86_64 PHP5 ver 5.3.2-1.1.1 x86_84 Appreciate any offers of help and thanks in advance.. Marc.. - |
From: <php...@li...> - 2010-07-06 20:01:06
|
Hi, > Tomcat6 ver 6.0.20-24.6.2 noarch Please download and install the original tomcat from apache.org. Please see http://php-java-bridge.sourceforge.net/doc/installation.php for details. Regards, Jost Bökemeier |
From: <php...@li...> - 2010-07-08 02:01:26
|
On 7/6/2010 1:00 PM, php...@li... wrote: > Hi, > > >> Tomcat6 ver 6.0.20-24.6.2 noarch >> > Please download and install the original tomcat from apache.org. > Please see http://php-java-bridge.sourceforge.net/doc/installation.php > for details. > > > Regards, > Jost Bökemeier > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > Jost - Thanks for your reply, but sorry to report that it resulted in exactly the same symptoms. So no joy! I did a fresh download of Tomcat 6 and placed it in a separate directory, stopped my original version, started the new version, followed the instructions as previously described and got exactly the same servlet exception error... Marc... |
From: <php...@li...> - 2010-07-08 08:18:22
|
> Jost - Thanks for your reply, but sorry to report that it resulted in > exactly the same symptoms. So no joy! If both tomcat intances show the same problem, the cause is external, for example a classpath problem. A "NoClassDefFoundError" for example caused b a library loaded from an external loader (e.g. the bootstrap loader). Please check the cause why your tomcat isn't able to instanciate a standard Java servlet. Regards, Jost Bökemeier |
From: <php...@li...> - 2010-07-07 03:48:12
|
Can u post ur code? You've also made the appropriate changes to conf/server.xml I assume? --Sravan On 7/7/10, php...@li... <php...@li...> wrote: > Hi - > (Sorry if this gets posted multiple times, but I have had a horrid time > trying to subscribe/post to this mail list and apparently cannot contact > the list administrator either, (no replies to my attempts to do so) so I > have tried to unsubscribe, resubscribe and repost...) > > I am following the instructions found at - > > http://php-java-bridge.sourceforge.net/doc/tomcat6.php > > to integrate PHP with my Tomcat6 server and have ran into a snag which I > don't quite understand. I got through the first two parts ok - > > Download and install Java, Tomcat and PHP > Install a PHP web application into Tomcat > > and ran the test examples fine. But when I tried to follow the > instructions for the third section to make PHP available to all web apps - > > PHP support for all existing Tomcat web applications > > and tried to execute the small test example I am getting the following > stack walkback error reported via an HTTP Status 500 web page - > > type Exception report > message > description The server encountered an internal error () that prevented > it from fulfilling this request. > exception > > javax.servlet.ServletException: Error instantiating servlet class > php.java.servlet.fastcgi.FastCGIServlet > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) > > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) > java.lang.Thread.run(Thread.java:619) > > root cause > > java.lang.InstantiationException > > sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30) > > java.lang.reflect.Constructor.newInstance(Constructor.java:513) > java.lang.Class.newInstance0(Class.java:355) > java.lang.Class.newInstance(Class.java:308) > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) > > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) > java.lang.Thread.run(Thread.java:619) > > > I have placed the jar files in the Tomcat lib directory and they appear > to be fine with same ownership and permissions as the rest of the jar > files. Some additional info - > > Running under SuSE 11.2 x86_64 > Tomcat6 ver 6.0.20-24.6.2 noarch > Java-1_6_0-sun x86_64 > PHP5 ver 5.3.2-1.1.1 x86_84 > > Appreciate any offers of help and thanks in advance.. Marc.. > > - > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > -- Sent from my mobile device Sincerely, Sravan Suryadevara University of Illinois | Urbana-Champaign B.S Computer Science | Class of 2013 E-mail | sur...@il... Phone | (908) 432-5330 |
From: <php...@li...> - 2010-07-08 02:21:03
|
On 7/6/2010 8:48 PM, php...@li... wrote: > Can u post ur code? You've also made the appropriate changes to > conf/server.xml I assume? > > --Sravan > > Sravan - Thanks for your reply, I am not sure what code it is that you would like me to post? Could you be more explicit? I have not modified the server.xml file in any way, nor does the website instructions tell me to do anything to it. The only file I have modified is conf/web.xml and I included the listener, servlet, and servlet-mappings configurations as described. Would you like me to post it? Marc... |
From: <php...@li...> - 2010-07-08 04:28:41
|
Sorry I did mean web.xml. There's one thing in particular that I had to fix. In the web.xml file, the website tells you to type in this line <init-param><param-name>php_include_java</param-name><param-value>On</param-value></init-param> The line should in fact be: <init-param><param-name>php_include_java</param-name><param-value>Off</param-value></init-param> As well at the head of each PHP file you must include require_once("java/Java.inc"); The java folder is in each webapp in Tomcat. If that doesn't help post your php code. I'm using Tomcat 6 and the only problem I encountered were fixed by the above changes. Sincerely, Sravan Suryadevara University of Illinois | Urbana-Champaign B.S Computer Science | Class of 2013 E-mail | sur...@il... Phone | (908) 432-5330 On Thu, Jul 8, 2010 at 7:50 AM, <php...@li... > wrote: > On 7/6/2010 8:48 PM, php...@li... wrote: > > Can u post ur code? You've also made the appropriate changes to > > conf/server.xml I assume? > > > > --Sravan > > > > > Sravan - Thanks for your reply, I am not sure what code it is that you > would like me to post? Could you be more explicit? > > I have not modified the server.xml file in any way, nor does the website > instructions tell me to do anything to it. The only file I have modified is > conf/web.xml and I included the listener, servlet, and servlet-mappings > configurations as described. Would you like me to post it? > > Marc... > > > > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
From: <php...@li...> - 2010-07-11 23:10:05
|
On 7/8/2010 1:18 AM, php...@li... wrote: >> Jost - Thanks for your reply, but sorry to report that it resulted in >> exactly the same symptoms. So no joy! > If both tomcat intances show the same problem, the cause is external, > for example a classpath problem. A "NoClassDefFoundError" for example > caused b a library loaded from an external loader (e.g. the bootstrap > loader). > > Please check the cause why your tomcat isn't able to instanciate a > standard Java servlet. > > > Regards, > Jost Bökemeier Jost - I fear I am quite baffled by this problem, and don't fully understand your reply... My Tomcat6 server is having no problems running other servlets, and it is only this php-java-bridge servlet that I am having troubles with... I have tried a couple different things to see if I could get anywhere and so far no joy... I installed the 3 jar files - JavaBridge.jar, php-script.jar, php-servlet.jar in the Tomcat6 lib directory - /usr/share/tomcat6/lib on my server. I should think the Common class loader would be able to find the class file for php.java.servlet.fastcgi.FastCGIServlet in the php-servlet.jar file without any problems. I also tried to install these 3 jar files in my local webapp directory where I placed my test.php file - ROOT/WEB-INF/lib without success either. So one of the class loaders should have been able to find the php-servlet.jar file and loaded the FastCGIServlet class ok.. I applied the fixes suggested by Sravan and here is what my test.php file now looks like - <?php require_once("java/Java.inc"); echo java("java.lang.System")->getProperties(); ?> and I included this lines in the web.xml file in the conf directory - <listener> <listener-class>php.java.servlet.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>PhpJavaServlet</servlet-name> <servlet-class>php.java.servlet.PhpJavaServlet</servlet-class> </servlet> <servlet> <servlet-name>PhpCGIServlet</servlet-name> <servlet-class>php.java.servlet.fastcgi.FastCGIServlet</servlet-class> <init-param> <param-name>prefer_system_php_exec</param-name> <param-value>On</param-value> </init-param> <init-param> <param-name>php_include_java</param-name> <param-value>Off</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>PhpJavaServlet</servlet-name> <url-pattern>*.phpjavabridge</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>PhpCGIServlet</servlet-name> <url-pattern>*.php</url-pattern> </servlet-mapping> At this point I decided to try a different tactic and removed the aforementioned jar files and deployed just the JavaBridge.war file instead. That resulted in the following errors - INFO: Deploying web application archive JavaBridge.war Jul 11, 2010 4:03:29 PM org.apache.catalina.startup.ContextConfig init SEVERE: Exception fixing docBase: {0} java.io.FileNotFoundException: /usr/share/tomcat6/webapps/JavaBridge/META-INF/MANIFEST.MF (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:457) at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:173) at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:882) at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:1017) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.StandardContext.init(StandardContext.java:5398) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4177) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:902) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1258) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:583) 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.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Jul 11 16:03:30 VMBridge ERROR: An exception occured: java.lang.IllegalArgumentException: Cannot access /WEB-INF/cgi within the current web directory. Explode your application .war file and try again. java.lang.IllegalArgumentException: Cannot access /WEB-INF/cgi within the current web directory. Explode your application .war file and try again. at php.java.servlet.CGIServlet.getRealPath(CGIServlet.java:998) at php.java.servlet.fastcgi.FastCGIServlet.checkCgiBinary(FastCGIServlet.java:179) at php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:278) at php.java.servlet.PhpCGIServlet.init(PhpCGIServlet.java:82) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:902) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1258) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:583) 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.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) So another dead end! Ideas? Marc |
From: <php...@li...> - 2010-07-12 07:20:59
|
Hi Marc, I think you've lost it. I admit that the java class loading mechanism is hard to understand. But this definitely sounds like a class path problem. > I should think the Common class loader would be able to find > the class file for php.java.servlet.fastcgi.FastCGIServlet If the common class loader loads any classes referring to the servlet API, I'd expect such errors, yes. Please see our FAQ entry "Why do I get a NoClassDefFoundError?" at http://php-java-bridge.sourceforge.net/pjb/FAQ.html > /usr/share/tomcat6/lib Remove it. The entire tomcat installation. And remove all "Java" files from your system. Download the original tomcat from tomcat.apache.org (any version). Download Java from Oracle. Install them. Then please follow the installation instructions from http://php-java-bridge.sourceforge.net/pjb/tomcat6.php. Remember to *move* the libraries over to the tomcat lib dir. A *copy* operation from one class path to the other will cause the problems you've described. Please see our FAQ "Why do I get a NoClassDefFoundError?" at http://php-java-bridge.sourceforge.net/pjb/FAQ.html Regards, Jost Bökemeier |