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";
}

Similar Messages

  • 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. :)

  • Class name cannot be resolved to a type

    Dear All,
    I have one main class calling another class but I keep getting this error "
    SMSClient cannot be resolved to a type". Before this I tried on other pc it was ok. Below is part of the codes. What could have been wrong? Can it be a missing library but how to trace that?
    public class callSMSClient{   public static void main(String[] args)  {       
              SMSClient t1 = new SMSClient(0);       
              t1.sendMessage("+6065544223","testing one two");  }}public class callSMSClient
              public static void main(String[] args)
           SMSClient t1 = new SMSClient(0);
           t1.sendMessage("+6065544223","testing one two");
    public class SMSClient implements Runnable{  
    public final static int SYNCHRONOUS=0; 
    public final static int ASYNCHRONOUS=1; 
    private Thread myThread=null;  
    private int mode=-1; 
    private String recipient=null; 
    private String message=null;  
    public int status=-1; 
    public long messageNo=-1;   
    public SMSClient(int mode) {     
    this.mode=mode;   
    public int sendMessage (String recipient, String message)
          this.recipient=recipient;   
          this.message=message;  
          myThread = new Thread(this);   
          myThread.start();
          //    run();   
          return status;   
    public void run()
    Sender aSender = new Sender(recipient,message);    
    try{     
    //send message         
    aSender.send ();         
    // System.out.println("sending ... ");      
    //in SYNCHRONOUS mode wait for return : 0 for OK, -2 for timeout, -1 for other errors     
    if (mode==SYNCHRONOUS)
    while (aSender.status == -1)
    {            myThread.sleep (1000);         
    if (aSender.status == 0)
    messageNo=aSender.messageNo ;   
    catch (Exception e)
    {         e.printStackTrace();    
    this.status=aSender.status ;    
    aSender=null;   
    }public class SMSClient implements Runnable{
      public final static int SYNCHRONOUS=0;
      public final static int ASYNCHRONOUS=1;
      private Thread myThread=null;
      private int mode=-1;
      private String recipient=null;
      private String message=null;
      public int status=-1;
      public long messageNo=-1;
      public SMSClient(int mode) {
          this.mode=mode;
      public int sendMessage (String recipient, String message){
        this.recipient=recipient;
        this.message=message;
        //System.out.println("recipient: " + recipient + " message: " + message);
        myThread = new Thread(this);
        myThread.start();
    //    run();
        return status;
        public void run(){
        Sender aSender = new Sender(recipient,message);
        try{
          //send message
              aSender.send ();
             // System.out.println("sending ... ");
          //in SYNCHRONOUS mode wait for return : 0 for OK, -2 for timeout, -1 for other errors
          if (mode==SYNCHRONOUS) {
              while (aSender.status == -1){
                myThread.sleep (1000);
          if (aSender.status == 0)
             messageNo=aSender.messageNo ;
        }catch (Exception e){
            e.printStackTrace();
        this.status=aSender.status ;
        aSender=null;
    }

    Dear Ejp,
    I would like to first share a simple case here first. Below is the simplied codes. Here I dont need any import statement. I keep both this in the same directory. I am using this command to compile javac callSMSClient.java. Why even this simple case is not working?
    public class callSMSClient{
      public static void main(String[] args)
           SMSClient t1 = new SMSClient(1);
           t1.sendMessage("+6014466044","testing one two");
    public class SMSClient {
      private int mode=-1;
      private String recipient=null;
      private String message=null;
      public SMSClient(int mode) {
          this.mode=mode;
      public void sendMessage (String recipient, String message){
        this.recipient=recipient;
        this.message=message;
        System.out.println("recipient: " + recipient + " message: " + message);
    }

  • 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

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

  • Can't use classes in own package ... cannot be resolved into a type

    I am fairly new to java and I am having the following problem.
    i have a folder structure that goes as follows:
    cs/uwm/client/io
    and in this directory I have 3 files: ConsoleReader.java ConsoleWriter.java and ConsoleManager.java
    and at the top of all three I have the following:
    package cs.uwm.client.io;
    ConsoleReader and ConsoleWriter are compiling fine
    However in ConsoleManager I am using these classes ConsoleReader/Writer and It compile fine for me on a windows JDK in cywin, but when I try this on a Fedore6 system with an Eclipe Java Compiler v_686_R32x, 3.2.2 release I have the following error:
    ConsoleWriter cannot be resolved into a type
    when I try the following line: ConsoleReader reader = new ConsoleReader( System.in );
    I tried importing cs.uwm.client.io but that didnt' work. I couldn't find anything on the forums here if you are trying to use a class defined in your package inside your package the way I am.
    Any help would be great!

    So it compiles from a commandline invocation of Java, but not from within Eclipse?
    Sounds like you need to ask the question at an Eclipse site, since the problem is not a Java problem - and this forum is for Java language questions, not IDE support questions.
    Probably caused by the fact that Eclipse doesn't use Sun's Java compiler.

  • Java proxy problem:com.sap.aii.proxy.xiruntime cannot be resolved to a type

    hi:
        i am new to Java proxy and new to SAP netweaver developer studio.
        thei PI version is 7.1
        I have generate a java proxy , then create a project in netweaver developer studio and import this java proxy according document "How Tou2026Work with XI 3.0 Java Proxies".
        but i can not find :aii_proxy_xirt.jar  aii_msg_runtime.jar on the PI server, only guidgenerator.jaraii_utilxi_misc.jar could be found. then i could not config the build path.
        in the  SAP netweaver developer studio, the error shows like :com.sap.aii.proxy.xiruntime cannot be resolved to a type
       then how to resolve this problem
       thank you very much

    Hi Cheng,
    I am trying to create a java proxy to send message from WebAS to PI using java proxy.
    I am using NWDS 7.1. Can you please help with step on how to create a java proxy in NWDS 7.1?
    Thanks and best regards,
    Arun prabhu S

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

  • What does "cannot be resolved to a type" mean?

    This error message is generated in Eclipse and I don't know what it means. I guess it might have multiple interpretations. Could you please comment this error message ?

    junit.framework.AssertionFailedError: Exception in constructor: testCreateCustomer (java.lang.Error: Unresolved compilation problems:
         CustomerMgtSvcImpl cannot be resolved to a type
         m_service cannot be resolved
         CustomerMgtSvcImpl cannot be resolved to a type
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         m_service cannot be resolved
         at com.tel.customermgt.CustomerMgtSvcImplTest.<init>(CustomerMgtSvcImplTest.java:74)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at junit.framework.TestSuite.createTest(TestSuite.java:131)
         at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
         at junit.framework.TestSuite.<init>(TestSuite.java:75)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.getTest(RemoteTestRunner.java:399)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
         at junit.framework.Assert.fail(Assert.java:47)
         at junit.framework.TestSuite$1.runTest(TestSuite.java:263)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

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

  • TransformerFactory.newInstance cannot be resolved to a type"

    Hi Techies,
    i am writing simple application for creation of XML using java,
    but while compiling i am getting the following error
    "Exception in thread "main" java.lang.Error: Unresolved compilation problem:
         TransformerFactory.newInstance cannot be resolved to a type"
    can any one help me to solve this error..
    thanks in advance

    hey here the code goes
    package src;
    import java.io.*;
    import javax.xml.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    public class XMLCreator {
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try{
                   BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
                   System.out.println("Enter the number of elements");
                   String str = bf.readLine();
                   int no = Integer.parseInt(str);
                   System.out.println("Enter root: ");
                   String root = bf.readLine();
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   Document doc = db.newDocument();
                   Element rootElement = doc.createElement(root);
                   doc.appendChild(rootElement);
                   for(int i=1;i<=no;i++){
                        System.out.println("Enter the data");
                        String element = bf.readLine();
                        System.out.println("Enter data");
                        String data = bf.readLine();
                        Element em = doc.createElement(element);
                        em.appendChild(doc.createTextNode(data));
                        rootElement.appendChild(em);
                        TransformerFactory tf = new TransformerFactory.newInstance();
                        Transformer tr = tf.newTransformer();
                        DOMSource domsrc = new DOMSource(doc);
                        StreamResult res = new StreamResult(System.out);
                        tr.transform(domsrc, res);
              }catch (Exception e) {
                   // TODO: handle exception
    }

  • Override cannot be resolved to a type

    Hello there,
    I have installed 32-bit and 64-bit versions of the JDK
    But my path is pointing at the 32-bit version.
    Moreover in the eclipse IDE, I have set the JRE environment variable pointing at the 32-bit jre6.
    I have also tried jre7 to no avail. Basically I am using the Eclipse IDE for a java card project.
    I am using EclipseJCDE, I have installed the plugin correctly. Anything I might have overlooked
    Let me know. Thanks Happy new year
    bye
    Jack

    package timeAttend;
    import javacard.framework.APDU;
    import javacard.framework.Applet;
    import javacard.framework.ISOException;
    public class TimeAttendApplet extends Applet {
         private TimeAttendApplet() {
         public static void install(byte bArray[], short bOffset, byte bLength)
                   throws ISOException {
              new TimeAttendApplet().register();
         @Override
         public void process(APDU arg0) throws ISOException {
              // TODO Auto-generated method stub
    }Override cannot be resolved to a type
    Nothing more, nothing less.
    Edited by: 933351 on 2012/12/27 下午 11:53

  • RAWSTRING issue in NWDS 7.3  - B cannot be resolved to a type

    Dear Experts,
    I'm facing an issue while importing a structure in RFC which has RAWSTRING in NWDS 7.3 SP09. This worked well in NWDS 7.0 but having issues in NWDS 7.3
    In the inbuilt Java files I'm having error in the method ( B cannot be resolved to a type )
      public [B getBinary1() {
        return ([B)super.getAttributeValue("Binary1");
    Appreciate your suggestions if you faced similar issues.
    Thanks

    hi mohamed ,
    as already specified  in the thread  ,http://scn.sap.com/thread/3286933  you can use the deprecated rfc , as even we were not able to solve that issue even though we deleted and reimported several times , you can use deprecated rfc . we tried changing the type of the attribute from xtring to other compatible types at abap side but it didnt work , so we used deprecated rfc.
    Regards
    Govardan

  • 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

Maybe you are looking for

  • Why can't the Thunderbolt port on the rear of the display support a Mini DisplayPort monitor?

    I bear no ill will as I knew the situation going in and am happy with my beautiful Thunderbolt display, but I simply cannot understand this lack of a blatantly obvious feature. Why I must unplug my Thunderbolt display from my MacBook Pro (and lose my

  • Time Machine backs up to one profile, and reads from another

    I have been running backups with Time Machine, for about 2 months now. Until now, I've never really looked closely at what comes up when I run TM. Today I've found that when the app is run, I can only jump back to states from the first two days that

  • Constrain window to image in tab view, how?

    I have photoshop workspace set up with the open documents across the top in tabs. Usually one of those tabs is the "Host" document and the other tabs are "Element" documents. In the process of creating, Element documents are usually resized to fit in

  • What is best to use

    I have a concern: if I need to evaluate in my where condition, what is best, use IN operator or use EXISTS operator. If in both cases I need to evaluate columna A versus select results.... Thank you

  • Help me in MS-Access-Java-MS-Excel combination

    i have to read a spreadsheet using Java & store in Access. my code is unable to do that,so modify the given java code for the above requirements. Don't import the spreadsheet directly from Excel to Access. // The Java Code. import java.sql.*; import