JDK-6374053 : Date format error with java.sql.SQLException error
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.sql
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2006-01-18
  • Updated: 2011-02-16
  • Resolved: 2006-02-21
Related Reports
Duplicate :  
Description
I'm running AS8.1 UR1 BAT test with Mustang (JDK6.0 b64) on sparc system.  I found two test case failures in ejb/cmp/datatypes testbase  (Testcase name: date_SQL and date_UTIL.)

date_SQL testcase involves a getter and setter interaction with database.
Test has one table mapped to DataTypes CMP bean. Valid Java/JDBC data types are mapped as persistent fields date_SQL testcase sets java.sql.Date and reads value back returned from cmp getter method 
Setter Value: 09/20/76
Getter:  java.sql.Date returned. 

Setter and getter are compared, and if they are equal,test is considered PASS. 
Those two testcases work fine with Mustang b59d but fail with b64 and later builds. I
found that both SQLDateSelection and UtilDateSelection return "null".
 It seems like there's an issue with JDBC in Mustang RC workspace.  

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Errors Exception:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#|2006-01-03T12:00:35.725-0800|WARNING|sun-appserver-ee8.1_01|javax.enterprise.resource.jdo.sqlstore|_ThreadID=14;|Exception.
java.sql.SQLException: Date format error :
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd
hh:mm:ss.fffffffff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Here's a portion of the testcase:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

public void runDateTest(){
         double result;

         DateFormat df=null;
         Locale currentLocale=new Locale("en","US");
         java.util.Date utildate=null;
 
         try{
            System.out.println("Date test with values comparing with 09/20/76");
            String dateString = "09/15/76";
            java.sql.Date sqldate = null;  
            df= DateFormat.getDateInstance  (DateFormat.SHORT,currentLocale);
            utildate = df.parse(dateString);            
            sqldate=new java.sql.Date(utildate.getTime());
            System.out.println("SQL Date value is "+sqldate);
            java.sql.Date returnDate=dataremote.SqlDateSelection(sqldate);
            System.out.println("SQLDateSelection \t"+returnDate);
            if(returnDate.equals(utildate)){
                stat.addStatus(testSuiteID+" "+"date_SQL",stat.PASS);
            }else
                stat.addStatus(testSuiteID+" "+"date_SQL",stat.FAIL);
            
        }catch(Throwable e){
            e.printStackTrace();
            stat.addStatus(testSuiteID+" "+"date_SQL",stat.FAIL);
        }
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Here're the output of the test:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

runclient-common:
     [echo] Executing appclient at
/export/AS81EE/appserver-sqe/pe/ejb/cmp/datatypes
     [echo] Testsuite id is :DATATYPES-CaptureSchemaCLI
     [echo] WS HOME appserver-sqe
     [echo] look up customer with jndi name ejb/MyDataTypes
     [echo]
     [echo] look up customer with jndi name ejb/MyTableManager
     [echo]
     [echo] 3
     [echo] DATA1 successfully added
     [echo] DATA2 successfully added
     [echo] DATA3 successfully added
     [echo] -----------------getting average of short----------
     [echo] double result is    10925.0
     [echo] -----------------getting average of byte----------
     [echo] double result is    45.0
     [echo] -----------------getting average of long----------
     [echo] double result is    3.0744573456182584E18
     [echo] -----------------getting average of float----------
     [echo] double result is    1.1342745E38
     [echo] float result from floatValue is 1.1342745E38
     [echo] -----------------getting average of integer----------
     [echo] double result is    7.15827885E8
     [echo] Where test with Byte in clause where byte==10
     [echo] WherewithByte    10.0
     [echo] Where test with Float in clause where float==10
     [echo] WherewithFloat    10.0
     [echo] Where test with Integer in clause where integer==10
     [echo] WherewithInteger    10.0
     [echo] Where test with Long in clause where long==10
     [echo] WherewithLong    10.0
     [echo] Where test with Short in clause where short==10
     [echo] WherewithShort    10.0
     [echo] Where test with character in clause where char    c
     [echo] WherewithCharacter    10925.0
     [echo] Expected result for query with char in where clause :10925.0
     [echo] Date test with values comparing with 09/20/76
     [echo] Date value is Mon Sep 20 00:00:00 PDT 1976

     [echo] UtilDateSelection    null   <<<<<<<<<NULL HERE<<<<<<<<<<

     [echo] java.lang.NullPointerExceptionDate test with values
comparing with 09/20/76
     [echo] SQL Date value is 1976-09-15
     [echo]
     [echo]    at
s1peqe.ejb.cmp.datatypes.client.DataTypesTestClient.runDateTest(DataTypesTestClient.java:417)
     [echo]    at
s1peqe.ejb.cmp.datatypes.client.DataTypesTestClient.runTest(DataTypesTestClient.java:63)
     [echo]    at
s1peqe.ejb.cmp.datatypes.client.DataTypesTestClient.main(DataTypesTestClient.java:477)
     [echo]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [echo]    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [echo]    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [echo]    at java.lang.reflect.Method.invoke(Method.java:589)
     [echo]    at
com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:237)
     [echo]    at com.sun.enterprise.appclient.Main.<init>(Main.java:426)
     [echo]    at com.sun.enterprise.appclient.Main.main(Main.java:97)

     [echo] SQLDateSelection    null     <<<<<<<<<NULL HERE<<<<<<<<<<

     [echo] java.lang.NullPointerExceptionTimestamp testcase
     [echo] TimeStamp setter in CMP :1977-03-09 15:52:00.000123
     [echo]
     [echo]    at
s1peqe.ejb.cmp.datatypes.client.DataTypesTestClient.runDateTest(DataTypesTestClient.java:437)
     [echo]    at
s1peqe.ejb.cmp.datatypes.client.DataTypesTestClient.runTest(DataTypesTestClient.java:63)
     [echo]    at
s1peqe.ejb.cmp.datatypes.client.DataTypesTestClient.main(DataTypesTestClient.java:477)
     [echo]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [echo]    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [echo]    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [echo]    at java.lang.reflect.Method.invoke(Method.java:589)
     [echo]    at
com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:237)
     [echo]    at com.sun.enterprise.appclient.Main.<init>(Main.java:426)
     [echo]    at com.sun.enterprise.appclient.Main.main(Main.java:97)
     [echo] TimeStamp returned from CMP :1977-03-09 15:52:00.000123
     [echo] Generating report at
/export/AS81EE/appserver-sqe/test_results.xml
     [echo]
     [echo]
     [echo] -----------------------------------------
     [echo] -      where_LONG: PASS    -
     [echo] -      where_INTEGER: PASS    -
     [echo] -      date_TIMESTAMP: PASS    -
     [echo] -      populate_LONGMAXVAL: PASS    -
     [echo] -      average_LONG: PASS    -
     [echo] -      populate_MEDIANVAL: PASS    -
     [echo] -      populate_MAXVAL: PASS -
     [echo] -      populate_BYTEMAXVAL: PASS    -
     [echo] -      average_INTEGER: PASS -
     [echo] -      populate_INTEGERMAXVAL: PASS    -
     [echo] -      -EJBQL: PASS    -
     [echo] -      average_BYTE: PASS    -
     [echo] -      date_SQL: FAIL    -
     [echo] -      date_UTIL: FAIL    -
     [echo] -      average_SHORT: PASS    -
     [echo] -      where_CHARACTER>: PASS    -
     [echo] -      where_SHORT: PASS    -
     [echo] -      average_FLOAT: PASS    -
     [echo] -      where_BYTE: PASS    -
     [echo] -      where_FLOAT: PASS    -
     [echo] -      populate_SHORTMAXVAL: PASS    -
     [echo] -----------------------------------------
     [echo] Total PASS: 19
     [echo] Total FAIL: 2
     [echo] Total DNR: 0
     [echo] -----------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++Here's the server log file:  ++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[#|2006-01-03T12:00:35.723-0800|WARNING|sun-appserver-ee8.1_01|javax.enterprise.resource.jdo.sqlstore|_ThreadID=14;|JDO76313:
Error while
getting value from resultset at index 18 as resultType 22. columnSqlType
91. Exception: java.sql.SQLException: Date format error :
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd
hh:mm:ss.fffffffff|#]

[#|2006-01-03T12:00:35.725-0800|WARNING|sun-appserver-ee8.1_01|javax.enterprise.resource.jdo.sqlstore|_ThreadID=14;|Exception.
java.sql.SQLException: Date format error :
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd
hh:mm:ss.fffffffff
        at com.pointbase.dbexcp.dbexcpException.getSQLException(Unknown
Source)
        at com.pointbase.net.netJDBCResultSet.a(Unknown Source)
        at com.pointbase.net.netJDBCResultSet.getDate(Unknown Source)
        at com.pointbase.net.netJDBCResultSet.a(Unknown Source)
        at com.pointbase.net.netJDBCResultSet.getObject(Unknown Source)
        at
com.sun.jdo.spi.persistence.support.sqlstore.sql.ResultDesc.getConvertedObject(ResultDesc.java:158)
        at
com.sun.jdo.spi.persistence.support.sqlstore.sql.ResultDesc.setFields(ResultDesc.java:588)
        at
com.sun.jdo.spi.persistence.support.sqlstore.sql.ResultDesc.getResult(ResultDesc.java:461)
        at
com.sun.jdo.spi.persistence.support.sqlstore.sql.generator.SelectQueryPlan.getResult(SelectQueryPlan.java:1534)
        at
com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.executeQuery(SQLStoreManager.java:446)
        at
com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.retrieve(SQLStoreManager.java:345)
        at
com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.retrieve(SQLStateManager.java:2024)
        at
com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1162)
        at
com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.reload(SQLStateManager.java:1118)
        at
com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:633)
        at
com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper.getObjectById(PersistenceManagerWrapper.java:245)
        at
s1peqe.ejb.cmp.datatypes.DataTypesBean914238719_ConcreteImpl.jdoGetInstance(DataTypesBean914238719_ConcreteImpl.java:1368)
        at
s1peqe.ejb.cmp.datatypes.DataTypesBean914238719_ConcreteImpl.ejbLoad(DataTypesBean914238719_ConcreteImpl.java:1390)
        at
com.sun.ejb.containers.EntityContainer.callEJBLoad(EntityContainer.java:2258)
        at
com.sun.ejb.containers.EntityContainer.afterBegin(EntityContainer.java:1325)
        at
com.sun.ejb.containers.BaseContainer.startNewTx(BaseContainer.java:2341)
        at
com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:2247)
        at
com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:782)
        at
com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:126)
        at $Proxy21.TimeStampSelection(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:589)
        at
com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:123)
        at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648)
        at
com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192)
        at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1709)
        at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1569)
        at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:951)
        at
com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
        at
com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:721)
        at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
        at
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1262)
        at
com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:409)
|#]



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

You can refer to the test result page URL:
http://jsqalab.sfbay/results/6.0/b64/Appserver_Comp/ee_sparc_koi_SunOS/html/summaryreport.html

You can get Mustang build 64 from:
/java/re/jdk/6/promoted/rc/b64/bundles

You can reproduce the test from the server:
koi.sfbay:/export/AS81EE/appserver-sqe/pe/ejb/cmp/datatypes

login in with your username and source /export/AS81EE/setup.csh file

Comments
EVALUATION Per Amit Handa, this bug is a duplicate of CR#5006540. I closed this bug as a duplicated bug for now. I'm working with Amit and verify the testcase of CR#6374053 once the CR#5006540 is fixed. The following is the email from Amit Handa: =============================== Yes this is known and will get this in soon. Unfortunately bugster is down now. :( This is approved to be checked in mustang here http://ccc.sfbay/5006540 Also Girish, for 6370455 is the same cause. thanks, Amit ===================================
21-02-2006