Running GWTTestCase in Netbeans IDE and "Java heap space" error

139 views
Skip to first unread message

danielgue

unread,
Nov 27, 2009, 5:27:26 AM11/27/09
to Google Web Toolkit
Hi List!

I use Netbeans 6.7.1 and GWT 1.7.

I already tried to find if this problem has been reported before and
indeed found one
thread which I mention below.

The problem is that within my Netbeans IDE I simply cannot run *any*
GWTTestCase
because there is always a "java.lang.OutOfMemoryError: Java heap
space" error
(see below for error message).

I already tried to fix this by allocating more memory but it didn't
help.

The problem seems to have been reported back in July last year:

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/b831a71efc4382d2/

Ironically, while being not able to run any GWTTestCase in Netbeans
(standard JUnit
tests all work), I immediately succeeded running one GWTTestCase in a
different
application with Eclipse and the Google GWT Plugin. So I checked, but
could not find
any differences between both projects concerning the compiling process
and the
tests. In fact, I even got the same "Java heap space" error within
Eclipse as I used
"Run As... JUnit Test" within the Eclipse context menu - if I use the
"correct"
"Run As... GWT JUnit Test" (which is provided by the Google GWT
Plugin, I think) any
GWTTestCase in Eclipse works.

Does this indicate anything that helps to solve my problem? What can
be the difference
between those two options in Eclipse and what happens if I choose one
or the other?


Many thanks in advance and regards,

Daniel



NewClassGWTTestCase): Caused an ERROR
Java heap space
java.lang.OutOfMemoryError: Java heap space
at java.lang.AbstractStringBuilder.<init>
(AbstractStringBuilder.java:45)
at java.lang.StringBuilder.<init>(StringBuilder.java:68)
at java.lang.Throwable.toString(Throwable.java:344)
at java.lang.String.valueOf(String.java:2826)
at java.io.PrintWriter.println(PrintWriter.java:710)
at java.lang.Throwable.printStackTrace(Throwable.java:509)
at
org.eclipse.jdt.internal.compiler.Compiler.handleInternalException
(Compiler.java:562)
at org.eclipse.jdt.internal.compiler.Compiler.compile
(Compiler.java:498)
at com.google.gwt.dev.javac.JdtCompiler.doCompile
(JdtCompiler.java:266)
at com.google.gwt.dev.javac.CompilationState.compile
(CompilationState.java:189)
at com.google.gwt.dev.javac.CompilationState.refresh
(CompilationState.java:178)
at com.google.gwt.dev.javac.CompilationState.<init>
(CompilationState.java:93)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState
(ModuleDef.java:264)
at com.google.gwt.dev.cfg.ModuleDef.getTypeOracle
(ModuleDef.java:325)
at
com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule
(JUnitShell.java:364)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:
626)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:
346)
at com.google.gwt.junit.client.GWTTestCase.runTest
(GWTTestCase.java:219)
at com.google.gwt.junit.client.GWTTestCase.run
(GWTTestCase.java:132)

pjulien

unread,
Nov 28, 2009, 8:03:46 PM11/28/09
to Google Web Toolkit
http://codepimpsdotorg.blogspot.com/2009/10/netbeans-and-gwttestcase.html

On Nov 27, 5:27 am, danielgue <eco...@googlemail.com> wrote:
> Hi List!
>
> I use Netbeans 6.7.1 and GWT 1.7.
>
> I already tried to find if this problem has been reported before and
> indeed found one
> thread which I mention below.
>
> The problem is that within my Netbeans IDE I simply cannot run *any*
> GWTTestCase
> because there is always a "java.lang.OutOfMemoryError: Java heap
> space" error
> (see below for error message).
>
> I already tried to fix this by allocating more memory but it didn't
> help.
>
> The problem seems to have been reported back in July last year:
>
> http://groups.google.com/group/google-web-toolkit/browse_thread/threa...

danielgue

unread,
Nov 30, 2009, 5:06:27 AM11/30/09
to Google Web Toolkit
Hi pjulien, List!

Hey many thanks for your reply and also your blog posting. It
seems you have had the same problem like me and the company
I work for are having. Many thanks for dealing with that and also
specifically replying to my inquire.

The problem is still there although I deleted the default value from
'Exclude From WAR File' and also modified the 'Additional
Compiler Options' with values like
-Xmx512m
-Xms512m -Xmx512m
-XstartOnFirstThread -Xmx512M

Besides getting different ranges of seconds before the error
occurs I have no positive reaction to that changes and I still have
to run my very first GWTTestCase in Netbeans 6.7.1.

Is there anybody who successfully uses this GWTTestCase
class and is able to test it with "Right Click" and "Test File" in
Netbeans?

Maybe someone can give me a little detail what he uses in
'Additional Compiler Options' which makes this thing working.

Many thanks in advance and regards,


Daniel



danielgue

unread,
Nov 30, 2009, 5:19:04 AM11/30/09
to Google Web Toolkit
Hi and many thanks again. You can disregard my last post. I found the
solution. I simply confused "Additional Compiler Options" in Netbeans'
Build/Compiling menu with "VM options" under Run menu.

When I entered "-Xms512m -Xmx512m" into "VM options" I finally got a
green bar and everything works.

Thanks again to pjulien and regards,


Daniel

On Nov 29, 2:03 am, pjulien <pjul...@gmail.com> wrote:
> http://codepimpsdotorg.blogspot.com/2009/10/netbeans-and-gwttestcase....
Reply all
Reply to author
Forward
0 new messages