Community
Participate
Working Groups
If You try to open an xml document, where the root tag is <project>, the java.lang.InstantiationException is thrown in the org.eclipse.wst.sse.ui.internal.StructuredTextViewer. For example create the next xml document: <project> <name>hello</name> </project> Save it as an xml file (hello.xml), close it and try to open it again with the xml editor. The result is: 1. java.lang.InstantiationException is thrown 2. there is the following message in the desing tab of the xml editor: "The document is empty" 3. there is no xml syntax highligting in the source tab of the xml editor. This bug has been reported in the 78340 bug as Additional Comment #4.
Similar to bug 89195?
Exactly same as 89195 as far as I can tell. This has been fixed in ant.core in M7 stream, but realize that doesn't help you right now with WTP M4 (since its based on M6). You can "work around" this bug in WTP M4 by disabling ant.core plugin, or, if you'd prefer, go into the ant.core plugin and comment out the ant contenttype contribution. This, of course, messes up some ant functions, but ... depending on what you need, it might get you by until the next milestone. *** This bug has been marked as a duplicate of 89195 ***
(In reply to comment #2) Commenting out the ant contenttype contribution does not work for me. The "java.lang.InstantiationException: org.eclipse.wst.sse.ui.internal.StructuredTextViewer" still gets thrown... Additionally, I have another file that does not work and does not have the project tag. It's a UML2 model file. The problems seems to exist for each UML2 model file. I don't think this bug is resolved. (Or I'm doing something wrong...)
To double check, when you comment out the ant contenttype contribution, you might have to restart Eclipse with the -clean option for it to know to pick up this change and flush any cached content type calculations. If that doesn't work, please re-open. And, actually, would be fair to re-open based on your comment about UML files ... please attach a sample one. (and/or, you might try with UML2 plugins disabled, to help us diagnose, but sounds like something we should definitily try to reproduce).
(In reply to comment #4) > To double check, when you comment out the ant contenttype contribution, you > might have to restart Eclipse with the -clean option for it to know to pick up > this change and flush any cached content type calculations. If that doesn't > work, please re-open. You are right, with the "-clean" option it works for the sample file with the "project" tag. > And, actually, would be fair to re-open based on your comment about UML files > ... please attach a sample one. (and/or, you might try with UML2 plugins > disabled, to help us diagnose, but sounds like something we should definitily > try to reproduce). This problem persists with the UML2 plugin disabled (if I did it correctly, using the configuration manager). It is enough to create a new model file and open that with the XML Editor to get the exception. <?xml version="1.0" encoding="UTF-8"?> <uml:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:uml="http://www.eclipse.org/uml2/1.0.0/UML" name="sample"/>
I was not able to reproduce the UML2 mentioned problem, even with UML2 installed, using the small sample provided. I tried with the 1.1 I200505051002 version of UML2. Not sure what to recommend, unless its to be sure to check the .metadata/.log file for any tell-tell clues. Thanks.
Created attachment 21030 [details] log file with stack traces
(In reply to comment #6) > I was not able to reproduce the UML2 mentioned problem, even with UML2 > installed, using the small sample provided. I tried with the 1.1 > I200505051002 version of UML2. I just found out, the file must have the "uml2" extension for the exception to raise. Otherwise ("xml" extension), no exception is raised. > Not sure what to recommend, unless its to be sure to check the .metadata/.log > file for any tell-tell clues. I have uploaded the log file. Maybe this helps.
This was helpful. I still could not replicate exception, per se, but admit, was testing on slightly different version. But, the basic problem, I'm 99% sure, is that you have to tell Eclipse that uml2 is a type of XML content. See "contentTypes" in http://www.eclipse.org/webtools/wst/components/sse/M4/news/sse-m4.html for detailed steps, if needed. I suspect that will "get you going", but if you can think of ways to improve error messages, etc., feel free to open feature requests for those.
Incidentally, I just found the cause of the InstantiationException. org.eclipse.wst.sse.ui was incorrectly specifying the "StructuredTextViewer" class as the fall-back text viewer configuration for StructuredTextEditors. The text viewer configurations are usually associated by content type and we define them for the supported cases, but there is a "fall-back" defined as well to prevent larger errors. When an unsupported (or over-defined) content type comes along, the fall-back is what gets used--in this case, erroneously specified as the viewer class and not the viewer configuration class. The plugin.xml file must not have been updated correctly during one of the many refactorings that have happened in the M3/M4 timeframe. Checking the corrected plugin.xml into HEAD.
I replaced the plugin.xml with the new one from CVS and now, I don't get the exception, but still a warning "StructuredTextEditor being used without StructuredDocument". Syntax-Highlighting and Outline are missing. If I rename the file from ".uml2" to ".uml2.xml" everything works fine.
Changed Version field given new release numbering.
Marking as verified as I know this issue is fixed (or correctly categorized). If, as originator, you disagree or still see, please re-open, or open a new bug. Thanks very much for reporting and helping make WTP better.
Closing