Bug 284427 - [translation] File not found exception using content assist on JSP page
Summary: [translation] File not found exception using content assist on JSP page
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M7   Edit
Assignee: Sarika Sinha CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
: 302588 (view as bug list)
Depends on: 308960
Blocks:
  Show dependency tree
 
Reported: 2009-07-23 10:28 EDT by Chris Jaun CLA
Modified: 2010-04-14 22:09 EDT (History)
4 users (show)

See Also:
nsand.dev: review+


Attachments
Add the check for temp file existance before performing validation (1.28 KB, patch)
2010-03-19 02:36 EDT, Sarika Sinha CLA
no flags Details | Diff
patch to Reconcile without forcing problem detection (951 bytes, patch)
2010-03-30 05:31 EDT, Sarika Sinha CLA
no flags Details | Diff
Proposed fix (3.89 KB, patch)
2010-04-14 18:42 EDT, Olivier Thomann CLA
nsand.dev: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jaun CLA 2009-07-23 10:28:21 EDT
1. Create a Dynamic web project.
2. Create a JSP file.
3. Add a script tag in the body.
4. Create a new type using a prototype
5. Use content assist to create a new type.

function MyType() {}
MyType.prototype = new Object();

var t = new My  <--- use content assist here.


In the log....


eclipse.buildId=I20090611-1540
java.version=1.6.0_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86


Error
Thu Jul 23 10:27:56 EDT 2009
File not found: '/Web/src/__2F_Web_2F_WebContent_2F_jPage_2E_jsp.java'

org.eclipse.core.internal.resources.ResourceException: Resource '/Web/src/__2F_Web_2F_WebContent_2F_jPage_2E_jsp.java' does not exist.
	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:319)
	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:196)
	at org.eclipse.core.internal.resources.File.getContents(File.java:286)
	at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1163)
	at org.eclipse.jdt.internal.core.CompilationUnit.getContents(CompilationUnit.java:647)
	at org.eclipse.jdt.internal.core.CompilationUnit$1.getContents(CompilationUnit.java:221)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9553)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9525)
	at org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:908)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:170)
	at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:178)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:515)
	at org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation.executeOperation(BecomeWorkingCopyOperation.java:38)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
	at org.eclipse.jdt.internal.core.CompilationUnit.getWorkingCopy(CompilationUnit.java:983)
	at org.eclipse.jdt.internal.core.CompilationUnit.getWorkingCopy(CompilationUnit.java:958)
	at org.eclipse.jst.jsp.core.internal.java.JSPTranslation.createCompilationUnit(JSPTranslation.java:472)
	at org.eclipse.jst.jsp.core.internal.java.JSPTranslation.getCompilationUnit(JSPTranslation.java:354)
	at org.eclipse.jst.jsp.core.internal.java.JSPTranslation.setProblemCollectingActive(JSPTranslation.java:542)
	at org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator.performValidation(JSPJavaValidator.java:318)
	at org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator.performValidation(JSPBatchValidator.java:386)
	at org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator.validateFile(JSPBatchValidator.java:443)
	at org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator$2.run(JSPBatchValidator.java:513)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4694)
	at org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator.validate(JSPBatchValidator.java:525)
	at org.eclipse.wst.validation.Validator$V2.validate(Validator.java:1120)
	at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:699)
	at org.eclipse.wst.validation.internal.ValManager$1.visit(ValManager.java:663)
	at org.eclipse.wst.validation.internal.ValManager.accept(ValManager.java:776)
	at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:667)
	at org.eclipse.wst.validation.internal.ValBuilderJob$Visitor.visit(ValBuilderJob.java:320)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48)
	at org.eclipse.wst.validation.internal.ValBuilderJob.deltaBuild(ValBuilderJob.java:210)
	at org.eclipse.wst.validation.internal.ValBuilderJob.run(ValBuilderJob.java:178)
	at org.eclipse.wst.validation.internal.ValBuilderJob.runInWorkspace(ValBuilderJob.java:125)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Chris Jaun CLA 2009-07-23 11:46:44 EDT
Moving this over to jst.jsp component.
Comment 2 Sarika Sinha CLA 2009-12-10 04:08:23 EST
Works in Eclipse build I20091125-2200.
Comment 3 Sarika Sinha CLA 2009-12-10 06:36:44 EST
Did reproduce once the same stack trace for different scenario(did a ctrl +V on whole page selection) in 3.1 milestone but could not reproduce in 3.2
Comment 4 Carlin Rogers CLA 2009-12-11 02:25:06 EST
We've seen this issue as well with M20090917-0800.
Comment 5 Sarika Sinha CLA 2010-03-19 02:36:45 EDT
Created attachment 162492 [details]
Add the check for temp file existance before performing validation
Comment 6 Sarika Sinha CLA 2010-03-19 02:38:12 EDT
Was able to reproduce this message in different scenarios.
Comment 7 Ian Tewksbury CLA 2010-03-19 08:12:26 EDT
(In reply to comment #6)
> Was able to reproduce this message in different scenarios.

This wont fix the underlying issue though, the fact that all of these files are suddenly not there is a problem.  My guess is this has something to do with the persisting code.
Comment 8 Sarika Sinha CLA 2010-03-30 05:31:05 EDT
Created attachment 163388 [details]
patch to Reconcile without forcing problem detection
Comment 9 Sarika Sinha CLA 2010-03-30 05:35:51 EDT
added new patch for review to reconcile withour forcing problem detection.
Comment 10 Nick Sandonato CLA 2010-04-08 16:26:40 EDT
(In reply to comment #8)
> Created an attachment (id=163388) [details]
> patch to Reconcile without forcing problem detection

(In reply to comment #9)
> added new patch for review to reconcile withour forcing problem detection.

Hi Sarika, I'm not sure if this will address the problem that Chris reported. It looks like your patch attempts to fix the reconciling of the compilation unit, but the code path that Chris reported is actually getting the shared workingCopy from the compilation unit.

Am I missing something? Thanks.
Comment 11 Sarika Sinha CLA 2010-04-09 06:51:38 EDT
Comment on attachment 163388 [details]
patch to Reconcile without forcing problem detection

Hi Nick, I have opened a different bug 308624 for reconcile. Removing this patch as this patch is for reconcile. Waiting for Alternate API from JDT. May be we need to raise a feature in JDT for this?
Comment 12 Nitin Dahyabhai CLA 2010-04-13 10:16:21 EDT
*** Bug 302588 has been marked as a duplicate of this bug. ***
Comment 13 Olivier Thomann CLA 2010-04-14 18:42:00 EDT
Created attachment 164920 [details]
Proposed fix

This patch needs to be tested in an environment properly set up. I had trouble to get the right runtime installations in my workspace.
Comment 14 Nick Sandonato CLA 2010-04-14 22:09:16 EDT
Olivier, thank you for your patch. It looks fine to me.