tags:

views:

1108

answers:

2

I just installed the current Tomcat version on my mac because I wanted to try the PHP Java bridge.

I followed the guide here http://php-java-bridge.sourceforge.net/pjb/tomcat6.php but when I paste the xml config to the tomcat configuration file

<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.PhpCGIServlet</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>On</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>

nothing works anymore - all I get when I open localhost:8080 is "error 404 - resource() not found". If I leave out the above lines, at least I get the welcome page, but then the directory where I put the phpJavaBridge application only shows the resource() not found error.

I am pretty new to development with Tomcat, so I really have no idea how to fix that problem. Any help would be greatly appreciated!

A: 

I'm basically running into the same problem. I'm using the JDK 1.5 on Mac OS tomcat6 comes from the macports and the JDK is the one included on the machine.

Here are the errors in the log. I'm not very familiar with java and I don't understand what's wrong here :

INFO: Deploying web application archive JavaBridgeTemplate5442.war Aug 4, 2009 4:36:47 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class php.java.servlet.ContextLoaderListener java.lang.NoClassDefFoundError: javax/script/ScriptException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at php.java.servlet.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342) 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:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:613) Aug 4, 2009 4:36:47 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart Aug 4, 2009 4:36:47 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/JavaBridgeTemplate5442] startup failed due to previous errors Aug 4, 2009 4:36:47 PM org.apache.catalina.core.StandardContext listenerStop SEVERE: Exception sending context destroyed event to listener instance of class php.java.servlet.ContextLoaderListener java.lang.NoClassDefFoundError: javax/script/ScriptException at php.java.servlet.ContextLoaderListener.destroyScriptEngines(ContextLoaderListener.java:86) at php.java.servlet.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:102) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3882) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4523) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4387) 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:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:613)

mtourne
A: 

Your Java Version is out of date. Use Sun Java 6 or above instead.

The 'NoClassDefFoundError' means that Sun's script api is missing. Search for script-api.jar and install that to get rid of this error.