Is it a Bug on java.util.Calendar or is expected?

When I try to set the DAY OF MONTH to another value then the actual and then set the DAY OF WEEK, if I do not call a 'get(anything)' or 'c.setTime(c.getTime())' beetwin the call to set the DAY OF MONTH and the DAY OF WEEK, when I call 'getTime()', it brings the closest day of week I've set to the actual day of month, and not the closest to the day of month I've setted.
Example:
Obs.: today is 05/14/2002
Scenario 1.:
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_MONTH, 29);
c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
System.out.println(c.getTime());
--> PRINTS OUT: Mon May 13 17:36:23 BRT 2002
Scenario 2.:
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_MONTH, 29);
c.setTime(c.getTime()); // or c.get(Calendar.HOUR);
c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
System.out.println(c.getTime());
--> PRINTS OUT: Mon May 27 17:31:25 BRT 2002
is it a bug or not?

The API documentation for the Calendar class says this:
"set(f, value) changes field f to value. In addition, it sets an internal member variable to indicate that field f has been changed. Although field f is changed immediately, the calendar's milliseconds is not recomputed until the next call to get(), getTime(), or getTimeInMillis() is made."
And:
"If fields conflict, the calendar will give preference to fields set more recently."
Which is what your tests show to be the case. So it is expected. Not a bug.

Similar Messages

  • Why not Deprecate java.util.Date and java.util.Calendar

    With the introduction of java.time, why did you not flag java.util.Date and java.util.Calendar. These classes have been a bane to every Java developer and should never be used again with the introduction of Java 1.8.

    Adding the @Deprecated annotation would only just provide a warning about an old API and recommendation to the developer(s) to no longer use it. Doing so would not break any existing library out there; in fact quite a number of constructors and methods on the Date class have already been flagged deprecated.
    The new java.time package is far superior to Date/Calendar.

  • Java.sql.Date vs java.util.Date vs. java.util.Calendar

    All I want to do is create a java.sql.Date subclass which has the Date(String) constructor, some checks for values and a few other additional methods and that avoids deprecation warnings/errors.
    I am trying to write a wrapper for the java.sql.Date class that would allow a user to create a Date object using the methods:
    Date date1 = new Date(2003, 10, 7);ORDate date2 = new Date("2003-10-07");I am creating classes that mimic MySQL (and eventually other databases) column types in order to allow for data checking since MySQL does not force checks or throw errors as, say, Oracle can be set up to do. All the types EXCEPT the Date, Datetime, Timestamp and Time types for MySQL map nicely to and from java.sql.* objects through wrappers of one sort or another.
    Unfortunately, java.sql.Date, java.sql.Timestamp, java.sql.Time are not so friendly and very confusing.
    One of my problems is that new java.sql.Date(int,int,int); and new java.util.Date(int,int,int); are both deprecated, so if I use them, I get deprecation warnings (errors) on compile.
    Example:
    public class Date extends java.sql.Date implements RangedColumn {
      public static final String RANGE = "FROM '1000-01-01' to '8099-12-31'";
      public static final String TYPE = "DATE";
       * Minimum date allowed by <strong>MySQL</strong>. NOTE: This is a MySQL
       * limitation. Java allows dates from '0000-01-01' while MySQL only supports
       * dates from '1000-01-01'.
      public static final Date MIN_DATE = new Date(1000 + 1900,1,1);
       * Maximum date allowed by <strong>Java</strong>. NOTE: This is a Java limitation, not a MySQL
       * limitation. MySQL allows dates up to '9999-12-31' while Java only supports
       * dates to '8099-12-31'.
      public static final Date MAX_DATE = new Date(8099 + 1900,12,31);
      protected int _precision = 0;
      private java.sql.Date _date = null;
      public Date(int year, int month, int date) {
        // Deprecated, so I get deprecation warnings from the next line:
        super(year,month,date);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public Date(String s) {
        super(0l);
        // Start Cut-and-paste from java.sql.Date.valueOf(String s)
        int year;
        int month;
        int day;
        int firstDash;
        int secondDash;
        if (s == null) throw new java.lang.IllegalArgumentException();
        firstDash = s.indexOf('-');
        secondDash = s.indexOf('-', firstDash+1);
        if ((firstDash > 0) & (secondDash > 0) & (secondDash < s.length()-1)) {
          year = Integer.parseInt(s.substring(0, firstDash)) - 1900;
          month = Integer.parseInt(s.substring(firstDash+1, secondDash)) - 1;
          day = Integer.parseInt(s.substring(secondDash+1));
        } else {
          throw new java.lang.IllegalArgumentException();
        // End Cut-and-paste from java.sql.Date.valueOf(String s)
        // Next three lines are deprecated, causing warnings.
        this.setYear(year);
        this.setMonth(month);
        this.setDate(day);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public static boolean isWithinRange(Date date) {
        if(date.before(MIN_DATE))
          return false;
        if(date.after(MAX_DATE))
          return false;
        return true;
      public String getRange() { return RANGE; }
      public int getPrecision() { return _precision; }
      public String getType() { return TYPE; }
    }This works well, but it's deprecated. I don't see how I can use a java.util.Calendar object in stead without either essentially re-writing java.sql.Date almost entirely or losing the ability to be able to use java.sql.PreparedStatement.get[set]Date(int pos, java.sql.Date date);
    So at this point, I am at a loss.
    The deprecation documentation for constructor new Date(int,int,int)says "instead use the constructor Date(long date)", which I can't do unless I do a bunch of expensive String -> [Calendar/Date] -> Milliseconds conversions, and then I can't use "super()", so I'm back to re-writing the class again.
    I can't use setters like java.sql.Date.setYear(int) or java.util.setMonth(int) because they are deprecated too: "replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date)". Well GREAT, I can't go from a Date object to a Calendar object, so how am I supposed to use the "Calendar.set(...)" method!?!? From where I'm sitting, this whole Date deprecation thing seems like a step backward not forward, especially in the java.sql.* realm.
    To prove my point, the non-deprecated method java.sql.Date.valueOf(String) USES the DEPRECATED constructor java.util.Date(int,int,int).
    So, how do I create a java.sql.Date subclass which has the Date(String) constructor that avoids deprecation warnings/errors?
    That's all I really want.
    HELP!

    I appreciate your help, but what I was hoping to accomplish was to have two constructors for my java.sql.Date subclass, one that took (int,int,int) and one that took ("yyyy-MM-dd"). From what I gather from your answers, you don't think it's possible. I would have to have a static instantiator method like:public static java.sql.Date createDate (int year, int month, int date) { ... } OR public static java.sql.Date createDate (String dateString) { ... }Is that correct?
    If it is, I have to go back to the drawing board since it breaks my constructor paradigm for all of my 20 or so other MySQL column objects and, well, that's not acceptable, so I might just keep my deprecations for now.
    -G

  • How to map javax.xml.datatype.XMLGregorianCalendar to java.util.Calendar

    Hi ,
    How to map javax.xml.datatype.XMLGregorianCalendar to java.util.Calendar so that i can use pass String parameter in YYYY-MM-DD format to my Web service.
    I generated the schema classes using Jaxb 2.1.5.
    Please give suggestion
    Thanks in Advance.

    toGregorianCalendar().getTime()

  • Web Service Model transforms dateTime elements to java.util.Calendar

    The issue is that my EJB returns a java.util.Date object, the WS that exposes this EJB states in the wsdl that it returns a dateTime element (see attachment). Web Dynpro web-service model, when given the wsdl generates proxies that receive a java.util.Calendar. Later this Calendar object can’t be bound to UI elements (e.g. tables) see error below.
    Has anybody encountered this problem in the past? Do you have a solution, besides manually transferring the java.util.Calendar objects to java.util.Date object?

    Hi Valery,
    I tried changing my return type in a method in the EJB from java.util.Date to java.sql.Date, the problem that I ran into is that I was not able to expose that method in the web service afterwards. This is a bit strange since java.sql.Date is suppose to be supported as a web service Endpoint. I checked this twice just to make sure.

  • Convert java.sql.Timestamp to java.util.Calendar?

    What's the best way to convert java.sql.Timestamp to java.util.Calendar?

    Use Calendar's setTime(Date date) method.
    java.sql.Timestamp extends java.util.Date.
    -Roy

  • Ktoolbar does not recognize "java.util.Calendar"

    Hi!
    Although http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXRPC4.html says that java.util.Calendar is supported, ktoolbar errors out with
    error: Found unknown simple type: java.util.Calendar
    What's wrong? WSDL not compatible with Java ME?
    any help/hint is very much appreciated,
    regards Florian

    To be honest, I am a bit lost.
    I am beginning / trying to develop a mobile app using WTK / Java ME which uses a web service; the WSDL is here: http://www.pegel-mainz.de/WSDL/v3.0/iLON100.WSDL
    Running ktoolbar's stub generator with a local copy of this file, I get the error above, but with a simple MIDlet which just says "Hi", everything builds and runs fine.
    Funny thing, at least for me - or make that "irritating":
    There is no "Stub" in the generated files. The one class which at least extends "java.rmi.Remote" is "MainSoapPort", but that is only an interface.
    But in all tutorials/docs so far I find these Stub-classes to instantiate the service!
    I guess I am doing something fundamentally wrong.
    Any advice/hint/help/link?
    It's very much appreciated (as I'm lost atm)
    regards,
    Florian

  • Java.util.Calendar calculates wrong date when any duration is added

    Hi friends,
    I am trying to calculate the date through java.util.Calendar object and getting wrong value. Let me explain the scenario -
    Scenario1:
    I have taken start date and added some duration to that and expecting a new date which should be calculated as (start date+ duration). The value is as below -
    start date = 2012-01-09 (9 January 2012 )
    duration = 1year, 1month, 20 days
    new date = 2013-02-28 ( 28 February 2013)
    *Here new date I am expecting is 2013-03-01 (1 March 2013).
    Scenario2:
    I have taken another set of values as below -
    start date = 2011-02-15 (15 February 2011)
    duration = 1year, 1month, 15days
    new date = 2012-03-30 (30 March 2012)
    *Here new date is as expected.
    Scenario1 data is giving me wrong result. Please let me know if any more information is required. Any help will be appriciated. Thanks in advance.
    Edited by: user560316 on ९ जनवरी, २०१२ ६:२३ अपराह्न
    Edited by: user560316 on ९ जनवरी, २०१२ ६:२४ अपराह्न

    It all looks pretty straightforward to me. Try running the following code:
    public class TestCalendar {
        public static void main(String[] args) {
            java.util.Calendar myDate = java.util.Calendar.getInstance();
            java.text.DateFormat df = new java.text.SimpleDateFormat("dd MMMM yyyy");
            myDate.set(2012, java.util.Calendar.JANUARY, 9);
            System.out.println("Start date = " + df.format(myDate.getTime()));
            myDate.add(java.util.Calendar.YEAR, 1);
            myDate.add(java.util.Calendar.MONTH, 1);
            myDate.add(java.util.Calendar.DAY_OF_MONTH, 20);
            System.out.println("End date = " + df.format(myDate.getTime()));
    }This gives the following result:
    Start date = 09 January 2012
    End date = 01 March 2013

  • Java.util.Calendar

    Where can i find examples for java.util.Calendar
    can someone please tell me ^^
    Thanks a lot

    take a look at
    java.util.GregorianCalendar
    maybe its this you need ...

  • Java.util.Calendar returning wrong Date object

    Example: This was my scenario last night. A server in California has date/time of 'Mon Aug 18'. Current time in Indiana is 'Sun Aug 17'. I use Calendar.getInstance(TimeZone.getTimeZone("America/Indiana/Indianapolis")) to return a Calendar instance. I then call the getTime() method on that instance. It should return a Date object relating to that particular time zone. It will not. It defaults back to the server time. When I print out the Calendar instance everything is good, correct date, correct time,etc. WHY WON'T THE getTime() return the correct java.util.Date???
    Following is the output was run today so the dates happened to be the same so focus on the Time. Output includes Server time, new Calendar values, and the Date returned by calendar instance getTime(). See that the Calendar is getting the correct Time.
    SERVER DATE=Mon Aug 18 15:52:13 CEST 2003
    CALENDAR INSTANCE=java.util.GregorianCalendar[time=1061214732975,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/Indiana/Indianapolis",offset=-18000000,dstSavings=0,useDaylight=false,transitions=35,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=1,ERA=1,YEAR=2003,MONTH=7,WEEK_OF_YEAR=34,WEEK_OF_MONTH=4,DAY_OF_MONTH=18,DAY_OF_YEAR=230,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=8,HOUR_OF_DAY=8,MINUTE=52,SECOND=12,MILLISECOND=975,ZONE_OFFSET=-18000000,DST_OFFSET=0]
    Date from getTime()=Mon Aug 18 15:52:12 CEST 2003

    I got it worked with using DateFormat.parse !
    The trick is to instantiate a new Date object as a result
    of parsing out of 'localized' date string.
    with below code :
    Calendar localCal = new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"));
    localCal.set(Calendar.DATE, 25);
    localCal.set(Calendar.MONTH, 7);
    localCal.set(Calendar.YEAR, 2003);
    localCal.set(Calendar.HOUR_OF_DAY,6);
    localCal.set(Calendar.MINUTE, 38);
    localCal.set(Calendar.SECOND, 11);
    Calendar sinCal = new GregorianCalendar(TimeZone.getTimeZone("Asia/Singapore"));
    sinCal.setTimeInMillis(localCal.getTimeInMillis());
    int date = sinCal.get(Calendar.DATE);
    int month = sinCal.get(Calendar.MONTH);
    int year = sinCal.get(Calendar.YEAR);
    int hour = sinCal.get(Calendar.HOUR_OF_DAY);
    int min = sinCal.get(Calendar.MINUTE);
    int sec = sinCal.get(Calendar.SECOND);
    String sinTimeString = date + "/" + month + "/" + year + " " + hour + ":" + min + ":" + sec;
    System.out.println("VIDSUtil.hostToLocalTime : time string now in SIN time : " + sinTimeString);
    java.util.Date sinTime = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(sinTimeString);
    System.out.println("time in SIN using Date.toString(): " + sinTime.toString());
    It prints out :
    VIDSUtil.hostToLocalTime : time string now in SIN time : 25/7/2003 21:38:11
    time in SIN using Date.toString(): Fri Jul 25 21:38:11 PDT 2003
    (Ignore the PDT, because Date.toString() defaults where the JVM is running)

  • A bug in java.util.Date module?

    When I try to execute this code:
    private java.util.Date getStringAsDate(String s) throws Exception {
         SimpleDateFormat fmt = new SimpleDateFormat("DD.MM.yyyy");
             return fmt.parse(s);
    java.util.Date one = getStringAsDate("8.6.2005"), two = getStringAsDate("8.7.2005");
    if (one.compareTo (two) ==0 )
       System.out.println("Equals!");
    else
       System.out.println("Not equals!");
    System.out.println(one);
    System.out.println(two);I get this result:
    Equals!
    Sat Jan 08 00:00:00 GMT+01:00 2005
    Sat Jan 08 00:00:00 GMT+01:00 2005
    My locales are Czech, time zone GMT+01. Thoughts?

    Thanks.
    I was looking for an error in months as they were
    incorrect...Look into the API and you should see why the month value is wrong for the pattern you wrote:
    http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.htmlThe hint is in the definition of 'D' versus 'd'.

  • Error in the Dates in java.util.Calendar/java.util.SimpleDateFormat

    I specifies the year(1999) and the week of that year(1).
    Then I want an existing date like 1999-01-01.
    But I get 1998-12-31. This date is WEEK 53 of year 1998.
    So what I found was that every week in a year (Ex. 1999),
    that have a previous year with 53 weeks (Ex. 1998), have
    their dates dislocated one week. This means that
    all dates I receive is from the previous week instead for
    the correct one.
    Code ex.
    Calendar aCalendar=Calendar.getInstance();
    aCalendar.set(Calendar.YEAR, aIntYear);
    aCalendar.set(Calendar.WEEK_OF_YEAR, aIntWeek);
    SimpleDateFormat aDateFormatter=new SimpleDateFormat ("yyyy-MM-dd");
    aDateFormatter.setCalendar(aCalendar);
    String aParsedDate=aDateFormatter.format(aCalendar.getTime());
    Have anyone a good solution for this, (without a check if the previous year
    has 53 weeks and then adding 1 to all weeks in the next year)?

    After reading the API I see that their implementation is correct. If the first day of the year doesn't begin on the first day of the week, then the first day of that week is in the previous year.
    For example if New Year's day is on Wednesday and the first day of that week is Sunday then the date of the first day of the week (Sunday) is in the previous year.
    I'm not sure how you would like to alter this, if you change it so that it ignores that the first week was not 7 days long then your program will return incorrect values. In the previous example, your proposed alteration would return January 5 as the first day of the first week of the year, which doesn't make any sense.
    One thing you could do is check to see that after you set the week, check to see whether the date returned is less than the first day of the year you set. If so return the first day of the year.

  • Error while deploying a web service whose return type is java.util.Date

    Hi
    I have written a simple web service which takes in a date input (java.util.Date) and returns the same date back to the client.
    public interface Ping extends Remote
    * A simple method that pings the server to test the webservice.
    * It sends a datetime to the server which returns the datetime.
    * @param pingDateRequest A datetime sent to the server
    * @returns The original datetime
    public Date ping(Date pingDateRequest) throws RemoteException;
    The generation of the Web service related files goes smoothly in JDeveloper 10g. The problem arises when I try to deploy this web service on the Oracle 10g (10.0.3) OC4J standalone. it gives me the following error on the OC4J console :
    E:\Oracle\oc4j1003\j2ee\home\application-deployments\Sachin-TradingEngineWS-WS\
    WebServices\com\sachin\tradeengine\ws\Ping_Tie.java:57: ping(java.util.Date) in com.sachin.tradeengine.ws.Ping cannot be applied to (java.util.Calendar) _result  = ((com.sachin.tradeengine.ws.Ping) getTarget()).ping
    (myPing_Type.getDate_1());
    ^
    1 error
    04/03/23 17:17:35 Notification ==&gt; Application Deployer for Sachin-TradingEngineWS-WS FAILED: java.lang.InstantiationException: Error compiling :E:\Oracle\oc4j1003\j2ee\home\applications\Sachin-TradingEngineWS-WS\WebServices: Syntax error in source [ 2004-03-23T17:17:35.937GMT+05:30 ]
    I read somewhere that the conversion between java to xml datatype and vice versa fails for java.util.Date, so it is better to use java.util.Calendar. When I change the code to return a java.util.Calendar then the JDeveloper prompts me the following failure:
    Method Ping: the following parameter types do not have an XML Schema mapping and/or serializer specified : java.util.Calendar.
    This forces me to return a String data.
    I would appreciate if someone can help me out.
    Thanks
    Sachin Mathias
    Datamatics Ltd.

    Hi
    I got the web service working with some work around. But I am not sure it this approach would be right and good.
    I started altogether afresh. I did the following step :
    1. Created an Interface (Ping.java) for use in web Service as follows :
    public interface Ping extends Remote{
    public java.util.Date ping(java.util.Date pingDateRequest)
    throws RemoteException;
    2. Implemented the above interface in PingImpl.java as follows :
    public class PingImpl implements Ping
    public java.util.Date ping(java.util.Date pingDateRequest) throws RemoteException {
    System.out.println("PingImpl: ping() return datetime = " + pingDateRequest.toString());
    return pingDateRequest;
    3. Compiled the above 2 java files.
    4. Generated a Stateless Java Web Service with the help of JDeveloper. This time the generation was sucessful.(If I had "java.util.Calendar" in place of "java.util.Date" in the java code of the above mentioned files the web service generation would prompt me for error)
    5. After the generation of Web Service, I made modification to the Ping interface and its implementing class. In both the files I replaced "java.util.Date" with "java.util.Calendar". The modified java will look as follows :
    Ping.Java
    =========
    public interface Ping extends Remote{
    public java.util.Calendar ping(java.util.Calendar pingDateRequest)
    throws RemoteException;
    PingImpl.Java
    ================
    public class PingImpl implements Ping
    public java.util.Calendar ping(java.util.Calendar pingDateRequest) throws RemoteException {
    System.out.println("PingImpl: ping() return datetime = " + pingDateRequest.toString());
    return pingDateRequest;
    6. Now I recompile both the java files.
    7. Withour regenerating the Web Service I deploy the Web Service on OC4j 10.0.3 from JDeveloper. This time the deployment was sucessful.(The Deployment fails if I don't follow the step 5.)
    8. Now I generated a Stub from JDeveloper and accessed the stub from a client. It works fine. Here if you see the Stub code it takes java.util.Date as a parameter and returns a java.util.Date. (Mind you I am accepting a java.util.Calendar and returning the same in my Web Service interface. Step 5)
    The confusing thing is the Serialization and Deserialization of Data from Client java data to Soap message and Soap message to Server java data.
    From Client to SOAP :
    java.util.Date to datetime
    From SOAP to Server :
    datetime to java.util.Calendar
    From Server to SOAP :
    java.util.Calendar to datetime
    From SOAP to Client :
    datetime to java.util.Date (I am not able to understand this part of the conversion)
    Any help or inputs would be appreciated.
    Thanks
    Sachin Mathias

  • ODI-20088 :  Error while generating scenario ( java.util.ConcurrentMod....)

    Hi ODI gurus,
    I need your advice in resolving the ODI-20088 issue (ODI 11.1.1.6.0).,
    Until i made changes(adding 2 columns) to the table in the model - everything was perfect with the execution of the Project scenarios (a driver scenario wrapping multiple scenarios/procedures from different folders within a same project).
    Now after i made changes to a table in the model - by adding two columns., these two columns are reflected in the related interface, mapped those columns and also modified a related procedure. After all these, if i try to re-generate a scenario - i am encountering the ODI-20088 issue.
    I did try all the listed options - but all in vain, could not resolve the issue.,
    1. Tried many options with re-saving model object, related interface and procedures - the ODI-20088 issue did not get resolved.
    2. Bounced DB and mid-tier services - not resolved.
    3. Copied the package and tried to generate the scenario for the new copied package - not resolved
    4. Created a new package without the related interface or procedure - just with variables - not resolved
    5. Now, i notice - a scenario cannot be (re)generated for any of the artifacts
    I am struck, cannot proceed any further, please to help in resolving the ( ODI 11g - 11.1.1.6.0) issue.
    Thanks and regards,
    The stack trace.,
    java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.nextEntry(HashMap.java:977)
    at java.util.HashMap$KeyIterator.next(HashMap.java:1012)
    at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.finishScenario(SnpGeneratorSQLCIT.java:2465)
    at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.mainGenTrtScenario(SnpGeneratorSQLCIT.java:11457)
    at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.mainGenTrtScenario(SnpGeneratorSQLCIT.java:11392)
    at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.mainGenScenSourceScenario(SnpGeneratorSQLCIT.java:11487)
    at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.mainGenScenSourceScenario(SnpGeneratorSQLCIT.java:11505)
    at com.sunopsis.graphical.dialog.SnpsDialogScen.generateScen(SnpsDialogScen.java:190)
    at com.sunopsis.graphical.scenario.DwgScenGeneratingWizard.generate(DwgScenGeneratingWizard.java:68)
    at oracle.odi.ui.action.SnpsPopupActionGenerateScenHandler.actionPerformed(SnpsPopupActionGenerateScenHandler.java:103)
    at oracle.odi.ui.SnpsActionControler.handleEvent(SnpsActionControler.java:89)
    at oracle.ide.controller.IdeAction.performAction(IdeAction.java:529)
    at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:897)
    at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:502)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2319)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:358)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1224)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
    at java.awt.Component.processMouseEvent(Component.java:6267)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3268)
    at java.awt.Component.processEvent(Component.java:6032)
    at java.awt.Container.processEvent(Container.java:2042)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2101)
    at java.awt.Component.dispatchEvent(Component.java:4461)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2479)
    at java.awt.Component.dispatchEvent(Component.java:4461)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:175)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:162)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Hi,
    The cause of the issue is following unpublished bug:
    Bug 13592619: JAVA.UTIL.CONCURRENTMODIFICATIONEXCEPTION WHEN GENERATING SCENARIO OF INTERFACE
    Solution
    Follow the below steps to resolve this issue :
    1.First apply the Bundled Patch for ODI 11.1.1.6.3: Patch 14037855
    2.After the above patch is applied, apply the ODI 11.1.1.6.3 patch: Patch 14596284
    Regards,
    Rickson Lewis

  • Wsimport, mapping of xs:date to java.util.Date via ext file, and -B option

    Summary:
    JDK 1.7.0_09 and wsimport and xjc that comes with it.
    Global JAXB binding to map xs:date to java.util.Date
    I have the following external bindings file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
         elementFormDefault="qualified" attributeFormDefault="unqualified"
         jaxb:extensionBindingPrefixes="xjc" jaxb:version="2.1">
         <xs:annotation>
              <xs:appinfo>
                   <jaxb:globalBindings>
                        <xjc:serializable />
                        <jaxb:javaType name="java.util.Date" xmlType="xs:date" parseMethod="au.com.xxx.jaxb.DateAdapter.parseDate" printMethod="au.com.xxx.jaxb.DateAdapter.printDate" />
                   </jaxb:globalBindings>
              </xs:appinfo>
         </xs:annotation>
    </xs:schema>The au.com.xxx.jaxb.DateAdapter code is as follows:
    package au.com.xxx.jaxb;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import javax.xml.bind.DatatypeConverter;
    public class DateAdapter {
         public static Date parseDate(String s) {
              return DatatypeConverter.parseDate(s).getTime();
         public static String printDate(Date dt) {
              Calendar cal = new GregorianCalendar();
              cal.setTime(dt);
              return DatatypeConverter.printDate(cal);
    }When I run the following wsimport from the command line, I get:
    salvojo@AUD20901BL /cygdrive/c/workspace/JSF/insurance
    $ /cygdrive/c/java/jdk1.7.0_09/x64/bin/wsimport -keep -s gen-src -b external/wsdl/jaxb-bindings.xml -wsdllocation /wsdl/Member.wsdl -d WebContent/WEB-INF/classes external/wsdl/Member.wsdl
    parsing WSDL...
    Generating code...
    Compiling code...
    C:\workspace\JSF\insurance\gen-src\org\w3\_2001\xmlschema\Adapter1.java:13: error: package au.com.xxx.jaxb does not exist
            return (au.com.xxx.jaxb.DateAdapter.parseDate(value));
                                   ^
    C:\workspace\JSF\insurance\gen-src\org\w3\_2001\xmlschema\Adapter1.java:17: error: package au.com.xxx.jaxb does not exist
            return (au.com.xxx.jaxb.DateAdapter.printDate(value));
                                   ^
    2 errors
    compilation failed, errors should have been reportedWhich means that wsimport or xjc needs to know the classpath to find au.com.xxx.jaxb.DateAdapter.
    But how do I pass the classpath from wsimport to the JAXB compiler ?
    There is the -B option in wsimport, but I could not get it to work.
    If I read it correctly, I should be able to pass the -classpath option to the JAXB compiler from wsimport via -B.
    I tried:
    salvojo@AUD20901BL /cygdrive/c/workspace/JSF/insurance
    $ /cygdrive/c/java/jdk1.7.0_09/x64/bin/wsimport -keep -s gen-src -B"-classpath WebContent/WEB-INF/classes" -b external/wsdl/jaxb-bindings.xml -wsdllocation /wsdl/Member.wsdl -d WebContent/WEB-INF/classes external/wsdl/Member.wsdl
    no such JAXB option: -classpath WebContent/WEB-INF/classes
    Usage: wsimport [options] <WSDL_URI>
    where [options] include:
      -b <path>                 specify jaxws/jaxb binding files or additional schemas
                                (Each <path> must have its own -b)
      -B<jaxbOption>            Pass this option to JAXB schema compiler
      -catalog <file>           specify catalog file to resolve external entity references
                                supports TR9401, XCatalog, and OASIS XML Catalog format.
      -d <directory>            specify where to place generated output files
    <...snipped...>... where WebContent/WEB-INF/classes is the classpath where au.com.xxx.jaxb.DateAdapter.class could be found. Obviously it did not like it.
    Also, why is wsimport generate org.w3._2001.xmlschema.Adapter1.java ? All it is doing is wrapping up the exact same call that I have specified in my DateAdapter. How can I tell wsimport or xjc to NOT create that extra Adapter1.java and simply directly use my DateAdapter ??

    create additional column of type LONG to represent date.
    dateFormat is of type java.util.Date:
    long newLongDate = dateFormat.getTime();
    select object(b) from MyEntity b where b.MYLONGDATE > ?1 and b.MYLOGDATE <= ?2

Maybe you are looking for

  • How to reassign a budget type which has been assigned

    hi, i wanted to know how to reassign the budget type assigned for psoting period ending 30.09.2008. i want to change the key figure assigned to the budget type so i am trying to delete the budget type for that purpose. i cannot delete key figure for

  • Need a code for Customer exit for extractor 0WBS_ELEMT_ATTR

    Hi Guys, I need a code for following requirement. I have appended some fields to standard extractor 0WBS_ELEMT_ATTR which normally takes data from PRPS table. But the new fields will be getting data from PRTE and PROJ table. with common keys. Followi

  • Ios update and mesh ap

                       I've two wlan controller Cisco2100 (Air-WLC2125-k9) with a software version 7.0.98.0. Now I want upgrade to a new release but some my Ap are in mesh mode. How this ap will upgrade ? Many Thanks

  • Balance in local currency while doing MIGO

    Hi Gurus, Below is the message which I am receiving when doing MIGO. Can some body let me know how to solve this Balance in local currency Message no. F5703 Diagnosis A balance exists in local currency "INR" with the following details: Exchange rate

  • TM doesn't work

    Hi, I'm having a problem with TM: I enter the app and nothing works, the windows are stuck, everything is still. I have to alt-cmd-esc to exit the app. Worked fine last time I used it last week and I didn't do anything except update to 10.6.3... Any