Bug 108671 - "Error trying to set new file into editor" error message under WST project
"Error trying to set new file into editor" error message under WST project
Status: CLOSED FIXED
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee
0.7
PC Windows 2000
: P3 critical with 1 vote (vote)
: 1.0 M8
Assigned To: John Lanuti CLA Friend
:
: 109907 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2005-09-02 09:55 EDT by jfeid CLA Friend
Modified: 2006-09-22 21:07 EDT (History)
6 users (show)

See Also:


Attachments
The stack trace of when it fails. (4.98 KB, text/plain)
2005-09-06 14:10 EDT, Richard Kulp CLA Friend
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description jfeid CLA Friend 2005-09-02 09:55:41 EDT
When I try to create a new Visual Class under a Dynamic Web Project (WST 0.7) an
error message "Error trying to set new file into editor" appears.
Configuration:
- Eclipse SDK 3.1 (JDK 1.5.0_04)
- EMF 2.1
- GEF 3.1
- VE 1.1
- WST 0.7
Here is how to reproduce the problem (in brackets are my options):
1. Create a new Dynamic Web Project (Target Server: Apache Tomcat 5.0.28, Module
Version: 2.4, Context Root: same as project name)
2. Create a new Visual Class (Swing/Application, main option checked) for this
project.
3. VE pops up a error dialog saying "Error trying to set new file into editor.
Reason: java.lang.NullPointerException".

It appears that the message pops up when selecting visual class style Swing or
AWT (tested with Swing/Application, Swing/Frame and AWT/Frame). On the contrary,
VE works ok when try to create a visual class with SWT style (SWT/Shell).
Comment 1 Richard Kulp CLA Friend 2005-09-06 12:03:04 EDT
When you say WST, do you mean WTP? WST doesn't have Web project support?

Which download of WTP did you install? Was it 

R-0.7-200507290654/wtp-sdk-0.7.zip
Comment 2 Richard Kulp CLA Friend 2005-09-06 14:10:30 EDT
Created attachment 26859 [details]
The stack trace of when it fails.

It is due to a call to a method from WTP that isn't normally called by straight
VE. The problem is that the method WorkbenchResourceHelperBase.getResource(URI)
is called for a resource. This method turns around and calls
WorkspaceResourceHandler.getResource(ResourceSet, URI) but it passes in "null"
for the resource set. 

This will always be a problem because the current implementation of
WorkspaceResourceHandler.getResource(ResourceSet, URI) requires ResourceSet to
be not null.
Comment 3 jfeid CLA Friend 2005-09-07 03:12:25 EDT
(In reply to comment #1)
> When you say WST, do you mean WTP? WST doesn't have Web project support?
> 
> Which download of WTP did you install? Was it 
> 
> R-0.7-200507290654/wtp-sdk-0.7.zip

Yes, it is the Web Standard Tools feature of WTP.
I didn't download any zip file, I used Eclipse's update manager.
The version installed is 0.7.0
Comment 4 Gili Mendel CLA Friend 2005-09-19 14:12:05 EDT
*** Bug 109907 has been marked as a duplicate of this bug. ***
Comment 5 David Williams CLA Friend 2005-09-22 14:28:29 EDT
John will review for M8 need. 
Comment 6 Gili Mendel CLA Friend 2005-09-22 15:57:26 EDT
This is really needed for M8, it is a blocker for VE
Comment 7 John Lanuti CLA Friend 2005-09-22 17:49:43 EDT
This is fixed for the WTP M8 final driver.
Tested by full suite of JUnits.
Comment 8 David Williams CLA Friend 2005-09-22 18:00:32 EDT
Thanks Gili, after many discussions and reviews and tests, we 
feel comfortable with a "work around" in our M8 code for the 
bug that is essentially in JEM code. 

Does JEM already have a bug to fix the basic API? If not, will you please
open one for it, and document here, to make sure gets fixed in future versions
of JEM? 

I've opened bug 110386 to track a few other places we in WTP should remove use 
of the getResource(uri, true) method, but turns out as code currently is they 
would not have this "blocking" problem. 


Comment 9 Richard Kulp CLA Friend 2005-09-23 12:29:05 EDT
David, I've just sent out a note to JEM mailing list and to you and Chuck with a
proposal on what to do. If that proposal is accepted I will open a defect on it.
I need to send it to mailing list because JEM is opensource and I need to get
everyone's acceptance on this change.
Comment 10 David Williams CLA Friend 2006-09-22 21:07:30 EDT
This bug is being moved to the "closed" state since it has been in the fixed state for a so long it is being assumed fixed, without explicit verification from the originator. If there is still a problem, in the most recent 1.5.x builds, please reopen or open another bug.