what is cannot be resolved to a type error?
When i run jsp programs, am getting :
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /dbcoffee.jsp
Generated servlet error:
CoffeeQBean cannot be resolved to a type
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:409)
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:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
what does cannot be resolved to a type mean?
modify web.xml file in conf dir
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
into
<init-param>
<param-name>fork</param-name>
<param-value>true</param-value>
</init-param>
and restart the server
I have exact same problem. I don't understand where to turn the false value into true since my web.xml doesn't have any word says "false". I am attaching my web.xml as follow:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed 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
http://www.apache.org/licenses/LICENSE-2.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.
-->
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<servlet-class>org.apache.jsp.index_jsp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
<!-- JSPC servlet mappings end -->
</web-app>
I think you are looking at the wrong web.xml file. He meant the one in your %catalina_home%/conf directory
That said, I changed my fork to true, but other possible problems:
not including classfiles in ur jsp <%@ page import="classfile" %>
not having the classfiles in the WEB-INF/classes directory of your webapp
I have been running webapps without deploying them for a while, and putting my classes in the webapps/ROOT directory. Now that I am trying to get my act together I faced this same problem, and it was all fixed by putting the relevant class files in the specific webapps web-inf directory as well as changing the fork parameter to true
hi,
previously i also have this error(cannot be resolved to a type error). But after i did the thing that u mention the new error message comes to me.
I already
1. put <%@ page import = "fooddler.FooddlerIndexer"...
2. put the FooddlerIndexer.class under mywebWEB-INF/classes/
3. modify the web.xml at conf/web.xml with <Context reloadable="true">
Below is the error msg that i get
javax.servlet.ServletException: FooddlerIndexer
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:103)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: FooddlerIndexer
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
--
Anyone can help me? thx if any
sorry i type the wrong name is context.xml not web.xml. So, anyone can help me?