php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61817 if php file is exist, java.io.IOException:at net.php.servlet.send(Native Met
Submitted: 2012-04-22 17:34 UTC Modified: 2015-07-16 05:38 UTC
From: johnsun dot hu at 163 dot com Assigned:
Status: Not a bug Package: Built-in web server
PHP Version: 5.4.0 OS: win7
Private report: No CVE-ID: None
 [2012-04-22 17:34 UTC] johnsun dot hu at 163 dot com
Description:
------------
hello,

   I setup success for Jbossweb 2.1.9 whith pecl-5.2.5-win32 and PHP 5.2.17, use php-java, and visit http://localhost/phpinfo.php successfully.

   but when visit http://localhost/phpinfo1.php which is not exist, the page return infomation:
------------------------------------------------
   type Exception report
   message
   description The server encountered an internal error () that prevented it from fulfilling this request.
   exception
   java.io.IOException: 
	net.php.servlet.send(Native Method)
	net.php.servlet.service(servlet.java:190)
	net.php.servlet.service(servlet.java:214)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   note The full stack trace of the root cause is available in the JBoss Web/2.1.9.GA logs.
-------------------------------------------------
and log file "jbossweb-stderr.2012-04-22.log" is:
-------------------------------------------------
java.lang.ClassNotFoundException: org.apache.catalina.servlets.php.Handler
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:396)
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:388)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:117)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4417)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:800)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:780)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:638)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:564)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:499)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1263)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:322)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1064)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1056)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:523)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:736)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


Servlet.service() for servlet php threw exception
java.io.IOException: 
	at net.php.servlet.send(Native Method)
	at net.php.servlet.service(servlet.java:190)
	at net.php.servlet.service(servlet.java:214)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
	at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:905)
	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:592)
	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2036)
	at java.lang.Thread.run(Unknown Source)

----------------------------------------------------

Jbossweb is down.

if I visist http://localhost/index1.jsp which is not exist, the page return infomation:
   HTTP Status 404 - /index1.jsp
   type Status report
   message /index1.jsp
   description The requested resource (/index1.jsp) is not available.
   JBoss Web/2.1.9.GA

so I think the php-java servlet has a bug.

-----------------------------------------------
I setup php-java progress:

1. download & unzip PHP (5.2.6) to a directory, c:\php-5.2.6-Win32
2. download PECL 5.2.5 Win32 binaries (PECL 5.2.6 does not include the files required.)
3. rename php.ini-dist to php.ini in c:\php-5.2.6-Win32
4. add extension=php_java.dll in Dynamic Extensions section in php.ini
5. extract php5servlet.dll from PECL 5.2.5 to c:\php-5.2.6-Win32
6. extract php_java.dll from PECL 5.2.5 to c:\php-5.2.6-Win32\ext
7. create a directory named forphp (any name you like) in jboss\webapps directory
8. extract phpsrvlt.jar from PECL 5.2.5 to jboss\webapps\forphp\WEB-INF\lib
9. unzip phpsrvlt.jar
10. modify both net\php\reflect.properties and net\php\servlet.properties to library=php5servlet
11. pack php5srvlt.jar
12. creat web.xml in jboss\webapps\forphp\WEB-INF as following:

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd ">

 <servlet>
   <servlet-name>php</servlet-name>
   <servlet-class>net.php.servlet</servlet-class>
 </servlet>
 <servlet>
   <servlet-name>php-formatter</servlet-name>
   <servlet-class>net.php.formatter</servlet-class>
 </servlet>

 <servlet-mapping>
   <servlet-name>php</servlet-name>
   <url-pattern>*.php</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
   <servlet-name>php-formatter</servlet-name>
   <url-pattern>*.phps</url-pattern>
 </servlet-mapping>
</web-app>

13. add php path to the system variable named path
14. create phptest.php for testing under jboss\webapps\forphp as following

<?php phpinfo(); ?>

15. startup jboss

-----------------------------------------------

can you help me?

thanks!




   


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-22 20:51 UTC] johannes@php.net
PHP 5.2 is not supported anymore. That Java module is not supported anymore. Sorry.
 [2012-04-22 20:51 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2015-06-16 10:55 UTC] andrewjames085 at gmail dot com
Thanks for nice post. http://www.w3schools.com
 [2015-06-17 10:32 UTC] jamesmartin057 at gmail dot com
This page delivers best resource which helps me in my job. I am working in app development company where Professional web application developers USA work in the team. I read this blog weekly and learned many things from here. (http://www.cygnismedia.com/web-application/)
 [2015-07-16 05:20 UTC] marksteve952 at gmail dot com
I was searching this material from last three days and finally i find this bug here. I stuck in my job, I really need to understand the exact solution which i find it here. http://www.ieventapp.com/ios-event-app/
 [2015-07-16 05:38 UTC] requinix@php.net
-Block user comment: No +Block user comment: Yes
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 02:01:27 2024 UTC