[jira] Issue Comment Edited: (CAY-1071) NullPointer in BaseQueryMetadata while executing Queri

From: JIRA (Jürgen)
Date: Tue Jun 17 2008 - 16:06:52 EDT

  • Next message: Andrus Adamchik: "Wrapping up Cayenne 3.0"

        [ https://issues.apache.org/cayenne/browse/CAY-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12960#action_12960 ]

    pille edited comment on CAY-1071 at 6/17/08 1:05 PM:
    --------------------------------------------------------------

    Now I have changed my App to use HSQLDB instead of H2-DB and I can use the performQuery without any problems. So the problem only occured wile using H2-DB.

    To create the Context I use this methode:
        private void createDBContext() {
            try {
                dbcontext = DataContext.getThreadDataContext();
            }
            catch(IllegalStateException ex) {
                // handle failure
                dbcontext = DataContext.createDataContext();
            }
        }

    I don't know if its normal to get a IllegalStateException at the line:
               dbcontext = DataContext.getThreadDataContext();

    But creating the context normal works fine for me.

    Thanks for hearing my problems.

          was (Author: pille):
        Now I have changed my App to use HSQLDB instead of H2-DB and I can use the performQuery without any problems. So the problem only why using H2-DB.

    To create the Context I use this methode:
        private void createDBContext() {
            try {
                dbcontext = DataContext.getThreadDataContext();
            }
            catch(IllegalStateException ex) {
                // handle failure
                dbcontext = DataContext.createDataContext();
            }
        }

    I don't know if its normal to get a IllegalStateException at the line:
               dbcontext = DataContext.getThreadDataContext();

    But creating the context normal works fine for me.

    Thanks for hearing my problems.

      
    > NullPointer in BaseQueryMetadata while executing Queri
    > ------------------------------------------------------
    >
    > Key: CAY-1071
    > URL: https://issues.apache.org/cayenne/browse/CAY-1071
    > Project: Cayenne
    > Issue Type: Bug
    > Components: Cayenne Core Library
    > Affects Versions: 3.0
    > Environment: openSuSE 10.3, Kernel Linux 2.6.22.17-0.1-default i686, Java 1.6.0_04
    > Reporter: Jürgen Seliger
    > Assignee: Andrus Adamchik
    >
    > I figured out a problem (NullPointerException) in Line at org.apache.cayenne.query.BaseQueryMetadata.resolve(BaseQueryMetadata.java:100) in BaseQueryMetadata class. The resolver in line 100
    > entity = resolver.lookupObjEntity((Class<?>) root);
    > is null and there is no check if there is so.
    > The methode getEntityResolver() in DataContext says it could be null. I also recommend to put the surrounding if-statement at the end of all if-else-statements, because all classes are instances of Class.
    > Hope I could help you, and you fixe the problem as soon as possible, because I want use cayenne for myself.
    > Dear
    > Jurgen Seliger

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



    This archive was generated by hypermail 2.0.0 : Tue Jun 17 2008 - 16:07:44 EDT