Results 1 to 5 of 5

Thread: SimpleDateFormat

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Location
    SA
    Posts
    13

    Question

    Help needed agently. I am using SimpleDate format to get my date and it has been working, Now all of a surden it gices a resource not found. am compleely lost. this is the code

    public static String timeNow()
    {
    // Format the current time.
    SimpleDateFormat formatter = new SimpleDateFormat ("dd.MMM.yyyy HH:mm:ss ");
    Date currentTime = new Date();
    return formatter.format(currentTime);
    }

    and this is the stacktrace.
    java.util.MissingResourceException: Can't find resource
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.lang.RuntimeException.<init>(Compiled Code)
    at java.util.MissingResourceException.<init>(Compiled Code)
    at java.util.ResourceBundle.getObject(Compiled Code)
    at java.text.DateFormatSymbols.initializeData(Compiled Code)
    at java.text.DateFormatSymbols.<init>(Compiled Code)
    at java.text.SimpleDateFormat.<init>(Compiled Code)
    at java.text.SimpleDateFormat.<init>(Compiled Code)
    at za.co.sbic.system.EventLog.timeNow(Compiled Code

    Strage thing is someother program is using the same call and it works.

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    69
    hey innom,

    I don't have a jvm on this machine to test out the code. I will try to test it out later, but I did find a place that describes the exception. If you have internet connection, here is the site:


    http://java.sun.com/products/jdk/1.2...Exception.html


    hope this helps,


    Manoj

  3. #3
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    This is a little wierd. Normally if you get an error like that and with the method being static, it would seem that you are trying to use a variable that might not have been created yet. But in your case with the code you have posted this is not the issue. Since everything you use there is created in it.

  4. #4
    VirtuallyVB
    Guest

    Question Works for me

    What's weird is that it works for me on version 1.3. What are you using and how do you call timeNow()?

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Location
    SA
    Posts
    13
    Ok!!! The problem seemed to be with out of memory Exception. One of the processes was giving this and I wasn't aware. I am still on java 1.2 still need to upgrade.

Posting Permissions

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



Click Here to Expand Forum to Full Width