Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313632 - IllegalArgumentException when retrieving ui for file that is not supported by platform
Summary: IllegalArgumentException when retrieving ui for file that is not supported by...
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows Mobile 2003
: P3 minor (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 17:35 EDT by Paul Fullbright CLA
Modified: 2012-08-20 11:42 EDT (History)
3 users (show)

See Also:


Attachments
patch (3.11 KB, patch)
2012-05-10 14:35 EDT, Paul Fullbright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Fullbright CLA 2010-05-19 17:35:36 EDT
(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.
Comment 1 Neil Hauge CLA 2011-07-01 16:26:05 EDT
Moving JPA specific bugs to new JPA component in bugzilla.
Comment 2 Karen Butzke CLA 2011-11-02 14:53:31 EDT
This bug appears to have been fixed in 3.0, I cannot reproduce in 3.0 maintenance or in HEAD
Comment 3 Karen Butzke CLA 2012-03-28 09:42:49 EDT
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)
Comment 4 Paul Fullbright CLA 2012-04-23 17:06:37 EDT
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?
Comment 5 Neil Hauge CLA 2012-05-03 09:41:09 EDT
I think we have determined that we should not be logging errors for this case.  Let's fix in 3.3M1 and Juno SR1.
Comment 6 Neil Hauge CLA 2012-05-10 10:28:52 EDT
Given that this is a very low risk change, seems reasonable for RC1.
Comment 7 Paul Fullbright CLA 2012-05-10 14:35:41 EDT
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.)
Comment 8 Neil Hauge CLA 2012-05-11 12:12:55 EDT
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.
Comment 9 Karen Butzke CLA 2012-07-09 13:36:41 EDT
checked the patch in to HEAD, do we want to put this in 3.2.1?
Comment 10 Neil Hauge CLA 2012-07-09 13:55:21 EDT
(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.
Comment 11 Karen Butzke CLA 2012-07-09 15:56:48 EDT
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
Comment 12 Paul Fullbright CLA 2012-07-16 13:32:21 EDT
Committed for 3.3 M1.  Made small change to patch for java files, which for some reason was not "supported" by platforms.