From: <php...@li...> - 2008-10-24 16:24:14
|
When Tomcat starts I got an error msg showing JavaBridge was not loaded. Would someone help to find the cause? Oct 24, 2008 12:45:42 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class php.java.servlet.RequestListener java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:299) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1302) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786) 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.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) 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:578) 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) Oct 24, 2008 12:45:42 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Skipped installing application listeners due to previous error(s) Oct 24, 2008 12:45:42 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Oct 24, 2008 12:45:42 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Accessing http://localhost:8080 I get TOmcat homepage, but http://localhost:8080/JavaBridge/ gives me 404 / The requested resource () is not available. When I run "java -jar JavaBridge.jar SERVLET:8080 3 javabridge_servlet.log" everything works fine, but I can't get it to work with Tomcat. May be it's related o Tomcat's permissions, but I'm not sure which settings to change. I already inserted in catalina.policy: grant codeBase "file:${catalina.home}/webapps/JavaBridge/WEB-INF/lib/-" { permission java.security.AllPermission; }; with no success, no matter if I start tomcat with or without "-security" parameter Any clue? |
From: <php...@li...> - 2009-04-03 09:34:00
|
Hi, I should say something about the NoClassDefFoundError "javax.script.ScriptEngine". This bug is caused by a serious bug in Sun's Java platform. I'd say that this bug causes 60% of all support requests. It is impossible to detect, and even a simple file system copy operation may trigger this bug. To solve this problem, please remove all files which export the feature and then install all required dependencies of the feature which has requested the failing feature (I should say "component", but Java doesnt support components). BTW: There was a proposal for a SML-type module system based on generics. But since Java doesn't support generics on byte code level (Java's generics are good for suns marketing dept. but useless otherwise), this would be a major change. Regards, Jost Boekemeier -- Apr 2, 2009 5:13 nachm. schrieb am "Jost Bekemeier" < jos...@go...>: Hi, please take a look at the exception again. It is a NoSuchProcedureException, not a NoSuchMethodException. This means that a Java procedure with that name doesnt exist. The other failure is caused by a missing context listener class from some other web app. Regards, Jost Boekemeier Apr 2, 2009 4:43 nachm. schrieb am < php...@li...>: Hi Jost, Thank you for the swift reply. Both apache and tomcat servers are definitely up and running, I'm actually running it on my local machine. I have checked my tomcat server.xml config file and it seems as tho I'm not using AJP at all. That section is commented out. I did try to telnet to the webserver and it was accepting empty PUT commands for the resource /HelloWorldWebApp/ , but not for the .phpjavabridge resource. For this I code the status code 403. That's when I remembered I didn't put the servlet definitions in my web.xml. So I changed my web.xml to look like; <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" 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"> <display-name>HelloWorldWebApp</display-name> <!-- PHP Servlet: back-end for Apache or IIS --> <servlet> <servlet-name>PhpJavaServlet</servlet-name> <servlet-class>php.java.servlet.PhpJavaServlet</servlet-class> <!-- Allow non-local PHP clients. Default is Off. --> <!-- Leave this off if your server is connected to the internet. --> <!-- <init-param> <param-name>promiscuous</param-name> <param-value>On</param-value> </init-param> --> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>PhpJavaServlet</servlet-name> <url-pattern>*.phpjavabridge</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app> However in my catalina.out log file I get the following error on startup; ERROR - Exception sending context initialized event to listener instance of class php.java.servlet.ContextLoaderListener java.lang.NoClassDefFoundError: javax/script/ScriptException Even with this however I can get JVM system info from my php scripts; $SystemClazz = Java("java.lang.System"); echo $SystemClazz->getProperties(); But calling my own defined classes I get the following error; Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[c:HelloWorld]]->getMessage. Cause: php.java.bridge.NoSuchProcedureException: static getMessage() The method and class are definitely there, contained in the WEB-INF/classes directory of my webapp. One last thing. Looking at the javabridge template I also added the following to my web.xml; <!-- support for J2EE cluster --> <distributable/> <!-- Override the define ("JAVA_HOSTS", "127.0.0.1:8080"); --> <!-- setting from your PHP script, Config.inc or Java.inc or --> <!-- JavaProxy.php, so that PHP connects back to the current VM. --> <context-param> <param-name>override_hosts</param-name> <param-value>On</param-value> </context-param> <!-- Attach the JSR223 script factory to the servlet context --> <listener> <listener-class>php.java.servlet.ContextLoaderListener</listener-class> </listener> However when I do this, the application simply fails to load and I cannot even retrieve system info. I get the following error message; [2009-04-02 15:05:59,978] ERROR - Error listenerStart [2009-04-02 15:05:59,978] ERROR - Context [/JavaBridge] startup failed due to previous errors [2009-04-02 15:05:59,979] ERROR - Exception sending context destroyed event to listener instance of class php.java.servlet.ContextLoaderListener java.lang.NoClassDefFoundError: javax/script/ScriptException ... Incidentally when I attempt to simply place the JavaBridgeTemplate.war into my webapps directory I have the same issue. Any ideas? I am running tomcat 5.5.25. Thank You On 2/4/09 13:03, "php...@li..." <php...@li...> wrote: > Hi, > > the php-servlet.jar is missing in t... > ***** This Email has been scanned for Viruses and SPAM by Blackspider > Mailcontrol. ***** > Click > https://www.mailcontrol.com/sr/7WmkR8Jsg7XTndxI!oX7UpRUG+IHZ5e6oz7AiS!Lx!8sRuw > rsLuNdtdxow7SW0jL2j!a2kADeZ62eN6FcXjHgg== to report this email as spam. -- Jaz Chana Integration Specialist Lean Practitioner Direct Dial: 0151 290 5917 Email: jaz.chana@cdm... ------------------------------------------------------------------------------ _____________________... |
From: <php...@li...> - 2010-05-28 10:18:33
|
Hello! if a user copies a library to java.ext.dirs and the library tries to access javax/servlet, a NoClassDefFoundError is thrown. The error message is: Unresolved external reference: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletResponse. -- Unable to call the method, see the README section "Java platform issues" for details and DO NOT REPORT THIS PROBLEM TO THE PHP/Java Bridge MAILING LIST! I think the error message should include the current class and its loader. Look here: http://forums.sun.com/thread.jspa?threadID=5440266&start=0&tstart=0 Peter |
From: <php...@li...> - 2010-05-29 08:10:38
|
Hi, > if a user copies a library to java.ext.dirs and the library tries to access > javax/servlet, a NoClassDefFoundError is thrown. I think this is a misunderstanding. If users link their java applications according to the documents http://php-java-bridge.sourceforge.net/pjb/desktop-apps.php or http://php-java-bridge.sourceforge.net/pjb/webapp.php then they shouldn't get these link-time errors. Adding more information to the error message is not useful, users probably don't understand what it means anyway. But our FAQ should be cleaned up, of course. The sentence "All libraries and their dependencies must be loaded by one, and only one class loader." is obsolete, as we don't use a dynamic class loader anymore. Instead we should link directly to the above documents. Regards, Jost Bökemeier |
From: <php...@li...> - 2008-10-24 17:14:27
|
Som more info about the software installed: host:/opt/tomcat/lib # /opt/tomcat/bin/catalina.sh version Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr Server version: Apache Tomcat/6.0.18 Server built: Jul 22 2008 02:00:36 Server number: 6.0.18.0 OS Name: Linux OS Version: 2.4.28-vs1.29 Architecture: i386 JVM Version: 1.6.0_03-b05 JVM Vendor: Sun Microsystems Inc. JavaBridge was correclty deployed from JavaBridge.war under webapps. ----- Original Message ----- From: php...@li... To: php...@li... Sent: Friday, October 24, 2008 2:23 PM Subject: [Php-java-bridge-users] NoClassDefFoundError When Tomcat starts I got an error msg showing JavaBridge was not loaded. Would someone help to find the cause? Oct 24, 2008 12:45:42 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class php.java.servlet.RequestListener java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:299) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1302) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786) 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.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) 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:578) 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) Oct 24, 2008 12:45:42 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Skipped installing application listeners due to previous error(s) Oct 24, 2008 12:45:42 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Oct 24, 2008 12:45:42 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Accessing http://localhost:8080 I get TOmcat homepage, but http://localhost:8080/JavaBridge/ gives me 404 / The requested resource () is not available. When I run "java -jar JavaBridge.jar SERVLET:8080 3 javabridge_servlet.log" everything works fine, but I can't get it to work with Tomcat. May be it's related o Tomcat's permissions, but I'm not sure which settings to change. I already inserted in catalina.policy: grant codeBase "file:${catalina.home}/webapps/JavaBridge/WEB-INF/lib/-" { permission java.security.AllPermission; }; with no success, no matter if I start tomcat with or without "-security" parameter Any clue? ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
From: <php...@li...> - 2008-10-24 19:57:11
|
I changed from SDK to JDK (jdk-6u10-linux-i586), but still get error: Oct 24, 2008 5:53:17 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /JavaBridge threw load() exception java.lang.IllegalAccessError: class php.java.script.servlet.PhpScriptTemporarilyOutOfResourcesException cannot access its superclass php.java.script.PhpScriptException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) |
From: <php...@li...> - 2008-10-25 16:06:39
|
Hi, please re-read the README section "Java platform issues" for details. It is nearly impossible to fix these problems on app level, so your only option is to re-install your J2EE server again. -- You could try to clean the work/Catalina and temp directories and check if that helps. Regards, Jost Boekemeier |
From: <php...@li...> - 2008-10-26 16:51:05
|
Problem solved. I uninstalled jdk and tomcat and instaled jre1.5.0_16 and tomcat_5.5.27. |
From: <php...@li...> - 2008-10-27 17:27:28
|
Hi, I noticed that, if tomcat was started with the -security flag, the JSR 223 examples did not work. I have added the necessary doPrivileged() calls to EngineFactory and to the Servlet* ScriptEngines, so that eval() is now called with the security context of the PHP/Java Bridge library [1]. Regards, Jost Boekemeier [1] You must move all jars from the application- to the library folder, to make this work, of course. |