|
From: <php...@li...> - 2009-06-08 10:25:37
|
Hi
I am trying to invoke a php function from the servlet. I am getting the following error. Pls find the following code.
public void doPost(
final HttpServletRequest httpRequest,
final HttpServletResponse httpResponse)
throws ServletException, IOException {
try {
URI remotePhpApp = new URI("http://localhost:9080/JavaBridge/java/JavaProxy.php");
ScriptEngine e =
EngineFactory.getInvocablePhpScriptEngine (this,
this.getServletContext(), httpRequest, httpResponse, remotePhpApp);
Object result = ((Invocable)e).invokeFunction("phpversion", new Object[]{});
System.out.println(result);
e.eval ((Reader)null);
} catch (Exception ex) {
System.out.println("Could not evaluate script: "+ex);
} finally { // make sure to close() the file
// in JDK 1.5 and above use ((Closeable)e).close() instead
}
}
I am getting following error.
Could not evaluate script: java.lang.IllegalStateException: No EngineFactory found. Have you registered a listener?
The same code works fine with jsp.
Thanks
- Ravi -
|
|
From: <php...@li...> - 2009-06-08 10:53:02
|
8. Jun 2009 12:25 nachm. schrieb am <
php...@li...>:
Hi
I am trying to invoke a php function from the servlet. I am getting the
following error. Pls find the following code.
public void doPost(
final HttpServletRequest httpRequest,
final HttpServletResponse httpResponse)
throws ServletException, IOException {
try {
URI remotePhpApp = new URI("
http://localhost:9080/JavaBridge/java/JavaProxy.php");
ScriptEngine e =
EngineFactory.getInvocablePhpScriptEngine (this,
this.getServletContext(), httpRequest,
httpResponse, remotePhpApp);
Object result = ((Invocable)e).invokeFunction("phpversion", new
Object[]{});
System.out.println(result);
e.eval ((Reader)null);
} catch (Exception ex) {
System.out.println("Could not evaluate script: "+ex);
} finally { // make sure to close() the file
// in JDK 1.5 and above use ((Closeable)e).close() instead
}
}
I am getting following error.
Could not evaluate script: java.lang.IllegalStateException: No EngineFactory
found. Have you registered a listener?
The same code works fine with jsp.
Thanks
- Ravi -
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2009-06-08 10:55:10
|
You need to register a context listener. Please see the install.j2ee
document or the JavaBridge.war example application for details.
Regards,
Jost Boekemeier
8. Jun 2009 12:25 nachm. schrieb am <
php...@li...>:
Hi
I am trying to invoke a php function from the servlet. I am getting the
following error. Pls find the following code.
public void doPost(
final HttpServletRequest httpRequest,
final HttpServletResponse httpResponse)
throws ServletException, IOException {
try {
URI remotePhpApp = new URI("
http://localhost:9080/JavaBridge/java/JavaProxy.php");
ScriptEngine e =
EngineFactory.getInvocablePhpScriptEngine (this,
this.getServletContext(), httpRequest,
httpResponse, remotePhpApp);
Object result = ((Invocable)e).invokeFunction("phpversion", new
Object[]{});
System.out.println(result);
e.eval ((Reader)null);
} catch (Exception ex) {
System.out.println("Could not evaluate script: "+ex);
} finally { // make sure to close() the file
// in JDK 1.5 and above use ((Closeable)e).close() instead
}
}
I am getting following error.
Could not evaluate script: java.lang.IllegalStateException: No EngineFactory
found. Have you registered a listener?
The same code works fine with jsp.
Thanks
- Ravi -
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2009-06-08 11:03:00
|
Hi Jost Boekemeier
Thanks for the reply. I am able to run the same code in JSP. I am using jboss server for this. Do I need to register any listener ?
Thanks
- Ravi -
-----Original Message-----
From: php...@li... [mailto:php...@li...]
Sent: Monday, June 08, 2009 4:25 PM
To: php...@li...
Subject: Re: [Php-java-bridge-users] Could not evaluate script: java.lang.IllegalStateException: No EngineFactory found. Have you registered a listener?
You need to register a context listener. Please see the install.j2ee
document or the JavaBridge.war example application for details.
Regards,
Jost Boekemeier
8. Jun 2009 12:25 nachm. schrieb am <
php...@li...>:
Hi
I am trying to invoke a php function from the servlet. I am getting the
following error. Pls find the following code.
public void doPost(
final HttpServletRequest httpRequest,
final HttpServletResponse httpResponse)
throws ServletException, IOException {
try {
URI remotePhpApp = new URI("
http://localhost:9080/JavaBridge/java/JavaProxy.php");
ScriptEngine e =
EngineFactory.getInvocablePhpScriptEngine (this,
this.getServletContext(), httpRequest,
httpResponse, remotePhpApp);
Object result = ((Invocable)e).invokeFunction("phpversion", new
Object[]{});
System.out.println(result);
e.eval ((Reader)null);
} catch (Exception ex) {
System.out.println("Could not evaluate script: "+ex);
} finally { // make sure to close() the file
// in JDK 1.5 and above use ((Closeable)e).close() instead
}
}
I am getting following error.
Could not evaluate script: java.lang.IllegalStateException: No EngineFactory
found. Have you registered a listener?
The same code works fine with jsp.
Thanks
- Ravi -
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2009-06-08 11:15:09
|
8. Jun 2009 1:03 nachm. schrieb am < php...@li...>: Hi Jost Boekemeier Thanks for the reply. I am able to run the same code in JSP. I am using jboss server for this. Do I need to register any listener ? Thanks - Ravi - -----Original Message----- From: php...@li...[mailto: php-java-bridg... |
|
From: <php...@li...> - 2009-06-08 11:20:07
|
Hi, I would start with the generated .java file. Jsp compiles to a servlet. If it works in jsp, it also works in a servlet. You can find the generated .java file in the tomcat work folder (assuming your jboss installation uses tomcat, not jetty). Regards, Jost Boekemeier P.S.: Please ignore the empty replies. They are generated by a software bug. :) 8. Jun 2009 1:03 nachm. schrieb am < php...@li...>: Hi Jost Boekemeier Thanks for the reply. I am able to run the same code in JSP. I am using jboss server for this. Do I need to register any listener ? Thanks - Ravi - -----Original Message----- From: php...@li...[mailto: php-java-bridg... |