ClassName cannot be resolved. Indirectly referenced. Eclipse IDE.

Hi, I am trying to import a selection of classes within Eclipse and am having trouble. I seem to be able to link the classes so they are recognised by Eclipse but when I preform any operations on instances of the class I get the error as per my title.
Outside of eclipse the classes work fine if I put the folder in with the source files and just import org.smslib.*. Any help is much appreciated, here is a picture of the problem which may highlight something I have missed.
http://img512.imageshack.us/my.php?image=eclipseerrorqn3.jpg

Hey, thank you very much for the response. Sorry I have not gotten back to you sooner but the main forum page was showing 10 views and no replies for some reason.
I followed your instructions but they didn't quite work. Taking it back to the org folder allowed me to import smslib.* and it would recognise the classes but they were stilling looking for the functions etc in org.smslib so I went back another folder still and put the org folder inside a classes folder which solved the issue as I can now import org.smslib.*
Thanks for the hint, you allowed me to figure out the problem (or at least a solution!).
Here is a new screenshot to show you the new structure.
http://img89.imageshack.us/my.php?image=eclipsefixaj6.jpg

Similar Messages

  • Javax.servlet.ServletContext cannot be resolved in Eclipse

    I am loading my project in Eclipse, I am getting this error :
    The type[b] javax.servlet.ServletContext cannot be resolved. It is indirectly referenced from required .class files
    I have set all the libraries, how can make eclipse avaliable with this class

    Which libraries have you set?
    javax.servlet.ServletContext would be in the J2EE servlet API.
    In tomcat this is [TOMCAT]/common/lib/servlet-api.jar
    In other containers it might be j2ee.jar

  • Eclipse and Apache I18N Taglib - how to fix "bundle cannot be resolved" msg

    I edit my jsp pages in Eclipse 3.1.2
    And I use Apache I18N Taglib.
    Everythink works fine, but I get annoying messages in problem list that "bundle cannot be resolved"
    a piece jsp code
    <%@ taglib uri="http://jakarta.apache.org/taglibs/i18n-1.0" prefix="i18n"%>
    <i18n:bundle baseName="my.test" id="bundle"/>
    <%     
    if (isFoo) {
         buttonValue = bundle.getString("AddButtonText");
    } else {
         buttonValue = bundle.getString("UpdateButtonText");
    %>This code works fine, but Eclipse think that code has errors.
    also I want do demonstate taglib config in web.xml
         <jsp-config>
              <taglib>
                   <taglib-uri>http://jakarta.apache.org/taglibs/i18n-1.0</taglib-uri>
                   <taglib-location>/WEB-INF/i18n.tld</taglib-location>
              </taglib>
         </jsp-config>

    Well, putting all that Java code into a JSP was a bad idea in the first place, just on general design principles. But you've done it in such a way that the result of compiling the JSP is malformed Java code. Frankly I would just throw it away and put the Java code into a servlet or some other Java class, where it belongs.
    But if you're really working in a place where nobody has learned anything since 2003, and you're forced to support that old junk, then I would point out that the error occurs before the place which generates this line:
    import java.util.*;You only need to look at two of the thousand lines of code you posted.

  • 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

  • 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

  • BO XI 3.1 SDK and Eclipse: import cannot be resolved

    I am preparing my Eclipse 3.4.1 installation to develop using the BO XI 3.1 SDK; I got some samples from the SAP Developer network, however, Eclipse always shows import errors like "The import com.crystaldecisions cannot be resolved"
    I added the paths "C:\Program Files\Business Objects\common\4.0\java\lib" and "C:\Program Files\Business Objects\common\4.0\java\lib\external" to my project (rigt click -> Properties -> Java Build Path -> Libraries -> "Add external class folder" button) but I am still getting these errors.
    I also tried Netbeans 6.5 but it shows similar errors: "package com.crystaldecisions.sdk does not exist".
    It's a BO XI 3.1 server installation.
    What am I doing wrong?
    Thanks!

    Hi Stefan,
    Instead of adding the "Add external class folder" try out to add to your Java Build Libraries "Add External JARs"
    When you click on this button you can select the path of all the jar files from your Business Objects installation directory.
    E.g. C:\Program Files\Business Objects\common\4.0\java\lib"
    and "C:\Program Files\Business Objects\common\4.0\java\lib\external"
    Regards,
    Anu

  • JspIdConsumer cannot be resolved

    I want to write a custom component. So I need to expand UIComponentELTag. It looks like this
    package jsf;
    import javax.faces.webapp.*;
    import javax.faces.component.*;
    import javax.faces.context.*;
    import javax.faces.application.*;
    import javax.el.*;
    import javax.faces.webapp.*;
    public class CreditCardTag extends javax.faces.webapp.UIComponentELTag {
         String size, value;
         public String getComponentType() {
              return new String("CREDIT_CARD_INPUT");
         public String getRendererType() {
              return new String("CREDIT_CARD_RENDERER");
    //...and so on...But my eclipse underlines the classname "CreditCardTag" red. And next to the first line "package jsf;" appears a little bulb with a red rect in the lower right corner with a white cross on it telling me:
    "The type javax.servlet.jsp.tagext.jspidconsumer cannot be resolved. It is indirectly referenced from a required .class name"
    Acutally I don't understand what I need to add to my web project.

    Okay I downloaded the jsp 2.1 implementation and included the jar in eclipse. But it seems as if I have to switch to tomcat 6, because it seems as if the "TOMCAT_HOME/common/lib/jsp-api.jar" does not contain the most recent jsp specification. So I expect I've to migrate from tomcat 5.5 to 6

  • Import cannot be resolved

    Hi All,
        Our NWDS always shows that certain import which generated by meta data cannot be found or resolved.
    For instance "import com.xx.sc_os_sale.dc_ws_styleinfo.comp.wdp.IPrivateStyleInfoComp;"
    I can find the code file in my local path
    "D:\Documents\01 WORK\03 Programming\cobest\dtc\0\DCs\xx.com\DC_WS_StyleInfo\_comp\gen_wdp\packages\com\xx\sc_os_sale\dc_ws_styleinfo\comp\wdp"
    And the "D:\Documents\01 WORK\03 Programming\xx\dtc\0\DCs\xx.com\DC_WS_StyleInfo\_comp\gen_wdp\packages\" has been add to the project as the Java Build Path automatically when the project was created,
    But the error is still there.
    If I build the project, no error would show in task and err log page. Also the CBS can build this project successfully. I'm totally mazed about it.
    Anyone can help me?
    Thanks,
    YiNing
    Edited by: YiNing Mao on Mar 11, 2008 11:55 AM

    Thanks, all. After close and reopen my project, the "cannot be resolved" problem is gone, but there's a new one.
    One of my web dynpro component has been expose as public of its DC, and another component from an other DC uses it as a used component, I keep being infomed of following error:
    1. The project was not built since its classpath is incomplete. Cannot find the class file for com.xx.sc_os_sale.dc_wsv_customer.model.Response_SC_OS_SALE_CustomerInfoViDocument_getCustomerList. Fix the classpath then try rebuilding this project.
    2. This compilation unit indirectly references the missing type com.xx.sc_os_sale.dc_wsv_customer.model.Response_SC_OS_SALE_CustomerInfoViDocument_getCustomerList (typically some required class file is referencing a type outside the classpath)
    I've tried to delete local project and reimport from DTR, but it doesn't help at all.
    Hope you can help me.
    YiNing
    Edited by: YiNing Mao on Mar 11, 2008 7:25 PM

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

  • 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

  • MyClass cannot be resolved to a type

    am looking to call a java class from within a servlet but am having this error on compilation: "MyClass" cannot be resolved to a type.
    my code look like follows showing the file path where am using eclipse :
    <eclipse>/workspace/MyApp/src/pal/MyClass.java
    package pal;
    public class MyClass
        public MyClass()
    }<eclipse>/workspace/MyApp/src/pal/MyServlet.java
    package pal;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class MyServlet extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException
              new MyClass();
    }what did i miss?

    Personally I dislike Netbeans, I found it to be ugly, non-intuitive and buggy. I already threw it away from my system after only 5 mins of testing. It's only good for ones who are really, really new to Java and by a coincidence got Netbeans in the JDK pack, and/or followed the Sun tutorials wherein Netbeans is pushed up, and/or still know nothing about the existence of other IDE's and what they all provides.

  • DefaultHander cannot be resolved to a type

    Hello -
    I am using Eclipse to write a java mapping program but even before compilation, Eclipse IDE shows DefaultHandler as cannot be resolved to a type.
    I have done the following imports:
    import com.sap.aii.mapping.api.StreamTransformation;
    import org.xml.sax.*;
    import java.io.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.SAXParserFactory;
    import java.util.Map;
    import javax.xml.parsers.SAXParser;
    I have added only aii_map_api.jar in the External JAR's in Eclipse.
    What other imports should be done to avoid this error?
    Thanks,
    Tirumal

    Tirumal ,
    If you are getting the same error as you have written in the thread subject,
    <b>DefaultHander</b> cannot be resolved to a type , then note that if it is reffering to an imported class <b>DefaultHander</b> which should be <b>DefaultHandler</b>

  • Runtime error - Session cannot be resolved to a type

    Hello! I try to get JavaMail working, but all in vain.
    The problem is I get such an error every time.
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 29 in the jsp file: /SendMail.jsp
    Session cannot be resolved to a type
    26:    prop.put("mail.smtp.host",hostMail);
    27:    prop.put("mail.smtp.user",fromEmail);
    28:    prop.put("mail.smtp.auth","true");
    29:    Session ses =  Session.getInstance(prop,null);
    30:    ses.setDebug(true);
    31:    MimeMessage msg = new MimeMessage(ses);
    32:    MimeBodyPart m1 = new MimeBodyPart();
    An error occurred at line: 29 in the jsp file: /SendMail.jsp
    Session cannot be resolved
    26:    prop.put("mail.smtp.host",hostMail);
    27:    prop.put("mail.smtp.user",fromEmail);
    28:    prop.put("mail.smtp.auth","true");
    29:    Session ses =  Session.getInstance(prop,null);
    30:    ses.setDebug(true);
    31:    MimeMessage msg = new MimeMessage(ses);
    32:    MimeBodyPart m1 = new MimeBodyPart();
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)I'm using Eclipse, so I've added external JARs there (activation.jar, mail.jar, mailapi.jar, pop3.jar, smtp.jar). In addition to this, the same libraries are in +/opt/jdk1.6.0_13/jre/lib/+.
    I've imported javax.mail.*, java.util.*, javax.mail.internet.* in my JSP file. I tried to do a lot of manipulations. Also I tried to use different code examples, but the error in the line "Session.getInstance(props, null)" remains the same.
       Properties prop = new Properties();
       prop.put("mail.smtp.host",hostMail);
       prop.put("mail.smtp.user",fromEmail);
       prop.put("mail.smtp.auth","true");
       Session ses =  Session.getInstance(prop,null);The same problem remains when I do this as a Servlet. Class compilation with javac occurs without errors.
    Might the problem be in version compatibility? I use: ArchLinux, Tomcat 5.5, JavaMail 1.4.2.
    Thanks in advance.
    Edited by: Pavel_Z on May 7, 2009 4:55 PM

    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

  • AppBuilder :Getting Error While importing the Project to Eclipse IDE ?

    Hi Experts,
    While importing the project from AppBuilder to Eclipse IDE following error i'm getting,
    Error : Cordova Activity Cannot be resolved to a type,
    Can someone help me to solve this.
    Thanks in advance,
    Vamsi K.

    Thanks ,I have been gone through <Projection Type='System.WorkItem.Incident.ProjectionType">.
    Now i am getting many errors while importing data.I have customized fields in servicedesk and i have created same fields in scsm incident form.When i am imported
    data i am getting below error.
    Please let me know how can i import customized feilds data to SCSM without issues.
    Regards, H@ri

  • Import org.apache.avalon cannot be resolved

    Hi, I am new to Eclipse and J2EE in general and I have tried to import a project in Eclipse 3.0.1. However, I am getting several compile errors having to do with the following imports:
    import org.apache.avalon.framework.activity.Initializable;
    import org.apache.avalon.framework.activity.Startable;
    import org.apache.avalon.framework.configuration.Configurable;
    import org.apache.avalon.framework.configuration.Configuration;
    import org.apache.avalon.framework.configuration.ConfigurationException;
    import org.apache.avalon.framework.logger.AbstractLogEnabled;
    import dragon.common.services.cache.janitor.ICacheJanitorService;
    import dragon.common.services.cache.store.IExpiringStoreComponent;
    import dragon.common.services.cache.store.IStoreComponent;
    stating that
    "The import..." [import package name] "...cannot be resolved"
    Can anyone help with what I should do? Thanx

    I am trying to compile code but keep getting an error stating that the import of a class is not working? I wondered if I am having the same problem. I am running eclipse 3.0. The applet is called joole and it is importing CBoolFkt but it is evidently not working. Appreciate any ideas.
    The applet is not initiating and the error messages is as follows:
    java.lang.Error: Unresolved compilation problems:
         The import CBoolFkt cannot be resolved
         The import ShowCopyright cannot be resolved
         at Joole.<init>(Joole.java:8)
         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 java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

Maybe you are looking for

  • New to the game and need some quick help

    I have been thrown our exisiting phone infrastructure and what do you know we are having some issues. We have a new series of DID's and when they are dialed from our directory they go anywhere? Not routing to the proper extension.  Translation patter

  • How can I insert a table in the header?

    The question is easy: How can I insert a table of one row in the header. Thanks in advance. Jesús.

  • I need to learn how to use all about java & mysql...help me!

    I have a situation here, I need to learn how to use java with mysql . Can I connect to a MYSQL DB with servlets? how can I build an e-mail server with java (no matter how difficult) please, I need help, and I really apreciate your help. thank you ver

  • YourKit Java Profiler 6.0.16

    Hi here is my problem, I am using the YourKit Java Profiler. everytime time I am closing a JInternalFrame what I noticed in this YourKit Profiler is that Allocated Memory is not decreasing when I dispose() the JInternalFrame. What do I need to do so

  • Install OS9 using an external CD drive

    I have an eMac OSX10.4.11 They internal CD drive has died and I'm using an external drive connect by firewire. I want to install OS9 but the computer doesn't recognise the external CD drive when I hold c and restart. Any suggestions please