- This topic has 6 replies, 3 voices, and was last updated 19 years, 8 months ago by Victor Ott.
-
AuthorPosts
-
David HoyleMemberI really need someone’s help. I have a JSP application which crashes on startup. I get this error “org.apache.jasper.JasperException:unable to compile class for jsp”
I have searched and it seems that many people have the same problem but have yet to find anyone who has found a solution.
I would greatly! appreciate anyones help
Thanks,
David
Riyad KallaMemberMoving to OT > Soft Dev.
David please post the JSP code for that page. Also check your <tomcat>\log files, the compile error should be in there someplace.
David HoyleMemberI have a page which tries to import a number of classes
<%@ page import=”Account,Banner,CalDate,Campaign,Dates,DB,DetectOSBrowser,Environment,GetAdServlet,GetLinkServlet,Javamail,Keys,LicenseCheck,LogError,LogonValidation,LogsCutover,Msgsend,Popwindow,Region,Sendmail,servletUpload,SmartHello,Stats,Subscriber,Zone” %>
However, I get an error which says “The import cannot be resolved for”–all of the above. I have a folder under my WEB-INF folder called classes which is where all the classes reside. I am also listing the XML file. Is the path to the classes the problem?
Thanks,
David<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<!DOCTYPE web-app
PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN”
“http://java.sun.com/j2ee/dtds/web-app_2_2.dtd”><web-app>
<!– Define all servlets here –>
<servlet>
<servlet-name>AdvertStart</servlet-name>
<servlet-class>AdvertStart</servlet-class>
<init-param>
<param-name>JAVA_HOME</param-name>
<param-value>C:\Program Files\Java\jre1.5.0_02</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet><servlet>
<servlet-name>Account</servlet-name>
<servlet-class>BannerNetworks.Account</servlet-class>
</servlet><servlet>
<servlet-name>Banner</servlet-name>
<servlet-class>BannerNetworks.Banner</servlet-class>
</servlet><servlet>
<servlet-name>CalDate</servlet-name>
<servlet-class>BannerNetworks.CalDate</servlet-class>
</servlet><servlet>
<servlet-name>Campaign</servlet-name>
<servlet-class>BannerNetworks.Campaign</servlet-class>
</servlet><servlet>
<servlet-name>Dates</servlet-name>
<servlet-class>BannerNetworks.Dates</servlet-class>
</servlet><servlet>
<servlet-name>DB</servlet-name>
<servlet-class>BannerNetworks.DB</servlet-class>
</servlet><servlet>
<servlet-name>DetectOSBrowser</servlet-name>
<servlet-class>BannerNetworks.DetectOSBrowser</servlet-class>
</servlet><servlet>
<servlet-name>Environment</servlet-name>
<servlet-class>BannerNetworks.Environment</servlet-class>
</servlet><servlet>
<servlet-name>GetAdServlet</servlet-name>
<servlet-class>BannerNetworks.GetAdServlet</servlet-class>
</servlet><servlet>
<servlet-name>GetLinkServlet</servlet-name>
<servlet-class>BannerNetworks.GetLinkServlet</servlet-class>
</servlet><servlet>
<servlet-name>RichMediaServlet</servlet-name>
<servlet-class>BannerNetworks.RichMediaServlet</servlet-class>
</servlet><servlet>
<servlet-name>RichMediaPopWindow</servlet-name>
<servlet-class>BannerNetworks.RichMediaPopWindow</servlet-class>
</servlet><servlet>
<servlet-name>InitAdServlet</servlet-name>
<servlet-class>BannerNetworks.InitAdServlet</servlet-class>
</servlet><servlet>
<servlet-name>Javamail</servlet-name>
<servlet-class>BannerNetworks.Javamail</servlet-class>
</servlet><servlet>
<servlet-name>Keys</servlet-name>
<servlet-class>BannerNetworks.Keys</servlet-class>
</servlet><servlet>
<servlet-name>LicenseCheck</servlet-name>
<servlet-class>BannerNetworks.LicenseCheck</servlet-class>
</servlet><servlet>
<servlet-name>LogError</servlet-name>
<servlet-class>BannerNetworks.LogError</servlet-class>
</servlet><servlet>
<servlet-name>LogonValidation</servlet-name>
<servlet-class>BannerNetworks.LogonValidation</servlet-class>
</servlet><servlet>
<servlet-name>LogsCutover</servlet-name>
<servlet-class>BannerNetworks.LogsCutover</servlet-class>
</servlet><servlet>
<servlet-name>Msgsend</servlet-name>
<servlet-class>BannerNetworks.Msgsend</servlet-class>
</servlet><servlet>
<servlet-name>Popwindow</servlet-name>
<servlet-class>BannerNetworks.Popwindow</servlet-class>
</servlet><servlet>
<servlet-name>Region</servlet-name>
<servlet-class>BannerNetworks.Region</servlet-class>
</servlet><servlet>
<servlet-name>Sendmail</servlet-name>
<servlet-class>BannerNetworks.Sendmail</servlet-class>
</servlet><servlet>
<servlet-name>servletUpload</servlet-name>
<servlet-class>BannerNetworks.servletUpload</servlet-class>
</servlet><servlet>
<servlet-name>SmartHello</servlet-name>
<servlet-class>BannerNetworks.SmartHello</servlet-class>
</servlet><servlet>
<servlet-name>Stats</servlet-name>
<servlet-class>BannerNetworks.Stats</servlet-class>
</servlet><servlet>
<servlet-name>Subscriber</servlet-name>
<servlet-class>BannerNetworks.Subscriber</servlet-class>
</servlet><servlet>
<servlet-name>Zone</servlet-name>
<servlet-class>BannerNetworks.Zone</servlet-class>
</servlet><servlet>
<servlet-name>File</servlet-name>
<servlet-class>BannerNetworks.File</servlet-class>
</servlet><servlet>
<servlet-name>Files</servlet-name>
<servlet-class>BannerNetworks.Files</servlet-class>
</servlet><servlet>
<servlet-name>Request</servlet-name>
<servlet-class>BannerNetworks.Request</servlet-class>
</servlet><servlet>
<servlet-name>SmartUpload</servlet-name>
<servlet-class>BannerNetworks.SmartUpload</servlet-class>
</servlet><servlet>
<servlet-name>SmartUploadException</servlet-name>
<servlet-class>BannerNetworks.SmartUploadException</servlet-class>
</servlet><servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>BannerNetworks.TestServlet</servlet-class>
</servlet><!– Servlet mappings included here –>
<servlet-mapping>
<servlet-name>AdvertStart</servlet-name>
<url-pattern>/servlet/AdvertStart</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Account</servlet-name>
<url-pattern>/servlet/Account</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Banner</servlet-name>
<url-pattern>/servlet/Banner</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>CalDate</servlet-name>
<url-pattern>/servlet/CalDate</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Campaign</servlet-name>
<url-pattern>/servlet/Campaign</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Dates</servlet-name>
<url-pattern>/servlet/Dates</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>DB</servlet-name>
<url-pattern>/servlet/DB</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>DetectOSBrowser</servlet-name>
<url-pattern>/servlet/DetectOSBrowser</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Environment</servlet-name>
<url-pattern>/servlet/Environment</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>GetAdServlet</servlet-name>
<url-pattern>/servlet/GetAdServlet</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>GetLinkServlet</servlet-name>
<url-pattern>/servlet/GetLinkServlet</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>RichMediaServlet</servlet-name>
<url-pattern>/servlet/RichMediaServlet</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>RichMediaPopWindow</servlet-name>
<url-pattern>/servlet/RichMediaPopWindow</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>InitAdServlet</servlet-name>
<url-pattern>/servlet/InitAdServlet</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Javamail</servlet-name>
<url-pattern>/servlet/Javamail</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Keys</servlet-name>
<url-pattern>/servlet/Keys</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>LicenseCheck</servlet-name>
<url-pattern>/servlet/LicenseCheck</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>LogError</servlet-name>
<url-pattern>/servlet/LogError</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>LogonValidation</servlet-name>
<url-pattern>/servlet/LogonValidation</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Msgsend</servlet-name>
<url-pattern>/servlet/Msgsend</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Popwindow</servlet-name>
<url-pattern>/servlet/Popwindow</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Region</servlet-name>
<url-pattern>/servlet/Region</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Sendmail</servlet-name>
<url-pattern>/servlet/Sendmail</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>servletUpload</servlet-name>
<url-pattern>/servlet/servletUpload</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>SmartHello</servlet-name>
<url-pattern>/servlet/SmartHello</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Stats</servlet-name>
<url-pattern>/servlet/Stats</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Subscriber</servlet-name>
<url-pattern>/servlet/Subscriber</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Zone</servlet-name>
<url-pattern>/servlet/Zone</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>File</servlet-name>
<url-pattern>/servlet/File</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Files</servlet-name>
<url-pattern>/servlet/Files</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>Request</servlet-name>
<url-pattern>/servlet/Request</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>SmartUpload</servlet-name>
<url-pattern>/servlet/SmartUpload</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>SmartUploadException</servlet-name>
<url-pattern>/servlet/SmartUploadException</url-pattern>
</servlet-mapping><servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/servlet/TestServlet</url-pattern>
</servlet-mapping><session-config>
<session-timeout>1</session-timeout> <!– 30 minutes –>
</session-config><security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name><!– Define the context-relative URL(s) to be protected –>
<url-pattern>/jsp/security/protected/*</url-pattern>
<!– If you list http methods, only those methods are protected –>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<!– Anyone with one of the listed roles may access this area –>
<role-name>tomcat</role-name>
<role-name>role1</role-name>
</auth-constraint>
</security-constraint><!– Default login configuration uses BASIC authentication –>
<!–
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Example Basic Authentication Area</realm-name>
</login-config>
–><!– Form-based login is enabled by default. If you wish to
try Basic authentication, comment out the <login-config>
section below and uncomment the one above. –>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Example Form-Based Authentication Area</realm-name>
<form-login-config>
<form-login-page>/jsp/security/login/login.jsp</form-login-page>
<form-error-page>/jsp/security/login/error.jsp</form-error-page>
</form-login-config>
</login-config></web-app>
Riyad KallaMemberNever never never never use classes that are in the default package. Go put all those classes into packages and your problems will disappear.
David HoyleMemberI added all the classes into a package. I reference the package so the error i get now is “import (classname) cannot be resolved.
<%@ page import=”classes.Account,classes.Banner,classes.CalDate,classes.Campaign,classes.Dates,classes.DB,classes.DetectOSBrowser,classes.Environment,classes.GetAdServlet,classes.GetLinkServlet,classes.Javamail,classes.Keys,classes.LicenseCheck,classes.LogError,classes.LogonValidation,classes.LogsCutover,classes.Msgsend,classes.Popwindow,classes.Region,classes.Sendmail,classes.servletUpload,classes.SmartHello,classes.Stats,classes.Subscriber,classes.Zone” %>
Riyad KallaMemberIs this a project that you would be able to mail to us? support@genuitec.com ATTN Riyad with a link to this thread so I know why I’m getting it?
Victor OttMember@dhoyle: is your package really named ‘classes’? could you please post the complete path of the directory where the ‘classes’ directory is stored into?
-
AuthorPosts