debugging CC compiler in eclipse

163 views
Skip to first unread message

Dom

unread,
Dec 31, 2009, 6:19:15 PM12/31/09
to Closure Compiler Discuss
Hi there,

Could someone help me to debug the JavaScript Closure Compiler within
Eclipse? (i.e. walk the code single step). - I'm more of a C#/Visual
Studio .NET person but very interested in seeing how that compiler
works under the hood

Below is the stack trace I get.

I've spent more than 15 minutes on this - I've tried adding the build
folder to classpath in my project in Eclipse and no luck. I also
tried looking at http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuseEclipse
(a page that mentioned building a project using a build.xml in eclipse
and also being able to run JUnit tests from Eclipse)

What does currently work in Eclipse is being able to compile and run
the unit tests using the Ant build file

Thanks for your help!

Dominique


java.util.MissingResourceException: Can't find bundle for base name
rhino_ast.java.com.google.javascript.rhino.Messages, locale en_US
at java.util.ResourceBundle.throwMissingResourceException
(ResourceBundle.java:1521)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:787)
at com.google.javascript.rhino.ScriptRuntime.getMessage
(ScriptRuntime.java:466)
at com.google.javascript.rhino.ScriptRuntime.getMessage0
(ScriptRuntime.java:423)
at com.google.javascript.jscomp.RhinoErrorReporter.<init>
(RhinoErrorReporter.java:73)
at com.google.javascript.jscomp.RhinoErrorReporter.<init>
(RhinoErrorReporter.java:67)
at com.google.javascript.jscomp.RhinoErrorReporter
$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:134)
at com.google.javascript.jscomp.RhinoErrorReporter
$OldRhinoErrorReporter.<init>(RhinoErrorReporter.java:133)
at com.google.javascript.jscomp.RhinoErrorReporter.forOldRhino
(RhinoErrorReporter.java:99)
at com.google.javascript.jscomp.Compiler.<init>(Compiler.java:130)
at com.google.javascript.jscomp.CompilerTestCase.createCompiler
(CompilerTestCase.java:855)
at com.google.javascript.jscomp.CompilerTestCase.test
(CompilerTestCase.java:326)
at com.google.javascript.jscomp.CompilerTestCase.test
(CompilerTestCase.java:267)
at com.google.javascript.jscomp.CompilerTestCase.test
(CompilerTestCase.java:236)
at com.google.javascript.jscomp.CompilerTestCase.test
(CompilerTestCase.java:224)
at com.google.javascript.jscomp.AliasExternalsTest.testUnaliasable
(AliasExternalsTest.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run
(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:197)

Mike Samuel

unread,
Dec 31, 2009, 11:53:10 PM12/31/09
to closure-comp...@googlegroups.com
You're missing something on your classpath.
If you look at your project settings you should see something like
"Java Build Path". You need to add a source path entry to that so
that it can get at com/google/javascript/rhino/Messages.properties. I
think that file is under trunk/src so I'd add that directory.

2009/12/31 Dom <dominiqu...@gmail.com>:


> Hi there,
>
> Could someone help me to debug the JavaScript Closure Compiler within
> Eclipse? (i.e. walk the code single step). - I'm more of a C#/Visual
> Studio .NET person but very interested in seeing how that compiler
> works under the hood
>
> Below is the stack trace I get.
>
> I've spent more than 15 minutes on this - I've tried adding the build
> folder to classpath in my project in Eclipse and no luck.  I also
> tried looking at http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuseEclipse
> (a page that mentioned building a project using a build.xml in eclipse
> and also being able to run JUnit tests from Eclipse)
>
> What does currently work in Eclipse is being able to compile and run
> the unit tests using the Ant build file
>
> Thanks for your help!
>
> Dominique
>
>
> java.util.MissingResourceException: Can't find bundle for base name
> rhino_ast.java.com.google.javascript.rhino.Messages, locale en_US

The rhino_ast on the front here is a bit confusing though.

bolinfest

unread,
Jan 1, 2010, 6:22:05 PM1/1/10
to Closure Compiler Discuss
If you install the Subclipse plugin for Eclipse and use it to check
out from http://closure-compiler.googlecode.com/svn/trunk/, you should
see the following radio button checked in the "Checkout from SVN"
dialog:

"Check out as a project in the workspace"

If you hit "Finish", Eclipse will check out the project and use the
information in the .project and .classpath files in the root of the
Compiler repository to create the project with the name "closure-
compiler" and the correct build settings.

The messages/properties stuff is a bit of a pain, so it is simplest to
build the jar using Ant (run "ant jar") and then use build/
compiler.jar as part of the classpath for other Java projects that use
the Compiler. By building the jar using the provided build.xml file,
Ant will make sure the messages/properties files end up in the right
place. I believe you can then associate a sourcepath with a jar which
Eclipse will then refer to when using compiler.jar in debug mode.

On Dec 31 2009, 6:19 pm, Dom <dominique.pla...@gmail.com> wrote:
> Hi there,
>
> Could someone help me to debug the JavaScript Closure Compiler within
> Eclipse? (i.e. walk the code single step). - I'm more of a C#/Visual
> Studio .NET person but very interested in seeing how that compiler
> works under the hood
>
> Below is the stack trace I get.
>
> I've spent more than 15 minutes on this - I've tried adding the build
> folder to classpath in my project in Eclipse and no luck.  I also

> tried looking athttp://raibledesigns.com/wiki/Wiki.jsp?page=AppFuseEclipse

Dom

unread,
Jan 3, 2010, 1:42:06 PM1/3/10
to Closure Compiler Discuss
Hi Mike and bolinfest,

Just wanted to say thanks to both of you for taking the time to reply
- I am now able to step through the code!!!

In the debug configuration for a unit test class I added the jar
generated by compile target in ant build file (build.xml) and now I
can step through the code (finally!)

Thanks!
Dominique

On Jan 1, 3:22 pm, bolinfest <bolinf...@gmail.com> wrote:
> If you install the Subclipse plugin for Eclipse and use it to check

> out fromhttp://closure-compiler.googlecode.com/svn/trunk/, you should

Reply all
Reply to author
Forward
0 new messages