Jsp:useBean gives cannot be resolved to a type in Tomcat

Hi, I am using Tomcat 5.5
I have a simple JavaBean for test purposes :
import java.io.Serializable;
    public class testBean implements Serializable {
        int number;
        public testBean() {
        public int getNumber() {
            return number;
        public void setNumber(int newValue) {
            number = newValue;
    }In a file called testBean.java
I have successfuly compiled it and put the class file the WEB-INF/classes directory.
I have the following JSP page :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<jsp:useBean id="pub" scope="session" class="testBean" />
<jsp:setProperty name="pub" property="number" value="1" />
<html>
<head>
</head>
<body>
<jsp:getProperty name="pub" property="number" />
</body>
</html>When I open this jsp page I get the following error:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 2 in the jsp file: /test.jsp
Generated servlet error:
testBean cannot be resolved to a typeThis example is pretty minimal and I don't understand why it doesn't work. The error seems to be coming from the first JSP statement.
Any help would be greatly appreciated.
Thanks in advance.

1. Put your bean class in a package.
package test;
import...........2. Put the .class file in web-inf/classes/test/testBean.class
3. Specify the fully qualified name of the class in the useBean declaration.
<jsp:useBean class="test.testBean" .../>Note: You'd be better off following the java bean naming conventions. Specifically your class name should be TestBean (first letter caps).
ram.

Similar Messages

  • JSP impot class cannot be resolved to a type

    This has got to be an easy problem but we cannot seem to figure it out.
    I am using Tomcat 6.0.18 and JRE 1.5.09
    This is my class:
    package hello;
    public class hello{
    public void run(){
         System.out.println("Hello World");
    }}This is my JSP:
    <%@ page language="java" import="java.util.* , java.io.* , java.text.*" errorPage="error.jsp"%>
    <%@ page import="hello.*" %>
    <%
    hello h = new hello();
    h.run();
    %>and this is the error:
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 7 in the jsp file: /test.jsp
    hello cannot be resolved to a type
    4:
    5: <%
    6:
    7: hello h = new hello();
    8: h.run();
    9:
    10: %>
    I have the "hello.class" in
    C:\Tomcat6\webapps\ROOT\WEB-INF\classes\hello
    C:\Tomcat6\webapps\ROOT\WEB-INF\classes
    C:\Tomcat6\webapps\ROOT\WEB-INF
    C:\Tomcat6\webapps\manager\WEB-INF\classes\hello
    C:\Tomcat6\webapps\manager\WEB-INF\classes
    C:\Tomcat6\webapps\manager\WEB-INF
    C:\Tomcat6\webapps\host-manager\WEB-INF\classes\hello
    C:\Tomcat6\webapps\host-manager\WEB-INF\classes
    C:\Tomcat6\webapps\host-manager\WEB-INF
    Can someone pelase offer a suggestion and please tell me where the CLASS file should actually reside? Please?

    hii..
    Try this code.I hope u wil get the output.
    test.jsp
    <%@ page language="java" import="java.util.* , java.io.* , java.text.*" errorPage="error.jsp"%>
    <%@ page import="hello.*" %>
    <html>
    <head></head>
    <body><%
    hello h = new hello();
    out.println( h.run());%>
    </body>
    </html>
    hello.java
    package hello;
    public class hello{
    public String run(){
         String a="Hello World";
    return a;
    }}

  • Include JSP in JSP - Error:  cannot be resolved to a type

    Hello,
    Several of my jsp pages include other jsp pages. The project has many errors: "x cannot be resolved to a type". Is there a way to resolve these errors? Below is a small example of the issue:
    JSP #1:
    <%@ page import="com.testing.Introduction" %>
    <html>
    <head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Hello</title>
    </head>
    <body>
    <%
         Introduction intro = new Introduction();
         String speak = intro.sayHello();
    %>
    <p><%=speak %></p>
    <%@ include file="Name.jsp" %>
    </body>
    </html>  JSP #2:
    <html>
    <head>
    <title>Name</title>
    </head>
    <body>
    <%
         String speak2 = intro.sayName();
    %>
    <p>
    <%=speak2 %>
    </p>
    </body>
    </html>Class:
    package com.testing;
    public class Introduction
         public static void main(String[] args) {
         public Introduction() {
              super();
         public String sayHello() {
              return "Hello";          
         public String sayName()     {
              return "My name is Sam";
    }The error shows up in Name.jsp; the issue is with "intro". Any ideas how to resolve this issue?
    Thank you in advance for your help!

    The jsp page Name.jsp appears to be missing the import statement that appears in the first page.
    <%@ page import="com.testing.Introduction" %>The included file is included character for character into the main page which is then treated as a single jsp page for the response. The include directive is invoked at the time of page translation. Given this, I don't see the purpose of using the <html> <head> and <title> tags in the second and included page. I don't think that this suggests the proper purpose of the include directive.
    Note too that if the included file changes, all of the jsp files that call this file need to be updated as well. Servers can handle the alteration of the main jsp, but may not serve the altered content if the included file changes.
    For more information see here. http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro8.html

  • HttpServletRequest cannot be resolved to a type in JSP - eclipse

    Hi,
    i've created a webapp in eclipse ver 3.2.
    my jsp looks like this:
    <%!
    private boolean checkLoginRule(HttpServletRequest request, HttpServletResponse response, Integer nLevel) {
    // if user was already authenticated pass him on
    if (request.getSession(true).getAttribute("userID") == null)
    response.sendRedirect("index.jsp");
    else {
    Integer nUserLevel =(Integer)request.getSession(true).getAttribute("userRole");
    if (nUserLevel.intValue() < nLevel.intValue())
    return false;
    return true;
    %>
    i'm getting an error:
    HttpServletRequest cannot be resolved to a type
    What to do?

    import the following package...
    import javax.servlet.http.HttpServletRequest

  • JspWriter cannot be resolved to a type

    The following is CheckAddress.jsp page which checks if the form has the name and phone fields filled in or not. If not then it must print the errors. But the problem I am having is that the Eclipse is showing me the error "JspWriter cannot be resolved to a type".
    If I ignore this error and run the page in the j2ee preview server in eclipse than I get the following error:
    >
    Unable to compile class for JSP
    An error occurred at line: 22 in the jsp file: /CheckAddress.jsp
    Generated servlet error:
    The method prinln(String) is undefined for the type JspWriter
    An error occurred at line: 22 in the jsp file: /CheckAddress.jsp
    Generated servlet error:
    The method prinln(String) is undefined for the type JspWriter
    An error occurred at line: 22 in the jsp file: /CheckAddress.jsp
    Generated servlet error:
    The method prinln(String) is undefined for the type JspWriter
    Caused by:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    >
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <%--Provide Directives to inform JSP of packages needed--%>
    <%@page language="java" import="java.util.*"%>
    <%@page language="java" import="java.io.*"%>
    <%--Specify JSTL tag library for use --%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <meta http-equiv="Content-Type" content="text/html; charaset=ISO-8859-1">
    <title>Check Address</title>
    </head>
    <body>
    <%--Declare the java bean for the addresslist to be queried --%>
         <jsp:useBean id="dbab" class="addressBean.DBAddressBean" />
    <%--Use JSP scripting elements to define two methods --%>
    <%!
         List<String> checkAddress(String Name, String Phone){
          List<String> errors = new ArrayList<String>();
          if((Name == null) || (Name.equals(""))){
               errors.add("Name must not be blank");
          if((Phone == null)||(Phone.equals(""))){
               errors.add("Phone must not be blank");
          return errors;
         void printErrors(JspWriter out, List<String> errors) throws IOException{
              //Report the errors
              out.prinln("<p class=\"error1\">The following errors occured: <br />");
              out.prinln("<ul>");
              Iterator<String> i = errors.iterator();
              while(i.hasNext()){
                   out.println("<li type=\"disc\">"+i.next()+"</li>");
              out.prinln("</ul></p><p><b>please try again</b></p><br />");
    %>     
    <%--Use the internal Scriptlet to call an internal method and get the request parameters with the form info--%>
    <%
         List<String> errors = checkAddress(request.getParameter("Name"), request.getParameter("Phone"));
    %>
    <%--Use JSTL tags to get the values of the parameters for all of the form info --%>
         <c:set var="aid" value="${param.aid}"/>
         <c:set var="Name" value="${param.Name}"/>
         <c:set var="Street" value="${param.Street}"/>
         <c:set var="City" value="${param.City}"/>
         <c:set var="State" value="${param.State}"/>
         <c:set var="Zip" value="${param.Zip}"/>
         <c:set var="Phone" value="${param.Phone}"/>
    <%--Use JSP elements to set the values in the Java Beans--%>
         <jsp:setProperty name="dbab" property="id" value="${aid}"/>
         <jsp:setProperty name="dbab" property="name" value="${Name}"/>
         <jsp:setProperty name="dbab" property="street" value="${Street}"/>
         <jsp:setProperty name="dbab" property="city" value="${City}"/>
         <jsp:setProperty name="dbab" property="state" value="${State}"/>
         <jsp:setProperty name="dbab" property="zip" value="${Zip}"/>
         <jsp:setProperty name="dbab" property="phone" value="${Phone}"/>
    <%--Use the scriptlet to determine where to go now --%>
    <%--Notice how the JSP element tag is used within the scriptlet, the scriptlet needs to be "closed" and "reopened"--%>
    <%
         if(errors.size()==0){
              dbab.saveChanges();
              response.sendRedirect("AddressList.jsp");
         }else{
              //print errors
              printErrors(out, errors);
    %>          
         <jsp:include page="EditAddress.jsp"/>
    <%
    %>     
    </body>
    Edited by: blinkaj on Apr 18, 2010 2:15 AM

    Thanks elOpalo, even though eclipse is still showing the error, things are running fine after I rectified my typing mistake about the prinln. :)

  • Some class that cannot be resolved to a type

    Hello, I?m trying to use the[b] itext API for PDF creating from Java.
    In order to do this you must include the package .jar in your classpath and import com.logawie.text.* in your java file. All this steps are obviusly, and work correctly, in JAVA, but i?m trying to develope a web application, using JSP.
    Usually when I try to import a package from a JAR file that are allocated in the C:\j2sdk1.4.2_12\lib directory it doesn?t work. I solved this problem with some classes including it directly to the src.zip file. But with the itext package it doesn?t work, I don?t know if my solution is too bad, but with another classes it works, but with the itext package it says that all classes references "cannot be resolved to a type".
    Anyone can help me? Thanks in advance.

    when i try to depooy it then error comes
    user cannot be resolved to a type
    can any body help me
    and tell me about classpath
    //UserData.java
    package user;
    public class UserData {
    String username;
    String email;
    int age;
    public void setUsername( String value )
    username = value;
    public void setEmail( String value )
    email = value;
    public void setAge( int value )
    age = value;
    public String getUsername() { return username; }
    public String getEmail() { return email; }
    public int getAge() { return age; }
    //GetName.jsp
    <HTML>
    <BODY>
    <FORM METHOD=POST ACTION="SaveName.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
    What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
    What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
    <P><INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>
    //NextPage.jsp
    <jsp:useBean id="user" class="user.UserData" scope="session"/>
    <HTML>
    <BODY>
    You entered<BR>
    Name: <%= user.getUsername() %><BR>
    Email: <%= user.getEmail() %><BR>
    Age: <%= user.getAge() %><BR>
    </BODY>
    </HTML>
    //SaveName.jsp
    <jsp:useBean id="user" class="user.UserData" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
     Continue<font face="Arial"> </font>
    </BODY>
    </HTML>

  • My class cannot be resolved to a type

    I just installed jstl and I am trying to get it work using this test code. The class Customer is in WEB-INF/classes, an ArrayList of Customer objects is stored in the session in the attribute "results". Any ideas why this is failing?
    <base href="<%= request.getScheme() +"://" + request.getServerName() + (request.getServerPort() != 80 ? ":" + request.getServerPort() : "") + request.getRequestURI() %> "/>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ page import="java.util.Collection,
                     java.util.ArrayList"%>
    <%@ taglib prefix="h" tagdir="/WEB-INF/tags" %>
    <jsp:useBean id="customer" class="Customer" />
    <jsp:useBean id="results" scope="session" class="java.util.ArrayList" />
    <table>
    <c:forEach items="${customer.results}" var="item">
    <tr>
         <td><c:out value="${item.id}"/></td>
         <td><c:out value="${item.name}"/></td>
    </tr>
    </c:forEach>
    </table>Here is the error I'm getting:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 8 in the jsp file: /listCustomers.jsp
    Generated servlet error:
    Customer cannot be resolved to a type
    An error occurred at line: 8 in the jsp file: /listCustomers.jsp
    Generated servlet error:
    Customer cannot be resolved to a type
    An error occurred at line: 8 in the jsp file: /listCustomers.jsp
    Generated servlet error:
    Customer cannot be resolved to a type
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         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)
         Search.doPost(Search.java:95)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 8 in the jsp file: /listCustomers.jsp
    Generated servlet error:
    Customer cannot be resolved to a type
    An error occurred at line: 8 in the jsp file: /listCustomers.jsp
    Generated servlet error:
    Customer cannot be resolved to a type
    An error occurred at line: 8 in the jsp file: /listCustomers.jsp
    Generated servlet error:
    Customer 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:413)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
         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)
         Search.doPost(Search.java:95)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         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.16 logs.

    I added this line to my class:
    package storePackage;and put the compiled class in: WEB-INF/classes/storePackage/
    Then I changed my jsp to:
    <base href="<%= request.getScheme() +"://" + request.getServerName() + (request.getServerPort() != 80 ? ":" + request.getServerPort() : "") + request.getRequestURI() %> "/>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ page import="java.util.Collection,
                     java.util.ArrayList"%>
    <%@ taglib prefix="h" tagdir="/WEB-INF/tags" %>
    <c:set var="customer" value="<%= new Customer() %>"/>
    <jsp:useBean id="customer" class="com.storePackage.Customer" />
    <jsp:useBean id="results" scope="session" class="java.util.ArrayList" />
    <table>
    <c:forEach items="${customer.results}" var="item">
    <tr>
         <td><c :o ut value="${item.id}"/></td>
         <td><c :o ut value="${item.name}"/></td>
    </tr>
    </c:forEach>
    </table>Now I'm getting this:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /listCustomers.jsp(9,0) The value for the useBean class attribute com.CustomerPackage.Customer is invalid.
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         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)
         Search.doPost(Search.java:95)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: /listCustomers.jsp(9,0) The value for the useBean class attribute com.CustomerPackage.Customer is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1174)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3304)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
         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)
         Search.doPost(Search.java:95)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         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.16 logs.

  • Cannot be resolved to a type

    Hello everybody,
    An error occurred while executing these codes
    <%@page import="examples.simple.ActiveClass" %>
    try
    String userId=request.getParameter("userID");
    String activateCode=request.getParameter("activationCode");
    ActiveClass object=new ActiveClass();
    String status=object.Activate(userId);
    if(status.equals("success"))
    ok
    catch(Exception e)
    The error displayed was:
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 25 in the jsp file: /simple/activeAccount.jsp
    ActiveClass cannot be resolved to a type
    22: String userId=request.getParameter("userID");
    23: String activateCode=request.getParameter("activationCode");
    24:
    25: ActiveClass object=new ActiveClass();
    26: String status=object.Activate(userId);
    27:
    28: if(status.equals("success"))
    Can anyone help me out please?

    * ActiveClass.java
    * Created on August 31, 2007, 3:04 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package examples.simple;
    import javax.sql.DataSource;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import examples.sql.connect;
    * @author Administrator
    public class ActiveClass {
    int userId;
    Connection con=null;
    /** Creates a new instance of ActiveClass */
    public ActiveClass() {
    public String Activate(String userId)
    this.userId=Integer.parseInt(userId);
    try
    connect conn=new connect();
    con=conn.createConnection();
    Statement stmt=con.createStatement();
    String sql="UPDATE registered_user SET user_privileges='Y' WHERE user_id = "+this.userId;
    if(stmt.executeUpdate(sql)==1)
    return "success";
    else
    return "failure";
    catch (SQLException ex)
    ex.printStackTrace();
    return "failure";
    }

  • I am getting this error - JspFormsSession cannot be resolved to a type

    Hi
    I am getting following error when I try to open a jsp file.
    Any solution?
    JSP line details are -
    JspFormsSession openrules_session = (JspFormsSession) session.getAttribute(s_attr);
    Error is -
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
    An error occurred at line: 4 in the jsp file: /index.jsp
    Generated servlet error:
    JspFormsSession cannot be resolved to a type
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         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)

    Now I am confident that the problem is with library including, as the same thing happens with other libraries.
    I found that such a warning appears every time:
    Classpath entry /jspbook/src/lib/mail.jar will not be exported or published. Runtime ClassNotFoundExceptions may result.Unfortunately, I've no idea how to include this in a proper way. I think that setting it in "Add External JARs" in "Java Build Path" is enough... or not?
    Seems we're close to solve the problem. May be this screen shot will be helpful to determine the problem?
    http://img257.imageshack.us/img257/3967/screenshotjavaeejspbook.png
    You can see that libraries are included in the Project Explorer

  • 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?

    I am getting the same error but while creating a Web Service.
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         _serviceClient cannot be resolved
         org.apache cannot be resolved to a type
         _service cannot be resolved
         _serviceClient cannot be resolved
         _serviceClient cannot be resolved
         org.apache cannot be resolved to a type
         _serviceClient cannot be resolved
         _serviceClient cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         The constructor TemperatureConverterStub(null, String) is undefined
         org.apache cannot be resolved to a type
         _serviceClient cannot be resolved
         _operations cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         _serviceClient cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         org.apache cannot be resolved to a type
         at ws.example.TemperatureConverterStub.<init>(TemperatureConverterStub.java:17)
         at ws.example.TemperatureConverterServiceClient.main(TemperatureConverterServiceClient.java:8)If you want I can post the files too.

  • Re: OracleDriver cannot be resolved to a type

    I still have the same problem which was reported in the first post.
    I tried all the changes mentioned above but doesn't help as I am totally new to jsp please suggest me a way out in detail.
    An error occurred at line: 6 in the jsp file: /one.jsp
    oracle.jdbc.driver.OracleDriver cannot be resolved to a type
      <%
      try{  
      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
      Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@10.145.2.142:1521:MESNEW","MESAPUSER", "mesdev");
      String query1="Select OWNER,TABLE_NAME FROM ALL_TAB_PRIVS_MADE ";
    Stacktrace:
      org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
      org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
      org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    Thanking you in advance.

    1) you don't want to do that in a JSP
    2) did you actually add the correct jars to the classpath of your web application? Because if you did, you'd not get this error.
    That means adding it to the proper location in your WAR file, as you should have learned when you studied tutorials and books about web application development.

  • Eclipse "cannot be resolved to a type" and new .JAR lib - config prob?

    I'm trying to make use of the Commons HttpClient library in a project being built in Eclipse (3.1). I have a sample program (PostXML) that runs into "cannot be resolved to a type" on the "HttpClient" object. I think the problem is that the JRE 1.4.2 (Mac OS-X) system library includes an earlier release (3.0.1) of the HttpClient, but some of the classes used by PostXML are in the 3.1rc of HttpClient. I've downloaded the newer release, created a user library, and modified the load order so I can see the user library above (i.e. loaded prior to?) the System JRE in the package browser. I can see the HttpClient.class in the Package browser. I have "import org.apache.commons.httpclient.methods.*;" in the head of the application (that took tweaking). Several of the HttpClient methods resolve correctly, but not the HttpClient object constructor itself. I am also finding I cannot simply import all the HttpClient methods, but must import each explicitly (?). Suggestions?

    I have gotten the sample code to compile and run,
    though I still have some confusion about needing the
    explicit imports (as compared to a wildcard import).
    In the end I believe my "cannot be resolved to a
    type" error was due to dependencies within the
    HttpClient library on the commons-codec library. Once
    I downloaded and installed that, the samples started
    working better. Still trying to understand the API,
    but making progress.when downloading third-party libraries, check the download page to see if it has any further dependencies. apache libraries are notoriously dependent on other apache libraries
    regarding the imports, it's not that there's a need for explicit imports, it's more that wildcard imports are a bad idea. explicit imports gives other people looking at your code a first clue as to what it does, and it also can serve as an indicator that your class is too big, if there are lots of imports. wildcards hide this from you. apart from that, it makes no difference to your code, and imports don't even exist at runtime so it affects how your code actually runs, not at all

  • HashTable cannot be resolved to a Type

    Hey Guys,
    I want to use a HashTable to assign Integer object values to the to String keys defined by the getActionCommand() methods of an array of JButtons. Now I tried to construct a HashTable like this:
    private HashTable<String, Integer> commandParser = new HashTable<String, Integer>();Eclipse gives me the error "HashTable cannot be resolved to a Type" .
    I thought I had done it all as was stated in the APIs. What?s wrong here?
    Sum1 hlp pls i cant figger ths oot ;-)
    EDIT: While I?m here, I get a warning:
    The serializable class BuildPane does not declare a static final serialVersionUID field of type long
    for every one of my classes.
    What is that about? I ignored it because it?s just a warning, but always safe, never sorry.
    Edited by: AikmanAgain on Mar 29, 2008 5:29 AM

    AikmanAgain wrote:
    Hey Guys,
    I want to use a HashTable to assign Integer object values to the to String keys defined by the getActionCommand() methods of an array of JButtons. Now I tried to construct a HashTable like this:
    private HashTable<String, Integer> commandParser = new HashTable<String, Integer>();Eclipse gives me the error "HashTable cannot be resolved to a Type" .
    I thought I had done it all as was stated in the APIs. What?s wrong here?There is no class called HashTable in the JRE. Look again ... and remember Java is case sensitive.
    The serializable class BuildPane does not declare a static final serialVersionUID field of type long
    for every one of my classes.
    What is that about? I ignored it because it?s just a warning, but always safe, never sorry.The serialVersionUID is a field that's used in serialization (as the name and the warning should have suggested).
    Google for any serialization tutorial and you'll learn what it's good for.

  • Class cannot be resolved to a type

    Hello, I�m trying to use the[b] itext API for PDF creating from Java.
    In order to do this you must include the package .jar in your classpath and import com.logawie.text.* in your java file. All this steps are obviusly, and work correctly, in JAVA, but i�m trying to develope a web application, using JSP.
    Usually when I try to import a package from a JAR file that are allocated in the C:\j2sdk1.4.2_12\lib directory it doesn�t work. I solved this problem with some classes including it directly to the src.zip file. But with the itext package it doesn�t work, I don�t know if my solution is too bad, but with another classes it works, but with the itext package it says that all classes references "cannot be resolved to a type".
    Anyone can help me? Thanks in advance.

    I found the answer:
    You must allocate .jar in tomcat\common\lib directory and restart apache tomcat.
    I hope it would be usefull to anybody.

  • SQLServerDriver cannot be resolved to a type

    How do i solve this. I have imported java.sql.* and javax.sql.* using page directive. Still it is not able to resolve the driver. The same code works in a normal java file but not in jsp page
    An error occurred at line: 12 in the jsp file: /jsp/AMSX_Page.jsp
    com.microsoft.jdbc.sqlserver.SQLServerDriver cannot be resolved to a type
    9: <H1>Asset Management System (AMSX) </H1>
    10:
    11: <%              
    12:      DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    14:          Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://10.187.33.159:49408","username","password");
    15:      if (connection != null)Message was edited by:
    BrijeshShah

    Yes i did put the driver files in the WEB-INF directory but still i have the same error.
    Do you have any other suggestion?
    Brijesh Shah

Maybe you are looking for

  • ECC 6.0 Questions on New Business Partner Standard Address Functionality.

    Hello. We are upgrading our client from 4.72 to ECC6.0 and in the UAT testing phase. Where before in 4.72 the Standard Mailing address was determined by a simple radio button, it appears that they have gone to a time dependent type of format which is

  • Using Jumpeye Component in Flex

    Hi, has anyone successfully used Jumpeye's Drop Down Tree Menu Component V3 in Flex 3? It's a great component to use in flash, the submenus open and close on rollover/rollout (something I have not been able to acheive with the Flex menubar). I used t

  • Magnet & Mailto links won't open in safari

    Hello all, I just bought myself a MacBook Pro 15" retina but I am having a problem in Safari. When I try to open a magnet or a mailto link, it links me to safari's top sites instead of to the link. Other hyperlinks seem to work just fine.. Looking fo

  • How Hard is it to program in Java.Swing

    Hi I wanted to program using java.swing component but i don't have any idea where i should start. I have been programming in java using java.Awt and i can do simple array programing. So how hard is it, and Where should i start learning java.swing. Ps

  • How can I increase the number of times my 4s rings before it goes 2 msg bank?

    My iphone 4s only rings 3 times before it goes to msg bank. How Can I increase the number of times it rings?