Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318748 - NPE running JavaScript validation
Summary: NPE running JavaScript validation
Status: RESOLVED WORKSFORME
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: 3.2.3   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 11:33 EDT by olandere CLA
Modified: 2011-06-02 11:13 EDT (History)
5 users (show)

See Also:


Attachments
Bug in the JavaScript builder (99.91 KB, application/x-javascript)
2010-07-15 02:39 EDT, Silep CLA
no flags Details
The test project with the error (22.13 KB, application/octet-stream)
2010-07-22 09:19 EDT, Silep CLA
no flags Details
The error message (17.94 KB, image/jpeg)
2010-07-22 09:20 EDT, Silep CLA
no flags Details
The file which causes the problems. (45.28 KB, text/plain)
2010-10-26 08:20 EDT, Jan Peters CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description olandere CLA 2010-07-02 11:33:36 EDT
The following NPE occurs every few minutes after enabling the Javascript facet on this project.  Disabling automatic building stops it.

eclipse.buildId=I20100608-0911
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product

Error
Fri Jul 02 08:22:44 MST 2010
Errors running builder 'JavaScript Validator' on project 'dojo-gradebook'.

java.lang.NullPointerException
at org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1242)
at org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter.incompatibleReturnType(ProblemReporter.java:1705)
at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodVerifier.reportIncompatibleReturnTypeError(MethodVerifier.java:510)
at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodVerifier.checkAgainstInheritedMethods(MethodVerifier.java:138)
at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodVerifier.checkMethods(MethodVerifier.java:267)
at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodVerifier.verify(MethodVerifier.java:517)
at org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding.verifyMethods(SourceTypeBinding.java:1340)
at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.verifyMethods(CompilationUnitScope.java:1129)
at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:584)
at org.eclipse.wst.jsdt.internal.compiler.Compiler.compile(Compiler.java:347)
at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:286)
at org.eclipse.wst.jsdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:86)
at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:252)
at org.eclipse.wst.jsdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:58)
at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:291)
at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:199)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)



-- Configuration Details --
Product: Eclipse 1.3.0.20100617-0521 (org.eclipse.epp.package.jee.product)
Installed Features:
 org.eclipse.platform 3.6.0.v20100602-9gF78GpqFt6trOGhL60z0oEx3fz-JKNwxPY
 
JavaScript Development Tools

Version: 1.2.0.v201005270528-7C78FGDF9JgLWLMBWz-Ose6
Build id: 20100615235519
Comment 1 Silep CLA 2010-07-07 08:06:52 EDT
Same problem with Javascript Builder when build last project of TinyMCE.
The problem in the file
<tinymce>/classes/firebug-lite.js
JDK: 1.5
OS: Windows XPx64
Eclipse: Helios (only !)
Comment 2 Chris Jaun CLA 2010-07-14 15:26:12 EDT
Please supply a sample JS file to re-produce this problem.
Comment 3 Silep CLA 2010-07-15 02:39:29 EDT
Created attachment 174372 [details]
Bug in the JavaScript builder
Comment 4 Silep CLA 2010-07-15 02:40:18 EDT
Comment on attachment 174372 [details]
Bug in the JavaScript builder

This file.
Comment 5 Chris Jaun CLA 2010-07-15 16:20:36 EDT
I am unable to reproduce this problem.

Can you provide some additional information on your project setup?
Comment 6 Silep CLA 2010-07-22 09:19:37 EDT
Created attachment 174967 [details]
The test project with the error

The test project with the error here.

OS: WinXPx64.
I used last version of eclipse for Windows 64 Bit.
Comment 7 Silep CLA 2010-07-22 09:20:45 EDT
Created attachment 174969 [details]
The error message
Comment 8 Chris Jaun CLA 2010-07-22 09:57:13 EDT
Thanks for the additional info.
Comment 9 Chris Jaun CLA 2010-08-11 13:23:45 EDT
I cannot reproduce this problem in wtp 3.2.1 with the included files and project.
Comment 10 Steve Gevers CLA 2010-10-25 17:11:20 EDT
Seems to be happening to me as well.  I haven't figured out what file is causing the problem, but I just downloaded the current version of dojo.  I get the same error with the stack trace ending up on the same line of the same class.  I noticed the version of the JDK was the same, so I upgraded that with no change.  The difference I have is I can't disable the Javascript facet, so I just keep getting the error.

eclipse.buildId=M20100909-0800
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product


java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding.sourceStart(SourceTypeBinding.java:1242)
	at org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter.incompatibleReturnType(ProblemReporter.java:1705)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodVerifier.reportIncompatibleReturnTypeError(MethodVerifier.java:510)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodVerifier.checkAgainstInheritedMethods(MethodVerifier.java:138)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodVerifier.checkMethods(MethodVerifier.java:267)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodVerifier.verify(MethodVerifier.java:517)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding.verifyMethods(SourceTypeBinding.java:1340)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.verifyMethods(CompilationUnitScope.java:1129)
	at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:584)
	at org.eclipse.wst.jsdt.internal.compiler.Compiler.compile(Compiler.java:347)
	at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:286)
	at org.eclipse.wst.jsdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:86)
	at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:225)
	at org.eclipse.wst.jsdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:58)
	at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:291)
	at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:199)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 11 Jan Peters CLA 2010-10-26 08:20:45 EDT
Created attachment 181712 [details]
The file which causes the problems.

The Problem is not a Problem of Eclipse itself, as it seems.

Ran into the same problem and did some research. If you use the current Dojo Version (1.5, and maybe some of the versions before) there is a resource file which seems to cause the error.

Please check for the "dojox/gfx/resources/svg2gfx.xsl" file. Deleting this file (or making the xsl valid) solves the problem.

I attached the file for testing purposes if anyone is interested in.

Kind Regards

Jan Peters
Comment 12 Steve Gevers CLA 2010-10-26 10:04:46 EDT
Thanks for the work around.  I had seen that there was an error in the file, but didn't associate the error with the NPE.  I don't know if the XSL is really valid or not, but even if it isn't, an NPE isn't really an acceptable reaction.