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

Reinhard Sandtner commented on OPENJPA-2632:
--------------------------------------------

hey,

my ear looks like this (simplified for the sample - see also 
https://github.com/struberg/was_bugs/tree/master/was_bug19)

{noformat}
ear
| - lib
|    | - myjar
|    |      | - TheEntity.class
|    |      | - persistence.xml
| - mywar
|    | - WEB-INF
|    |      | - classes
|    |      |      | - Result.class
|    |      |      | - ServiceUsingResult.class
{noformat}

as i understand, the entity gets loaded via the ear-CL and this did not know 
the {{Result.class}}. i've not found any restrictions in the spec that the 
result class must be in the same classloader as the entity. 

> select new not working if result class is not in same classloader
> -----------------------------------------------------------------
>
>                 Key: OPENJPA-2632
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2632
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 2.4.1
>            Reporter: Reinhard Sandtner
>         Attachments: OPENJPA-2632.patch
>
>
> in my case i'm using an ear with multiple war files.
> the entities are located in ear/lib and my select new result class and the 
> service which loads it are located in a war (doesn't matter if in WEB-INF/lib 
> or WEB-INF/classes)
> openJPA uses the CL stored in QueryImpl but this one can not load my class.
> imo if the class can not be loaded with the stored class loader, we can try 
> to use the TCCL to load the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to