You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Jürgen Seliger (JIRA)" <de...@cayenne.apache.org> on 2008/06/09 23:20:52 UTC

[jira] Created: (CAY-1071) NullPointer in BaseQueryMetadata while executing Queri

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.


[jira] Commented: (CAY-1071) NullPointer in BaseQueryMetadata while executing Queri

Posted by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12944#action_12944 ] 

Andrus Adamchik commented on CAY-1071:
--------------------------------------

So why is "resolver" null? Could you post a full stack trace? It shouldn't be null under normal circumstances. 

> 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.


[jira] Commented: (CAY-1071) NullPointer in BaseQueryMetadata while executing Queri

Posted by "Jürgen Seliger (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12960#action_12960 ] 

Jürgen Seliger commented on CAY-1071:
-------------------------------------

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.


[jira] Commented: (CAY-1071) NullPointer in BaseQueryMetadata while executing Queri

Posted by "Jürgen Seliger (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12954#action_12954 ] 

Jürgen Seliger commented on CAY-1071:
-------------------------------------

In my Webapp I have  this line:
      List result = dbcontext.performQuery(select1);

And then I get this Error:
008-06-11 22:57:25,330 - ERROR (WebInitServlet.java:118) - Fehler: null
java.lang.NullPointerException
	at org.apache.cayenne.query.BaseQueryMetadata.resolve(BaseQueryMetadata.java:100)
	at org.apache.cayenne.query.SelectQueryMetadata.resolve(SelectQueryMetadata.java:45)
	at org.apache.cayenne.query.SelectQuery.getMetaData(SelectQuery.java:148)
	at org.apache.cayenne.util.ObjectContextQueryAction.<init>(ObjectContextQueryAction.java:79)
	at org.apache.cayenne.access.DataContextQueryAction.<init>(DataContextQueryAction.java:49)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325)
	at de.seliger.jsweb.db.DBUpdate.existsInitialTable(DBUpdate.java:79)
	at de.seliger.jsweb.db.DBUpdate.updateDB(DBUpdate.java:43)
	at de.seliger.jsweb.init.WebInitServlet.init(WebInitServlet.java:60)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
	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:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Before I created the context with this lines:
            try {
                dbcontext = DataContext.getThreadDataContext();
            }
            catch(IllegalStateException ex) {
                // handle failure
                dbcontext = DataContext.createDataContext();
            }

The line 
DataContext.getThreadDataContext();
throw an catch(IllegalStateException and I musst create a Context normal.



> 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.


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

Posted by "Jürgen Seliger (JIRA)" <de...@cayenne.apache.org>.
    [ 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.


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

Posted by "Jürgen Seliger (JIRA)" <de...@cayenne.apache.org>.
    [ 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:06 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 while 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 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.

  
> 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.


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

Posted by "Jürgen Seliger (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12954#action_12954 ] 

pille edited comment on CAY-1071 at 6/11/08 2:09 PM:
--------------------------------------------------------------

In my Webapp I have  this line:
      List result = dbcontext.performQuery(select1);

And then I get this Error:
008-06-11 22:57:25,330 - ERROR (WebInitServlet.java:118) - Fehler: null
java.lang.NullPointerException
	at org.apache.cayenne.query.BaseQueryMetadata.resolve(BaseQueryMetadata.java:100)
	at org.apache.cayenne.query.SelectQueryMetadata.resolve(SelectQueryMetadata.java:45)
	at org.apache.cayenne.query.SelectQuery.getMetaData(SelectQuery.java:148)
	at org.apache.cayenne.util.ObjectContextQueryAction.<init>(ObjectContextQueryAction.java:79)
	at org.apache.cayenne.access.DataContextQueryAction.<init>(DataContextQueryAction.java:49)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325)
	at de.seliger.jsweb.db.DBUpdate.existsInitialTable(DBUpdate.java:79)
	at de.seliger.jsweb.db.DBUpdate.updateDB(DBUpdate.java:43)
	at de.seliger.jsweb.init.WebInitServlet.init(WebInitServlet.java:60)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
	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:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Before I created the context with this lines:
            try {
                dbcontext = DataContext.getThreadDataContext();
            }
            catch(IllegalStateException ex) {
                // handle failure
                dbcontext = DataContext.createDataContext();
            }

The line 
DataContext.getThreadDataContext();
throw an catch(IllegalStateException and I musst create the context normal.



      was (Author: pille):
    In my Webapp I have  this line:
      List result = dbcontext.performQuery(select1);

And then I get this Error:
008-06-11 22:57:25,330 - ERROR (WebInitServlet.java:118) - Fehler: null
java.lang.NullPointerException
	at org.apache.cayenne.query.BaseQueryMetadata.resolve(BaseQueryMetadata.java:100)
	at org.apache.cayenne.query.SelectQueryMetadata.resolve(SelectQueryMetadata.java:45)
	at org.apache.cayenne.query.SelectQuery.getMetaData(SelectQuery.java:148)
	at org.apache.cayenne.util.ObjectContextQueryAction.<init>(ObjectContextQueryAction.java:79)
	at org.apache.cayenne.access.DataContextQueryAction.<init>(DataContextQueryAction.java:49)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1336)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1325)
	at de.seliger.jsweb.db.DBUpdate.existsInitialTable(DBUpdate.java:79)
	at de.seliger.jsweb.db.DBUpdate.updateDB(DBUpdate.java:43)
	at de.seliger.jsweb.init.WebInitServlet.init(WebInitServlet.java:60)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
	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:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Before I created the context with this lines:
            try {
                dbcontext = DataContext.getThreadDataContext();
            }
            catch(IllegalStateException ex) {
                // handle failure
                dbcontext = DataContext.createDataContext();
            }

The line 
DataContext.getThreadDataContext();
throw an catch(IllegalStateException and I musst create a Context normal.


  
> 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.