New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Entity objects are not enhanced by the load time weaver in certain situations [SPR-8523] #13167
Comments
Matt Young commented Tested against 3.0.5 as well, can confirm the problem exists there also. |
Chris Beams commented Hi Matt, Thanks for attaching the project. Would you be willing to submit this as a pull request following the instructions here? https://github.com/SpringSource/spring-framework-issues#readme We'll look into this either way of course, but this helps streamline things. Thanks! Chris |
Matt Young commented Thanks for your help, Chris. I've added the sample project to github (correctly, I hope) and confirmed that the same result comes out. Please let me know if anything is wrong with the commit. |
Chris Beams commented Matt submitted spring-attic/spring-framework-issues#3 |
Chris Beams commented Confirmed the issue locally. Scheduling for RC1 |
Chris Beams commented This issue seems very similar to #13148, but it is not yet clear that it is a duplicate per se. See the reproduction projects for both issues to observe the similarities (README contains instructions) https://github.com/SpringSource/spring-framework-issues/tree/master/SPR-8502 |
Chris Beams commented Also note that the reproduction project linked above has now been heavily simplified in an attempt to isolate the issue. It is quite clear what will cause the failure to enhance, but not yet clear why. |
Chris Beams commented Matt, you may want to consider compile-time weaving as a workaround in the meantime. I've documented how to do this as well in the reproduction project. See the README: https://github.com/SpringSource/spring-framework-issues/tree/master/SPR-8523 |
Matt Young commented Thanks Chris for the helpful configuration example.... we'll try compile-time weaving until this gets sorted out. |
Juergen Hoeller commented This sounds like it is basically the same issue as #14490, covered by the same fix. Please give the upcoming 3.2 RC1 a try and let us know whether it solves the problem for you... Juergen |
Matt Young opened SPR-8523 and commented
I've boiled down a confusing situation into a reproducible odd behavior in the attached example application. In an OpenJPA-supported application when there are two classes (an abstract parent and a concrete child) that are both marked with
@Entity
, the classes are not enhanced when an autowired@Repository
DAO is called from a unit test. The DAO contains an inserted@PersistenceContext
to get access to the EntityManager.If the call to the dao is commented out, the classes are enhanced as they should be.
Using spring-instrument-3.1.M2.jar on a -javaagent line.
Notes:
Run a mvn package with the dao call commented out and not commented out in the test class
Observe the difference in openjpa reporting the enhancement of classes vs. not enhancing them
It doesn't matter if you use a persistence.xml file or the new packagesToScan option in LocalContainerEntityManagerFactoryBean
Affects: 3.1 M2
Attachments:
Issue Links:
@Configurable
does not work if method with configured classes as parameter exists1 votes, 3 watchers
The text was updated successfully, but these errors were encountered: