[jira] [Commented] (ARIES-681) JPA Container BundleDelegatingClassLoader should look for classes in the provider bundle, too

2011-07-06 Thread Balazs Zsoldos (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13060354#comment-13060354
 ] 

Balazs Zsoldos commented on ARIES-681:
--

Hi,

thank you very much for the fast response. I think as there is a new issue that 
has the aim to make this work this issue could be closed. I tried the solution 
compiled from SVN and ran into some exceptions. I will note these at ARIES-691.

Regards,
Balazs

 JPA Container BundleDelegatingClassLoader should look for classes in the 
 provider bundle, too
 -

 Key: ARIES-681
 URL: https://issues.apache.org/jira/browse/ARIES-681
 Project: Aries
  Issue Type: Bug
  Components: JPA
Affects Versions: 0.3
 Environment: Glassfish 3.0 (EclipseLink 2.0.2), Glassfish 3.1 
 (EclipseLink 2.2)
Reporter: Balazs Zsoldos
 Attachments: classloadingFromMultipleProviderDuringQuery.0.3.patch


 Currently the BundleDelegatingClassLoader in JPA container only looks for 
 classes in the bundle of the entitymanager. However the JPA implementation 
 Eclipselink needs some classes from itself. The reason is that in entity 
 classes the properties that hold mapping of One-To-Many are converted to 
 EclipseLink list type. See the following exception stacktrace:
 Internal Exception: java.lang.ClassNotFoundException: 
 org.eclipse.persistence.indirection.IndirectList
   at 
 org.eclipse.persistence.exceptions.ValidationException.classNotFoundWhileConvertingClassNames(ValidationException.java:2317)
   at 
 org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.convertClassNamesToClasses(InterfaceContainerPolicy.java:123)
   at 
 org.eclipse.persistence.mappings.CollectionMapping.convertClassNamesToClasses(CollectionMapping.java:788)
   at 
 org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1458)
   at 
 org.eclipse.persistence.sessions.Project.convertClassNamesToClasses(Project.java:362)
   at 
 org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:322)
   ... 83 more
 Caused by: java.lang.ClassNotFoundException: 
 org.eclipse.persistence.indirection.IndirectList
   at 
 org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:744)
   at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61)
   at 
 org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1656)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   at 
 org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:604)
   at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1487)
   at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:897)
   at 
 org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader$1.run(BundleDelegatingClassLoader.java:50)
   at 
 org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader$1.run(BundleDelegatingClassLoader.java:47)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
 org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:47)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:247)
   at 
 org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:88)
   at 
 org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.convertClassNamesToClasses(InterfaceContainerPolicy.java:120)
   ... 87 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (ARIES-691) Add tests for EclipseLink - possibly include fragment for EclipseLink support

2011-07-06 Thread Balazs Zsoldos (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13060408#comment-13060408
 ] 

Balazs Zsoldos commented on ARIES-691:
--

Hi,

I have tried this solution in Glassfish 3.1. I ran into some problems:
- The import-package contains version lower than 2.0 for package 
javax.persistence and javax.persistence.spi. However Glassfish contains version 
2.0.2. (I changed it to move forward)
- If there is no other application in Glassfish that uses JPA, Eclipselink 
bundle remains in RESOLVED state. Therefore the function 
handlePotentialEclipseLink is never called. I modified the source a bit that 
it starts the eclipselink bundle if it is in RESOLVED state. It might not be 
the best solution, I would be happy if you could direct me how to solve this in 
a better way.
- To make transactions work Eclipselink must know in what environment it runs. 
By default it thinks that it is in a standalone program and JTA does not work. 
To make JTA work we must have an entry in the persistence.xml that says we are 
in Glassfish. However it needs a package (as all platform does) to be imported 
into the adapter: org.eclipse.persistence.platform.server.sunas. I think all of 
the packages inside platform should be imported into adapter to let the 
classloader find the platform dependent classes.
- It seems to me that in Felix the getBundleContext() function gives back null 
when the Bundle is in RESOLVED state. The bundlecontext is set only when the 
function start() is called on the bundle. This is a problem of blueprint. It 
gives back a nullpointer exception when the blueprint file of a bundle is 
loaded. (Currently I always debug there and call the start() function by hand 
:))

Regards,
Balazs


 Add tests for EclipseLink - possibly include fragment for EclipseLink support
 -

 Key: ARIES-691
 URL: https://issues.apache.org/jira/browse/ARIES-691
 Project: Aries
  Issue Type: Improvement
  Components: JPA
Affects Versions: 0.4
Reporter: Timothy Ward
Assignee: Valentin Mahrwald
 Fix For: 0.4


 We should test the Aries JPA container with EclipseLink as well as OpenJPA to 
 give us better coverage. This may involve writing code to expose the 
 EclipseLink PersistenceProvider implementation

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Updated] (ARIES-691) Add tests for EclipseLink - possibly include fragment for EclipseLink support

2011-07-06 Thread Balazs Zsoldos (JIRA)

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

Balazs Zsoldos updated ARIES-691:
-

Attachment: eclipselinkadapter.patch

Uploading a patch file that does the followings:
- If the eclipselink provider bundle is found but it is in RESOLVED state it 
starts the bundle.
- Changes the import-package entry to contain higher versions of 
javax.persistence and the package that is necessary for glassfish from 
eclipselink-core bundle

With the patch my project still does not work (due to the blueprint problem) 
but I think it contains some necessary steps to get the goal. Also I would be 
really happy if I could get some response that my the patch contains changes 
that will be applied or I should try other solution...

Regards,
Balazs

 Add tests for EclipseLink - possibly include fragment for EclipseLink support
 -

 Key: ARIES-691
 URL: https://issues.apache.org/jira/browse/ARIES-691
 Project: Aries
  Issue Type: Improvement
  Components: JPA
Affects Versions: 0.4
Reporter: Timothy Ward
Assignee: Valentin Mahrwald
 Fix For: 0.4

 Attachments: eclipselinkadapter.patch


 We should test the Aries JPA container with EclipseLink as well as OpenJPA to 
 give us better coverage. This may involve writing code to expose the 
 EclipseLink PersistenceProvider implementation

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (ARIES-702) [Whiteboard] Use introspection to find the MBean interface

2011-07-06 Thread Alasdair Nottingham (JIRA)

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

Alasdair Nottingham reassigned ARIES-702:
-

Assignee: Alasdair Nottingham

 [Whiteboard] Use introspection to find the MBean interface
 --

 Key: ARIES-702
 URL: https://issues.apache.org/jira/browse/ARIES-702
 Project: Aries
  Issue Type: Improvement
  Components: JMX
Affects Versions: 0.3
Reporter: Felix Meschberger
Assignee: Alasdair Nottingham
 Attachments: ARIES-702-2.patch, ARIES-702.patch


 The JMX Spec states that standard MBeans must implement an interface whose 
 name is derived from the implementation class by appending the MBean suffix 
 and the interface must be located in the same package as the implementation 
 class.
 This is problematic in multiple ways.
 I suggest we change this as follows:
   * If the service object implements the DynamicMBean interface (or an 
 extension thereof), use the object as is as the MBean
   * Find the MBean interface by walking up the class and interface hierarchy

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (ARIES-691) Add tests for EclipseLink - possibly include fragment for EclipseLink support

2011-07-06 Thread Valentin Mahrwald (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13060494#comment-13060494
 ] 

Valentin Mahrwald commented on ARIES-691:
-

Hi Balazs,

thanks a lot for testing the changes on Glassfish and for the feedback. Highly 
appreciated.

Now, in terms of the issues you have found:
- javax.persistence imports absolutely should be able to handle minor version 
updates. Thanks for spotting that.

- Handling RESOLVED Eclipselink bundles also makes sense. However, I think 
rather than starting the Eclipselink bundle (which is slightly more invasive). 
I think loading the provider class from the RESOLVED bundle and tracking it in 
case the Eclipselink bundle is unresolved / uninstalled would be better !?

- I have found the same problem, which is why the OSGiTSServer is included now. 
This retrieves a TransactionManager from the service registry. If that does not 
work or you want to use the SunAS integration, I would suggest having the 
import on the persistence bundle rather than the adapter bundle. The reasoning 
for this is that even when adding all the common server packages from 
Eclipselink in this way we would not be able to support other providers and 
they would have to be added in the persistence bundle's import anyway. So I 
would rather make it consistent and have the responsibility for that import at 
the persistence bundle, which also defines the dependency. 

- getBundleContext() returning null is a well-known feature of the OSGi 
Bundle API :) I am afraid I am not clear though on where exactly this method 
gets called and how Blueprint gets involved. Could you be more specific in 
where this interaction comes from and how it goes wrong :)

I hope to commit a fix (based on your patch) for the first two issues either 
today or tomorrow.

Regards,

Valentin






 Add tests for EclipseLink - possibly include fragment for EclipseLink support
 -

 Key: ARIES-691
 URL: https://issues.apache.org/jira/browse/ARIES-691
 Project: Aries
  Issue Type: Improvement
  Components: JPA
Affects Versions: 0.4
Reporter: Timothy Ward
Assignee: Valentin Mahrwald
 Fix For: 0.4

 Attachments: eclipselinkadapter.patch


 We should test the Aries JPA container with EclipseLink as well as OpenJPA to 
 give us better coverage. This may involve writing code to expose the 
 EclipseLink PersistenceProvider implementation

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Resolved] (ARIES-681) JPA Container BundleDelegatingClassLoader should look for classes in the provider bundle, too

2011-07-06 Thread Balazs Zsoldos (JIRA)

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

Balazs Zsoldos resolved ARIES-681.
--

Resolution: Duplicate

As there is a final solution in ARIES-691 this issue will be solved as well.

 JPA Container BundleDelegatingClassLoader should look for classes in the 
 provider bundle, too
 -

 Key: ARIES-681
 URL: https://issues.apache.org/jira/browse/ARIES-681
 Project: Aries
  Issue Type: Bug
  Components: JPA
Affects Versions: 0.3
 Environment: Glassfish 3.0 (EclipseLink 2.0.2), Glassfish 3.1 
 (EclipseLink 2.2)
Reporter: Balazs Zsoldos
 Attachments: classloadingFromMultipleProviderDuringQuery.0.3.patch


 Currently the BundleDelegatingClassLoader in JPA container only looks for 
 classes in the bundle of the entitymanager. However the JPA implementation 
 Eclipselink needs some classes from itself. The reason is that in entity 
 classes the properties that hold mapping of One-To-Many are converted to 
 EclipseLink list type. See the following exception stacktrace:
 Internal Exception: java.lang.ClassNotFoundException: 
 org.eclipse.persistence.indirection.IndirectList
   at 
 org.eclipse.persistence.exceptions.ValidationException.classNotFoundWhileConvertingClassNames(ValidationException.java:2317)
   at 
 org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.convertClassNamesToClasses(InterfaceContainerPolicy.java:123)
   at 
 org.eclipse.persistence.mappings.CollectionMapping.convertClassNamesToClasses(CollectionMapping.java:788)
   at 
 org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1458)
   at 
 org.eclipse.persistence.sessions.Project.convertClassNamesToClasses(Project.java:362)
   at 
 org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:322)
   ... 83 more
 Caused by: java.lang.ClassNotFoundException: 
 org.eclipse.persistence.indirection.IndirectList
   at 
 org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:744)
   at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61)
   at 
 org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1656)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   at 
 org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:604)
   at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1487)
   at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:897)
   at 
 org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader$1.run(BundleDelegatingClassLoader.java:50)
   at 
 org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader$1.run(BundleDelegatingClassLoader.java:47)
   at java.security.AccessController.doPrivileged(Native Method)
   at 
 org.apache.aries.jpa.container.unit.impl.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:47)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:247)
   at 
 org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:88)
   at 
 org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.convertClassNamesToClasses(InterfaceContainerPolicy.java:120)
   ... 87 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Created] (ARIES-703) JDKProxyManager cannot proxy blueprint beans

2011-07-06 Thread Balazs Zsoldos (JIRA)
JDKProxyManager cannot proxy blueprint beans


 Key: ARIES-703
 URL: https://issues.apache.org/jira/browse/ARIES-703
 Project: Aries
  Issue Type: Bug
  Components: Proxy
 Environment: Glassfish 3.1
Reporter: Balazs Zsoldos


When there is no ASM between the bundles and aries proxy is installed the 
default proxy manager is JDKProxyManager. When there is a bean in a blueprint 
fragment that has for example tx:transaction inside creating the transactional 
proxy fails with the following stacktrace:


[#|2011-07-06T14:29:24.542+0200|SEVERE|glassfish3.1|org.apache.aries.blueprint.container.BlueprintContainerImpl|_ThreadID=27;_ThreadName=Thread-1;|Unable
 to start blueprint container for bundle 
biz.everit.audit.persistence.biz.everit.audit.persistence.impl
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to 
create proxy for bean eventPersistenceImpl in bundle 
biz.everit.audit.persistence.biz.everit.audit.persistence.impl version 
0.1.0.SNAPSHOT
at 
org.apache.aries.blueprint.container.BeanRecipe.addInterceptors(BeanRecipe.java:695)
at 
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:730)
at 
org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:71)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at 
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:79)
at 
org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)
at 
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:98)
at 
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:220)
at 
org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:205)
at 
org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:144)
at 
org.apache.aries.blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java:398)
at 
org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:271)
at 
org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:243)
at 
org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:320)
at 
org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:465)
at 
org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:310)
at 
org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)
at 
org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
at org.apache.felix.framework.Felix.getService(Felix.java:3014)
at 
org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)
at 
org.jvnet.hk2.osgiadapter.HK2Main$HK2ServiceTrackerCustomizer.addingService(HK2Main.java:260)
at 
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
at 
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:233)
at 
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:840)
at 
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:871)
at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733)
at 
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3769)
at org.apache.felix.framework.Felix.access$000(Felix.java:80)
at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:722)
at 
org.apache.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:107)
at org.apache.felix.framework.Felix.registerService(Felix.java:2854)
at 
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:251)
at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:408)
at 
org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:187)
at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:666)
at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:334)
at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:230)
  

[jira] [Updated] (ARIES-704) BundleToClassLoaderAdapter does not implement loadClass(String, boolean)

2011-07-06 Thread Balazs Zsoldos (JIRA)

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

Balazs Zsoldos updated ARIES-704:
-

Attachment: BundleToClassLoaderAdapter fix.patch

The patch I created simply implements the loadClass(String, boolean) in a way 
that if the parameter resolved is true it throws an unsupported exception 
otherwise the original behavior will be done.

 BundleToClassLoaderAdapter does not implement loadClass(String, boolean)
 

 Key: ARIES-704
 URL: https://issues.apache.org/jira/browse/ARIES-704
 Project: Aries
  Issue Type: Bug
  Components: Util
 Environment: Glassfish 3.1, aries-eclipselink-adapter, JDK 1.6.0_26
Reporter: Balazs Zsoldos
 Attachments: BundleToClassLoaderAdapter fix.patch


 When there is a loadClass(String) to a classloader it simply calls 
 loadClass(String, boolean). The second function checks if a class is 
 available in the parent classloader by checking loadClass(String, boolean). 
 If BundleToClassLoader adapter is used for a ClassLoader as the parent, the 
 loadClass(String) will never be called.
 Here is a sample stacktrace ( line numbers from JDK 1.6.0_26):
 at 
 org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
   at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
   at 
 org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   at 
 org.apache.aries.jpa.eclipselink.adapter.Activator$PersistenceUnitProxyWithTargetServer$1.findClass(Activator.java:102)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:247)
   at 
 org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:93)
   at 
 org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1258)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Updated] (ARIES-691) Add tests for EclipseLink - possibly include fragment for EclipseLink support

2011-07-06 Thread Balazs Zsoldos (JIRA)

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

Balazs Zsoldos updated ARIES-691:
-

Attachment: eclipselinkAdapter.patch

Hi,

I made it work in my environment finally. I upload a patch that contains every 
change that I did (based on current svn).

Please note that I found two problems: ARIES-703 and ARIES-704. The first does 
not come up if we have ASM in the bundle list. I provided a patch for the 
second that you may like. So the patch ARIES-704 is also necessary to make this 
patch work.

There is one final problem:
- I changed the EntityManagerFactoryManager to create the entitymanager 
factories only when the bundle is in STARTING state (not RESOLVED). This fixes 
the nullpointer problem at my side. However two unit tests fail in this case as 
createEntityManagerFactories is not called during processing them. I have not 
looked more into but it might be much easier to change the unit test for those 
who wrote it...

BTW: The stacktrace of the nullpointer is the following:


[#|2011-07-05T16:05:41.442+0200|SEVERE|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=43;_ThreadName=Thread-1;|javax.persistence.PersistenceException:
 Exception [EclipseLink-28018] (Eclipse Persistence Services - 
2.2.0.v20110202-r8913): 
org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit 
[biz.everit.audit.persistence.entity] failed.
Internal Exception: java.lang.NullPointerException
at 
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1127)
at 
org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:187)
at 
org.apache.aries.jpa.eclipselink.adapter.Activator$EclipseLinkProviderService$1.createContainerEntityManagerFactory(Activator.java:200)
at 
org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.createEntityManagerFactories(EntityManagerFactoryManager.java:261)
at 
org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.bundleStateChange(EntityManagerFactoryManager.java:156)
at 
org.apache.aries.jpa.container.impl.PersistenceBundleManager.modifiedBundle(PersistenceBundleManager.java:285)
at 
org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:453)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:237)
at 
org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:413)
at 
org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:807)
at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:729)
at 
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:610)
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3758)
at org.apache.felix.framework.Felix.access$600(Felix.java:80)
at 
org.apache.felix.framework.Felix$FelixResolver.fireResolvedEvents(Felix.java:4296)
at 
org.apache.felix.framework.Felix$FelixResolver.resolve(Felix.java:4062)
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3436)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1727)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:922)
at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.processAllBundles(DirectoryWatcher.java:1146)
at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:456)
at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 
2.2.0.v20110202-r8913): 
org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit 
[biz.everit.audit.persistence.entity] failed.
Internal Exception: java.lang.NullPointerException
at 
org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:210)
... 24 more
Caused by: java.lang.NullPointerException
at 
org.apache.aries.util.internal.DefaultWorker.setupListener(DefaultWorker.java:98)
at 
org.apache.aries.util.internal.DefaultWorker.getClassLoader(DefaultWorker.java:86)
at 
org.apache.aries.util.AriesFrameworkUtil.getClassLoaderForced(AriesFrameworkUtil.java:93)
at 
org.apache.aries.jpa.container.unit.impl.PersistenceUnitInfoImpl.getClassLoader(PersistenceUnitInfoImpl.java:89)
at 

Build failed in Jenkins: Aries ยป Apache Aries Util #1079

2011-07-06 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/1079/changes

Changes:

[mahrwald] ARIES-704: Fix BundleToClassLoaderAdapter delegation from sub 
classloaders - based on patch by Balazs Zsoldos

--
[INFO] 
[INFO] Building Apache Aries Util
[INFO]task-segment: [clean, install]
[INFO] 
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/target
 (included: [**], excluded: [])
[INFO] [enforcer:enforce {execution: default}]
[INFO] [remote-resources:process {execution: default}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] skip non existing resourceDirectory 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/filtered-resources
[INFO] Copying 7 resources
[INFO] Copying 3 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 37 source files to 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/target/classes
[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/java/org/apache/aries/util/tracker/InternalRecursiveBundleTracker.java:[29,33]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/java/org/apache/aries/util/tracker/InternalRecursiveBundleTracker.java:[144,69]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/java/org/apache/aries/util/tracker/InternalRecursiveBundleTracker.java:[64,21]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/java/org/apache/aries/util/tracker/InternalRecursiveBundleTracker.java:[84,21]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/java/org/apache/aries/util/tracker/InternalRecursiveBundleTracker.java:[101,21]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/java/org/apache/aries/util/tracker/InternalRecursiveBundleTracker.java:[112,21]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/java/org/apache/aries/util/tracker/InternalRecursiveBundleTracker.java:[113,6]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/main/java/org/apache/aries/util/tracker/InternalRecursiveBundleTracker.java:[113,28]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 20 resources
[INFO] skip non existing resourceDirectory 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/test/filtered-resources
[INFO] Copying 3 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 10 source files to 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/target/test-classes
[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/test/java/org/apache/aries/util/filesystem/IOUtilsTest.java:[35,14]
 [deprecation] java.io.StringBufferInputStream in java.io has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/test/java/org/apache/aries/util/filesystem/FileUtilsTest.java:[28,14]
 [deprecation] java.io.StringBufferInputStream in java.io has been deprecated

[WARNING] 
https://builds.apache.org/job/Aries/org.apache.aries$org.apache.aries.util/ws/src/test/java/org/apache/aries/util/RecursiveBundleTrackerTest.java:[34,33]
 [deprecation] org.osgi.service.framework.CompositeBundle in 
org.osgi.service.framework has been deprecated

[WARNING] 

[jira] [Created] (ARIES-705) proxy code is weaving JPA metamodel classes and can cause JPA errors

2011-07-06 Thread Kevan Miller (JIRA)
proxy code is weaving JPA metamodel classes and can cause JPA errors


 Key: ARIES-705
 URL: https://issues.apache.org/jira/browse/ARIES-705
 Project: Aries
  Issue Type: Bug
  Components: Proxy
Affects Versions: 0.4
Reporter: Kevan Miller
Priority: Critical


Aries proxy code is weaving JPA metamodel classes. This results in the 
following error for current OpenJPA (2.1.x):

java.lang.IllegalStateException: localized message key: meta-field-not-param; 
substitutions: [class com.foo.Baz_, serialVersionUID, long] 
   at 
org.apache.openjpa.persistence.meta.MetamodelImpl.getParameterziedType(MetamodelImpl.java:341)
 
   at 
org.apache.openjpa.persistence.meta.MetamodelImpl.populate(MetamodelImpl.java:310)
 
   at 
org.apache.openjpa.persistence.meta.MetamodelImpl.instantiate(MetamodelImpl.java:257)
 
   at 
org.apache.openjpa.persistence.meta.MetamodelImpl.find(MetamodelImpl.java:226) 
   at 
org.apache.openjpa.persistence.meta.MetamodelImpl.init(MetamodelImpl.java:91) 
   at 
org.apache.openjpa.persistence.EntityManagerFactoryImpl.getMetamodel(EntityManagerFactoryImpl.java:346)
 
   at 
org.apache.openjpa.persistence.EntityManagerFactoryImpl.getCriteriaBuilder(EntityManagerFactoryImpl.java:333)
 
   at 
org.apache.openjpa.persistence.EntityManagerImpl.getCriteriaBuilder(EntityManagerImpl.java:1638)
 
   at 
org.apache.openjpa.persistence.EntityManagerImpl.getCriteriaBuilder(EntityManagerImpl.java:101)
 
   at com.foo.Test.query(Test.java:xxx) 

See https://issues.apache.org/jira/browse/OPENJPA-2024

IMO, MetaModel classes (annotated with 
javax.persistence.metamodel.StaticMetamodel) should be ignored by aries 
weaving...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira