[jira] Created: (JDO-640) NPE when running tck in debug mode

View: New views
6 Messages — Rating Filter:   Alert me  

[jira] Created: (JDO-640) NPE when running tck in debug mode

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

NPE when running tck in debug mode
----------------------------------

                 Key: JDO-640
                 URL: https://issues.apache.org/jira/browse/JDO-640
             Project: JDO
          Issue Type: Bug
          Components: tck2
    Affects Versions: JDO 2 maintenance release 2
            Reporter: Michael Bouschen
            Assignee: Michael Bouschen


A couple of test configurations fail with a NPE when running the tck in debug mode, e.g.:

    [java] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.jdo.tck.pc.companyMapWithoutJoin.ICompany org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(long,java.lang.String,java.util.Date)] threw exception; nested exception is java.lang.NullPointerException
    [java] Caused by: java.lang.NullPointerException
    [java]      at java.util.Calendar.setTime(Calendar.java:1037)
    [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:803)
    [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:796)
    [java]      at java.text.DateFormat.format(DateFormat.java:314)
    [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.getFieldRepr(Company.java:177)
    [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.toString(Company.java:166)
    [java]      at java.lang.String.valueOf(String.java:2615)
    [java]      at java.lang.StringBuilder.append(StringBuilder.java:116)
    [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(CompanyFactoryAbstractImpl.java:55)

When running in debug mode the new Company method prints the created instance, before the field values are initialized. So any date fields are still null and the code in getRepr runs into the NPE for a null date field.

To enable the debug mode, replace line
    log4j.logger.org.apache.jdo.tck = INFO, TCK
by
    log4j.logger.org.apache.jdo.tck = DEBUG, TCK
in file src/conf/log4j.properties.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-640) NPE when running tck in debug mode

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JDO-640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-640:
---------------------------------

    Attachment: TCK-results.txt

TCK test result listing all test failures caused by the described NPE.

> NPE when running tck in debug mode
> ----------------------------------
>
>                 Key: JDO-640
>                 URL: https://issues.apache.org/jira/browse/JDO-640
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Michael Bouschen
>            Assignee: Michael Bouschen
>         Attachments: TCK-results.txt
>
>
> A couple of test configurations fail with a NPE when running the tck in debug mode, e.g.:
>     [java] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.jdo.tck.pc.companyMapWithoutJoin.ICompany org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(long,java.lang.String,java.util.Date)] threw exception; nested exception is java.lang.NullPointerException
>     [java] Caused by: java.lang.NullPointerException
>     [java]      at java.util.Calendar.setTime(Calendar.java:1037)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:803)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:796)
>     [java]      at java.text.DateFormat.format(DateFormat.java:314)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.getFieldRepr(Company.java:177)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.toString(Company.java:166)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.lang.StringBuilder.append(StringBuilder.java:116)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(CompanyFactoryAbstractImpl.java:55)
> When running in debug mode the new Company method prints the created instance, before the field values are initialized. So any date fields are still null and the code in getRepr runs into the NPE for a null date field.
> To enable the debug mode, replace line
>     log4j.logger.org.apache.jdo.tck = INFO, TCK
> by
>     log4j.logger.org.apache.jdo.tck = DEBUG, TCK
> in file src/conf/log4j.properties.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-640) NPE when running tck in debug mode

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JDO-640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-640:
---------------------------------

    Fix Version/s: JDO 2 maintenance release 3

> NPE when running tck in debug mode
> ----------------------------------
>
>                 Key: JDO-640
>                 URL: https://issues.apache.org/jira/browse/JDO-640
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Michael Bouschen
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: TCK-results.txt
>
>
> A couple of test configurations fail with a NPE when running the tck in debug mode, e.g.:
>     [java] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.jdo.tck.pc.companyMapWithoutJoin.ICompany org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(long,java.lang.String,java.util.Date)] threw exception; nested exception is java.lang.NullPointerException
>     [java] Caused by: java.lang.NullPointerException
>     [java]      at java.util.Calendar.setTime(Calendar.java:1037)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:803)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:796)
>     [java]      at java.text.DateFormat.format(DateFormat.java:314)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.getFieldRepr(Company.java:177)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.toString(Company.java:166)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.lang.StringBuilder.append(StringBuilder.java:116)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(CompanyFactoryAbstractImpl.java:55)
> When running in debug mode the new Company method prints the created instance, before the field values are initialized. So any date fields are still null and the code in getRepr runs into the NPE for a null date field.
> To enable the debug mode, replace line
>     log4j.logger.org.apache.jdo.tck = INFO, TCK
> by
>     log4j.logger.org.apache.jdo.tck = DEBUG, TCK
> in file src/conf/log4j.properties.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JDO-640) NPE when running tck in debug mode

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JDO-640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-640:
---------------------------------

    Attachment: JDO-640.patch

Attached you find a patch for review (JDO-640.patch).

The NPE is caused by a debug statement in the company factory methods. It prints the newly created instance before its fields are initialized,  which fails for date fields. The patch moves the debug statement  at the end of the factory method and changes the print code to check for date fields being null.

> NPE when running tck in debug mode
> ----------------------------------
>
>                 Key: JDO-640
>                 URL: https://issues.apache.org/jira/browse/JDO-640
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Michael Bouschen
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-640.patch, TCK-results.txt
>
>
> A couple of test configurations fail with a NPE when running the tck in debug mode, e.g.:
>     [java] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.jdo.tck.pc.companyMapWithoutJoin.ICompany org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(long,java.lang.String,java.util.Date)] threw exception; nested exception is java.lang.NullPointerException
>     [java] Caused by: java.lang.NullPointerException
>     [java]      at java.util.Calendar.setTime(Calendar.java:1037)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:803)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:796)
>     [java]      at java.text.DateFormat.format(DateFormat.java:314)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.getFieldRepr(Company.java:177)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.toString(Company.java:166)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.lang.StringBuilder.append(StringBuilder.java:116)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(CompanyFactoryAbstractImpl.java:55)
> When running in debug mode the new Company method prints the created instance, before the field values are initialized. So any date fields are still null and the code in getRepr runs into the NPE for a null date field.
> To enable the debug mode, replace line
>     log4j.logger.org.apache.jdo.tck = INFO, TCK
> by
>     log4j.logger.org.apache.jdo.tck = DEBUG, TCK
> in file src/conf/log4j.properties.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JDO-640) NPE when running tck in debug mode

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/JDO-640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757370#action_12757370 ]

Craig Russell commented on JDO-640:
-----------------------------------

Nimble fingers you have. Good is the patch. May the force be with you.

> NPE when running tck in debug mode
> ----------------------------------
>
>                 Key: JDO-640
>                 URL: https://issues.apache.org/jira/browse/JDO-640
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Michael Bouschen
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-640.patch, TCK-results.txt
>
>
> A couple of test configurations fail with a NPE when running the tck in debug mode, e.g.:
>     [java] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.jdo.tck.pc.companyMapWithoutJoin.ICompany org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(long,java.lang.String,java.util.Date)] threw exception; nested exception is java.lang.NullPointerException
>     [java] Caused by: java.lang.NullPointerException
>     [java]      at java.util.Calendar.setTime(Calendar.java:1037)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:803)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:796)
>     [java]      at java.text.DateFormat.format(DateFormat.java:314)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.getFieldRepr(Company.java:177)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.toString(Company.java:166)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.lang.StringBuilder.append(StringBuilder.java:116)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(CompanyFactoryAbstractImpl.java:55)
> When running in debug mode the new Company method prints the created instance, before the field values are initialized. So any date fields are still null and the code in getRepr runs into the NPE for a null date field.
> To enable the debug mode, replace line
>     log4j.logger.org.apache.jdo.tck = INFO, TCK
> by
>     log4j.logger.org.apache.jdo.tck = DEBUG, TCK
> in file src/conf/log4j.properties.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JDO-640) NPE when running tck in debug mode

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/JDO-640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen resolved JDO-640.
----------------------------------

    Resolution: Fixed

Checked in the patch (revision 816927).

> NPE when running tck in debug mode
> ----------------------------------
>
>                 Key: JDO-640
>                 URL: https://issues.apache.org/jira/browse/JDO-640
>             Project: JDO
>          Issue Type: Bug
>          Components: tck2
>    Affects Versions: JDO 2 maintenance release 2
>            Reporter: Michael Bouschen
>            Assignee: Michael Bouschen
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: JDO-640.patch, TCK-results.txt
>
>
> A couple of test configurations fail with a NPE when running the tck in debug mode, e.g.:
>     [java] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.jdo.tck.pc.companyMapWithoutJoin.ICompany org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(long,java.lang.String,java.util.Date)] threw exception; nested exception is java.lang.NullPointerException
>     [java] Caused by: java.lang.NullPointerException
>     [java]      at java.util.Calendar.setTime(Calendar.java:1037)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:803)
>     [java]      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:796)
>     [java]      at java.text.DateFormat.format(DateFormat.java:314)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.getFieldRepr(Company.java:177)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.Company.toString(Company.java:166)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.lang.StringBuilder.append(StringBuilder.java:116)
>     [java]      at org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryAbstractImpl.newCompany(CompanyFactoryAbstractImpl.java:55)
> When running in debug mode the new Company method prints the created instance, before the field values are initialized. So any date fields are still null and the code in getRepr runs into the NPE for a null date field.
> To enable the debug mode, replace line
>     log4j.logger.org.apache.jdo.tck = INFO, TCK
> by
>     log4j.logger.org.apache.jdo.tck = DEBUG, TCK
> in file src/conf/log4j.properties.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.