[jboss-jira] [JBoss JIRA] (WFLY-1032) Enhance validation message when multiple persistence units are found
Oliver Gierke (JIRA)
jira-events at lists.jboss.org
Thu Jun 13 16:49:55 EDT 2013
[ https://issues.jboss.org/browse/WFLY-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781523#comment-12781523 ]
Oliver Gierke commented on WFLY-1032:
-------------------------------------
What is the reason, the class is getting scanned in the first place? To me it feels like too aggressive scanning for JPA related annotations. I guess it's due to the fact that potentially every class can become CDI managed and Wildfly would have to inject an {{EntityManager}} in that case, right?
> Enhance validation message when multiple persistence units are found
> --------------------------------------------------------------------
>
> Key: WFLY-1032
> URL: https://issues.jboss.org/browse/WFLY-1032
> Project: WildFly
> Issue Type: Enhancement
> Components: JPA / Hibernate
> Reporter: Markus Dahm
> Assignee: Scott Marlow
> Priority: Minor
>
> The current message is
> Caused by: java.lang.IllegalArgumentException: JBAS011470: Persistence unitName was not specified and there are 9 persistence unit definitions in application deployment "test.ear". Either change the application to have only one persistence unit definition or specify the unitName for each reference to a persistence unit.
> Yet what is always helpful in search of such validation errors is the context.
> In that case the offending class name would suffice, you should have this information at hands since you're scanning the classes, right?
>
> Given that information I'd have found the problem immediately.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list