Re: Missing ProductDerivation resource error

2007-01-09 Thread Rahul Thakur
okies, my work is progressing in trickles as I am squeezing some time 
outside work :-)


Here's the latest issue while trying to process a bunch of .class files 
with Enhancer. It seems my orm.xml is missing something that is causing 
the PersistenceMetaDataFactory parse operation to fail, but not sure 
what. I have setup only one very basic persistent entity to get started 
with. Any ideas? I tried googling for some orm.xml samples but not many 
examples.


TIA,
Rahul

[snip]
[ERROR]  Standard error from the OpenJPA Enhancer tool:
[ERROR] 
[ERROR] 109  openjpa  INFO   [main] openjpa.Tool - Enhancer running on 
type class org.apache.maven.continuum.model.project.Schedule.
Exception in thread main 0|false|0.9.7-incubating-SNAPSHOT 
org.apache.openjpa.util.GeneralException: org.xml.sax.SAXException: 
file:/E:/continuum-key-based-r
efactor/continuum-model/target/classes/META-INF/orm.xml [Location: Line: 
7, C: 94]: Type org.apacha.maven.continuum.model.project.Schedule 
could not be instant

iated.
   at 
org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML(PersistenceMetaDataFactory.java:231)
   at 
org.apache.openjpa.persistence.PersistenceMetaDataFactory.load(PersistenceMetaDataFactory.java:180)
   at 
org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:414)
   at 
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:272)
   at 
org.apache.openjpa.enhance.PCEnhancer.init(PCEnhancer.java:186)
   at 
org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:3680)
   at 
org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:3635)
   at 
org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:3607)
Caused by: java.io.IOException: org.xml.sax.SAXException: 
file:/E:/continuum-key-based-refactor/continuum-model/target/classes/META-INF/orm.xml 
[Location: Line:
7, C: 94]: Type org.apacha.maven.continuum.model.project.Schedule 
could not be instantiated.
   at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:373)
   at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:312)
   at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:289)
   at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:263)
   at 
org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML(PersistenceMetaDataFactory.java:229)

   ... 7 more
Caused by: org.xml.sax.SAXException: 
file:/E:/continuum-key-based-refactor/continuum-model/target/classes/META-INF/orm.xml 
[Location: Line: 7, C: 94]: Type org.
apacha.maven.continuum.model.project.Schedule could not be 
instantiated.
   at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.getException(XMLMetaDataParser.java:649)
   at 
org.apache.openjpa.lib.meta.CFMetaDataParser.classForName(CFMetaDataParser.java:281)
   at 
org.apache.openjpa.persistence.XMLPersistenceMetaDataParser.classForName(XMLPersistenceMetaDataParser.java:1642)
   at 
org.apache.openjpa.persistence.XMLPersistenceMetaDataParser.startClass(XMLPersistenceMetaDataParser.java:713)
   at 
org.apache.openjpa.lib.meta.CFMetaDataParser.startElement(CFMetaDataParser.java:102)
   at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.startElement(XMLMetaDataParser.java:426)
   at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
   at 
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:708)
   at 
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
   at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
   at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
   at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
   at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
   at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
   at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)

   at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
   at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:370)

   ... 11 more

[ERROR] 
[INFO] 
[ERROR] BUILD ERROR
[INFO] 
[INFO] The OpenJPA Enhancer tool exited with a non-null exit code.
[INFO] 

Re: Missing ProductDerivation resource error

2007-01-09 Thread Marc Prud'hommeaux

Rahul-

Did you misspell apache in  
org.apacha.maven.continuum.model.project.Schedule?





On Jan 9, 2007, at 12:53 AM, Rahul Thakur wrote:

okies, my work is progressing in trickles as I am squeezing some  
time outside work :-)


Here's the latest issue while trying to process a bunch of .class  
files with Enhancer. It seems my orm.xml is missing something that  
is causing the PersistenceMetaDataFactory parse operation to fail,  
but not sure what. I have setup only one very basic persistent  
entity to get started with. Any ideas? I tried googling for some  
orm.xml samples but not many examples.


TIA,
Rahul

[snip]
[ERROR]  Standard error from the OpenJPA Enhancer tool:
[ERROR] 
[ERROR] 109  openjpa  INFO   [main] openjpa.Tool - Enhancer running  
on type class org.apache.maven.continuum.model.project.Schedule.
Exception in thread main 0|false|0.9.7-incubating-SNAPSHOT  
org.apache.openjpa.util.GeneralException: org.xml.sax.SAXException:  
file:/E:/continuum-key-based-r
efactor/continuum-model/target/classes/META-INF/orm.xml [Location:  
Line: 7, C: 94]: Type  
org.apacha.maven.continuum.model.project.Schedule could not be  
instant

iated.
   at  
org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML 
(PersistenceMetaDataFactory.java:231)
   at  
org.apache.openjpa.persistence.PersistenceMetaDataFactory.load 
(PersistenceMetaDataFactory.java:180)
   at  
org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal 
(MetaDataRepository.java:414)
   at org.apache.openjpa.meta.MetaDataRepository.getMetaData 
(MetaDataRepository.java:272)
   at org.apache.openjpa.enhance.PCEnhancer.init 
(PCEnhancer.java:186)
   at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java: 
3680)
   at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java: 
3635)
   at org.apache.openjpa.enhance.PCEnhancer.main 
(PCEnhancer.java:3607)
Caused by: java.io.IOException: org.xml.sax.SAXException: file:/E:/ 
continuum-key-based-refactor/continuum-model/target/classes/META- 
INF/orm.xml [Location: Line:
7, C: 94]: Type org.apacha.maven.continuum.model.project.Schedule  
could not be instantiated.
   at  
org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource 
(XMLMetaDataParser.java:373)
   at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse 
(XMLMetaDataParser.java:312)
   at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse 
(XMLMetaDataParser.java:289)
   at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse 
(XMLMetaDataParser.java:263)
   at  
org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML 
(PersistenceMetaDataFactory.java:229)

   ... 7 more
Caused by: org.xml.sax.SAXException: file:/E:/continuum-key-based- 
refactor/continuum-model/target/classes/META-INF/orm.xml [Location:  
Line: 7, C: 94]: Type org.
apacha.maven.continuum.model.project.Schedule could not be  
instantiated.
   at org.apache.openjpa.lib.meta.XMLMetaDataParser.getException 
(XMLMetaDataParser.java:649)
   at org.apache.openjpa.lib.meta.CFMetaDataParser.classForName 
(CFMetaDataParser.java:281)
   at  
org.apache.openjpa.persistence.XMLPersistenceMetaDataParser.classForNa 
me(XMLPersistenceMetaDataParser.java:1642)
   at  
org.apache.openjpa.persistence.XMLPersistenceMetaDataParser.startClass 
(XMLPersistenceMetaDataParser.java:713)
   at org.apache.openjpa.lib.meta.CFMetaDataParser.startElement 
(CFMetaDataParser.java:102)
   at org.apache.openjpa.lib.meta.XMLMetaDataParser.startElement 
(XMLMetaDataParser.java:426)
   at  
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElem 
ent(AbstractSAXParser.java:533)
   at  
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startEle 
ment(XMLSchemaValidator.java:708)
   at  
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanS 
tartElement(XMLNSDocumentScannerImpl.java:330)
   at  
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl 
$FragmentContentDispatcher.dispatch 
(XMLDocumentFragmentScannerImpl.java:1693)
   at  
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl 
.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
   at  
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse 
(XML11Configuration.java:834)
   at  
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse 
(XML11Configuration.java:764)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse 
(XMLParser.java:148)
   at  
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse 
(AbstractSAXParser.java:1242)

   at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
   at  
org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource 
(XMLMetaDataParser.java:370)

   ... 11 more

[ERROR] 
[INFO]  
-- 
--

[ERROR] BUILD 

[jira] Created: (OPENJPA-96) Runtime Enhancement only processes first persistence unit defined in persistence.xml

2007-01-09 Thread Kevin Sutter (JIRA)
Runtime Enhancement only processes first persistence unit defined in 
persistence.xml


 Key: OPENJPA-96
 URL: https://issues.apache.org/jira/browse/OPENJPA-96
 Project: OpenJPA
  Issue Type: Bug
  Components: jpa
Reporter: Kevin Sutter


(This Issue may be related to OPENJPA-9, but since that one was specific to 
static PCEnhancing, I thought I would open a separate Issue.  Just in case the 
solutions are separate.)

I'm using dynamic runtime enhancement via the -javaagent parameter.  It seems 
that only the first persistence-unit defined in the persistence.xml is being 
processed for the runtime enhancement.  If the persistence.xml has only one 
entry, no problem.  But, if it has more than one entry, then only the first 
persistence-unit definition is being processed for the dynamic enhancement.

When I turn trace on, I get the following message when the runtime enhancement 
works:

8312  my persistence unit  INFO   [main] openjpa.MetaData - Found 1 classes 
with metadata in 0 milliseconds.
8943  my persistence unit  TRACE  [main] openjpa.Enhance - 
com/ibm/ws/persistence/tests/simple/TestEntity requires runtime enhancement: 
true
9043  my persistence unit  TRACE  [main] openjpa.MetaData - Loading metadata 
for class com.ibm.ws.persistence.tests.simple.TestEntity under mode 
[META][QUERY].

When this p-u definition is not first in my persistence.xml, the 8943 message 
is missing and my test fails:

8512  my persistence unit  INFO   [main] openjpa.MetaData - Found 1 classes 
with metadata in 0 milliseconds.
8522  my persistence unit  TRACE  [main] openjpa.MetaData - Using metadata 
factory [EMAIL PROTECTED].
8522  my persistence unit  TRACE  [main] openjpa.MetaData - Loading metadata 
for class com.ibm.ws.persistence.tests.simple.TestEntity under mode 
[META][QUERY].

I eventually get the following message when running the testcase:

4|false|0.0.0 org.apache.openjpa.persistence.ArgumentException: Attempt to 
cast instance [EMAIL PROTECTED] to PersistenceCapable failed.  Ensure that it 
has been enhanced.
FailedObject: [EMAIL PROTECTED]
at 
org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4234)
at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2344)
at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2204)
at 
org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:991)
at 
org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:525)
at 
com.ibm.ws.persistence.tests.simple.TestInsertAndFind.test001(TestInsertAndFind.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at 
org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at 
org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at 
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at 
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at 
org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at 
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
at 
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at 
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at 
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at 
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Thanks,
Kevin


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (OPENJPA-96) Runtime Enhancement only processes first persistence unit defined in persistence.xml

2007-01-09 Thread Kevin Sutter (JIRA)

[ 
https://issues.apache.org/jira/browse/OPENJPA-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463337
 ] 

Kevin Sutter commented on OPENJPA-96:
-

Looks like this is a duplicate of OPENJPA-78.  I will close this one out.

 Runtime Enhancement only processes first persistence unit defined in 
 persistence.xml
 

 Key: OPENJPA-96
 URL: https://issues.apache.org/jira/browse/OPENJPA-96
 Project: OpenJPA
  Issue Type: Bug
  Components: jpa
Reporter: Kevin Sutter

 (This Issue may be related to OPENJPA-9, but since that one was specific to 
 static PCEnhancing, I thought I would open a separate Issue.  Just in case 
 the solutions are separate.)
 I'm using dynamic runtime enhancement via the -javaagent parameter.  It seems 
 that only the first persistence-unit defined in the persistence.xml is being 
 processed for the runtime enhancement.  If the persistence.xml has only one 
 entry, no problem.  But, if it has more than one entry, then only the first 
 persistence-unit definition is being processed for the dynamic enhancement.
 When I turn trace on, I get the following message when the runtime 
 enhancement works:
 8312  my persistence unit  INFO   [main] openjpa.MetaData - Found 1 classes 
 with metadata in 0 milliseconds.
 8943  my persistence unit  TRACE  [main] openjpa.Enhance - 
 com/ibm/ws/persistence/tests/simple/TestEntity requires runtime 
 enhancement: true
 9043  my persistence unit  TRACE  [main] openjpa.MetaData - Loading metadata 
 for class com.ibm.ws.persistence.tests.simple.TestEntity under mode 
 [META][QUERY].
 When this p-u definition is not first in my persistence.xml, the 8943 
 message is missing and my test fails:
 8512  my persistence unit  INFO   [main] openjpa.MetaData - Found 1 classes 
 with metadata in 0 milliseconds.
 8522  my persistence unit  TRACE  [main] openjpa.MetaData - Using metadata 
 factory [EMAIL PROTECTED].
 8522  my persistence unit  TRACE  [main] openjpa.MetaData - Loading metadata 
 for class com.ibm.ws.persistence.tests.simple.TestEntity under mode 
 [META][QUERY].
 I eventually get the following message when running the testcase:
 4|false|0.0.0 org.apache.openjpa.persistence.ArgumentException: Attempt to 
 cast instance [EMAIL PROTECTED] to PersistenceCapable failed.  Ensure that 
 it has been enhanced.
 FailedObject: [EMAIL PROTECTED]
   at 
 org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4234)
   at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2344)
   at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2204)
   at 
 org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:991)
   at 
 org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:525)
   at 
 com.ibm.ws.persistence.tests.simple.TestInsertAndFind.test001(TestInsertAndFind.java:30)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:615)
   at 
 org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
   at 
 org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
   at 
 org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
   at 
 org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
   at 
 org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
   at 
 org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
   at 
 org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
   at 
 org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
   at 
 org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
   at 
 org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
   at 
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
   at 
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
 Thanks,
 Kevin


[jira] Resolved: (OPENJPA-96) Runtime Enhancement only processes first persistence unit defined in persistence.xml

2007-01-09 Thread Kevin Sutter (JIRA)

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

Kevin Sutter resolved OPENJPA-96.
-

Resolution: Duplicate

This is a dup of OPENJPA-78.  Not resolved yet, but the same problem is being 
reported.

 Runtime Enhancement only processes first persistence unit defined in 
 persistence.xml
 

 Key: OPENJPA-96
 URL: https://issues.apache.org/jira/browse/OPENJPA-96
 Project: OpenJPA
  Issue Type: Bug
  Components: jpa
Reporter: Kevin Sutter

 (This Issue may be related to OPENJPA-9, but since that one was specific to 
 static PCEnhancing, I thought I would open a separate Issue.  Just in case 
 the solutions are separate.)
 I'm using dynamic runtime enhancement via the -javaagent parameter.  It seems 
 that only the first persistence-unit defined in the persistence.xml is being 
 processed for the runtime enhancement.  If the persistence.xml has only one 
 entry, no problem.  But, if it has more than one entry, then only the first 
 persistence-unit definition is being processed for the dynamic enhancement.
 When I turn trace on, I get the following message when the runtime 
 enhancement works:
 8312  my persistence unit  INFO   [main] openjpa.MetaData - Found 1 classes 
 with metadata in 0 milliseconds.
 8943  my persistence unit  TRACE  [main] openjpa.Enhance - 
 com/ibm/ws/persistence/tests/simple/TestEntity requires runtime 
 enhancement: true
 9043  my persistence unit  TRACE  [main] openjpa.MetaData - Loading metadata 
 for class com.ibm.ws.persistence.tests.simple.TestEntity under mode 
 [META][QUERY].
 When this p-u definition is not first in my persistence.xml, the 8943 
 message is missing and my test fails:
 8512  my persistence unit  INFO   [main] openjpa.MetaData - Found 1 classes 
 with metadata in 0 milliseconds.
 8522  my persistence unit  TRACE  [main] openjpa.MetaData - Using metadata 
 factory [EMAIL PROTECTED].
 8522  my persistence unit  TRACE  [main] openjpa.MetaData - Loading metadata 
 for class com.ibm.ws.persistence.tests.simple.TestEntity under mode 
 [META][QUERY].
 I eventually get the following message when running the testcase:
 4|false|0.0.0 org.apache.openjpa.persistence.ArgumentException: Attempt to 
 cast instance [EMAIL PROTECTED] to PersistenceCapable failed.  Ensure that 
 it has been enhanced.
 FailedObject: [EMAIL PROTECTED]
   at 
 org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4234)
   at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2344)
   at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2204)
   at 
 org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:991)
   at 
 org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:525)
   at 
 com.ibm.ws.persistence.tests.simple.TestInsertAndFind.test001(TestInsertAndFind.java:30)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:615)
   at 
 org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
   at 
 org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
   at 
 org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
   at 
 org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
   at 
 org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
   at 
 org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
   at 
 org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
   at 
 org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
   at 
 org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
   at 
 org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
   at 
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
   at 
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
   at 
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
 

Re: Deadlock when insert in t1 and find in t2

2007-01-09 Thread Vlad Tatavu
Kevin,

I use the MappingTool to create the db before I run the test program, so I 
don't have to specify any classes (i.e. class) in my persistence.xml - 
we don't really want to have to specify classes in persistence.xml because 
in the real project there are a lot of classes that use OpenJPA and the 
development cycle is obviously much shorter if developers don't have to 
worry about keeping the list of classes in synch.

Since my code doesn't hang in 100% of the executions, it's obvious that 
it's about a race condition - so it may be difficult to reproduce on other 
machines.  Based on what I know about OpenJPA, specifying the class 
element(s) in persistence.xml will cause the enhancer to touch only the 
specified classes, so I think it's expected that this problem will be much 
more difficult (if not impossible) to reproduce in this case.

I use exactly the same Derby and Java versions.

I changed the openjpa.Log as you suggested and I still get the deadlock 
(as expected).  The extra info in the log doesn't mean much to me, 
unfortunately.  The stack traces in the java dump look much more 
interesting, but I don't know enough about OpenJPA to be able to draw any 
conclusions.

I'll zip up my test Eclipse project and the Java dump and send them 
directly to you - if you don't mind.  It looks like the mailing list 
server removes all attachments.
--
Best regards,
Vlad Tatavu
Provisioning  Orchestration Development, IBM Tivoli Toronto
[EMAIL PROTECTED]
Office (905) 413-3853



Kevin Sutter [EMAIL PROTECTED] 
09/01/2007 11:01 AM
Please respond to
open-jpa-dev@incubator.apache.org


To
open-jpa-dev@incubator.apache.org
cc

Subject
Re: Deadlock when insert in t1 and find in t2






Vlad,
Using your provided class, testcase, and persistence.xml (I'll try to 
append them and see if it works), I can not reproduce your problem.  I 
have discovered several other anomolies, but not the one you are 
describing. 

One item that I did have to modify is to specify the specific class 
entry in your persistence.xml.  Without this, the automatic SchemaMapping 
doesn't kick in.

But, after doing that, whether I use runtime enhancement or static 
enhancement, I can not reproduce the problem.  I am using the following 
Derby version... 

databaseProductName: Apache Derby
databaseProductVersion: 10.2.1.6 - (452058)
driverName: Apache Derby Embedded JDBC Driver
driverVersion: 10.2.1.6 - (452058)

And, my Java version is as follows...

C:\temp\playjava -version
java version 1.5.0
Java(TM) 2 Runtime Environment, Standard Edition (build pwi32dev-20061002a 
(SR3))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 
j9vmwi3223-20061001 (JIT enabled)
J9VM - 20060915_08260_lHdSMR
JIT  - 20060908_1811_r8
GC   - 20060906_AA)
JCL  - 20061002

You might want to change your trace level so as to get more help with the 
problem... 

property name=openjpa.Log value=DefaultLevel=TRACE, 
SQL=TRACE/

Let us know what you find out.

Thanks,
Kevin

On 1/8/07, Marc Prud'hommeaux [EMAIL PROTECTED] wrote:
Vlad-

Interesting ... looks like it has something to do with an interaction
between the JVM and the PCClassFileTransformer agent (responsible for
enhancing the entity classes at runtime). If you manually enhance 
your entities and then run without the -javaagent flag, do you ever
get the deadlock?




On Jan 8, 2007, at 12:25 PM, Vlad Tatavu wrote:

 Yeah, it looks like the attachments were removed by the list 
 server.  I'm
 using Derby.  Here are the stack traces for the two threads
 involved in
 the deadlock:

 3XMTHREADINFO  main (TID:0x0015EC00, sys_thread_t:0x00358470, 
 state:B, native ID:0x17B4) prio=5
 4XESTACKTRACE  at
 com/ibm/oti/vm/BootstrapClassLoader.loadClass
 (BootstrapClassLoader.java:63(Compiled
 Code))
 4XESTACKTRACE  at 
 java/lang/ClassLoader.loadClass(ClassLoader.java:587(Compiled Code))
 4XESTACKTRACE  at
 java/lang/ClassLoader.loadClass(ClassLoader.java:587(Compiled Code))
 4XESTACKTRACE  at 
 sun/misc/Launcher$AppClassLoader.loadClass(Launcher.java:327(Compiled
 Code))
 4XESTACKTRACE  at
 java/lang/ClassLoader.loadClass(ClassLoader.java:563(Compiled Code))
 4XESTACKTRACE  at java/lang/ClassLoader.defineClassImpl(Native 
 Method)
 4XESTACKTRACE  at
 java/lang/ClassLoader.defineClass(ClassLoader.java:223(Compiled Code))
 4XESTACKTRACE  at
 java/security/SecureClassLoader.defineClass(SecureClassLoader.java :
 148(Compiled
 Code))
 4XESTACKTRACE  at
 java/net/URLClassLoader.defineClass(URLClassLoader.java:556(Compiled
 Code))
 4XESTACKTRACE  at
 java/net/URLClassLoader.access$400( URLClassLoader.java:119(Compiled
 Code))
 4XESTACKTRACE  at
 java/net/URLClassLoader$ClassFinder.run(URLClassLoader.java:957
 (Compiled
 Code))
 4XESTACKTRACE  at
 java/security/AccessController.doPrivileged(AccessController.java:275)
 4XESTACKTRACE  at
 

[jira] Closed: (OPENJPA-63) Better pessimistic lock support for DB2 v8.2+

2007-01-09 Thread Kevin Sutter (JIRA)

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

Kevin Sutter closed OPENJPA-63.
---


 Better pessimistic lock support for DB2 v8.2+
 -

 Key: OPENJPA-63
 URL: https://issues.apache.org/jira/browse/OPENJPA-63
 Project: OpenJPA
  Issue Type: Improvement
  Components: jdbc
 Environment: IBM DB2 UDB v8.2 or later
Reporter: Igor Fedorenko
 Assigned To: Kevin Sutter
 Attachments: db2-selectForUpdate.patch, 
 db2-selectForUpdate2.patch.diff


 There is new SELECT FOR READ ONLY WITH RS USE AND KEEP EXCLUSIVE LOCKS 
 syntax in DB2 v8.2 and later that can be used to implement pessimistic locks 
 for selects with multiple from tables, subselects, inner/outer joins and so 
 forth. I'll attach simple patch shortly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




Re: Configuration: either / or ?

2007-01-09 Thread Matthieu Riou

If I don't set openjpa.ConnectionDriverName (and even if I set 
openjpa.ConnectionFactory with my datasource instance) I get the A JDBC
Driver or DataSource class name must be specified in the
ConnectionDriverName property error. So I'm getting more and more confused
as to which properties I should set...

On 1/8/07, Marc Prud'hommeaux [EMAIL PROTECTED] wrote:


Matthieu-

I think you want openjpa.ConnectionFactory, not
openjpa.ConnectionDriverName.



On Jan 8, 2007, at 9:45 AM, Matthieu Riou wrote:

 Hi,

 I've just tried your fix after compiling the OpenJPA trunk. I'm
 getting a
 ClassCastException as the openjpa.ConnectionDriverName is set as a
 StringValue. Should I use another property instead?

 My code:

propMap.put(openjpa.jdbc.DBDictionary, 
 org.apache.openjpa.jdbc.sql.DerbyDictionary);
propMap.put(openjpa.ManagedRuntime, new TxMgrProvider());
propMap.put(openjpa.ConnectionDriverName, _datasource);
propMap.put(openjpa.Log, DefaultLevel=TRACE);
EntityManagerFactory emf =
 Persistence.createEntityManagerFactory(ode-dao,
 propMap);
EntityManager em = emf.createEntityManager();

 The exception:

 0|true|0.9.7-incubating-SNAPSHOT
 org.apache.openjpa.persistence.PersistenceException: There was an
 error when
 invoking the static newInstance method on the named factory class 
 org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.  See the nested
 exception
 for details.
at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(
 Bootstrap.java:62)
at
 org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMan
 agerFactory
 (PersistenceProviderImpl.java:70)
at
 org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMan
 agerFactory
 (PersistenceProviderImpl.java:78)
at javax.persistence.Persistence.createEntityManagerFactory(
 Persistence.java:83)
at org.apache.ode.axis2.ODEServerJPA.initJPA
 (ODEServerJPA.java:345)
at org.apache.ode.axis2.ODEServerJPA.init(ODEServerJPA.java:96)
at org.apache.ode.axis2.hooks.ODEAxisServlet.init(
 ODEAxisServlet.java:50)
at org.apache.catalina.core.StandardWrapper.loadServlet(
 StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(
 StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(
 StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(
 StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(
 ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(
 ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild
 (StandardHost.java
 :524)
at org.apache.catalina.startup.HostConfig.deployWAR
 (HostConfig.java
 :809)
at org.apache.catalina.startup.HostConfig.deployWARs
 (HostConfig.java
 :698)
at org.apache.catalina.startup.HostConfig.deployApps
 (HostConfig.java
 :472)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java
 :1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(
 HostConfig.java:310)
at
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
 LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start
 (ContainerBase.java
 :1021)
at org.apache.catalina.core.StandardHost.start
 (StandardHost.java
 :718)
at org.apache.catalina.core.ContainerBase.start
 (ContainerBase.java
 :1013)
at org.apache.catalina.core.StandardEngine.start
 (StandardEngine.java
 :442)
at org.apache.catalina.core.StandardService.start(
 StandardService.java:450)
at org.apache.catalina.core.StandardServer.start
 (StandardServer.java
 :709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:
 551)
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:585)
at org.apache.catalina.startup.Bootstrap.start
 (Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:
 432)
 Caused by: org.apache.openjpa.lib.util.ParseException:
 ConnectionDriverName:
 [EMAIL PROTECTED]
at org.apache.openjpa.lib.conf.Value.setObject(Value.java:298)
at
 org.apache.openjpa.lib.conf.ConfigurationImpl.fromProperties(
 ConfigurationImpl.java:627)
at
 org.apache.openjpa.lib.conf.MapConfigurationProvider.setInto(
 MapConfigurationProvider.java:82)
at
 org.apache.openjpa.persistence.PersistenceProductDerivation
 $ConfigurationProviderImpl.setInto
 (PersistenceProductDerivation.java:406)
at
 org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(
 JDBCBrokerFactory.java:56)
at 

Re: [jira] Created: (OPENJPA-96) Runtime Enhancement only processes first persistence unit defined in persistence.xml

2007-01-09 Thread Vlad Tatavu
I know.  I just said that because it is somehow related...
--
Best regards,
Vlad Tatavu
Provisioning  Orchestration Development, IBM Tivoli Toronto
[EMAIL PROTECTED]
Office (905) 413-3853



Kevin Sutter [EMAIL PROTECTED] 
09/01/2007 12:20 PM
Please respond to
open-jpa-dev@incubator.apache.org


To
open-jpa-dev@incubator.apache.org
cc

Subject
Re: [jira] Created: (OPENJPA-96) Runtime Enhancement only processes first 
persistence unit defined in persistence.xml






Vlad,
I'm currently not specifying a persistence file on the javaagent 
parameter.
I only specify where to find the class files for kicking off the runtime
enhancement:

-javaagent:C:/eclipse.workspaces/3.2rc2/openjpa/openjpa-all/target/openjpa-
all-0.9.7-incubating-SNAPSHOT.jar

I let the runtime find my persistence.xml file in my META-INF directory.

Kevin

On 1/9/07, Vlad Tatavu [EMAIL PROTECTED] wrote:

 Being able to specify multiple persistence files as args for the 
javaagent
 would be VERY useful as well.  Currently, only one file name can be 
passed
 as arg to the javaagent.
 --
 Best regards,
 Vlad Tatavu
 Provisioning  Orchestration Development, IBM Tivoli Toronto
 [EMAIL PROTECTED]
 Office (905) 413-3853



 Igor Fedorenko [EMAIL PROTECTED]
 09/01/2007 11:56 AM
 Please respond to
 open-jpa-dev@incubator.apache.org


 To
 open-jpa-dev@incubator.apache.org
 cc

 Subject
 Re: [jira] Created: (OPENJPA-96) Runtime Enhancement only processes 
first
 persistence unit defined in persistence.xml






 Does this bugreport cover persistent units defined in different
 persistence.xml files too? If I am not mistaken, OpenJPA looks at first
 persistent unit of randomly chosen persistence.xml file.

 - Original Message 
 From: Kevin Sutter (JIRA) [EMAIL PROTECTED]
 To: open-jpa-dev@incubator.apache.org
 Sent: Tuesday, January 9, 2007 11:41:27 AM
 Subject: [jira] Created: (OPENJPA-96) Runtime Enhancement only processes
 first persistence unit defined in persistence.xml

 Runtime Enhancement only processes first persistence unit defined in
 persistence.xml

 


  Key: OPENJPA-96
  URL: https://issues.apache.org/jira/browse/OPENJPA-96
  Project: OpenJPA
   Issue Type: Bug
   Components: jpa
 Reporter: Kevin Sutter


 (This Issue may be related to OPENJPA-9, but since that one was specific
 to static PCEnhancing, I thought I would open a separate Issue.  Just in
 case the solutions are separate.)

 I'm using dynamic runtime enhancement via the -javaagent parameter.  It
 seems that only the first persistence-unit defined in the 
persistence.xml
 is being processed for the runtime enhancement.  If the persistence.xml
 has only one entry, no problem.  But, if it has more than one entry, 
then
 only the first persistence-unit definition is being processed for the
 dynamic enhancement.

 When I turn trace on, I get the following message when the runtime
 enhancement works:

 8312  my persistence unit  INFO   [main] openjpa.MetaData - Found 1
 classes with metadata in 0 milliseconds.
 8943  my persistence unit  TRACE  [main] openjpa.Enhance -
 com/ibm/ws/persistence/tests/simple/TestEntity requires runtime
 enhancement: true
 9043  my persistence unit  TRACE  [main] openjpa.MetaData - Loading
 metadata for class com.ibm.ws.persistence.tests.simple.TestEntity 
under
 mode [META][QUERY].

 When this p-u definition is not first in my persistence.xml, the 8943
 message is missing and my test fails:

 8512  my persistence unit  INFO   [main] openjpa.MetaData - Found 1
 classes with metadata in 0 milliseconds.
 8522  my persistence unit  TRACE  [main] openjpa.MetaData - Using 
metadata
 factory
 
[EMAIL PROTECTED].
 8522  my persistence unit  TRACE  [main] openjpa.MetaData - Loading
 metadata for class com.ibm.ws.persistence.tests.simple.TestEntity 
under
 mode [META][QUERY].

 I eventually get the following message when running the testcase:

 4|false|0.0.0 org.apache.openjpa.persistence.ArgumentException: 
Attempt
 to cast instance 
[EMAIL PROTECTED]
 to PersistenceCapable failed.  Ensure that it has been enhanced.
 FailedObject: [EMAIL PROTECTED]
 at
 org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(
 BrokerImpl.java:4234)
 at 
org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2344)
 at 
org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2204)
 at
 org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java
 :991)
 at
 org.apache.openjpa.persistence.EntityManagerImpl.persist(
 EntityManagerImpl.java:525)
 at
 com.ibm.ws.persistence.tests.simple.TestInsertAndFind.test001(
 TestInsertAndFind.java:30)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
 :64)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(
 

Re: Deadlock when insert in t1 and find in t2

2007-01-09 Thread Craig L Russell

Hi Vlad,

It might be easier for you to file a JIRA and upload your test case  
to it.


Craig

On Jan 9, 2007, at 8:56 AM, Vlad Tatavu wrote:



Kevin,

I use the MappingTool to create the db before I run the test  
program, so I don't have to specify any classes (i.e. class) in  
my persistence.xml - we don't really want to have to specify  
classes in persistence.xml because in the real project there are a  
lot of classes that use OpenJPA and the development cycle is  
obviously much shorter if developers don't have to worry about  
keeping the list of classes in synch.


Since my code doesn't hang in 100% of the executions, it's obvious  
that it's about a race condition - so it may be difficult to  
reproduce on other machines.  Based on what I know about OpenJPA,  
specifying the class element(s) in persistence.xml will cause the  
enhancer to touch only the specified classes, so I think it's  
expected that this problem will be much more difficult (if not  
impossible) to reproduce in this case.


I use exactly the same Derby and Java versions.

I changed the openjpa.Log as you suggested and I still get the  
deadlock (as expected).  The extra info in the log doesn't mean  
much to me, unfortunately.  The stack traces in the java dump look  
much more interesting, but I don't know enough about OpenJPA to be  
able to draw any conclusions.


I'll zip up my test Eclipse project and the Java dump and send them  
directly to you - if you don't mind.  It looks like the mailing  
list server removes all attachments.

--
Best regards,
Vlad Tatavu
Provisioning  Orchestration Development, IBM Tivoli Toronto
[EMAIL PROTECTED]
Office (905) 413-3853


Kevin Sutter [EMAIL PROTECTED]
09/01/2007 11:01 AM
Please respond to
open-jpa-dev@incubator.apache.org


To
open-jpa-dev@incubator.apache.org
cc
Subject
Re: Deadlock when insert in t1 and find in t2





Vlad,
Using your provided class, testcase, and persistence.xml (I'll try  
to append them and see if it works), I can not reproduce your  
problem.  I have discovered several other anomolies, but not the  
one you are describing.


One item that I did have to modify is to specify the specific  
class entry in your persistence.xml.  Without this, the automatic  
SchemaMapping doesn't kick in.


But, after doing that, whether I use runtime enhancement or static  
enhancement, I can not reproduce the problem.  I am using the  
following Derby version...


databaseProductName: Apache Derby
databaseProductVersion: 10.2.1.6 - (452058)
driverName: Apache Derby Embedded JDBC Driver
driverVersion: 10.2.1.6 - (452058)

And, my Java version is as follows...

C:\temp\playjava -version
java version 1.5.0
Java(TM) 2 Runtime Environment, Standard Edition (build  
pwi32dev-20061002a (SR3))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32  
j9vmwi3223-20061001 (JIT enabled)

J9VM - 20060915_08260_lHdSMR
JIT  - 20060908_1811_r8
GC   - 20060906_AA)
JCL  - 20061002

You might want to change your trace level so as to get more help  
with the problem...


   property name=openjpa.Log value=DefaultLevel=TRACE,  
SQL=TRACE/


Let us know what you find out.

Thanks,
Kevin

On 1/8/07, Marc Prud'hommeaux [EMAIL PROTECTED] wrote:
Vlad-

Interesting ... looks like it has something to do with an interaction
between the JVM and the PCClassFileTransformer agent (responsible for
enhancing the entity classes at runtime). If you manually enhance
your entities and then run without the -javaagent flag, do you ever
get the deadlock?




On Jan 8, 2007, at 12:25 PM, Vlad Tatavu wrote:

 Yeah, it looks like the attachments were removed by the list
 server.  I'm
 using Derby.  Here are the stack traces for the two threads
 involved in
 the deadlock:

 3XMTHREADINFO  main (TID:0x0015EC00, sys_thread_t:0x00358470,
 state:B, native ID:0x17B4) prio=5
 4XESTACKTRACE  at
 com/ibm/oti/vm/BootstrapClassLoader.loadClass
 (BootstrapClassLoader.java:63(Compiled
 Code))
 4XESTACKTRACE  at
 java/lang/ClassLoader.loadClass(ClassLoader.java:587(Compiled Code))
 4XESTACKTRACE  at
 java/lang/ClassLoader.loadClass(ClassLoader.java:587(Compiled Code))
 4XESTACKTRACE  at
 sun/misc/Launcher$AppClassLoader.loadClass(Launcher.java:327 
(Compiled

 Code))
 4XESTACKTRACE  at
 java/lang/ClassLoader.loadClass(ClassLoader.java:563(Compiled Code))
 4XESTACKTRACE  at java/lang/ClassLoader.defineClassImpl 
(Native

 Method)
 4XESTACKTRACE  at
 java/lang/ClassLoader.defineClass(ClassLoader.java:223(Compiled  
Code))

 4XESTACKTRACE  at
 java/security/SecureClassLoader.defineClass(SecureClassLoader.java :
 148(Compiled
 Code))
 4XESTACKTRACE  at
 java/net/URLClassLoader.defineClass(URLClassLoader.java:556(Compiled
 Code))
 4XESTACKTRACE  at
 java/net/URLClassLoader.access$400( URLClassLoader.java:119(Compiled
 Code))
 4XESTACKTRACE  at
 java/net/URLClassLoader$ClassFinder.run(URLClassLoader.java:957
 (Compiled
 Code))
 

Property access validation rules (was: RE: Troubleshooting help)

2007-01-09 Thread Patrick Linskey
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Monday, January 08, 2007 9:01 PM
 To: open-jpa-dev@incubator.apache.org
 Subject: Troubleshooting help
 
 ...
 
  [java] 6222  WARN   [OCDriverAllOpsAgent[0].0] 
 openjpa.Enhance - Detected the following possible violations 
 of the restrictions placed on property access persistent types:
  [java] pb.common.Assembly uses property access, but 
 its field purchased is accessed directly in method 
 writeObject defined in pb.common.Assembly.
  [java] pb.common.Assembly uses property access, but 
 its field planner is accessed directly in method 
 readObject defined in pb.common.Assembly.

I understand that writeObject() should not be using fields directly, but
it would seem to me that it's fine for readObject() to set fields
directly, since readObject() is (presumably) only invoked during
deserialization, and during deserialization an instance cannot be
managed.

It would seem that we should special-case 'void
readObject(ObjectOutputStream)', 'Object readResolve()', and
'Externalizable.readExternal(ObjectInput)'. 

Also, given the text in 2.1.1 of the JPA spec:

If property-based access is used and lazy fetching is 
specified, portable applications should not directly
access the entity state underlying the property methods 
of managed instances until after it has been fetched by 
the persistence provider.

we might want to not generate warnings for read access to fields that
are in the default fetch group.

Thoughts?

-Patrick
___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.