You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Daniel Persson <ma...@gmail.com> on 2012/05/11 09:15:02 UTC

QueryCache don't allow for misconfigurations

Hi.

Might have found a "bug".

This could be replicated with a malformed persistence.xml. You have to
create a configuration without any classes specified then the QueryCache
will throw a null pointer exception.

104  test  INFO   [main] openjpa.Enhance - You have enabled runtime
enhancement, but have not specified the set of persistent classes.  OpenJPA
must look for metadata for every loaded class, which might increase class
load times significantly.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.
212  test  INFO   [main] openjpa.Runtime - OpenJPA dynamically loaded a
validation provider.
292  test  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.2.0
410  test  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
"org.apache.openjpa.jdbc.sql.MySQLDictionary".
Exception in thread "main" <openjpa-2.2.0-r422266:1244990 nonfatal general
error> org.apache.openjpa.persistence.PersistenceException: null
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:218)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
at org.ea.test.TestAdd.main(TestAdd.java:20)
Caused by: java.lang.NullPointerException
at
org.apache.openjpa.datacache.AbstractQueryCache.initialize(AbstractQueryCache.java:112)
at
org.apache.openjpa.datacache.ConcurrentQueryCache.initialize(ConcurrentQueryCache.java:95)
at
org.apache.openjpa.datacache.DataCacheManagerImpl.initialize(DataCacheManagerImpl.java:64)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getDataCacheManagerInstance(OpenJPAConfigurationImpl.java:725)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.createDelegatingStoreManager(AbstractBrokerFactory.java:843)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:226)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
... 5 more


Best regards

Daniel

Re: QueryCache don't allow for misconfigurations

Posted by Dmitry Pavlov <id...@ufanet.ru>.
Hi all,

May be someone looks to other bug connected with Query Cache  (to be 
precise Prepared SQL Query Cache) :
https://issues.apache.org/jira/browse/OPENJPA-2147

Thank you in advance.

Sincerely,

Dmitry Pavlov



12.05.2012 15:49, Daniel Persson пишет:
> Hi Rick.
>
> Open OPENJPA-2191<https://issues.apache.org/jira/browse/OPENJPA-2191>
>
> Best regards
>
> Daniel
>
> On Fri, May 11, 2012 at 8:39 PM, Rick Curtis<cu...@gmail.com>  wrote:
>
>> Can I have you open a JIRA for this issue?
>>
>> Thanks,
>> Rick
>>
>> On Fri, May 11, 2012 at 1:17 PM, Daniel Persson<mailto.woden@gmail.com
>>> wrote:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence
>> "
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="
>>> http://java.sun.com/xml/ns/persistence
>>> http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
>>> <persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
>>>     <properties>
>>>         <property name="openjpa.ConnectionURL"
>>> value="jdbc:mysql://localhost:3306/test"/>
>>>         <property name="openjpa.ConnectionUserName" value="root"/>
>>>         <property name="openjpa.ConnectionPassword" value="hack123"/>
>>>         <property name="openjpa.ConnectionDriverName"
>>> value="com.mysql.jdbc.Driver"/>
>>>         <property name="openjpa.Log" value="DefaultLevel=INFO,
>>> Runtime=INFO, Tool=INFO, SQL=INFO"/>
>>>         <property name="openjpa.ConnectionFactoryProperties"
>>> value="MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=1800000"/>
>>>         <property name="openjpa.jdbc.DBDictionary"
>>> value="org.apache.openjpa.jdbc.sql.MySQLDictionary"/>
>>> <property name="openjpa.jdbc.SynchronizeMappings"
>>> value="buildSchema(ForeignKeys=true)"/>
>>>         <property name="openjpa.DataCache" value="true(CacheSize=1000,
>>> SoftReferenceSize=0)"/>
>>>         <property name="openjpa.QueryCache" value="true(CacheSize=1000,
>>> SoftReferenceSize=0, EvictPolicy='timestamp')"/>
>>>          <property name="openjpa.DetachState"
>>> value="fetch-groups(DetachedStateField=true)"/>
>>>         <property name="openjpa.jdbc.UpdateManager"
>>> value="operation-order"/>
>>>     </properties>
>>> </persistence-unit>
>>> </persistence>
>>>
>>> On Fri, May 11, 2012 at 2:15 PM, Rick Curtis<cu...@gmail.com>  wrote:
>>>
>>>> Please post the persistence.xml file you were that led to this
>> exception.
>>>> Thanks, Rick
>>>> On May 11, 2012 2:15 AM, "Daniel Persson"<ma...@gmail.com>
>>> wrote:
>>>>> Hi.
>>>>>
>>>>> Might have found a "bug".
>>>>>
>>>>> This could be replicated with a malformed persistence.xml. You have
>> to
>>>>> create a configuration without any classes specified then the
>>> QueryCache
>>>>> will throw a null pointer exception.
>>>>>
>>>>> 104  test  INFO   [main] openjpa.Enhance - You have enabled runtime
>>>>> enhancement, but have not specified the set of persistent classes.
>>>>   OpenJPA
>>>>> must look for metadata for every loaded class, which might increase
>>> class
>>>>> load times significantly.
>>>>> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
>>>>> SLF4J: Defaulting to no-operation (NOP) logger implementation
>>>>> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
>>>> further
>>>>> details.
>>>>> 212  test  INFO   [main] openjpa.Runtime - OpenJPA dynamically
>> loaded a
>>>>> validation provider.
>>>>> 292  test  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.2.0
>>>>> 410  test  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
>>>>> "org.apache.openjpa.jdbc.sql.MySQLDictionary".
>>>>> Exception in thread "main"<openjpa-2.2.0-r422266:1244990 nonfatal
>>>> general
>>>>> error>  org.apache.openjpa.persistence.PersistenceException: null
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:218)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>>>>> at org.ea.test.TestAdd.main(TestAdd.java:20)
>>>>> Caused by: java.lang.NullPointerException
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.datacache.AbstractQueryCache.initialize(AbstractQueryCache.java:112)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.datacache.ConcurrentQueryCache.initialize(ConcurrentQueryCache.java:95)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.datacache.DataCacheManagerImpl.initialize(DataCacheManagerImpl.java:64)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getDataCacheManagerInstance(OpenJPAConfigurationImpl.java:725)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.createDelegatingStoreManager(AbstractBrokerFactory.java:843)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:226)
>>>>> at
>>>>>
>>>>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>>>>> ... 5 more
>>>>>
>>>>>
>>>>> Best regards
>>>>>
>>>>> Daniel
>>>>>
>>
>>
>> --
>> *Rick Curtis*
>>


Re: QueryCache don't allow for misconfigurations

Posted by Daniel Persson <ma...@gmail.com>.
Hi Rick.

Open OPENJPA-2191 <https://issues.apache.org/jira/browse/OPENJPA-2191>

Best regards

Daniel

On Fri, May 11, 2012 at 8:39 PM, Rick Curtis <cu...@gmail.com> wrote:

> Can I have you open a JIRA for this issue?
>
> Thanks,
> Rick
>
> On Fri, May 11, 2012 at 1:17 PM, Daniel Persson <mailto.woden@gmail.com
> >wrote:
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence
> "
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="
> > http://java.sun.com/xml/ns/persistence
> > http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
> > <persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
> >    <properties>
> >        <property name="openjpa.ConnectionURL"
> > value="jdbc:mysql://localhost:3306/test"/>
> >        <property name="openjpa.ConnectionUserName" value="root"/>
> >        <property name="openjpa.ConnectionPassword" value="hack123"/>
> >        <property name="openjpa.ConnectionDriverName"
> > value="com.mysql.jdbc.Driver"/>
> >        <property name="openjpa.Log" value="DefaultLevel=INFO,
> > Runtime=INFO, Tool=INFO, SQL=INFO"/>
> >        <property name="openjpa.ConnectionFactoryProperties"
> > value="MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=1800000"/>
> >        <property name="openjpa.jdbc.DBDictionary"
> > value="org.apache.openjpa.jdbc.sql.MySQLDictionary"/>
> > <property name="openjpa.jdbc.SynchronizeMappings"
> > value="buildSchema(ForeignKeys=true)"/>
> >        <property name="openjpa.DataCache" value="true(CacheSize=1000,
> > SoftReferenceSize=0)"/>
> >        <property name="openjpa.QueryCache" value="true(CacheSize=1000,
> > SoftReferenceSize=0, EvictPolicy='timestamp')"/>
> >         <property name="openjpa.DetachState"
> > value="fetch-groups(DetachedStateField=true)"/>
> >        <property name="openjpa.jdbc.UpdateManager"
> > value="operation-order"/>
> >    </properties>
> > </persistence-unit>
> > </persistence>
> >
> > On Fri, May 11, 2012 at 2:15 PM, Rick Curtis <cu...@gmail.com> wrote:
> >
> > > Please post the persistence.xml file you were that led to this
> exception.
> > >
> > > Thanks, Rick
> > > On May 11, 2012 2:15 AM, "Daniel Persson" <ma...@gmail.com>
> > wrote:
> > >
> > > > Hi.
> > > >
> > > > Might have found a "bug".
> > > >
> > > > This could be replicated with a malformed persistence.xml. You have
> to
> > > > create a configuration without any classes specified then the
> > QueryCache
> > > > will throw a null pointer exception.
> > > >
> > > > 104  test  INFO   [main] openjpa.Enhance - You have enabled runtime
> > > > enhancement, but have not specified the set of persistent classes.
> > >  OpenJPA
> > > > must look for metadata for every loaded class, which might increase
> > class
> > > > load times significantly.
> > > > SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> > > > SLF4J: Defaulting to no-operation (NOP) logger implementation
> > > > SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
> > > further
> > > > details.
> > > > 212  test  INFO   [main] openjpa.Runtime - OpenJPA dynamically
> loaded a
> > > > validation provider.
> > > > 292  test  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.2.0
> > > > 410  test  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
> > > > "org.apache.openjpa.jdbc.sql.MySQLDictionary".
> > > > Exception in thread "main" <openjpa-2.2.0-r422266:1244990 nonfatal
> > > general
> > > > error> org.apache.openjpa.persistence.PersistenceException: null
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:218)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> > > > at org.ea.test.TestAdd.main(TestAdd.java:20)
> > > > Caused by: java.lang.NullPointerException
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.datacache.AbstractQueryCache.initialize(AbstractQueryCache.java:112)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.datacache.ConcurrentQueryCache.initialize(ConcurrentQueryCache.java:95)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.datacache.DataCacheManagerImpl.initialize(DataCacheManagerImpl.java:64)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getDataCacheManagerInstance(OpenJPAConfigurationImpl.java:725)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.createDelegatingStoreManager(AbstractBrokerFactory.java:843)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:226)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> > > > ... 5 more
> > > >
> > > >
> > > > Best regards
> > > >
> > > > Daniel
> > > >
> > >
> >
>
>
>
> --
> *Rick Curtis*
>

Re: QueryCache don't allow for misconfigurations

Posted by Rick Curtis <cu...@gmail.com>.
Can I have you open a JIRA for this issue?

Thanks,
Rick

On Fri, May 11, 2012 at 1:17 PM, Daniel Persson <ma...@gmail.com>wrote:

> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
> <persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
>    <properties>
>        <property name="openjpa.ConnectionURL"
> value="jdbc:mysql://localhost:3306/test"/>
>        <property name="openjpa.ConnectionUserName" value="root"/>
>        <property name="openjpa.ConnectionPassword" value="hack123"/>
>        <property name="openjpa.ConnectionDriverName"
> value="com.mysql.jdbc.Driver"/>
>        <property name="openjpa.Log" value="DefaultLevel=INFO,
> Runtime=INFO, Tool=INFO, SQL=INFO"/>
>        <property name="openjpa.ConnectionFactoryProperties"
> value="MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=1800000"/>
>        <property name="openjpa.jdbc.DBDictionary"
> value="org.apache.openjpa.jdbc.sql.MySQLDictionary"/>
> <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(ForeignKeys=true)"/>
>        <property name="openjpa.DataCache" value="true(CacheSize=1000,
> SoftReferenceSize=0)"/>
>        <property name="openjpa.QueryCache" value="true(CacheSize=1000,
> SoftReferenceSize=0, EvictPolicy='timestamp')"/>
>         <property name="openjpa.DetachState"
> value="fetch-groups(DetachedStateField=true)"/>
>        <property name="openjpa.jdbc.UpdateManager"
> value="operation-order"/>
>    </properties>
> </persistence-unit>
> </persistence>
>
> On Fri, May 11, 2012 at 2:15 PM, Rick Curtis <cu...@gmail.com> wrote:
>
> > Please post the persistence.xml file you were that led to this exception.
> >
> > Thanks, Rick
> > On May 11, 2012 2:15 AM, "Daniel Persson" <ma...@gmail.com>
> wrote:
> >
> > > Hi.
> > >
> > > Might have found a "bug".
> > >
> > > This could be replicated with a malformed persistence.xml. You have to
> > > create a configuration without any classes specified then the
> QueryCache
> > > will throw a null pointer exception.
> > >
> > > 104  test  INFO   [main] openjpa.Enhance - You have enabled runtime
> > > enhancement, but have not specified the set of persistent classes.
> >  OpenJPA
> > > must look for metadata for every loaded class, which might increase
> class
> > > load times significantly.
> > > SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> > > SLF4J: Defaulting to no-operation (NOP) logger implementation
> > > SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
> > further
> > > details.
> > > 212  test  INFO   [main] openjpa.Runtime - OpenJPA dynamically loaded a
> > > validation provider.
> > > 292  test  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.2.0
> > > 410  test  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
> > > "org.apache.openjpa.jdbc.sql.MySQLDictionary".
> > > Exception in thread "main" <openjpa-2.2.0-r422266:1244990 nonfatal
> > general
> > > error> org.apache.openjpa.persistence.PersistenceException: null
> > > at
> > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:218)
> > > at
> > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> > > at
> > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> > > at
> > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
> > > at
> > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> > > at org.ea.test.TestAdd.main(TestAdd.java:20)
> > > Caused by: java.lang.NullPointerException
> > > at
> > >
> > >
> >
> org.apache.openjpa.datacache.AbstractQueryCache.initialize(AbstractQueryCache.java:112)
> > > at
> > >
> > >
> >
> org.apache.openjpa.datacache.ConcurrentQueryCache.initialize(ConcurrentQueryCache.java:95)
> > > at
> > >
> > >
> >
> org.apache.openjpa.datacache.DataCacheManagerImpl.initialize(DataCacheManagerImpl.java:64)
> > > at
> > >
> > >
> >
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getDataCacheManagerInstance(OpenJPAConfigurationImpl.java:725)
> > > at
> > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.createDelegatingStoreManager(AbstractBrokerFactory.java:843)
> > > at
> > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:226)
> > > at
> > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> > > ... 5 more
> > >
> > >
> > > Best regards
> > >
> > > Daniel
> > >
> >
>



-- 
*Rick Curtis*

Re: QueryCache don't allow for misconfigurations

Posted by Daniel Persson <ma...@gmail.com>.
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
    <properties>
        <property name="openjpa.ConnectionURL"
value="jdbc:mysql://localhost:3306/test"/>
        <property name="openjpa.ConnectionUserName" value="root"/>
        <property name="openjpa.ConnectionPassword" value="hack123"/>
        <property name="openjpa.ConnectionDriverName"
value="com.mysql.jdbc.Driver"/>
        <property name="openjpa.Log" value="DefaultLevel=INFO,
Runtime=INFO, Tool=INFO, SQL=INFO"/>
        <property name="openjpa.ConnectionFactoryProperties"
value="MaxActive=10,MaxIdle=5,MinIdle=2,MaxWait=1800000"/>
        <property name="openjpa.jdbc.DBDictionary"
value="org.apache.openjpa.jdbc.sql.MySQLDictionary"/>
<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/>
        <property name="openjpa.DataCache" value="true(CacheSize=1000,
SoftReferenceSize=0)"/>
        <property name="openjpa.QueryCache" value="true(CacheSize=1000,
SoftReferenceSize=0, EvictPolicy='timestamp')"/>
         <property name="openjpa.DetachState"
value="fetch-groups(DetachedStateField=true)"/>
        <property name="openjpa.jdbc.UpdateManager"
value="operation-order"/>
    </properties>
</persistence-unit>
</persistence>

On Fri, May 11, 2012 at 2:15 PM, Rick Curtis <cu...@gmail.com> wrote:

> Please post the persistence.xml file you were that led to this exception.
>
> Thanks, Rick
> On May 11, 2012 2:15 AM, "Daniel Persson" <ma...@gmail.com> wrote:
>
> > Hi.
> >
> > Might have found a "bug".
> >
> > This could be replicated with a malformed persistence.xml. You have to
> > create a configuration without any classes specified then the QueryCache
> > will throw a null pointer exception.
> >
> > 104  test  INFO   [main] openjpa.Enhance - You have enabled runtime
> > enhancement, but have not specified the set of persistent classes.
>  OpenJPA
> > must look for metadata for every loaded class, which might increase class
> > load times significantly.
> > SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> > SLF4J: Defaulting to no-operation (NOP) logger implementation
> > SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
> further
> > details.
> > 212  test  INFO   [main] openjpa.Runtime - OpenJPA dynamically loaded a
> > validation provider.
> > 292  test  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.2.0
> > 410  test  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
> > "org.apache.openjpa.jdbc.sql.MySQLDictionary".
> > Exception in thread "main" <openjpa-2.2.0-r422266:1244990 nonfatal
> general
> > error> org.apache.openjpa.persistence.PersistenceException: null
> > at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:218)
> > at
> >
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> > at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> > at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
> > at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> > at org.ea.test.TestAdd.main(TestAdd.java:20)
> > Caused by: java.lang.NullPointerException
> > at
> >
> >
> org.apache.openjpa.datacache.AbstractQueryCache.initialize(AbstractQueryCache.java:112)
> > at
> >
> >
> org.apache.openjpa.datacache.ConcurrentQueryCache.initialize(ConcurrentQueryCache.java:95)
> > at
> >
> >
> org.apache.openjpa.datacache.DataCacheManagerImpl.initialize(DataCacheManagerImpl.java:64)
> > at
> >
> >
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getDataCacheManagerInstance(OpenJPAConfigurationImpl.java:725)
> > at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.createDelegatingStoreManager(AbstractBrokerFactory.java:843)
> > at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:226)
> > at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> > ... 5 more
> >
> >
> > Best regards
> >
> > Daniel
> >
>

Re: QueryCache don't allow for misconfigurations

Posted by Rick Curtis <cu...@gmail.com>.
Please post the persistence.xml file you were that led to this exception.

Thanks, Rick
On May 11, 2012 2:15 AM, "Daniel Persson" <ma...@gmail.com> wrote:

> Hi.
>
> Might have found a "bug".
>
> This could be replicated with a malformed persistence.xml. You have to
> create a configuration without any classes specified then the QueryCache
> will throw a null pointer exception.
>
> 104  test  INFO   [main] openjpa.Enhance - You have enabled runtime
> enhancement, but have not specified the set of persistent classes.  OpenJPA
> must look for metadata for every loaded class, which might increase class
> load times significantly.
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: Defaulting to no-operation (NOP) logger implementation
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
> details.
> 212  test  INFO   [main] openjpa.Runtime - OpenJPA dynamically loaded a
> validation provider.
> 292  test  INFO   [main] openjpa.Runtime - Starting OpenJPA 2.2.0
> 410  test  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
> "org.apache.openjpa.jdbc.sql.MySQLDictionary".
> Exception in thread "main" <openjpa-2.2.0-r422266:1244990 nonfatal general
> error> org.apache.openjpa.persistence.PersistenceException: null
> at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:218)
> at
>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
> at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> at org.ea.test.TestAdd.main(TestAdd.java:20)
> Caused by: java.lang.NullPointerException
> at
>
> org.apache.openjpa.datacache.AbstractQueryCache.initialize(AbstractQueryCache.java:112)
> at
>
> org.apache.openjpa.datacache.ConcurrentQueryCache.initialize(ConcurrentQueryCache.java:95)
> at
>
> org.apache.openjpa.datacache.DataCacheManagerImpl.initialize(DataCacheManagerImpl.java:64)
> at
>
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getDataCacheManagerInstance(OpenJPAConfigurationImpl.java:725)
> at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.createDelegatingStoreManager(AbstractBrokerFactory.java:843)
> at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:226)
> at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> ... 5 more
>
>
> Best regards
>
> Daniel
>