Re: [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause
Kesavan, On 4/3/23 10:53, Kesavan, Suresh Prabhu (Fed) wrote: Thanks, can you tell me how to enable all security in tomcat Catalina.policy. Just turn off the security manager if you are going to allow all privilieges. Having it enabled without any enforcement means you get zero security controls and performance penalties all over the place. -chris -Original Message- From: Mark Thomas Sent: Wednesday, March 29, 2023 8:37 PM To: users@tomcat.apache.org Subject: Re: [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause Hi, I am unable to reproduce this with a clean build of the current 9.0.x source. I built the sample application without configuring the connection to Azure. Once deployed, it failed with a security permissions error. This has fixed by adding the following to the web application permissions: permission java.util.PropertyPermission "com.ctc.wstx.returnNullForDefaultNamespace", "read"; No other changes were made compared to the default. The index page then showed correctly. Mark On 27/03/2023 16:47, Kesavan, Suresh Prabhu (Fed) wrote: Hi Mark, Sure, below is the policy file */_catalina.policy_/* // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.apache.org%2Flicenses%2FLICENSE-2.0=05%7C01%7Csureshprabhu.kesavan%40nist.gov%7C0fae3558eb82448fe0f408db30b6dbe9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638157334161987625%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=1MXkLyzwJ0d9CWADPfIAjbvaGHlX2whCFY7iPYR3sdM%3D=0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // == == // catalina.policy - Security Policy Permissions for Tomcat // // This file contains a default set of security policies to be enforced (by the // JVM) when Catalina is executed with the "-security" option. In addition // to the permissions granted here, the following additional permissions are // granted to each web application: // // * Read access to the web application's document root directory // * Read, write and delete access to the web application's working directory // == == // == SYSTEM CODE PERMISSIONS = // These permissions apply to javac grant codeBase "file:${java.home}/lib/-" { permission java.security.AllPermission; }; // These permissions apply to all shared system extensions grant codeBase "file:${java.home}/jre/lib/ext/-" { permission java.security.AllPermission; }; // These permissions apply to javac when ${java.home} points at $JAVA_HOME/jre grant codeBase "file:${java.home}/../lib/-" { permission java.security.AllPermission; }; // These permissions apply to all shared system extensions when // ${java.home} points at $JAVA_HOME/jre grant codeBase "file:${java.home}/lib/ext/-" { permission java.security.AllPermission; }; // This permission is required when using javac to compile JSPs on Java 9 // onwards grant codeBase "jrt:/jdk.compiler" { permission java.security.AllPermission; }; // == CATALINA CODE PERMISSIONS === // These permissions apply to the daemon code grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" { permission java.security.AllPermission; }; // These permissions apply to the logging API // Note: If tomcat-juli.jar is in ${catalina.base} and not in ${catalina.home}, // update this section accordingly. // grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..} grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { permission java.io.FilePermission "${java.home}${file.separator}lib${file.separator}logging.properties", "read"; permission java.io.FilePermission "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read"; permission java.io.FilePermission "${catalina.base
RE: [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause
Hi Mark, Thanks, can you tell me how to enable all security in tomcat Catalina.policy. Thanks, Suresh Kesavan OISM/ASD National Institute of Standards and Technology Office:- 301-975-6973 -Original Message- From: Mark Thomas Sent: Wednesday, March 29, 2023 8:37 PM To: users@tomcat.apache.org Subject: Re: [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause Hi, I am unable to reproduce this with a clean build of the current 9.0.x source. I built the sample application without configuring the connection to Azure. Once deployed, it failed with a security permissions error. This has fixed by adding the following to the web application permissions: permission java.util.PropertyPermission "com.ctc.wstx.returnNullForDefaultNamespace", "read"; No other changes were made compared to the default. The index page then showed correctly. Mark On 27/03/2023 16:47, Kesavan, Suresh Prabhu (Fed) wrote: > Hi Mark, > > Sure, below is the policy file > > */_catalina.policy_/* > > // Licensed to the Apache Software Foundation (ASF) under one or more > // contributor license agreements. See the NOTICE file distributed > with // this work for additional information regarding copyright ownership. > // The ASF licenses this file to You under the Apache License, Version > 2.0 // (the "License"); you may not use this file except in compliance > with // the License. You may obtain a copy of the License at // > // > https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.apache.org%2Flicenses%2FLICENSE-2.0=05%7C01%7Csureshprabhu.kesavan%40nist.gov%7C0fae3558eb82448fe0f408db30b6dbe9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638157334161987625%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=1MXkLyzwJ0d9CWADPfIAjbvaGHlX2whCFY7iPYR3sdM%3D=0 > // > // Unless required by applicable law or agreed to in writing, software > // distributed under the License is distributed on an "AS IS" BASIS, > // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > // See the License for the specific language governing permissions and > // limitations under the License. > > // > == > == // catalina.policy - Security Policy Permissions for Tomcat // > // This file contains a default set of security policies to be > enforced (by the // JVM) when Catalina is executed with the > "-security" option. In addition // to the permissions granted here, > the following additional permissions are // granted to each web application: > // > // * Read access to the web application's document root directory // * > Read, write and delete access to the web application's working > directory // > == > == > > > // == SYSTEM CODE PERMISSIONS > = > > > // These permissions apply to javac > grant codeBase "file:${java.home}/lib/-" { > permission java.security.AllPermission; }; > > // These permissions apply to all shared system extensions grant > codeBase "file:${java.home}/jre/lib/ext/-" { > permission java.security.AllPermission; }; > > // These permissions apply to javac when ${java.home} points at > $JAVA_HOME/jre grant codeBase "file:${java.home}/../lib/-" { > permission java.security.AllPermission; }; > > // These permissions apply to all shared system extensions when // > ${java.home} points at $JAVA_HOME/jre grant codeBase > "file:${java.home}/lib/ext/-" { > permission java.security.AllPermission; }; > > // This permission is required when using javac to compile JSPs on > Java 9 // onwards grant codeBase "jrt:/jdk.compiler" { > permission java.security.AllPermission; }; > > > // == CATALINA CODE PERMISSIONS > === > > // These permissions apply to the daemon code > grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" { > permission java.security.AllPermission; > }; > > // These permissions apply to the logging API > // Note: If tomcat-juli.jar is in ${catalina.base} and not in > ${catalina.home}, > // update this section accordingly. > // grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..} > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { > permission java.io.FilePermission > > "${java.home}${file.separator}lib${file.separator}logging.properties", "read"
Re: [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause
essClassInPackage.org.apache.jasper.runtime.*"; // Applications using WebSocket need to be able to access these packages permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket.server"; }; // The Manager application needs access to the following packages to support the // session display functionality. It also requires the custom Tomcat // DeployXmlPermission to enable the use of META-INF/context.xml // These settings support the following configurations: // - default CATALINA_HOME == CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME grant codeBase "file:${catalina.base}/webapps/manager/-" { permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; permission org.apache.catalina.security.DeployXmlPermission "manager"; }; grant codeBase "file:${catalina.home}/webapps/manager/-" { permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; permission org.apache.catalina.security.DeployXmlPermission "manager"; }; grant codeBase "file:${catalina.base}/webapps/msal4j-servlet-auth/-"{ permission java.security.AllPermission; // permission java.lang.RuntimePermission "getClassLoader"; // permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www.protocol.*"; permission java.io.FilePermission "<>", "read, write, delete"; permission java.util.PropertyPermission "java.io.tmpdir", "readi, write"; }; // The Host Manager application needs the custom Tomcat DeployXmlPermission to // enable the use of META-INF/context.xml // These settings support the following configurations: // - default CATALINA_HOME == CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, per instance Host Manager in CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, shared Host Manager in CATALINA_HOME grant codeBase "file:${catalina.base}/webapps/host-manager/-" { permission org.apache.catalina.security.DeployXmlPermission "host-manager"; }; grant codeBase "file:${catalina.home}/webapps/host-manager/-" { permission org.apache.catalina.security.DeployXmlPermission "host-manager"; }; // You can assign additional permissions to particular web applications by // adding additional "grant" entries here, based on the code base for that // application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files. // // Different permissions can be granted to JSP pages, classes loaded from // the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/ // directory, or even to individual jar files in the /WEB-INF/lib/ directory. // // For instance, assume that the standard "examples" application // included a JDBC driver that needed to establish a network connection to the // corresponding database and used the scrape taglib to get the weather from // the NOAA web server. You might create a "grant" entries like this: // // The permissions granted to the context root directory apply to JSP pages. // grant codeBase "file:${catalina.base}/webapps/examples/-" { // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; // permission java.net.SocketPermission "*.noaa.gov:80", "connect"; // }; // // The permissions granted to the context WEB-INF/classes directory // grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" { // }; // // The permission granted to your JDBC driver // grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" { // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; // }; // The permission granted to the sc
RE: [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause
- default CATALINA_HOME == CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME grant codeBase "file:${catalina.base}/webapps/manager/-" { permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; permission org.apache.catalina.security.DeployXmlPermission "manager"; }; grant codeBase "file:${catalina.home}/webapps/manager/-" { permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; permission org.apache.catalina.security.DeployXmlPermission "manager"; }; grant codeBase "file:${catalina.base}/webapps/msal4j-servlet-auth/-"{ permission java.security.AllPermission; // permission java.lang.RuntimePermission "getClassLoader"; // permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www.protocol.*"; permission java.io.FilePermission "<>", "read, write, delete"; permission java.util.PropertyPermission "java.io.tmpdir", "readi, write"; }; // The Host Manager application needs the custom Tomcat DeployXmlPermission to // enable the use of META-INF/context.xml // These settings support the following configurations: // - default CATALINA_HOME == CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, per instance Host Manager in CATALINA_BASE // - CATALINA_HOME != CATALINA_BASE, shared Host Manager in CATALINA_HOME grant codeBase "file:${catalina.base}/webapps/host-manager/-" { permission org.apache.catalina.security.DeployXmlPermission "host-manager"; }; grant codeBase "file:${catalina.home}/webapps/host-manager/-" { permission org.apache.catalina.security.DeployXmlPermission "host-manager"; }; // You can assign additional permissions to particular web applications by // adding additional "grant" entries here, based on the code base for that // application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files. // // Different permissions can be granted to JSP pages, classes loaded from // the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/ // directory, or even to individual jar files in the /WEB-INF/lib/ directory. // // For instance, assume that the standard "examples" application // included a JDBC driver that needed to establish a network connection to the // corresponding database and used the scrape taglib to get the weather from // the NOAA web server. You might create a "grant" entries like this: // // The permissions granted to the context root directory apply to JSP pages. // grant codeBase "file:${catalina.base}/webapps/examples/-" { // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; // permission java.net.SocketPermission "*.noaa.gov:80", "connect"; // }; // // The permissions granted to the context WEB-INF/classes directory // grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" { // }; // // The permission granted to your JDBC driver // grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" { // permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; // }; // The permission granted to the scrape taglib // grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" { // permission java.net.SocketPermission "*.noaa.gov:80", "connect"; // }; // To grant permissions for web applications using packed WAR files, use the // Tomcat specific WAR url scheme. // // The permissions granted to the entire web application // grant codeBase "war:file:${catalina.base}/webapps/examples.war*/-" { // }; // // The permissions granted to a specific JAR // grant codeBase "war:file:${catalina.base}/webapps/examples.war*/WEB-INF/lib/foo.jar" { // }; Thanks, Suresh Kesavan OISM/ASD National
Re: [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause
Hi, The mailing lists strips attachments so please provide the contents of your catalina.policy file in-line. Thanks, Mark On 27/03/2023 12:59, Kesavan, Suresh Prabhu (Fed) wrote: Hi There, I am new to this forum, please correct me if this is not the right place to ask below question. */_Problem Description_/* I have tomcat9/OpenJDK17 with RHEL 8.7 container image deployed on AWS EKS/EC2 worker nodes. This image has FIPS compliance validation done at OS/OpenJDK and at tomcat level using the configurations. I am able to successfully deploy our application (has JSP’s) in this container but when I deploy the SSO application (using MSAL4J and can be found at https://github.com/Azure-Samples/ms-identity-msal-java-samples/tree/main/3.%20Java%20Servlet%20Web%20App%20Tutorial/1-Authentication/sign-in <https://github.com/Azure-Samples/ms-identity-msal-java-samples/tree/main/3.%20Java%20Servlet%20Web%20App%20Tutorial/1-Authentication/sign-in>) encountering below Jasper exception. Please be advised Tomcat is started with security manager and attaching the Catalina.policy used. */_Environment:_/* o EKS 1.24 o EC2 worker node with RHEL 8.7 o Container image with RHEL 8.7 and FIPS validation enabled o Tomcat 9.0.73 o openjdk version "17.0.6" 2023-01-17 LTS */_Observation_/* o My team member has deployed msal4j on same tomcat 9.0.73 without FIPS and tomcat security manager, it works fine. o I assume the index.jsp has something that is not having permission (due to tomcat started with security manager) to compile in runtime o When I access https://localhost:8643/msal4j-servlet-auth its returning 302 <https://localhost:8643/msal4j-servlet-auth%20its%20returning%20302>. This is expected o When I access https://localhost:8643/msal4j-servlet-auth/ <https://localhost:8643/msal4j-servlet-auth/> it returns 500 and throws below exception */_Question_/* Can you help me identify what the issue is */_Error:_/* [tomcat@c793762ed6ee logs]$ cat localhost.2023-03-24.log 24-Mar-2023 13:46:19.866 SEVERE [https-jsse-nio-8643-exec-4] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [jsp] in context with path [/msal4j-servlet-auth] threw exception [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause java.lang.NullPointerException: Cannot invoke "java.io.InputStream.close()" because the return value of "java.net.URLConnection.getInputStream()" is null at org.apache.jasper.JspCompilationContext.getLastModified(JspCompilationContext.java:408) at org.apache.jasper.JspCompilationContext.getLastModified(JspCompilationContext.java:368) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:391) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:368) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:596) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:280) at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) at java.base/javax.security.auth.Subject.doAsPrivileged(Subject.java:584) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:170) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:221) at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:145) at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) at org.apache.catalina.core.ApplicationFilt
[org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause
Hi There, I am new to this forum, please correct me if this is not the right place to ask below question. Problem Description I have tomcat9/OpenJDK17 with RHEL 8.7 container image deployed on AWS EKS/EC2 worker nodes. This image has FIPS compliance validation done at OS/OpenJDK and at tomcat level using the configurations. I am able to successfully deploy our application (has JSP's) in this container but when I deploy the SSO application (using MSAL4J and can be found at https://github.com/Azure-Samples/ms-identity-msal-java-samples/tree/main/3.%20Java%20Servlet%20Web%20App%20Tutorial/1-Authentication/sign-in) encountering below Jasper exception. Please be advised Tomcat is started with security manager and attaching the Catalina.policy used. Environment: * EKS 1.24 * EC2 worker node with RHEL 8.7 * Container image with RHEL 8.7 and FIPS validation enabled * Tomcat 9.0.73 * openjdk version "17.0.6" 2023-01-17 LTS Observation * My team member has deployed msal4j on same tomcat 9.0.73 without FIPS and tomcat security manager, it works fine. * I assume the index.jsp has something that is not having permission (due to tomcat started with security manager) to compile in runtime * When I access https://localhost:8643/msal4j-servlet-auth its returning 302<https://localhost:8643/msal4j-servlet-auth%20its%20returning%20302>. This is expected * When I access https://localhost:8643/msal4j-servlet-auth/ it returns 500 and throws below exception Question Can you help me identify what the issue is Error: [tomcat@c793762ed6ee logs]$ cat localhost.2023-03-24.log 24-Mar-2023 13:46:19.866 SEVERE [https-jsse-nio-8643-exec-4] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [jsp] in context with path [/msal4j-servlet-auth] threw exception [org.apache.jasper.JasperException: Unable to compile class for JSP] with root cause java.lang.NullPointerException: Cannot invoke "java.io.InputStream.close()" because the return value of "java.net.URLConnection.getInputStream()" is null at org.apache.jasper.JspCompilationContext.getLastModified(JspCompilationContext.java:408) at org.apache.jasper.JspCompilationContext.getLastModified(JspCompilationContext.java:368) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:391) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:368) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:596) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.apache.catalina.security.SecurityUtil.lambda$execute$0(SecurityUtil.java:280) at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) at java.base/javax.security.auth.Subject.doAsPrivileged(Subject.java:584) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:170) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:221) at org.apache.catalina.core.ApplicationFilterChain.lambda$doFilter$0(ApplicationFilterChain.java:145) at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:143) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.apache.catalina.se
Re: Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
2012/4/12 Ashima Sharma ashpr...@gmail.com: Most of the jsps have this issue...but it happens randomly. For e.g., i wd be able to access the registration page 5 times w/o any issue, and the 6th time I'd get this error. Its bizarre that tomcat tries to recompile the already compiled jsp at some random point even though the page hasn't changed, and throws the cannot compile error. All the jsps with this issue have the .java and .class files under the work directory. The compilation issue is in org.apache.jasper.runtime.JspSourceDependent.getDependants method for every jsp in regstration_jsp.java - line 49- public java.util.Mapjava.lang.String,java.lang.Long getDependants() { line 50- return _jspx_dependants; line 51- } *An error occurred at line: 49 in the generated java file* *This method must return a result of type MapString,Long* What is the type and value of _jspx_dependants field? It seems that it complaints that that field returned by the method is not MapString,Long. Can you confirm that after you try to access the .jsp from the browser, the timestamp on the .java file changes? Timestamp does not matter, because in latest Tomcat 7 it is set to match the original file. There is a comment at the top of generated java file that mentions this fact and the actual time of generation. You can look at creation time of the file as provided by NTFS. That is because a new file is created and then its modification time is set to the past. 1. Can you cite with what parameters JspServlet in your web.xml is configured, exactly? This error happens when the original .class file can't be deleted before re-naming an SMAP-loaded copy of the .class file. Can you confirm that you have files called, for example, userProfileBodyTile_jsp.java, userProfileBodyTile_jsp.class, and userProfileBodyTile_jsp.javatmp ? 2. It is possible to suppress SMAP generation by setting suppressSmap parameter in JspServlet to true. 3. Deletion of recently created files on Windows can be impeded by antivirus scanners. (Subversion client users on Windows are sometimes complaining about that. It depends on a/v product being used.). Maybe Tomcat can rename the old file before deleting it. IIRC Windows allows renaming files that are open for reading, but has problems with deleting them. I read that you have performed a clean install of Tomcat, which is a good step to take because this looks like a mismatched Jasper problem or something. On Windows the actual setting the Service starts with are stored in the registry. I hope those are correct. I also hope that you do not have any strange JARs (e.g. a copy of Jasper) in your webapp. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
Christopher, response to your questions: [Can you confirm that after you try to access the .jsp from the browser, the timestamp on the .java file changes?] -* It does not change. ALL the .java and .class files have the same timestamp as the .jsp files which is the same as when the war was deployed.* [Are you deploying from a WAR file or exploded directory? Also, are any of your JSPs in a .jar file (whether this is in a WAR file or not)?] - *From a war file. Jsps are not is a jar file. * *This is a legacy app and has spring + struts...spring is being used for dependency-injection only, and struts as the web-framework. I should have mentioned this earlier, but we have other spring based apps (without struts) on tomcat 7.0.26, and we don't see this issue with those apps. * [Can you confirm that you have files called, for example, userProfileBodyTile_jsp.java, userProfileBodyTile_jsp.class, and userProfileBodyTile_jsp.javatmp ?] *The only files that I see under the work directory are .java and .class, I have not seen any .javatmp files in that directory *I'll send you registration.jsp and .java files separately. thanks. --
Re: Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
Konstantin, responding to your questions: [What is the type and value of _jspx_dependants field? ] *private static java.util.Mapjava.lang.String,java.lang.Long _jspx_dependants; It does match the method return type!* [Can you cite with what parameters JspServlet in your web.xml is configured, exactly?] servlet servlet-namejsp/servlet-name servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class init-param param-namefork/param-name param-valuefalse/param-value /init-param init-param param-namexpoweredBy/param-name param-valuefalse/param-value /init-param init-param param-namedevelopment/param-name param-valuefalse/param-value /init-param init-param param-namegenStringAsCharArray/param-name param-valuetrue/param-value /init-param init-param param-nametrimSpaces/param-name param-valuetrue/param-value /init-param load-on-startup3/load-on-startup /servlet - I believe we have tried the suppressSmap=true setting in our uat environment, and still seen the 1st exception occur (related to getDependants). But I'll retry that and let you know the outcome. - We have excluded the tomcat folder from anti-virus scans. - As far as I can tell we don't have any strange jars in this web-app, definitely no copy of jasper. - Your question regarding the windows registry settings, let me know what specific settings do I need to verify and I will do that. thanks.
Re: Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Konstantin, On 4/12/12 10:03 AM, Konstantin Kolinko wrote: What is the type and value of _jspx_dependants field? Ashima has sent the original JSP and the translated .java file to me. The interesting parts are here: // Starting at line 21 (filenames redacted): private static java.util.Mapjava.lang.String,java.lang.Long _jspx_dependants; static { _jspx_dependants = new java.util.HashMapjava.lang.String,java.lang.Long(12); _jspx_dependants.put(/WEB-INF/tld/a.tld, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/pages/b.jsp, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tags/c.tag, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tld/d.tld, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tld/e.tld, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tags/f.tag, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tld/g.tld, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tld/h.tld, Long.valueOf(-1L)); _jspx_dependants.put(/WEB-INF/tld/i.tld, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tld/j.tld, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tld/k.tld, Long.valueOf(1333128256000L)); _jspx_dependants.put(/WEB-INF/tld/l.tld, Long.valueOf(1333128256000L)); } // ... // Line 49: public java.util.Mapjava.lang.String,java.lang.Long getDependants() { return _jspx_dependants; } That looks perfectly legit to me. It seems that it complaints that that field returned by the method is not MapString,Long. Can you confirm that after you try to access the .jsp from the browser, the timestamp on the .java file changes? Timestamp does not matter, because in latest Tomcat 7 it is set to match the original file. There is a comment at the top of generated java file that mentions this fact and the actual time of generation. /* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/7.0.26 * Generated at: 2012-04-12 14:47:59 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ 3. Deletion of recently created files on Windows can be impeded by antivirus scanners. (Subversion client users on Windows are sometimes complaining about that. It depends on a/v product being used.). It's weird that the .classtmp file does not appear to exist, either. Maybe Tomcat can rename the old file before deleting it. IIRC Windows allows renaming files that are open for reading, but has problems with deleting them. The code definitely creates the new file, then deletes, then renames. Since the delete fails, the rename can't occur. Strange thing is that the file that should be re-named (.classtmp) does not exist according to OP. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+HBoYACgkQ9CaO5/Lv0PBQJQCeN1XqxMEBjKh+QtTKDEb9Wi01 DIUAoKauJOoOj4+KW3ATIJioAJLhp7N7 =sHS8 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Konstantin, On 4/12/12 12:44 PM, Christopher Schultz wrote: Ashima has sent the original JSP and the translated .java file to me. The interesting parts are here: Also, there isn't much in the way of directives in the original JSP. First, some declarations: %@ page trimDirectiveWhitespaces=true % %@ include file=/WEB-INF/pages/taglibs.jsp % Then after that, it's just using standard JSTL tags. The page looks fairly clean to me. If there is A/V in the mix, there might be a problem writing, then reading, then deleting, then re-naming, etc. all in a short period of time... it might just be an I/O problem. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+HB6UACgkQ9CaO5/Lv0PCZlgCdHbrAsZGJq/8szkGiukOcOwf5 n24AnjeE0wyTSX0L728wGASYudYhZzW/ =eAxg -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
We just did a tomcat upgrade (from 6.0.36 to 7.0.26) for a legacy struts-1.3.10 app on Windows 2008 R2 (64-bit). Ever since, there's been an intermittent occurence of the following 2 exceptions (for random jsps) - *2012-04-10 18:27:45,751 ERROR [org.apache.struts.tiles.taglib.InsertTag] - ServletException in '/WEB-INF/pages/registration/registration.jsp': Unable to compile class for JSP: * *An error occurred at line: 49 in the generated java file* *This method must return a result of type MapString,Long* * * *AND* * * * 2012-04-10 18:36:58,501 ERROR [org.apache.struts.tiles.taglib.InsertTag] - ServletException in '/WEB-INF/pages/registration/registration.jsp': classFile.delete() failed org.apache.jasper.JasperException: Unable to compile class for JSP * * * * * We don't precompile the jsps. The related jsps already have the corresponding .java and .class files in the work folder. Have researched and found a ton of solution for similar issues with earlier versions of tomcat. Have tried the following plausible solutions: 1. Made sure that the tomcat install was clean, the work folder was deleted 2. Made sure tomcat has full permissions to the appropriate File/Folders 3. Made sure tomcat is running with development=false 4. Tried with JspServlet setting of fork=true and fork=false 5. Made sure that there's no search/indexing services trying to access tomcat folders creating access conflict 6. Tried going to the latest version of tomcat 7.0.27 The error still persists. Any thoughts/ideas ... thanks.
Re: Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ashima, On 4/11/12 11:05 AM, Ashima Sharma wrote: We just did a tomcat upgrade (from 6.0.36 to 7.0.26) for a legacy struts-1.3.10 app on Windows 2008 R2 (64-bit). Ever since, there's been an intermittent occurence of the following 2 exceptions (for random jsps) - *2012-04-10 18:27:45,751 ERROR [org.apache.struts.tiles.taglib.InsertTag] - ServletException in '/WEB-INF/pages/registration/registration.jsp': Unable to compile class for JSP: * *An error occurred at line: 49 in the generated java file* *This method must return a result of type MapString,Long* So, what's on line 49 in regstration_jsp.java? The JSP compiler is fairly good at reporting information about the original JSP source, too. Did it give you any clue what the problem was? When you say intermittent, do you mean that sometimes the JSP compiles without a problem and other times it fails? Or, are you saying that only some of these JSPs have the problem, but it's consistent? 2012-04-10 18:36:58,501 ERROR [org.apache.struts.tiles.taglib.InsertTag] - ServletException in '/WEB-INF/pages/registration/registration.jsp': classFile.delete() failed org.apache.jasper.JasperException: Unable to compile class for JSP Full stack trace? Have you tried tracking-down the problem on line 49 of that file? Maybe your underlying code changed and the JSP needs to be updated? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+F4pgACgkQ9CaO5/Lv0PAbEwCfTft4iExSXIDNNj5kkBCGDhbj /fIAn2X/tqJ3GIez2E0mmUPTJlv+mCke =Z2Xx -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
Most of the jsps have this issue...but it happens randomly. For e.g., i wd be able to access the registration page 5 times w/o any issue, and the 6th time I'd get this error. Its bizarre that tomcat tries to recompile the already compiled jsp at some random point even though the page hasn't changed, and throws the cannot compile error. All the jsps with this issue have the .java and .class files under the work directory. The compilation issue is in org.apache.jasper.runtime.JspSourceDependent.getDependants method for every jsp in regstration_jsp.java - line 49- public java.util.Mapjava.lang.String,java.lang.Long getDependants() { line 50-return _jspx_dependants; line 51- } For the 2nd exception, this is what the stack trace looks like no matter which jsp: 2012-04-04 09:55:26,022 ERROR [org.apache.struts.tiles.taglib.InsertTag] - ServletException in '/WEB-INF/pages/register/userProfileBodyTile.jsp': classFile.delete() failed org.apache.jasper.JasperException: Unable to compile class for JSP at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:661) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954) at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678) at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:129) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:152) at org.apache.struts.tiles.taglib.InsertTag.doInclude(InsertTag.java:764) at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:896) at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465) at org.apache.jsp.WEB_002dINF.pages.layouts.defaultLayout_jsp._jspx_meth_tiles_005finsert_005f1(defaultLayout_jsp.java:2663) at org.apache.jsp.WEB_002dINF.pages.layouts.defaultLayout_jsp._jspService(defaultLayout_jsp.java:253) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1083) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:295) at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:271) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:332) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
Re: Intermittent ServletException - Unable to compile class for JSP for a struts-1.3.10 web-app with Tomcat 7.0.26/7.0.27
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ashima, On 4/11/12 4:27 PM, Ashima Sharma wrote: Most of the jsps have this issue...but it happens randomly. For e.g., i wd be able to access the registration page 5 times w/o any issue, and the 6th time I'd get this error. Its bizarre that tomcat tries to recompile the already compiled jsp at some random point even though the page hasn't changed, and throws the cannot compile error. All the jsps with this issue have the .java and .class files under the work directory. Can you confirm that after you try to access the .jsp from the browser, the timestamp on the .java file changes? Are you deploying from a WAR file or exploded directory? Also, are any of your JSPs in a .jar file (whether this is in a WAR file or not)? There have been some recent reports of constant recompilation when JSPs are in ZIP archives (and both .jar and .war are just .zip files with certain expected entries within them). The compilation issue is in org.apache.jasper.runtime.JspSourceDependent.getDependants method for every jsp in regstration_jsp.java - line 49- public java.util.Mapjava.lang.String,java.lang.Long getDependants() { line 50-return _jspx_dependants; line 51- } Hmm, that looks like Tomcat is not generating good Java code. Would you be able to post the entire .java file and the original .jsp? I understand if that's not something you want to post publicly, so you could email it directly to me if you feel better about that. I read that you have performed a clean install of Tomcat, which is a good step to take because this looks like a mismatched Jasper problem or something. For the 2nd exception, this is what the stack trace looks like no matter which jsp: 2012-04-04 09:55:26,022 ERROR [org.apache.struts.tiles.taglib.InsertTag] - ServletException in '/WEB-INF/pages/register/userProfileBodyTile.jsp': classFile.delete() failed org.apache.jasper.JasperException: Unable to compile class for JSP at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:661) Yup, that's the compiler. org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) Spring plus Struts? Okay... Caused by: java.io.IOException: classFile.delete() failed at org.apache.jasper.compiler.SmapUtil$SDEInstaller.install(SmapUtil.java:201) at org.apache.jasper.compiler.SmapUtil.installSmap(SmapUtil.java:163) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646) ... 110 more This error happens when the original .class file can't be deleted before re-naming an SMAP-loaded copy of the .class file. Can you confirm that you have files called, for example, userProfileBodyTile_jsp.java, userProfileBodyTile_jsp.class, and userProfileBodyTile_jsp.javatmp ? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+F/XYACgkQ9CaO5/Lv0PDrIACfQDK6no4ncxzXnj8gkB4nulnX iv8AoI6L+FDyBGHF/VfB2LyEtVOQXLDQ =PQxy -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Error: Unable to compile class for JSP
On 11/01/2012 20:44, Justin Larose wrote: ma...@apache.org wrote on 01/11/2012 01:19:17 PM: From: ma...@apache.org To: Tomcat Users List users@tomcat.apache.org Date: 01/11/2012 01:20 PM Subject: Re: Error: Unable to compile class for JSP Justin Larose justin.lar...@nexweb.org wrote: An error occurred at line: 230 in the jsp file: /object_table.jsp The type Part is ambiguous 227:{ 228: //do nothing here - we don't want the filter to be displayed for lifecycles 229: } 230: else if (objType.equals(Part.class)) 231: { Have you imported more than one Part.class by accident, via a wildcard import perhaps? I did not import any classes. You must have at least one import to resolve the class Part. Since I'm pretty sure a class with that name was added in servlet 3, wildcard imports are very likely the problem. I downgraded the Tomcat to Version 6.0.35 and looks to be working correctly now. Maybe Serena Dimensions cannot work with that higher version of Tomcat (version 7.0.23)? The only files I copied over from the 6.0 version to the 6.0.35 version were the webapps directory the web.xml file and the server.xml file. The only difference in the server.xml file between the 2 versions is this: Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / So what Mark are both saying is this: in the JSP there is some code which imports, via a wildcard, two packages that both contains a Part class. We are not talking about importing things on the file system. We are talking about a specific Java command which is part of the code. E.g. If both of the packages below contain a class called Part, then the compiler can't tell which one you are trying to use. import com.examples.stuff.* import com.examples.other.* You can use an editor to look in the the JSP file in question for the word import somewhere near the top of the file and the '*' character. If there is more than one '*', you can report the error to Serena Dimensions or try to fix it yourself. p - Thanks, Justin ** This email and any files transmitted with it are intended solely for the use of the individual or agency to whom they are addressed. If you have received this email in error please notify the Navy Exchange Service Command e-mail administrator. This footnote also confirms that this email message has been scanned for the presence of computer viruses. Thank You! ** -- [key:62590808] signature.asc Description: OpenPGP digital signature
Error: Unable to compile class for JSP
Well now that I got the certificate setup and users login to the application they are not seeing all content... When they login to the application (Tomcat version 7.0.23) they get the error below in the initial splash window. (there should be a menu instead) If I switch back to the Tomcat 6.0 version it runs fine. I checked the .jps files and are identical between the version 6 and version 7 application. ___ Jan 11, 2012 8:28:23 AM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 230 in the jsp file: /object_table.jsp The type Part is ambiguous 227:{ 228: //do nothing here - we don't want the filter to be displayed for lifecycles 229: } 230: else if (objType.equals(Part.class)) 231: { 232:ObjectTablePagelet.addButton(Pagelet.EDIT_BUTTON, edit_design_part_master, BarAdapterItem.MODE_ENABLE_ON_ONE, Edit Design Part, 530, 550); 233: } Thanks, Justin LaRose ** This email and any files transmitted with it are intended solely for the use of the individual or agency to whom they are addressed. If you have received this email in error please notify the Navy Exchange Service Command e-mail administrator. This footnote also confirms that this email message has been scanned for the presence of computer viruses. Thank You! **
Re: Error: Unable to compile class for JSP
On 11/01/2012 13:53, Justin Larose wrote: An error occurred at line: 230 in the jsp file: /object_table.jsp The type Part is ambiguous 227:{ 228: //do nothing here - we don't want the filter to be displayed for lifecycles 229: } 230: else if (objType.equals(Part.class)) 231: { Have you imported more than one Part.class by accident, via a wildcard import perhaps? p -- [key:62590808] signature.asc Description: OpenPGP digital signature
Re: Error: Unable to compile class for JSP
An error occurred at line: 230 in the jsp file: /object_table.jsp The type Part is ambiguous 227:{ 228: //do nothing here - we don't want the filter to be displayed for lifecycles 229: } 230: else if (objType.equals(Part.class)) 231: { Have you imported more than one Part.class by accident, via a wildcard import perhaps? I did not import any classes. I installed Tomcat 7 in a different directory and copied all the webapp directories to the new location. - Justin ** This email and any files transmitted with it are intended solely for the use of the individual or agency to whom they are addressed. If you have received this email in error please notify the Navy Exchange Service Command e-mail administrator. This footnote also confirms that this email message has been scanned for the presence of computer viruses. Thank You! **
Re: Error: Unable to compile class for JSP
On 11/01/2012 16:56, Justin Larose wrote: An error occurred at line: 230 in the jsp file: /object_table.jsp The type Part is ambiguous 227:{ 228: //do nothing here - we don't want the filter to be displayed for lifecycles 229: } 230: else if (objType.equals(Part.class)) 231: { Have you imported more than one Part.class by accident, via a wildcard import perhaps? I did not import any classes. I installed Tomcat 7 in a different directory and copied all the webapp directories to the new location. The error message says you have a bug in the JSP. The bug appears to be that the Part.class reference is ambiguous. This means that more than one Part.class reference is visible in the scope of the JSP, possibly via an import statement inside the JSP. Can you examine the JSP code? p - Justin ** This email and any files transmitted with it are intended solely for the use of the individual or agency to whom they are addressed. If you have received this email in error please notify the Navy Exchange Service Command e-mail administrator. This footnote also confirms that this email message has been scanned for the presence of computer viruses. Thank You! ** -- [key:62590808] signature.asc Description: OpenPGP digital signature
Re: Error: Unable to compile class for JSP
Justin Larose justin.lar...@nexweb.org wrote: An error occurred at line: 230 in the jsp file: /object_table.jsp The type Part is ambiguous 227:{ 228: //do nothing here - we don't want the filter to be displayed for lifecycles 229: } 230: else if (objType.equals(Part.class)) 231: { Have you imported more than one Part.class by accident, via a wildcard import perhaps? I did not import any classes. You must have at least one import to resolve the class Part. Since I'm pretty sure a class with that name was added in servlet 3, wildcard imports are very likely the problem. Mark I installed Tomcat 7 in a different directory and copied all the webapp directories to the new location. - Justin ** This email and any files transmitted with it are intended solely for the use of the individual or agency to whom they are addressed. If you have received this email in error please notify the Navy Exchange Service Command e-mail administrator. This footnote also confirms that this email message has been scanned for the presence of computer viruses. Thank You! ** - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Error: Unable to compile class for JSP
ma...@apache.org wrote on 01/11/2012 01:19:17 PM: From: ma...@apache.org To: Tomcat Users List users@tomcat.apache.org Date: 01/11/2012 01:20 PM Subject: Re: Error: Unable to compile class for JSP Justin Larose justin.lar...@nexweb.org wrote: An error occurred at line: 230 in the jsp file: /object_table.jsp The type Part is ambiguous 227:{ 228: //do nothing here - we don't want the filter to be displayed for lifecycles 229: } 230: else if (objType.equals(Part.class)) 231: { Have you imported more than one Part.class by accident, via a wildcard import perhaps? I did not import any classes. You must have at least one import to resolve the class Part. Since I'm pretty sure a class with that name was added in servlet 3, wildcard imports are very likely the problem. I downgraded the Tomcat to Version 6.0.35 and looks to be working correctly now. Maybe Serena Dimensions cannot work with that higher version of Tomcat (version 7.0.23)? The only files I copied over from the 6.0 version to the 6.0.35 version were the webapps directory the web.xml file and the server.xml file. The only difference in the server.xml file between the 2 versions is this: Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / - Thanks, Justin ** This email and any files transmitted with it are intended solely for the use of the individual or agency to whom they are addressed. If you have received this email in error please notify the Navy Exchange Service Command e-mail administrator. This footnote also confirms that this email message has been scanned for the presence of computer viruses. Thank You! **
Unable to compile class for JSP
Hi, Does anyone know how to go about fixing the error below; I have spent a good 12 hours trying to work it out. HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 18 in the generated java file The return type is incompatible with JspSourceDependent.getDependants() Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:319) org.apache.jasper.compiler.Compiler.compile(Compiler.java:298) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:321) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:257) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.jenkov.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:93) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs. Apache Tomcat/6.0.33 -- View this message in context: http://old.nabble.com/Unable-to-compile-class-for-JSP-tp32503887p32503887.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Unable to compile class for JSP
2011/9/24 R4IDER raider-2...@hotmail.com: Hi, Does anyone know how to go about fixing the error below; I have spent a good 12 hours trying to work it out. HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 18 in the generated java file The return type is incompatible with JspSourceDependent.getDependants() (...) 1. If you are using precompiled jsp or tag files, you should compile them with exact the same x.y.z version of Tomcat where you deploy them. 2. Stop Tomcat and clear everything from the /work subdirectory of CATALINA_BASE. That is, there might be *.class files compiled with some other version of Tomcat. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
An error occurred at line: -1, Unable to compile class for JSP (Netware)
This is an upgrade from Apache2.0.59/Tomcat4.1.31/mod_jk 1.2.15 to Apache2.0.63/Tomcat4.1.37/mod_jk 1.2.36 on Netware 6.5 sp7. Except for JSP compiles, everything including HTML, servlets and precompiled JSPs works. Ant.jar is there in CATALINA_HOME\common\lib. The problem is with Ant v1.7 introduced in Tomcat4.1.36. If I use Ant v1.5 from Tomcat4.1.34 all works for me including JSP compiles. The current functioning environment Apache2.0.63/Tomcat4.1.37/Ant1.5/mod_jk1.2.26. I use configuration as here: http://archive.apache.org/dist/tomcat/tomcat-4/archive/v4.0.3/bin/netware/i386/Tomcat-on-NetWare-HowTo.html As an experiment: When using Tomcat4.1.37 and Ant v1.7 without an explicit envset (default) CATALINA_CLASSPATH=$CATALINA_HOME;\common\lib\ant.jar in Tomcat.conf I get error: [antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found. When using Tomcat4.1.36/.37 and Ant v1.7 with an explicit envset CATALINA_CLASSPATH=$CATALINA_HOME;\common\lib\ant.jar in Tomcat.conf I get NoClassDefFoundError: org/apache/tools/ant/launch/AntMain Short story: Ant.jar from Tomcat4.1.34 compiles JSPs in Tomcat4.1.37. Ant.jar included with Tomcat4.1.37 errors. I saw this with Tomcat4.1.36 also. I am simply copying .conf files from older Apache/Tomcat to current versions. How would I troubleshoot this further? Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Easter Seals-Goodwill Northern Rocky Mountain are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Please report any inappropriate or abusive use of this email system to [EMAIL PROTECTED]
Re: An error occurred at line: -1, Unable to compile class for JSP(Netware)
It's a known bug, which has beend discussed on the developers list only very recently. See http://marc.info/?t=12066709823r=1w=2 Your workaround (using ant 1.5) seems fine. The final solution is still pending, but it's quite possible, that Mark does a fix for the future 4.1.38. This still needs some clarification though. Regards, Rainer Howard Watson schrieb: This is an upgrade from Apache2.0.59/Tomcat4.1.31/mod_jk 1.2.15 to Apache2.0.63/Tomcat4.1.37/mod_jk 1.2.36 on Netware 6.5 sp7. Except for JSP compiles, everything including HTML, servlets and precompiled JSPs works. Ant.jar is there in CATALINA_HOME\common\lib. The problem is with Ant v1.7 introduced in Tomcat4.1.36. If I use Ant v1.5 from Tomcat4.1.34 all works for me including JSP compiles. The current functioning environment Apache2.0.63/Tomcat4.1.37/Ant1.5/mod_jk1.2.26. I use configuration as here: http://archive.apache.org/dist/tomcat/tomcat-4/archive/v4.0.3/bin/netware/i386/Tomcat-on-NetWare-HowTo.html As an experiment: When using Tomcat4.1.37 and Ant v1.7 without an explicit envset (default) CATALINA_CLASSPATH=$CATALINA_HOME;\common\lib\ant.jar in Tomcat.conf I get error: [antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found. When using Tomcat4.1.36/.37 and Ant v1.7 with an explicit envset CATALINA_CLASSPATH=$CATALINA_HOME;\common\lib\ant.jar in Tomcat.conf I get NoClassDefFoundError: org/apache/tools/ant/launch/AntMain Short story: Ant.jar from Tomcat4.1.34 compiles JSPs in Tomcat4.1.37. Ant.jar included with Tomcat4.1.37 errors. I saw this with Tomcat4.1.36 also. I am simply copying .conf files from older Apache/Tomcat to current versions. How would I troubleshoot this further? Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Easter Seals-Goodwill Northern Rocky Mountain are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Please report any inappropriate or abusive use of this email system to [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: An error occurred at line: -1, Unable to compile class for JSP(Netware)
Thanks. I did not find the bug listed when I searched. Rainer Jung [EMAIL PROTECTED] 4/1/2008 11:33 AM It's a known bug, which has beend discussed on the developers list only very recently. See http://marc.info/?t=12066709823r=1w=2 Your workaround (using ant 1.5) seems fine. The final solution is still pending, but it's quite possible, that Mark does a fix for the future 4.1.38. This still needs some clarification though. Regards, Rainer Howard Watson schrieb: This is an upgrade from Apache2.0.59/Tomcat4.1.31/mod_jk 1.2.15 to Apache2.0.63/Tomcat4.1.37/mod_jk 1.2.36 on Netware 6.5 sp7. Except for JSP compiles, everything including HTML, servlets and precompiled JSPs works. Ant.jar is there in CATALINA_HOME\common\lib. The problem is with Ant v1.7 introduced in Tomcat4.1.36. If I use Ant v1.5 from Tomcat4.1.34 all works for me including JSP compiles. The current functioning environment Apache2.0.63/Tomcat4.1.37/Ant1.5/mod_jk1.2.26. I use configuration as here: http://archive.apache.org/dist/tomcat/tomcat-4/archive/v4.0.3/bin/netware/i386/Tomcat-on-NetWare-HowTo.html As an experiment: When using Tomcat4.1.37 and Ant v1.7 without an explicit envset (default) CATALINA_CLASSPATH=$CATALINA_HOME;\common\lib\ant.jar in Tomcat.conf I get error: [antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found. When using Tomcat4.1.36/.37 and Ant v1.7 with an explicit envset CATALINA_CLASSPATH=$CATALINA_HOME;\common\lib\ant.jar in Tomcat.conf I get NoClassDefFoundError: org/apache/tools/ant/launch/AntMain Short story: Ant.jar from Tomcat4.1.34 compiles JSPs in Tomcat4.1.37. Ant.jar included with Tomcat4.1.37 errors. I saw this with Tomcat4.1.36 also. I am simply copying .conf files from older Apache/Tomcat to current versions. How would I troubleshoot this further? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Easter Seals-Goodwill Northern Rocky Mountain are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Please report any inappropriate or abusive use of this email system to [EMAIL PROTECTED]
Unable to compile class for JSP
Hi, I am getting Unable to compile class for JSP error in one of my JSPs which was working perfectly until 2 days back. It says: An error occurred at line: 10 in the jsp file: /WEB-INF/jsps/Listing.jsp String perspective = null; ^ This jsp is being included in another JSP and that is the one i am trying to access. The strange part is that I have Listing.jsp included in few other JSPs as well but those are working fine. Any help would be appreciated. Thanks and Regards, Gaurav Singh Kushwaha http://www.chakpak.com Ph: +91-9880110695 Bangalore, India.
Re: Unable to compile class for JSP
Just include the libraries in the main JSP not in every included file If u use Netbeans Right click on the main JSP and compile it... it will show you the errors have fun - Original Message - From: Gaurav Kushwaha [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, April 17, 2007 9:36 PM Subject: Unable to compile class for JSP Hi, I am getting Unable to compile class for JSP error in one of my JSPs which was working perfectly until 2 days back. It says: An error occurred at line: 10 in the jsp file: /WEB-INF/jsps/Listing.jsp String perspective = null; ^ This jsp is being included in another JSP and that is the one i am trying to access. The strange part is that I have Listing.jsp included in few other JSPs as well but those are working fine. Any help would be appreciated. Thanks and Regards, Gaurav Singh Kushwaha http://www.chakpak.com Ph: +91-9880110695 Bangalore, India. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to compile class for JSP
I am using Idea. Even that has an option to compile the jsps though. I will try that. What exactly do you mean by including libraries ? Are you referring to class imports ? Thanks, Gaurav Singh Kushwaha http://www.chakpak.com On 4/18/07, Johnny Kewl [EMAIL PROTECTED] wrote: Just include the libraries in the main JSP not in every included file If u use Netbeans Right click on the main JSP and compile it... it will show you the errors have fun - Original Message - From: Gaurav Kushwaha [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, April 17, 2007 9:36 PM Subject: Unable to compile class for JSP Hi, I am getting Unable to compile class for JSP error in one of my JSPs which was working perfectly until 2 days back. It says: An error occurred at line: 10 in the jsp file: /WEB-INF/jsps/Listing.jsp String perspective = null; ^ This jsp is being included in another JSP and that is the one i am trying to access. The strange part is that I have Listing.jsp included in few other JSPs as well but those are working fine. Any help would be appreciated. Thanks and Regards, Gaurav Singh Kushwaha http://www.chakpak.com Ph: +91-9880110695 Bangalore, India. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Ph: +91-9880110695 Bangalore, India.
Re: Unable to compile class for JSP
Hi Peter, I probably got the wrong end of the stick, missed the thread etc, but its seems like you going through a whole lot of pain so I was wondering. If you have a servlet and a bunch of JSP pages, did you know that the JSP's will not compile when you Clean and Build in Netbeans. If you right click on the project name and under the compile section ask it to--- then it will. Or if you compile each JSP file then it will to. So its possible that its just an error in the JSP that goes undetected until the browser hit it. Try set it up so that it compiles all the JSP's and I have a feeeling you will see it at design time. Dont think its a bug in tomcat good luck. - Original Message - From: [EMAIL PROTECTED] To: users@tomcat.apache.org; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, March 21, 2007 5:00 PM Subject: AW: Unable to compile class for JSP Hi everybody, thanks for your help, which I really appreciate! I still don't know exactly what it was, but I fixed it by doing the following: - uninstall tomcat - reinstall it, not having it run as a windows service - installing it in a directory tomcat_4_1 rather then the suggested tomcat 4.1 because I hade problems with spaces in path before. Now it works! Bye Peter - Original Message - From: [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, March 20, 2007 12:21 PM Subject: Unable to compile class for JSP Hi, This might be a silly question, but it seems to be quite a common problem (lots or links in google). But none of the offered solutions so far worked. So I am asking the people who probably know! I installed tomcat 4.1.29 with JDK 1.4.2 Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorH a ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.j a va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.j a va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j a va:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295 ) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic a tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil t erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal v e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal v e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato r Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:24 1 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav a :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV a lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav a :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80
AW: Unable to compile class for JSP
Hi everybody, thanks for your help, which I really appreciate! I still don't know exactly what it was, but I fixed it by doing the following: - uninstall tomcat - reinstall it, not having it run as a windows service - installing it in a directory tomcat_4_1 rather then the suggested tomcat 4.1 because I hade problems with spaces in path before. Now it works! Bye Peter - Original Message - From: [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, March 20, 2007 12:21 PM Subject: Unable to compile class for JSP Hi, This might be a silly question, but it seems to be quite a common problem (lots or links in google). But none of the offered solutions so far worked. So I am asking the people who probably know! I installed tomcat 4.1.29 with JDK 1.4.2 Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorH a ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.j a va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.j a va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j a va:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295 ) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic a tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil t erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal v e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal v e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato r Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:24 1 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav a :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV a lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav a :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve . java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:7 8 1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process C onnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:5 8 9) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo l .java:666) at java.lang.Thread.run(Unknown Source
Unable to compile class for JSP
Hi, This might be a silly question, but it seems to be quite a common problem (lots or links in google). But none of the offered solutions so far worked. So I am asking the people who probably know! I installed tomcat 4.1.29 with JDK 1.4.2 Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHa ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.ja va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:78 1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58 9) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:666) at java.lang.Thread.run(Unknown Source) Apache Tomcat/4.1.29 Thanks for help! Peter
RE: Unable to compile class for JSP
doesn't seem like much to go onwhich example did you use and did you look in the work folder to see what the compiled servlets were referring to? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 20, 2007 11:21 AM To: users@tomcat.apache.org Subject: Unable to compile class for JSP Hi, This might be a silly question, but it seems to be quite a common problem (lots or links in google). But none of the offered solutions so far worked. So I am asking the people who probably know! I installed tomcat 4.1.29 with JDK 1.4.2 Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHa ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.ja va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:78 1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58 9) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:666) at java.lang.Thread.run(Unknown Source) Apache Tomcat/4.1.29 Thanks for help! Peter - To start a new topic, e-mail: users@tomcat.apache.org
Re: Unable to compile class for JSP
Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. Hi Peter, did you check that the JAVA_HOME enviroment variable is properly setted? Since JSP are compiled in java classe the first time if Tomcat cannot compile it is maybe coz it dosen't find the JDK. Cheers Roberto - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to compile class for JSP
Peter jasper errors means your (index.)jsp is incorrectly compiled or your jspcompiler is incorrect or does not have permissions to compile If you look at $TOMCAT_HOME/conf/catalina.properties you should see these grants to the jasper compiler package package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans. package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper. Note the trailing . at the end of the package and in $TOMCAT_HOME/conf/catalina.policy you should see these grants try { // Precompiled JSPs need access to this package. permission java.lang.RuntimePermission accessClassInPackage.org.apache.jasper.runtime; permission java.lang.RuntimePermission accessClassInPackage.org.apache.jasper.runtime.*; }; Martin-- --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. --- Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. - Original Message - From: [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, March 20, 2007 12:21 PM Subject: Unable to compile class for JSP Hi, This might be a silly question, but it seems to be quite a common problem (lots or links in google). But none of the offered solutions so far worked. So I am asking the people who probably know! I installed tomcat 4.1.29 with JDK 1.4.2 Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHa ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.ja va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline
Re: Unable to compile class for JSP
The error report implies that it's trying to compile a jsp it can't read (line -1 and jsp file: null). Can you check for a root cause in the logs relating to the stack trace below? Also check the usual suspects -- file permissions, security manager, etc. --David [EMAIL PROTECTED] wrote: Hi, This might be a silly question, but it seems to be quite a common problem (lots or links in google). But none of the offered solutions so far worked. So I am asking the people who probably know! I installed tomcat 4.1.29 with JDK 1.4.2 Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHa ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.ja va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:78 1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58 9) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:666) at java.lang.Thread.run(Unknown Source) Apache Tomcat/4.1.29 Thanks for help! Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unable to compile class for JSP
Hi I'm not that professional But what I did and it worked is: Let's say we have jsp file called myJsp.jsp in ROOT and a java program myProgram.java 1-Compile myProgram.java in a package named myPackage In WEB-INF/classes. 2-import that package in myJsp.jsp like this %@ page import=myPackage.*% (put it in the first line of the file) 3-somewhere in myJsp.jsp create an instance of myProgram myProgram prog =new myProgram (); then use it as in java Abdelmonaam KALLALI Test Specialist DragonWave Inc 411 Legget Dr Phone :613-599 9991 ext 275 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 20, 2007 12:21 PM To: users@tomcat.apache.org Subject: Unable to compile class for JSP Hi, This might be a silly question, but it seems to be quite a common problem (lots or links in google). But none of the offered solutions so far worked. So I am asking the people who probably know! I installed tomcat 4.1.29 with JDK 1.4.2 Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHa ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.ja va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:78 1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt
Can't solve problem: Unable to compile class for JSP
Hallo, i tried to solve this problem and i read many posts but could found any good solution. plz help me :) org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: The return type is incompatible with JspSourceDependent.getDependants() org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397) org.apache.jasper.compiler.Compiler.compile(Compiler.java:288) org.apache.jasper.compiler.Compiler.compile(Compiler.java:267) org.apache.jasper.compiler.Compiler.compile(Compiler.java:255) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs. Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html
Re: Can't solve problem: Unable to compile class for JSP
Did you check on your favorite search engine for possible solutions? Reading this might help: http://tomcat.apache.org/tomcat-5.0-doc/jasper/docs/api/org/apache/jasper/runtime/JspSourceDependent.html -Rashmi - Original Message From: Linas Stankevicius [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Monday, March 19, 2007 1:52:58 PM Subject: Can't solve problem: Unable to compile class for JSP Hallo, i tried to solve this problem and i read many posts but could found any good solution. plz help me :) org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: The return type is incompatible with JspSourceDependent.getDependants() org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397) org.apache.jasper.compiler.Compiler.compile(Compiler.java:288) org.apache.jasper.compiler.Compiler.compile(Compiler.java:267) org.apache.jasper.compiler.Compiler.compile(Compiler.java:255) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs. Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't solve problem: Unable to compile class for JSP
Have you taken a look at the full stack trace of the root cause in the logs? It would also be helpful if we could see the relevant jsp source and know which version of tomcat you are working with. --David Linas Stankevicius wrote: Hallo, i tried to solve this problem and i read many posts but could found any good solution. plz help me :) org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: The return type is incompatible with JspSourceDependent.getDependants() org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397) org.apache.jasper.compiler.Compiler.compile(Compiler.java:288) org.apache.jasper.compiler.Compiler.compile(Compiler.java:267) org.apache.jasper.compiler.Compiler.compile(Compiler.java:255) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs. Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Unable to compile class for JSP
Hi, I'm having a newbie type of problem with getting a JSP to compile. Seems it can't find my class. Rest of error messages: Generated servlet error: The import FOO cannot be resolved Following files are located in Tomcat/webapps/VIP Code: Home.jsp %@ page import=java.util.* % html body br h2 align=centerHome Page/h2 pnbsp;/p jsp:include page=DisplBar.jsp flush=true/ pinput type=submit value=submit/p /body /html DisplBar.jsp jsp:directive.page import=java.util.*/ jsp:directive.page import=FOO/ // have also tried FOO.* . . . foo.bar(); . . . I have copies of the complied class foo.class in Tomcat/webapps/VIP, in Tomcat/webapps/VIP/WEB-INF, and in Tomcat/webapps/VIP/WEB-INF/classes. Class foo is in the default package. Beside using the default package, what am I doing wrong? Thanks. Ed - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unable to compile class for JSP
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Unable to compile class for JSP Class foo is in the default package. Beside using the default package, what am I doing wrong? Since you seem to be aware the using the default package is not allowed, why haven't you fixed that first? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unable to compile class for JSP
Well, umm, actually I wasn't aware that the default package isn't allowed. I just considered it poor practice to use. Let me go fix that. Thanks. Caldarale wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Unable to compile class for JSP Class foo is in the default package. Beside using the default package, what am I doing wrong? Since you seem to be aware the using the default package is not allowed, why haven't you fixed that first? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unable to compile class for JSP
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: RE: Unable to compile class for JSP Well, umm, actually I wasn't aware that the default package isn't allowed. Quoting from section 11.2 of the JSP spec: However, as of JDK 1.4, importing classes from the unnamed package is not valid (see http://java.sun.com/j2se/1.4/compatibility.html#source for details). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
org.apache.jasper.JasperException: Unable to compile class for JSP
Hi all! I used to work with Tomcat 3.3 but recently I decided to change to Tomcat 5.5 Unfortunately it appears that I cannot run most of my .jsp files on this version of the server because I encouter this problem: When the server tries to compile the jsp`s, it shows me an error with this stack trace : SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: The method handlePageException(Exception) in the type PageContext is not applicable for the arguments (Throwable) at org.apache.jasper.compiler.DefaultErrorHandler.javacError( DefaultErrorHandler.java:84) at org.apache.jasper.compiler.ErrorDispatcher.javacError( ErrorDispatcher.java:328) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java :414) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264) at org.apache.jasper.JspCompilationContext.compile( JspCompilationContext.java:563) at org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:303) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java :314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke( ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service( CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection (Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) However, when I convert the same files to applets, this problem doesn`t exist anymore. I use Java 1.5 and my OS is Windows XP Does anybody have any idea of what might that mean? Thanx in advance! -- Nick Agianniotis