Re: Configuration: either / or ?

2007-01-09 Thread Marc Prud'hommeaux

Matthieu-

The following code works for me against the most recent OpenJPA build:

org.apache.derby.jdbc.EmbeddedDataSource ds =
new org.apache.derby.jdbc.EmbeddedDataSource();
ds.setDatabaseName("testdb");
ds.setCreateDatabase("create");

Map props = new HashMap();
props.put("openjpa.ConnectionFactory", ds);

EntityManagerFactory emf = Persistence.
createEntityManagerFactory("", props);
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.getTransaction().commit();
em.close();
emf.close();


Can you try again with the most recent snapshot and see if you still  
get the error?




On Jan 9, 2007, at 1:07 PM, Matthieu Riou wrote:


So if I do:

   propMap.put("openjpa.ConnectionDriverName",
org.apache.derby.jdbc.EmbeddedDriver.class.getName());
   propMap.put("openjpa.ConnectionFactoryName",
org.apache.derby.jdbc.EmbeddedDriver.class.getName());
   propMap.put("openjpa.ConnectionFactory", _datasource);

It tries to lookup ConnectionFactoryName in JNDI which doesn't  
work. If I

remove ConnectionFactoryName and keep the other 2 it instantiates the
EmbeddedDriver itself and ignores the datasource instance I provided.

Another idea?

On 1/9/07, Marc Prud'hommeaux <[EMAIL PROTECTED]> wrote:


Matthieu-

We may not be expecting you to just manually set the DataSource. Try
setting the "openjpa.ConnectionFactory" property to the DataSource
object you are using, and then set "openjpa.ConnectionFactoryName" to
some bogus string and see what happens.

If there is an error, be sure to post the complete stack trace.



On Jan 9, 2007, at 9:11 AM, Matthieu Riou wrote:

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

>> n
>> > agerFactory
>> > (PersistenceProviderImpl.java:70)
>> >at
>> >
>>  
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMa

>> n
>> > 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
>> > (HostC

Re: Missing ProductDerivation resource error

2007-01-09 Thread Rahul Thakur
The plugin needs to be built and published just like other OpenJPA 
modules on to a Maven repository and the users can then choose to 
reference it in pom.xml for respective projects.


Rahul

Patrick Linskey wrote:

Definitely! I know nothing about Maven plugins; what's involved in
getting the plugin available for Maven users? Also, it'd be neat if we
could move our own integration test suite (in openjpa-persistence-jdbc)
to use it.

-Patrick

  


Re: Configuration: either / or ?

2007-01-09 Thread Matthieu Riou

So if I do:

   propMap.put("openjpa.ConnectionDriverName",
org.apache.derby.jdbc.EmbeddedDriver.class.getName());
   propMap.put("openjpa.ConnectionFactoryName",
org.apache.derby.jdbc.EmbeddedDriver.class.getName());
   propMap.put("openjpa.ConnectionFactory", _datasource);

It tries to lookup ConnectionFactoryName in JNDI which doesn't work. If I
remove ConnectionFactoryName and keep the other 2 it instantiates the
EmbeddedDriver itself and ignores the datasource instance I provided.

Another idea?

On 1/9/07, Marc Prud'hommeaux <[EMAIL PROTECTED]> wrote:


Matthieu-

We may not be expecting you to just manually set the DataSource. Try
setting the "openjpa.ConnectionFactory" property to the DataSource
object you are using, and then set "openjpa.ConnectionFactoryName" to
some bogus string and see what happens.

If there is an error, be sure to post the complete stack trace.



On Jan 9, 2007, at 9:11 AM, Matthieu Riou wrote:

> 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.createEntityMa
>> n
>> > agerFactory
>> > (PersistenceProviderImpl.java:70)
>> >at
>> >
>> org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMa
>> n
>> > 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)

RE: Missing ProductDerivation resource error

2007-01-09 Thread Patrick Linskey
Definitely! I know nothing about Maven plugins; what's involved in
getting the plugin available for Maven users? Also, it'd be neat if we
could move our own integration test suite (in openjpa-persistence-jdbc)
to use it.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

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

> -Original Message-
> From: Rahul Thakur [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 09, 2007 11:04 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: Missing ProductDerivation resource error
> 
> duh! silly me :p
> 
> Thanks for spotting that, Marc! BTW, looks like the enhancer 
> mojo worked 
> on that class .yay! now's time to clean it up a bit!
> 
> Would you guys be OK if I start a new module for OpenJPA maven plugin 
> under Mojo sandbox?
> 
> Thanks again for the help!
> 
> Cheers,
> Rahul
> 
> 
> - Original Message - 
> From: "Marc Prud'hommeaux" <[EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, January 09, 2007 9:58 PM
> Subject: Re: Missing ProductDerivation resource error
> 
> 
> > 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. 
> >> (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

Re: Missing ProductDerivation resource error

2007-01-09 Thread Rahul Thakur

duh! silly me :p

Thanks for spotting that, Marc! BTW, looks like the enhancer mojo worked 
on that class .yay! now's time to clean it up a bit!


Would you guys be OK if I start a new module for OpenJPA maven plugin 
under Mojo sandbox?


Thanks again for the help!

Cheers,
Rahul


- Original Message - 
From: "Marc Prud'hommeaux" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, January 09, 2007 9:58 PM
Subject: Re: Missing ProductDerivation resource error



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

[jira] Commented: (OPENJPA-98) Java deadlock when insert in t1 and find in t2 when using IBM JVM 1.5.0

2007-01-09 Thread Vlad Tatavu (JIRA)

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

Vlad Tatavu commented on OPENJPA-98:


I cannot reproduce this problem with Sun JDK 1.5.0_04.

> Java deadlock when insert in t1 and find in t2 when using IBM JVM 1.5.0
> ---
>
> Key: OPENJPA-98
> URL: https://issues.apache.org/jira/browse/OPENJPA-98
> Project: OpenJPA
>  Issue Type: Bug
> Environment: OpenJPA:
> 0.9.6
> Java:
> 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-2006100
> 1 (JIT enabled)
> J9VM - 20060915_08260_lHdSMR
> JIT  - 20060908_1811_r8
> GC   - 20060906_AA)
> JCL  - 20061002
> DB:
> Derby 10.2.1.6
>Reporter: Vlad Tatavu
> Attachments: console.txt, javacore.20070109.114312.3868.zip, play.zip
>
>
> I have a simple test program that uses OpenJPA 0.9.6 to insert an object into 
> a db in one transaction (t1) and retrieve it in another transaction (t2).  
> The program hangs in 30-50% of the executions right before the call to 
> entitymanager.find() (used to retrieve the object in t2).  I'm using OpenJPA 
> runtime enhancement.
> By looking at the JVM dump, I can see the following deadlock:
> 1LKDEADLOCKDeadlock detected !!!
> NULL   -
> NULL   
> 2LKDEADLOCKTHR  Thread "main" (0x0015EC00)
> 3LKDEADLOCKWTRis waiting for:
> 4LKDEADLOCKMON  sys_mon_t:0x41E40548 infl_mon_t: 0x41E40588:
> 4LKDEADLOCKOBJ  java/lang/[EMAIL PROTECTED]/00D4101C: 
> 3LKDEADLOCKOWNwhich is owned by:
> 2LKDEADLOCKTHR  Thread "Finalizer thread" (0x41B36200)
> 3LKDEADLOCKWTRwhich is waiting for:
> 4LKDEADLOCKMON  sys_mon_t:0x0035CD38 infl_mon_t: 0x0035CD78:
> 4LKDEADLOCKOBJ  sun/misc/[EMAIL PROTECTED]/00D4E5BC: 
> 3LKDEADLOCKOWNwhich is owned by:
> 2LKDEADLOCKTHR  Thread "main" (0x0015EC00)

-- 
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-98) Java deadlock when insert in t1 and find in t2 when using IBM JVM 1.5.0

2007-01-09 Thread Vlad Tatavu (JIRA)

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

Vlad Tatavu commented on OPENJPA-98:


Attachments:
play.zip - the Eclipse project used to reproduce this problem
javacore.20070109.114312.3868.zip - java dump after the deadlock occured
console.txt - java console of the test program after the deadlock occured

> Java deadlock when insert in t1 and find in t2 when using IBM JVM 1.5.0
> ---
>
> Key: OPENJPA-98
> URL: https://issues.apache.org/jira/browse/OPENJPA-98
> Project: OpenJPA
>  Issue Type: Bug
> Environment: OpenJPA:
> 0.9.6
> Java:
> 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-2006100
> 1 (JIT enabled)
> J9VM - 20060915_08260_lHdSMR
> JIT  - 20060908_1811_r8
> GC   - 20060906_AA)
> JCL  - 20061002
> DB:
> Derby 10.2.1.6
>Reporter: Vlad Tatavu
> Attachments: console.txt, javacore.20070109.114312.3868.zip, play.zip
>
>
> I have a simple test program that uses OpenJPA 0.9.6 to insert an object into 
> a db in one transaction (t1) and retrieve it in another transaction (t2).  
> The program hangs in 30-50% of the executions right before the call to 
> entitymanager.find() (used to retrieve the object in t2).  I'm using OpenJPA 
> runtime enhancement.
> By looking at the JVM dump, I can see the following deadlock:
> 1LKDEADLOCKDeadlock detected !!!
> NULL   -
> NULL   
> 2LKDEADLOCKTHR  Thread "main" (0x0015EC00)
> 3LKDEADLOCKWTRis waiting for:
> 4LKDEADLOCKMON  sys_mon_t:0x41E40548 infl_mon_t: 0x41E40588:
> 4LKDEADLOCKOBJ  java/lang/[EMAIL PROTECTED]/00D4101C: 
> 3LKDEADLOCKOWNwhich is owned by:
> 2LKDEADLOCKTHR  Thread "Finalizer thread" (0x41B36200)
> 3LKDEADLOCKWTRwhich is waiting for:
> 4LKDEADLOCKMON  sys_mon_t:0x0035CD38 infl_mon_t: 0x0035CD78:
> 4LKDEADLOCKOBJ  sun/misc/[EMAIL PROTECTED]/00D4E5BC: 
> 3LKDEADLOCKOWNwhich is owned by:
> 2LKDEADLOCKTHR  Thread "main" (0x0015EC00)

-- 
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] Updated: (OPENJPA-98) Java deadlock when insert in t1 and find in t2 when using IBM JVM 1.5.0

2007-01-09 Thread Vlad Tatavu (JIRA)

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

Vlad Tatavu updated OPENJPA-98:
---

Attachment: console.txt
javacore.20070109.114312.3868.zip
play.zip

> Java deadlock when insert in t1 and find in t2 when using IBM JVM 1.5.0
> ---
>
> Key: OPENJPA-98
> URL: https://issues.apache.org/jira/browse/OPENJPA-98
> Project: OpenJPA
>  Issue Type: Bug
> Environment: OpenJPA:
> 0.9.6
> Java:
> 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-2006100
> 1 (JIT enabled)
> J9VM - 20060915_08260_lHdSMR
> JIT  - 20060908_1811_r8
> GC   - 20060906_AA)
> JCL  - 20061002
> DB:
> Derby 10.2.1.6
>Reporter: Vlad Tatavu
> Attachments: console.txt, javacore.20070109.114312.3868.zip, play.zip
>
>
> I have a simple test program that uses OpenJPA 0.9.6 to insert an object into 
> a db in one transaction (t1) and retrieve it in another transaction (t2).  
> The program hangs in 30-50% of the executions right before the call to 
> entitymanager.find() (used to retrieve the object in t2).  I'm using OpenJPA 
> runtime enhancement.
> By looking at the JVM dump, I can see the following deadlock:
> 1LKDEADLOCKDeadlock detected !!!
> NULL   -
> NULL   
> 2LKDEADLOCKTHR  Thread "main" (0x0015EC00)
> 3LKDEADLOCKWTRis waiting for:
> 4LKDEADLOCKMON  sys_mon_t:0x41E40548 infl_mon_t: 0x41E40588:
> 4LKDEADLOCKOBJ  java/lang/[EMAIL PROTECTED]/00D4101C: 
> 3LKDEADLOCKOWNwhich is owned by:
> 2LKDEADLOCKTHR  Thread "Finalizer thread" (0x41B36200)
> 3LKDEADLOCKWTRwhich is waiting for:
> 4LKDEADLOCKMON  sys_mon_t:0x0035CD38 infl_mon_t: 0x0035CD78:
> 4LKDEADLOCKOBJ  sun/misc/[EMAIL PROTECTED]/00D4E5BC: 
> 3LKDEADLOCKOWNwhich is owned by:
> 2LKDEADLOCKTHR  Thread "main" (0x0015EC00)

-- 
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] Created: (OPENJPA-98) Java deadlock when insert in t1 and find in t2 when using IBM JVM 1.5.0

2007-01-09 Thread Vlad Tatavu (JIRA)
Java deadlock when insert in t1 and find in t2 when using IBM JVM 1.5.0
---

 Key: OPENJPA-98
 URL: https://issues.apache.org/jira/browse/OPENJPA-98
 Project: OpenJPA
  Issue Type: Bug
 Environment: OpenJPA:
0.9.6

Java:
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-2006100
1 (JIT enabled)
J9VM - 20060915_08260_lHdSMR
JIT  - 20060908_1811_r8
GC   - 20060906_AA)
JCL  - 20061002

DB:
Derby 10.2.1.6
Reporter: Vlad Tatavu


I have a simple test program that uses OpenJPA 0.9.6 to insert an object into a 
db in one transaction (t1) and retrieve it in another transaction (t2).  The 
program hangs in 30-50% of the executions right before the call to 
entitymanager.find() (used to retrieve the object in t2).  I'm using OpenJPA 
runtime enhancement.


By looking at the JVM dump, I can see the following deadlock:
1LKDEADLOCKDeadlock detected !!!
NULL   -
NULL   
2LKDEADLOCKTHR  Thread "main" (0x0015EC00)
3LKDEADLOCKWTRis waiting for:
4LKDEADLOCKMON  sys_mon_t:0x41E40548 infl_mon_t: 0x41E40588:
4LKDEADLOCKOBJ  java/lang/[EMAIL PROTECTED]/00D4101C: 
3LKDEADLOCKOWNwhich is owned by:
2LKDEADLOCKTHR  Thread "Finalizer thread" (0x41B36200)
3LKDEADLOCKWTRwhich is waiting for:
4LKDEADLOCKMON  sys_mon_t:0x0035CD38 infl_mon_t: 0x0035CD78:
4LKDEADLOCKOBJ  sun/misc/[EMAIL PROTECTED]/00D4E5BC: 
3LKDEADLOCKOWNwhich is owned by:
2LKDEADLOCKTHR  Thread "main" (0x0015EC00)


-- 
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 Marc Prud'hommeaux

Matthieu-

We may not be expecting you to just manually set the DataSource. Try  
setting the "openjpa.ConnectionFactory" property to the DataSource  
object you are using, and then set "openjpa.ConnectionFactoryName" to  
some bogus string and see what happens.


If there is an error, be sure to post the complete stack trace.



On Jan 9, 2007, at 9:11 AM, Matthieu Riou wrote:


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

> agerFactory
> (PersistenceProviderImpl.java:70)
>at
>  
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMa 
n

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

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.


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. ) 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  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  
 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\play>java -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...


   


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

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.

Re: Deadlock when insert in t1 and find in t2

2007-01-09 Thread Kevin Sutter

Fair enough.  I saw the Schema Mapping property in your persistence.xml, so
I assumed that you were using this feature.

   

I'll try to reproduce it later with this new information.

Thanks,
Kevin

On 1/9/07, Vlad Tatavu <[EMAIL PROTECTED]> 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. ) 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 
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 
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\play>java -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...

   

Let us know what you find out.

Thanks,
Kevin

On 1/8/07, *Marc Prud'hommeaux* <[EMAIL PROTECTED]<[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
>

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

2007-01-09 Thread Kevin Sutter

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

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

2007-01-09 Thread Kevin Sutter

Haven't specifically tried that.  But, given the current processing that I
found, it would be consistent that it only processes the first
persistence.xml file that is found.

On 1/9/07, Igor Fedorenko <[EMAIL PROTECTED]> wrote:


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

[jira] Created: (OPENJPA-97) Runtime Enhancement without entries in persistence.xml fails while attempting to process non-Entity classes

2007-01-09 Thread Kevin Sutter (JIRA)
Runtime Enhancement without  entries in persistence.xml fails while 
attempting to process non-Entity classes
---

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


When using dynamic Runtime Enhancement (-javaagent) and not having the explicit 
set of classes defined in persistence.xml, the processing gets sick once in a 
while.  It starts off fine with the appropriate warning...

160  my persistence unit  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.

It then starts parsing (and processing) every package and class that gets 
loaded...

210  my persistence unit  INFO   [main] openjpa.MetaData - Parsing class 
"org.eclipse.jdt.internal.junit.runner.RemoteTestRunner".
210  my persistence unit  INFO   [main] openjpa.MetaData - Parsing package 
"org.eclipse.jdt.internal.junit.runner.RemoteTestRunner".
230  my persistence unit  INFO   [main] openjpa.MetaData - Parsing class 
"org.eclipse.jdt.internal.junit.runner.MessageSender".
230  my persistence unit  INFO   [main] openjpa.MetaData - Parsing class 
"org.eclipse.jdt.internal.junit.runner.IVisitsTestTrees".
230  my persistence unit  INFO   [main] openjpa.MetaData - Parsing class 
"org.eclipse.jdt.internal.junit.runner.IListensToTestExecutions".
:
:

But, it also hits "warnings" similar to the following:

530  my persistence unit  WARN   [main] openjpa.Enhance - An exception was 
thrown while attempting to perform class file transformation on "$Proxy3":
<0|false|0.0.0> org.apache.openjpa.util.GeneralException: $Proxy3
at 
org.apache.openjpa.enhance.PCClassFileTransformer.needsEnhance(PCClassFileTransformer.java:179)
at 
org.apache.openjpa.enhance.PCClassFileTransformer.transform(PCClassFileTransformer.java:117)
at 
sun.instrument.TransformerManager.transform(TransformerManager.java:141)
at 
sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:174)
at java.lang.reflect.Proxy.defineClass0(Native Method)
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:515)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:592)
at 
com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:34)
at 
com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(AnnotationHelper.java:50)
at com.ibm.oti.reflect.Method.getDeclaredAnnotations(Method.java:31)
at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:704)
at 
java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:191)
at com.ibm.oti.reflect.Method.getAnnotation(Method.java:20)
at java.lang.reflect.Method.getAnnotation(Method.java:693)
at 
org.junit.internal.runners.TestIntrospector.getTestMethods(TestIntrospector.java:28)
at 
org.junit.internal.runners.TestClassMethodsRunner.(TestClassMethodsRunner.java:27)
at 
org.junit.internal.runners.TestClassRunner.(TestClassRunner.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
at 
org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.(JUnit4TestReference.java:26)
at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.(JUnit4TestClassReference.java:24)
at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:34)
at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:24)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
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)
Caused by: java.lang.ClassNotFoundException: $Proxy3
at java.lang.Class.forName(Class.java:160)
at 
org.apache.openjpa.enhance.PCClassFileTransformer.needsEnhance(PCClassFileTransformer.java:171)
... 29 more

There are similar ClassNotFoundExceptions for the following classes that 

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

2007-01-09 Thread Vlad Tatavu
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(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 
or

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:40

[jira] Closed: (OPENJPA-24) Allow OpenJPA to be extensible

2007-01-09 Thread Kevin Sutter (JIRA)

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

Kevin Sutter closed OPENJPA-24.
---


Housecleaning...

> Allow OpenJPA to be extensible
> --
>
> Key: OPENJPA-24
> URL: https://issues.apache.org/jira/browse/OPENJPA-24
> Project: OpenJPA
>  Issue Type: Bug
>  Components: kernel
>Reporter: Kevin Sutter
> Assigned To: Kevin Sutter
>
> The current OpenJPA architecture is not extendable to other implementations.  
> For example, if somebody wanted to provide their own PersistenceProvider 
> implementation, simply extending the 
> org.apache.openjpa.PersistenceProviderImpl would not suffice due to the 
> dependencies in the ConfigurationProviderImpl.  The discussion for this 
> improvement was started on the dev mailing list.  Once it was determined that 
> there was more to this request than a simple conditional or two, we decided 
> to open a JIRA report.
> The complete history of this request can be found in the OpenJPA dev mailing 
> list.  The first message was posted by me (Kevin Sutter) on August 14, titled 
> "Extending the OpenJPA Implementation".  I will attempt to paraphrase the 
> current state of the problem...
> We have three main players in this issue.  The PersistenceProvider, the 
> ConfigurationProvider, and the ProductDerivation (along with the various 
> implementations of these interfaces).  Currently, the ConfigurationProvider 
> is in the lib and is unaware of any specific persistence requirements.  The 
> ProductDerivation is in the kernel and, unfortunately, is aware of 
> persistence requirements, specifically the spec and store types.  Abe's 
> postings have indicated that we need to make these two interfaces more aware 
> of each other and work with each other.  We need to start with either making 
> ConfigurationProvider more persistence-aware and move it into kernel, or make 
> ProductDerivations less persistence-aware and move it into lib.  The latter 
> approach is preferred.
> After we get this re-organization of the base framework complete, we still 
> have a couple of other issues ot resolve:
> *  Still need the ability to extend EMF's through a ProductDerivation.  
> This should be doable by adding a new PluginValue to indicate what class of 
> EMF to load.
> *  There is still a question as to whether we will need to provide a 
> custom PersistenceProviderImpl and ConfigurationProviderImpl pair.  I still 
> think this will be necessary.   And, one of Abe's posts indicated that this 
> might help with class loading issues when multiple versions of OpenJPA-based 
> implementations are available in the same system.
> I also posted these questions last Friday.  (Abe has responded with some 
> answers, but I wanted to get this JIRA report created before trying to 
> paraphrase his answers.)
> *  You mention in several places about separating away the notion of 
> specs and stores.  In a general sense, I understand what these are.  But, can 
> you elaborate on how these types are used in the ConfigurationProvider and 
> ProductDerivation interfaces?
> * I've moved the ProductDerivation interface to the lib and added the 
> "load" methods from the ConfigurationProvider (as described in your previous 
> notes).  And, I've started to clean up the implementations that depend on 
> these interfaces.  But, concerning the implementation of the load methods...  
> Now that we need to return a ConfigurationProvider, would you expect that we 
> just new up a ConfigurationProviderImpl and then just call across to the 
> "load" methods on the implementation?  Since we want to keep the 
> ProductDerivations stateless, I'm not sure how else you were expecting to 
> create a ConfigurationProvider to return on these "load" methods.
> * Now that ConfigurationProvider is bare, the 
> ConfigurationTestConfigurationProvider doesn't have much function.  I'll need 
> to take a look to see if this is even required any longer.
> * Can you shed a bit more light on the Configurations class?  It doesn't 
> implement nor extend any interfaces or classes, but it seems to provide many 
> of the same methods as ConfigurationProvider, but as statics.  And, it's 
> dependent on having a Provider.  Can you explain the relationship of this 
> class in the bigger picture and how you think it might be affected by thes 
> changes?
> That's enough for the initial JIRA report.  We will now track this problem 
> here instead of the dev mailing list.  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] Closed: (OPENJPA-41) transforming classes doesn't work

2007-01-09 Thread Kevin Sutter (JIRA)

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

Kevin Sutter closed OPENJPA-41.
---


Housecleaning...

> transforming classes doesn't work
> -
>
> Key: OPENJPA-41
> URL: https://issues.apache.org/jira/browse/OPENJPA-41
> Project: OpenJPA
>  Issue Type: Bug
>  Components: jpa
> Environment: WinXP, Tomcat 5.5.17, Spring 2.0-RC4
>Reporter: Costin Leau
> Assigned To: Marc Prud'hommeaux
> Attachments: petclinic.zip, spring-tomcat-weaver.jar, 
> stacktrace-2.txt, stacktrace.txt
>
>
> I've tried several versions of OpenJPA including the most recent one(svn 
> 4409856) to run Spring's Petclinic with class level LoadTimeWeaver on OpenJPA.
> I have attached the stacktrace that I get. The same example works fine with 
> Toplink.
> I have attached petclinic w/o some of the libs to gain space; basically add 
> the OpenJPA libs and deploy the war into Tomcat. Note that you'll also have 
> to place spring-tomcat-weaver.jar under Tomcat's server/lib (this should be 
> enough - if you have problems let me know or take a look at the Spring 
> reference documentation).
> When the webapp starts, the exception pops up.

-- 
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] 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: [jira] Created: (OPENJPA-96) Runtime Enhancement only processes first persistence unit defined in persistence.xml

2007-01-09 Thread Igor Fedorenko
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(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.Rem

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. ) 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  
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  
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\play>java -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... 



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
> java/net/URLClassLoader.findClass(URLClassLoader.java:487(Compiled
> Code))
> 

[jira] Closed: (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 closed OPENJPA-96.
---


> 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,
> Kevi

[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:38

[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 

[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




Re: Deadlock when insert in t1 and find in t2

2007-01-09 Thread Kevin Sutter

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  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\play>java -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...

   

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
> java/net/URLClassLoader.findClass(URLClassLoader.java:487(Compiled
> Code))
> 4XESTACKTRACE  at
> java/lang/ClassLoader.loadClass(ClassLoader.java:606(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
> org/apache/openjpa/jdbc/sql/SQLFactoryImpl.newSelect
> (SQLFactoryImpl.java:40)
> 4XESTACKTRACE  at
> org/apache/openjpa/jdbc/kernel/
> JDBCStoreManager.getInitializeStateResult(JDBCStoreManager.java:367)
> 4XESTACKTRACE  at
> org/apache/openjpa/jdbc/kernel/JDBCStoreManager.initializeState
> (JDBCStoreManager.java:296)
> 4XESTACKTRACE  at
> org/apache/openjpa/jdbc/kernel/JDBCStoreManager.initialize
> (JDBCStoreManager.java:252)
> 4XESTACKTRACE  at
> org/apache/openjpa/kernel/DelegatingStoreManager.initialize
> (DelegatingStoreManager.java:108)
> 4XESTACKTRACE  at
> org/apache/openjpa/kernel/ROPStoreManager.initialize
> (ROPStoreManager.java:54)
> 4XESTACKTRACE  at
> org/apache/openjpa/kernel/BrokerImpl.initialize(BrokerImpl.java:870)
> 4XESTACKTRACE  at
> org/apache/openjpa/kernel/BrokerImpl.find(BrokerImpl.java:828)
> 4XESTACKTRACE  at
> org/apache/openjpa/kernel/BrokerImpl.find(BrokerImpl.java:743)
> 4XESTACKTRACE  at
> org/apache/openjpa/kernel/DelegatingBroker.find
> (DelegatingBroker.java:169)
> 4XESTACKTRACE  at
> org/apache/openjpa/persistence/EntityManagerImpl.find
> (EntityManagerImpl.java:320)
> 4XESTACKTRACE  at
> play/TestInsertAndFind.test001(TestInsertAndFind.java:48)
> 4XESTACKTRACE  at
> sun/reflect/NativeMethodAccessorImpl.invoke0(Native Method)
> 4XESTACKTRACE 

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

[E

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