Community
Participate
Working Groups
(see original bug 313405) from Tim deBoer: "I accidentally had a JPA 2.0 persistence.xml in a project that was set to a JPA 1.0 provider. As a result, there were a couple IllegalArgumentExceptions in the .log from BaseJpaPlatformUi.getResourceUiDefinition() whenever I browsed to the JPA content node of the project. I found my problem by debugging and fixed it via the provider setting. I'm not sure any user would have been able to figure this out, but at least we should not be throwing uncaught exceptions. Instead, can we either catch the exception or just log a short error message from this method?" Since this is an actual use case, we should not throw/log an exception, but should instead provide some meaningful UI. Perhaps a null implementation of ResourceUiProvider.
Moving JPA specific bugs to new JPA component in bugzilla.
This bug appears to have been fixed in 3.0, I cannot reproduce in 3.0 maintenance or in HEAD
I can reproduce this in 3.2, I was following the steps listed in bug 280673 and reproduce this. You can see where we throw the IllegalArgumentExceptions in BaseJpaPlatformUi.getResourceUiDefinition(JptResourceType) and getMappingResourceUiDefinition(JptResourceType)
We have validation messages for all cases where a file version is not supported for a given platform (or for a different platform). So this bug merely becomes that we are logging errors. Should we be logging errors?
I think we have determined that we should not be logging errors for this case. Let's fix in 3.3M1 and Juno SR1.
Given that this is a very low risk change, seems reasonable for RC1.
Created attachment 215423 [details] patch Check for support for the resource type before attempting to get structure UI for it. (Also includes small formatting change for error message.)
I changed my mind again after seeing the patch. This bug is just too minor to bother with PMC review, in addition to the very small amount of risk it introduces to the code base. It just doesn't stand up to these questions - http://wiki.eclipse.org/WTP_PMC_Defect_Review#How_To_Prepare_a_PMC_Defect_Candidate.
checked the patch in to HEAD, do we want to put this in 3.2.1?
(In reply to comment #9) > checked the patch in to HEAD, do we want to put this in 3.2.1? Yes, I think we should.
I have removed this patch from HEAD, I am unable to view the JPA structure for a java file with this patch. The JPA structure view displays 'A JPA strucutre provider is not available: Java Source File : v. <undetermind>. I have an EclipseLink 2.4.x platform project
Committed for 3.3 M1. Made small change to patch for java files, which for some reason was not "supported" by platforms.