Re: Stateless Pool and Stateful Pool Timeouts

2008-07-17 Thread David Blevins


On Jul 17, 2008, at 5:29 AM, the666pack wrote:



Hello,

i have a question regarding timeout values in openejb as the  
documentation

is somewhat sparse:

the timeout for the stateless pool is defined as:

"Specifies the time to wait between invocations. This
value is measured in milliseconds. A value of 5 would
result in a time-out of 5 milliseconds between invocations.
A value of zero would mean no timeout."

what exactly does the default value 0 now mean?


It looks like that value is no longer used.  It used to configure the  
amount of time a thread should block while waiting for a instance from  
the pool when strict pooling is used.  Zero was meant to imply "wait  
for as long as it takes", i.e. indefinitely.  Agree that description  
is terrible.


The code was updated between 3.0-beta-2 and 3.0 final to fix the  
enforcement of the StrictPooling option.  Looks like the timeout got  
left out of that refactor.  We definitely should update the code to  
use the configurable timeout again.




the timeout for the stateful pool is defined as:

"Specifies the time to wait between invocations. This
value is measured in minutes. A value of 5 would
result in a time-out of 5 minutes between invocations.
A value of zero would mean no timeout."

is this the time before the bean is passivated or is this timeout  
before the

bean gets removed from the container?


It's the amount of inactive time to wait until the bean instance is  
destroyed.  A value of zero would mean bean instances are never  
destroyed due to timeout.  Passivation is triggered when reaching the  
PoolSize.  At that point, the BulkPassivate value defines how many  
instances (oldest first) we will remove from the pool and passivate to  
disk.   Afterwards the number of active instances will be X where 'X =  
PoolSize - BulkPassivate'


We will definitely clean up those docs.  Thanks for asking for  
clarification!


-David



Re: Problem with openjpa enhancer - using runtime enhancement

2008-07-17 Thread Dain Sundstrom
I'm pretty sure this is the problem, and it is pretty common.  The  
problem is the persistence units are not processed until OpenEJB  
starts and that is typically after the test class has loaded.  The  
persistence classes reference by the test class are loaded when the  
test class is loaded, which means they are not enhanced since OpenEJB  
is initialized in the setUp method (after class loading).


Kevin, the OpenEJB javaagent is our transformation hook for JEE  
modules.  When a JEE application is deployed we scan for persistence  
units and create EntityManagerFactories.  The EntityManagerFactory  
gets our PersistenceUnitInfo which when OpenJPA calls addTransformer,  
we add the transformer using our JavaAgent.  When the application is  
undeployed, we remove the transformers.  We also need to support any  
JPA implementation provided by the user application, and our agent  
lets us do that.


David, I wonder if there is a way we could add a test mode to our  
agent which does eager scanning of the classpath and add transformers  
like OpenJPA does.


-dain

On Jul 17, 2008, at 2:31 AM, David Blevins wrote:

I wonder if this is simply an issue that the Entity classes are  
loaded *before* OpenEJB starts and is able to hand the  
persistence.xml data to OpenJPA.  If there are imports for the  
Entities in the TestCase then this is likely what's happening.


You might try moving the test code around a bit to see if you can't  
separate the bootstrapping of OpenEJB (and thus OpenJPA) from the  
code that consumes the Entities.  Putting the OpenEJB bits in a  
super class to the TestCase might work.  Or maybe putting the test  
bits in an inner class.


-David


On Jul 17, 2008, at 1:40 AM, Gareth Davies wrote:


Kevin,

This is the trace output from our build with all the OpenJPA  
options set
to TRACE and RuntimeUnenhancedClasses set to unsupported, it looks  
like
it finds the classes but fails to enhance any of them.  One  
slightly odd
thing about this is that it mentions that it is scanning the  
resources
"META-INF/orm.xml" for persistent types but this file doesn't  
exist, all

the persistent types are listed in the persistence.xml file, I don't
know if this has any significance.  I have also put in the test  
report

from the initial test case that fails.

Thanks

Gareth


*** Build ***

575  warehouse  TRACE  [main] openjpa.jdbc.JDBC -  [2 ms] close
643  warehouse  TRACE  [main] openjpa.MetaData - Scanning resource
"META-INF/orm.xml" for persistent types.
645  warehouse  TRACE  [main] openjpa.MetaData -
parsePersistentTypeNames() found [com.par.impl.HandheldDevice,
com.par.impl.AbstractMessage, com.par.impl.AssetMessage,
com.par.impl.Product, com.par.impl.TrainingQualification,
com.par.impl.HandheldMessageType, com.par.impl.LiveTableColumn,
com.par.impl.ClientNote, com.par.impl.BusinessFormInstance,
com.par.impl.ObjectGroup, com.par.impl.LiveTable,
com.par.impl.ClientModificationRecord, com.par.impl.Location,
com.par.impl.Category, com.par.impl.Asset, com.par.impl.LocationType,
com.par.impl.Department, com.par.impl.TemperatureReading,
com.par.impl.AssetTransport, com.par.impl.Permission,
com.par.impl.AssetReservation, com.par.impl.ObjectForm,
com.par.impl.TemperatureDevice, com.par.impl.Domain,
com.par.impl.SearchFormElement, com.par.impl.Client,
com.par.impl.AccessCategory, com.par.impl.WarehouseRoleUser,
com.par.impl.UserTrainingQualification, com.par.impl.HandheldMessage,
com.par.impl.AssetLocation, com.par.impl.ClientAddress,
com.par.impl.ObjectElement, com.par.impl.SearchForm,
com.par.impl.DomainRoleUser, com.par.impl.Country,
com.par.impl.BusinessFormAnswer, com.par.impl.BusinessForm,
com.par.impl.ActionMessage, com.par.impl.UserDetails,
com.par.impl.SpecialRequirement, com.par.impl.AssetStorageRule,
com.par.impl.JobTitle, com.par.impl.SystemConstant,  
com.par.impl.Role,

com.par.impl.AssetSerialNumber,
com.par.impl.WarehouseProductPriceHistory, com.par.impl.User,
com.par.impl.ObjectElementType, com.par.impl.HandheldSession,
com.par.impl.AssetFate, com.par.impl.AccessRight,
com.par.impl.AssetMessageType, com.par.impl.AssetType,
com.par.impl.BusinessFormQuestion, com.par.impl.SystemMessageType,
com.par.impl.RoleUser, com.par.impl.SystemMessage].
661  warehouse  TRACE  [main] openjpa.MetaData - Found 58 classes  
with

metadata in 23 milliseconds.
17:00:11  INFO [com.par.impl.SearchFormPersistenceTestCase] - Testing
query...
17:00:12  INFO [com.par.impl.SearchFormPersistenceTestCase] -  
Unable to

complete test case testSearchFormElement


org.apache.openjpa.persistence.ArgumentException: An error occurred
while
parsing the query filter "Select searchFormElement from
SearchFormElement searchFormElement". Error message: The name "Search
FormElement" is not a recognized entity or identifier. Known entity
names: []
  at
org 
.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(

AbstractExpressionBuilder.java:118)
  at
org 
.apache.openjpa.k

Re: Problem with openjpa enhancer - using runtime enhancement

2008-07-17 Thread Kevin Sutter
Gareth,
It still seems like the -javaagent is not taking effect.  What version of
the surefire plugin are you using?  If it's 2.3, you might be hitting the
problem in this Issue:  http://jira.codehaus.org/browse/SUREFIRE-297.  The
initial description sounds exactly like your situation.

Can you run your maven script with debug (-X) to see exactly what jvm
arguments are being passed to the process?

Sorry that I'm still grabbing at straws, but I have not been able to
reproduce the situation yet.  I run with a javaagent for most of my testing
and haven't experienced this problem.

Thanks for your patience,
Kevin


On Thu, Jul 17, 2008 at 3:40 AM, Gareth Davies <[EMAIL PROTECTED]>
wrote:

> Kevin,
>
> This is the trace output from our build with all the OpenJPA options set
> to TRACE and RuntimeUnenhancedClasses set to unsupported, it looks like
> it finds the classes but fails to enhance any of them.  One slightly odd
> thing about this is that it mentions that it is scanning the resources
> "META-INF/orm.xml" for persistent types but this file doesn't exist, all
> the persistent types are listed in the persistence.xml file, I don't
> know if this has any significance.  I have also put in the test report
> from the initial test case that fails.
>
> Thanks
>
> Gareth
>
>
> *** Build ***
>
> 575  warehouse  TRACE  [main] openjpa.jdbc.JDBC -  18248114> [2 ms] close
> 643  warehouse  TRACE  [main] openjpa.MetaData - Scanning resource
> "META-INF/orm.xml" for persistent types.
> 645  warehouse  TRACE  [main] openjpa.MetaData -
> parsePersistentTypeNames() found [com.par.impl.HandheldDevice,
> com.par.impl.AbstractMessage, com.par.impl.AssetMessage,
> com.par.impl.Product, com.par.impl.TrainingQualification,
> com.par.impl.HandheldMessageType, com.par.impl.LiveTableColumn,
> com.par.impl.ClientNote, com.par.impl.BusinessFormInstance,
> com.par.impl.ObjectGroup, com.par.impl.LiveTable,
> com.par.impl.ClientModificationRecord, com.par.impl.Location,
> com.par.impl.Category, com.par.impl.Asset, com.par.impl.LocationType,
> com.par.impl.Department, com.par.impl.TemperatureReading,
> com.par.impl.AssetTransport, com.par.impl.Permission,
> com.par.impl.AssetReservation, com.par.impl.ObjectForm,
> com.par.impl.TemperatureDevice, com.par.impl.Domain,
> com.par.impl.SearchFormElement, com.par.impl.Client,
> com.par.impl.AccessCategory, com.par.impl.WarehouseRoleUser,
> com.par.impl.UserTrainingQualification, com.par.impl.HandheldMessage,
> com.par.impl.AssetLocation, com.par.impl.ClientAddress,
> com.par.impl.ObjectElement, com.par.impl.SearchForm,
> com.par.impl.DomainRoleUser, com.par.impl.Country,
> com.par.impl.BusinessFormAnswer, com.par.impl.BusinessForm,
> com.par.impl.ActionMessage, com.par.impl.UserDetails,
> com.par.impl.SpecialRequirement, com.par.impl.AssetStorageRule,
> com.par.impl.JobTitle, com.par.impl.SystemConstant, com.par.impl.Role,
> com.par.impl.AssetSerialNumber,
> com.par.impl.WarehouseProductPriceHistory, com.par.impl.User,
> com.par.impl.ObjectElementType, com.par.impl.HandheldSession,
> com.par.impl.AssetFate, com.par.impl.AccessRight,
> com.par.impl.AssetMessageType, com.par.impl.AssetType,
> com.par.impl.BusinessFormQuestion, com.par.impl.SystemMessageType,
> com.par.impl.RoleUser, com.par.impl.SystemMessage].
> 661  warehouse  TRACE  [main] openjpa.MetaData - Found 58 classes with
> metadata in 23 milliseconds.
> 17:00:11  INFO [com.par.impl.SearchFormPersistenceTestCase] - Testing
> query...
> 17:00:12  INFO [com.par.impl.SearchFormPersistenceTestCase] - Unable to
> complete test case testSearchFormElement
>
> 
> org.apache.openjpa.persistence.ArgumentException: An error occurred
> while
> parsing the query filter "Select searchFormElement from
> SearchFormElement searchFormElement". Error message: The name "Search
> FormElement" is not a recognized entity or identifier. Known entity
> names: []
>at
> org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(
> AbstractExpressionBuilder.java:118)
>at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JP
> QLExpressionBuilder.java:180)
>at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaDat
> a(JPQLExpressionBuilder.java:150)
>at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaDat
> a(JPQLExpressionBuilder.java:225)
>at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaDat
> a(JPQLExpressionBuilder.java:195)
>at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JP
> QLExpressionBuilder.java:188)
>at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$600(JPQLExpr
> essionBuilder.java:69)
>at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate
> (JPQLExpressionBuilder.java:1754)
>at
> org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:56)
>at
> org.apache.openjpa.kernel.Ex

Stateless Pool and Stateful Pool Timeouts

2008-07-17 Thread the666pack

Hello,

i have a question regarding timeout values in openejb as the documentation
is somewhat sparse:

the timeout for the stateless pool is defined as:

"Specifies the time to wait between invocations. This
value is measured in milliseconds. A value of 5 would
result in a time-out of 5 milliseconds between invocations.
A value of zero would mean no timeout."

what exactly does the default value 0 now mean?

the timeout for the stateful pool is defined as:

"Specifies the time to wait between invocations. This
value is measured in minutes. A value of 5 would
result in a time-out of 5 minutes between invocations.
A value of zero would mean no timeout."

is this the time before the bean is passivated or is this timeout before the
bean gets removed from the container?

please clarify,

thanks,

mario.
-- 
View this message in context: 
http://www.nabble.com/Stateless-Pool-and-Stateful-Pool-Timeouts-tp18506993p18506993.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: Problem with openjpa enhancer - using runtime enhancement

2008-07-17 Thread David Blevins
I wonder if this is simply an issue that the Entity classes are loaded  
*before* OpenEJB starts and is able to hand the persistence.xml data  
to OpenJPA.  If there are imports for the Entities in the TestCase  
then this is likely what's happening.


You might try moving the test code around a bit to see if you can't  
separate the bootstrapping of OpenEJB (and thus OpenJPA) from the code  
that consumes the Entities.  Putting the OpenEJB bits in a super class  
to the TestCase might work.  Or maybe putting the test bits in an  
inner class.


-David


On Jul 17, 2008, at 1:40 AM, Gareth Davies wrote:


Kevin,

This is the trace output from our build with all the OpenJPA options  
set
to TRACE and RuntimeUnenhancedClasses set to unsupported, it looks  
like
it finds the classes but fails to enhance any of them.  One slightly  
odd

thing about this is that it mentions that it is scanning the resources
"META-INF/orm.xml" for persistent types but this file doesn't exist,  
all

the persistent types are listed in the persistence.xml file, I don't
know if this has any significance.  I have also put in the test report
from the initial test case that fails.

Thanks

Gareth


*** Build ***

575  warehouse  TRACE  [main] openjpa.jdbc.JDBC -  [2 ms] close
643  warehouse  TRACE  [main] openjpa.MetaData - Scanning resource
"META-INF/orm.xml" for persistent types.
645  warehouse  TRACE  [main] openjpa.MetaData -
parsePersistentTypeNames() found [com.par.impl.HandheldDevice,
com.par.impl.AbstractMessage, com.par.impl.AssetMessage,
com.par.impl.Product, com.par.impl.TrainingQualification,
com.par.impl.HandheldMessageType, com.par.impl.LiveTableColumn,
com.par.impl.ClientNote, com.par.impl.BusinessFormInstance,
com.par.impl.ObjectGroup, com.par.impl.LiveTable,
com.par.impl.ClientModificationRecord, com.par.impl.Location,
com.par.impl.Category, com.par.impl.Asset, com.par.impl.LocationType,
com.par.impl.Department, com.par.impl.TemperatureReading,
com.par.impl.AssetTransport, com.par.impl.Permission,
com.par.impl.AssetReservation, com.par.impl.ObjectForm,
com.par.impl.TemperatureDevice, com.par.impl.Domain,
com.par.impl.SearchFormElement, com.par.impl.Client,
com.par.impl.AccessCategory, com.par.impl.WarehouseRoleUser,
com.par.impl.UserTrainingQualification, com.par.impl.HandheldMessage,
com.par.impl.AssetLocation, com.par.impl.ClientAddress,
com.par.impl.ObjectElement, com.par.impl.SearchForm,
com.par.impl.DomainRoleUser, com.par.impl.Country,
com.par.impl.BusinessFormAnswer, com.par.impl.BusinessForm,
com.par.impl.ActionMessage, com.par.impl.UserDetails,
com.par.impl.SpecialRequirement, com.par.impl.AssetStorageRule,
com.par.impl.JobTitle, com.par.impl.SystemConstant, com.par.impl.Role,
com.par.impl.AssetSerialNumber,
com.par.impl.WarehouseProductPriceHistory, com.par.impl.User,
com.par.impl.ObjectElementType, com.par.impl.HandheldSession,
com.par.impl.AssetFate, com.par.impl.AccessRight,
com.par.impl.AssetMessageType, com.par.impl.AssetType,
com.par.impl.BusinessFormQuestion, com.par.impl.SystemMessageType,
com.par.impl.RoleUser, com.par.impl.SystemMessage].
661  warehouse  TRACE  [main] openjpa.MetaData - Found 58 classes with
metadata in 23 milliseconds.
17:00:11  INFO [com.par.impl.SearchFormPersistenceTestCase] - Testing
query...
17:00:12  INFO [com.par.impl.SearchFormPersistenceTestCase] - Unable  
to

complete test case testSearchFormElement


org.apache.openjpa.persistence.ArgumentException: An error occurred
while
parsing the query filter "Select searchFormElement from
SearchFormElement searchFormElement". Error message: The name "Search
FormElement" is not a recognized entity or identifier. Known entity
names: []
   at
org 
.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(

AbstractExpressionBuilder.java:118)
   at
org 
.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JP

QLExpressionBuilder.java:180)
   at
org 
.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaDat

a(JPQLExpressionBuilder.java:150)
   at
org 
.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaDat

a(JPQLExpressionBuilder.java:225)
   at
org 
.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaDat

a(JPQLExpressionBuilder.java:195)
   at
org 
.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JP

QLExpressionBuilder.java:188)
   at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access 
$600(JPQLExpr

essionBuilder.java:69)
   at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder 
$ParsedJPQL.populate

(JPQLExpressionBuilder.java:1754)
   at
org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:56)
   at
org 
.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(E

xpressionStoreQuery.java:153)
   at
org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:657)
   at
org 
.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryI

RE: Problem with openjpa enhancer - using runtime enhancement

2008-07-17 Thread Gareth Davies
Kevin,

This is the trace output from our build with all the OpenJPA options set
to TRACE and RuntimeUnenhancedClasses set to unsupported, it looks like
it finds the classes but fails to enhance any of them.  One slightly odd
thing about this is that it mentions that it is scanning the resources
"META-INF/orm.xml" for persistent types but this file doesn't exist, all
the persistent types are listed in the persistence.xml file, I don't
know if this has any significance.  I have also put in the test report
from the initial test case that fails.

Thanks

Gareth


*** Build ***

575  warehouse  TRACE  [main] openjpa.jdbc.JDBC -  [2 ms] close
643  warehouse  TRACE  [main] openjpa.MetaData - Scanning resource
"META-INF/orm.xml" for persistent types.
645  warehouse  TRACE  [main] openjpa.MetaData -
parsePersistentTypeNames() found [com.par.impl.HandheldDevice,
com.par.impl.AbstractMessage, com.par.impl.AssetMessage,
com.par.impl.Product, com.par.impl.TrainingQualification,
com.par.impl.HandheldMessageType, com.par.impl.LiveTableColumn,
com.par.impl.ClientNote, com.par.impl.BusinessFormInstance,
com.par.impl.ObjectGroup, com.par.impl.LiveTable,
com.par.impl.ClientModificationRecord, com.par.impl.Location,
com.par.impl.Category, com.par.impl.Asset, com.par.impl.LocationType,
com.par.impl.Department, com.par.impl.TemperatureReading,
com.par.impl.AssetTransport, com.par.impl.Permission,
com.par.impl.AssetReservation, com.par.impl.ObjectForm,
com.par.impl.TemperatureDevice, com.par.impl.Domain,
com.par.impl.SearchFormElement, com.par.impl.Client,
com.par.impl.AccessCategory, com.par.impl.WarehouseRoleUser,
com.par.impl.UserTrainingQualification, com.par.impl.HandheldMessage,
com.par.impl.AssetLocation, com.par.impl.ClientAddress,
com.par.impl.ObjectElement, com.par.impl.SearchForm,
com.par.impl.DomainRoleUser, com.par.impl.Country,
com.par.impl.BusinessFormAnswer, com.par.impl.BusinessForm,
com.par.impl.ActionMessage, com.par.impl.UserDetails,
com.par.impl.SpecialRequirement, com.par.impl.AssetStorageRule,
com.par.impl.JobTitle, com.par.impl.SystemConstant, com.par.impl.Role,
com.par.impl.AssetSerialNumber,
com.par.impl.WarehouseProductPriceHistory, com.par.impl.User,
com.par.impl.ObjectElementType, com.par.impl.HandheldSession,
com.par.impl.AssetFate, com.par.impl.AccessRight,
com.par.impl.AssetMessageType, com.par.impl.AssetType,
com.par.impl.BusinessFormQuestion, com.par.impl.SystemMessageType,
com.par.impl.RoleUser, com.par.impl.SystemMessage].
661  warehouse  TRACE  [main] openjpa.MetaData - Found 58 classes with
metadata in 23 milliseconds.
17:00:11  INFO [com.par.impl.SearchFormPersistenceTestCase] - Testing
query...
17:00:12  INFO [com.par.impl.SearchFormPersistenceTestCase] - Unable to
complete test case testSearchFormElement


org.apache.openjpa.persistence.ArgumentException: An error occurred
while
parsing the query filter "Select searchFormElement from
SearchFormElement searchFormElement". Error message: The name "Search
FormElement" is not a recognized entity or identifier. Known entity
names: []
at
org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(
AbstractExpressionBuilder.java:118)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JP
QLExpressionBuilder.java:180)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaDat
a(JPQLExpressionBuilder.java:150)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaDat
a(JPQLExpressionBuilder.java:225)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaDat
a(JPQLExpressionBuilder.java:195)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JP
QLExpressionBuilder.java:188)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$600(JPQLExpr
essionBuilder.java:69)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate
(JPQLExpressionBuilder.java:1754)
at
org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:56)
at
org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(E
xpressionStoreQuery.java:153)
at
org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:657)
at
org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:
638)
at
org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java
:604)
at
org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:66
6)
839  warehouse  TRACE  [main] openjpa.MetaData - Loading metadata for
"class com.par.impl.DomainRoleUser" under
mode "[META][QUERY]".
at
org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1486)
at
org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.j
ava:123)
at
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:227)
at
org.apache.openjpa.persistence.QueryImpl.getResultLi

Re: Problem with openjpa enhancer - using runtime enhancement

2008-07-17 Thread Kevin Sutter
Gareth,
If you are still falling into the non-enhanced class file path, then there's
still something wrong with the javaagent processing.  I'm not following the
reference that Nathan provided [1].  I'm not clear on what it's trying to
tell me.  Is the javaagent provided by OpenEJB supposed to automatically
include the one provided by OpenJPA?  The jar file that was referenced
previously does not seem to have any OpenJPA code in it, so I'm confused.
Or, does OpenEJB require both agents?  Maybe this needs to be discussed on
the OpenEJB forum?  I'll try cross-posting to see if we get any input.

In the mean time, you could turn on the OpenJPA trace to see if we are even
getting any of the classes to be enhanced.  My guess is that this trace
won't show the classes because they are not getting to our agent for
transforming.  But, it's worth a shot.  Maybe there's some problem during
the transformation that gets eaten by the classloading mechanism.

Another possibility is that the class that gets transformed during the agent
processing is not the same class that is loaded later by the runtime.  A
classloader issue with OpenEJB?  A long shot, but I'm just trying to
generate some thoughts by any of the readers.

Can you provide more details on the specific messages you are getting after
turning off the fallback enhancement process?  Does it show all of your
entities as not being processed?  Or, is it a subset?  Are you listing your
classes in your persistence.xml or are you relying on classloader detection?

I have not seen a problem with the agent enhancement process.  It's
basically the exact same code as our static enhancement, except for how it's
kicked off.  Any additional details or testcases on how to reproduce it
would help with the diagnosis.

Thanks,
Kevin

[1] http://openejb.apache.org/tomcat.html#Tomcat-Limitations

On Wed, Jul 16, 2008 at 11:04 AM, Gareth Davies <[EMAIL PROTECTED]>
wrote:

> Kevin,
>
> Thanks for your suggestion, I have tried changing it to use the OpenJPA
> jar file as you suggested, and added the relevant geronimo-jta jar file
> to the class path, but unfortunately it still has the same problem with
> unenhanced classes.
>
> Thanks
>
> Gareth
>
> -Original Message-
> From: Kevin Sutter [mailto:[EMAIL PROTECTED]
> Sent: 16 July 2008 16:30
> To: [EMAIL PROTECTED]
> Subject: Re: Problem with openjpa enhancer - using runtime enhancement
>
> Gareth,
> I'm not familar with the openejb-javaagent-3.0.jar.  Does that contain
> the OpenJPA code?  From what I can tell, it does not.  (I just now
> noticed that you had said you were using this and it didn't register
> when I first read your note.)
>
> Try replacing this stanza with the openjpa-1.1.0.jar (since you stated
> that you are using 1.1.0).
>
> Kevin
>
> On Wed, Jul 16, 2008 at 10:08 AM, Gareth Davies
> <[EMAIL PROTECTED]>
> wrote:
>
> > Kevin,
> >
> > Thanks for your reply, I changed the RuntimeUnhenhancedClasses to
> > unsupported as you suggested and I did get the error message stating
> > that my a number of my classes were not enhanced.  So does this mean
> > that the javaagent is not working correctly?  I am specifying it in my
>
> > maven pom.xml when the maven-surefire plugin is called with the
> > following:
> >
> >
> > 
> >org.apache.maven.plugins
> >maven-surefire-plugin
> >
> >once
> >
> > -javaagent:${project.build.directory}/openejb-javaagent-3.0.j
> > ar
> > 
> >
> >
> >
> > net.sourceforge.cobertura.datafile
> >
> > target/cobertura/cobertura.ser
> >
> >
> >pom.version
> >${pom.version}
> >
> >
> >appserver
> >${appserver}
> >
> >
> >
> > 
> >
> >
> >
> > I have also got the openejb jar file being copied to the required
> > location earlier on in the build.
> >
> > I will have a look at producing a testcase to demonstrate this today.
> >
> > Thanks
> >
> > Gareth
> >
> >
> > -Original Message-
> > From: Kevin Sutter [mailto:[EMAIL PROTECTED]
> > Sent: 16 July 2008 15:46
> > To: [EMAIL PROTECTED]
> > Subject: Re: Problem with openjpa enhancer - using runtime enhancement
> >
> > Gareth,
> >  Recently, I found an obscure problem with the IBM JDK when using the
> > javaagent enhancement, but I don't see how this would apply to this
> > situation. You end up with a nasty exception from the Java runtime,
> > and I would think you would have mentioned that...
> >
> > Other than than, I am not aware of any differences between the two
> > forms of enhancement.
> >
> > One idea is to ensure that the -javaagent is really taking effect.
> > Besides these two enhancement mechanisms, there is a third fallback
> > mechanism. This fallback mechanism is not quite "ready for pr