Hi,

I am using GWT-2.2.0 with NetBeans 7 and Tomcat 7.0.11.

In my unit testing I am using embedded Tomcat (see excepts below).

    public static void startTomcatInstance() throws
MalformedURLException, LifecycleException {
        tomcat = new Tomcat();

        tomcat.setBaseDir(".");
        tomcat.setPort(8084);

        Context ctx = tomcat.addWebapp(null, "/AdiibHarmoniser",
System.getProperty("user.dir") + "/build/web");
        File contextFile = new File(System.getProperty("user.dir") + "/
build/web/META-INF/context.xml");
        ctx.setConfigFile(contextFile.toURI().toURL());

        URL location =
Context.class.getProtectionDomain().getCodeSource().getLocation();
        System.out.println(location.getPath());

        tomcat.enableNaming();
        tomcat.start();
    }

    @AfterClass
    public static void tearDownClass() throws LifecycleException {
        if (tomcat.getServer() != null
                && tomcat.getServer().getState() !=
LifecycleState.DESTROYED) {
            if (tomcat.getServer().getState() !=
LifecycleState.STOPPED) {
                tomcat.stop();
            }
            tomcat.destroy();
        }
    }

I am also unit testing my view class with GWTTestCase. GWTTestCase
requires gwt-dev.jar to be on my CP. Adding gwt-dev.jar causes the
following aforementioned lines to break:

- ctx.setConfigFile(contextFile.toURI().toURL()); -- setConfigFile
only accepts a String
- tomcat.getServer().getState() -- does not exist

Additionally, having the Tomcat jar's on my CP causes the GWTTestCase
to fail with:

java.lang.NoSuchFieldError: warningThreshold at
com.google.gwt.dev.javac.JdtCompiler.getCompilerOptions(JdtCompiler.java:
340) at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.
(JdtCompiler.java:174) at
com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:616)
at com.google.gwt.dev.javac.CompilationStateBuilder
$CompileMoreLater.compile(CompilationStateBuilder.java:193) at
com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:
390) at
com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:
275) at
com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:
325) at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:
1322) at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:
1289) at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:631)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:
441) at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:
296)

Removing the Tomcat jar's enables GWTTestCase to work.. but my
embedded Tomcat then fails.

This is extremley frustrating. I have tried various things (including
repackaging gwt-dev.jar)..

Any ideas ?

WulfgarPro

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to