Results 1 to 6 of 6
  1. #1
    Kareng is offline Member
    Join Date
    Aug 2009
    Posts
    35
    Rep Power
    0

    Default How to resolve : Cannot find symbol....?

    Dear forum members,

    I have this line(in red) that gives me a problem:

    public class SetExpressCheckOutService {

    private static Logger log = Logger.getLogger(SetExpressCheckOutService.class);


    Netbean gives me this error:

    cannot find symbol
    symbol: method getlogger(java.lang.class <abc.shoppingcart.ws.SetExpressCheckOutService>)
    location: class java.util.logging.logger.

    Hope someone can advise me how to resolve the problem.

    Tks.

  2. #2
    eRaaaa is online now Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    5

    Default Re: How to resolve : Cannot find symbol....?

    -> Logger (Java Platform SE 6)
    There is no getLogger method with an class object as parameter!

    static Logger getLogger(String name)
    Find or create a logger for a named subsystem.
    static Logger getLogger(String name, String resourceBundleName)
    Find or create a logger for a named subsystem.

  3. #3
    Kareng is offline Member
    Join Date
    Aug 2009
    Posts
    35
    Rep Power
    0

    Default Re: How to resolve : Cannot find symbol....?

    Hi eRaaaa,

    Thanks for that piece of information. Yes, I didn't realise about the getLogger method with a class object.
    Now, I found this on the Oracle document, I suppose if I follow what's there then it should correct. Wonder if the rest of the free "paypal SetExpressCheckoutDetails" code is it also ok or not. But, at least one less error. Thanks again.:)

    package com.wombat;
    import java.util.logging.*;

    public class Nose{
    // Obtain a suitable logger.
    private static Logger logger = Logger.getLogger("com.wombat.nose");
    public static void main(String argv[]) {
    // Log a FINE tracing message
    logger.fine("doing stuff");
    try{
    Wombat.sneeze();
    } catch (Exception ex) {
    // Log the exception
    logger.log(Level.WARNING, "trouble sneezing", ex);
    }
    logger.fine("done");
    }
    }

  4. #4
    eRaaaa is online now Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    5

    Default Re: How to resolve : Cannot find symbol....?

    Which error? And what class is Wombat?

  5. #5
    Kareng is offline Member
    Join Date
    Aug 2009
    Posts
    35
    Rep Power
    0

    Default Re: How to resolve : Cannot find symbol....?

    the error was that getLogger has included a class inside which should not be...isn't that so?

    The Wombat is just an example I got from Oracle site. Hope that clears the air.

  6. #6
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,854
    Rep Power
    19

    Default Re: How to resolve : Cannot find symbol....?

    That Logger is (probably) the log4j Logger from Apache.
    Which was probably imported in the sample code.
    Which does mean that the log4j jar needs to be on the classpath.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Cannot resolve symbol error
    By name in forum New To Java
    Replies: 4
    Last Post: 12-07-2011, 05:35 PM
  2. Yet another Cannot Resolve Symbol
    By Gabinka in forum New To Java
    Replies: 5
    Last Post: 03-27-2009, 10:28 PM
  3. cannot resolve symbol while using javac
    By andi9 in forum New To Java
    Replies: 5
    Last Post: 05-14-2008, 06:50 AM
  4. Cannot Resolve Symbol error...
    By seral1969 in forum New To Java
    Replies: 4
    Last Post: 02-18-2008, 12:17 AM
  5. Error: cannot resolve symbol, help me
    By mathias in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 08-06-2007, 02:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •