openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ян Программист <webautoma...@gmail.com>
Subject Re: OPENJPA-1642
Date Wed, 12 May 2010 14:39:36 GMT
Using ant to initiate enhancer brings risks and troubles for deploying to
production environment. So I created an external tool type builder for
Eclipse:

Location: /usr/bin/java

Working Directory: ${workspace_loc:/openJPA/src}

Arguments:

-classpath
/home/webautomator/openjpa-all-2.0.0-beta3.jar:${workspace_loc:/openJPA/src}:${workspace_loc:/openJPA/bin}
org.apache.openjpa.enhance.PCEnhancer -directory
${workspace_loc:/openJPA/bin} User Phone Address ContactInfo

So it looks like classes seam to be enhanced now. And I've got exception:

193  embeddables  INFO   [main] openjpa.Runtime - Starting OpenJPA
2.0.0-beta3
465  embeddables  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
"org.apache.openjpa.jdbc.sql.HSQLDictionary".
Exception in thread "main" &lt;openjpa-2.0.0-beta3-r422266:926797 fatal
store error&gt; org.apache.openjpa.persistence.RollbackException: user lacks
privilege or object not found: OPENJPA_SEQUENCE_TABLE {SELECT SEQUENCE_VALUE
FROM OPENJPA_SEQUENCE_TABLE WHERE ID = ?} [code=-5501, state=42501]
at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:573)
at Main.init(Main.java:79)
at Main.main(Main.java:32)
Caused by: &lt;openjpa-2.0.0-beta3-r422266:926797 fatal general error&gt;
org.apache.openjpa.persistence.PersistenceException: user lacks privilege or
object not found: OPENJPA_SEQUENCE_TABLE {SELECT SEQUENCE_VALUE FROM
OPENJPA_SEQUENCE_TABLE WHERE ID = ?} [code=-5501, state=42501]
at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4827)
at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4787)
at
org.apache.openjpa.jdbc.sql.HSQLDictionary.newStoreException(HSQLDictionary.java:318)
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:110)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62)
at
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:66)
at org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
at
org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:786)
at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:487)
at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:770)
at
org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
at
org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:605)
at
org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2952)
at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:40)
at
org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1047)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2060)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2020)
at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1938)
at
org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1462)
at
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:924)
at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:556)
... 2 more
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: user lacks
privilege or object not found: OPENJPA_SEQUENCE_TABLE {SELECT SEQUENCE_VALUE
FROM OPENJPA_SEQUENCE_TABLE WHERE ID = ?} [code=-5501, state=42501]
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:257)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:237)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$000(LoggingConnectionDecorator.java:70)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement(LoggingConnectionDecorator.java:289)
at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:186)
at
org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.prepareStatement(ConfiguringConnectionDecorator.java:155)
at
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:175)
at
org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:549)
at
org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:529)
at
org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:518)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.prepareStatement(TableJDBCSeq.java:806)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.getSequence(TableJDBCSeq.java:545)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.setSequence(TableJDBCSeq.java:587)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq$AllocateSequenceRunnable.run(TableJDBCSeq.java:892)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:454)
at
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:305)
at
org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
... 20 more

Interesting thing is that if I use one of the following syntaxes:

-classpath
/home/webautomator/openjpa-all-2.0.0-beta3.jar:${workspace_loc:/openJPA/src}:${workspace_loc:/openJPA/bin}
org.apache.openjpa.enhance.PCEnhancer -directory
${workspace_loc:/openJPA/bin} -scanDevPath=false
-enforcePropertyRestrictions=true User Phone Address ContactInfo


-classpath
/home/webautomator/openjpa-all-2.0.0-beta3.jar:${workspace_loc:/openJPA/src}:${workspace_loc:/openJPA/bin}
org.apache.openjpa.enhance.PCEnhancer -directory
${workspace_loc:/openJPA/bin} -enforcePropertyRestrictions=true User Phone
Address ContactInfo

I got following exception:

185  embeddables  INFO   [main] openjpa.Runtime - Starting OpenJPA
2.0.0-beta3
454  embeddables  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class
"org.apache.openjpa.jdbc.sql.HSQLDictionary".
Exception in thread "main" &lt;openjpa-2.0.0-beta3-r422266:926797 nonfatal
user error&gt; org.apache.openjpa.persistence.ArgumentException: This
configuration disallows runtime optimization, but the following listed types
were not enhanced at build time or at class load time with a javaagent: "
User".
at
org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:116)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:304)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:202)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:213)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:151)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:57)
at Main.main(Main.java:31)

Feels like a bug...

2010/5/9 Pinaki Poddar <ppoddar@apache.org>

>
> Enhance your classes at build-time and the problem will go away.
> Following properties ensure that OpenJPA runtime will *not* attempt dynamic
> enhancement
>         <property name="openjpa.DynamicEnhancementAgent" value="false"/>
>        <property name="openjpa.RuntimeUnenhancedClasses"
> value="unsupported"/>
>
> -----
> Pinaki
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/OPENJPA-1642-tp5024086p5027141.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message