[jbosstools-dev] The horrors of jar-file validation in dali/hibernate

Max Rydahl Andersen max.andersen at redhat.com
Wed Jun 13 14:23:46 EDT 2012


>>> this problem marker is created by JPA Validator. It checks the jar at the path:
>>> 
>>> /src/main/java/sportsclub-domain.jar and doesn't find it.
>> Where does it get that path from ?
> It gets defaultSourceRoot of the project and appends jar name to it (for the projects without Dynamic Web project facet).

yeah, well that isn't right for sure - should look in the classpath if anything.

>>> How the validator should be updated?
>> My guess is that persistence.xml has a relative reference to a jar which the validator does not resolve correctly.
> There is no this jar in projects, but one of the project named "sportsclub-domain" and I think it will be generated in the sportsclub-domain.jar and available in classpath of our project, but the question is how can I know this?

isn't sportsclub-domain in the list of dependent projects ? could check when refs with xyz.jar if there is a xyz named project?

> I could provide a place for such validation for the guy working with web projects who know what will be available at runtime(Rob, Fred,...?).

so this is validation *we* control and not dali ?

>> I recall there being discussions on dali-dev on this subject because the JPA spec is not clear about it.
>> 
>> One way to "fix" this is to at least not make this an error by default since jars might not exist at tooling time.
> This would also switch off correct error messages.

All JPA validation messages or just those concerning similar jar reference errors ?

/max

>> 
>> /max
>> 
>>> Dmitry
>>> 
>>> 08.06.2012 11:33, Max Rydahl Andersen wrote:
>>>> Dima,
>>>> 
>>>> Can you track down why https://issues.jboss.org/browse/JBIDE-11534 is happening on projects like https://github.com/snowdrop/snowdrop-examples ?
>>>> 
>>>> /max




More information about the jbosstools-dev mailing list