I really did spend a bit of time working on this problem and couldn't
come up with a satisfactory solution, and just couldn't find one.
SO...
The best I could do to make GWTTestCase and remote testing work the
way you might want under M2 was to add this to the pom file:
<profiles>
<profile>
<id>darwin</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev-mac</artifactId>
<version>1.3.3</version>
<scope>system</scope>
<systemPath>${google.webtoolkit.home}/gwt-dev-
mac.jar</systemPath>
</dependency>
</dependencies>
</profile>
<profile>
<id>linux</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev-linux</artifactId>
<version>1.3.3</version>
<scope>system</scope>
<systemPath>${google.webtoolkit.home}/gwt-dev-
linux.jar</systemPath>
</dependency>
</dependencies>
</profile>
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev-linux</artifactId>
<version>1.3.3</version>
<scope>system</scope>
<systemPath>${google.webtoolkit.home}/gwt-dev-
windows.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
It is important to note that MAVEN_OPTS must contain -
XstartOnFirstThread for Mac users. There isn't a good way to change
the way the JUnit harness runs to add this to the system unless I
totally hack a whole new testing plugin and source path. I might do
this in the future, but uuuughhh...
[WARN] StandardContext[]Error loading WebappClassLoader
delegate: false
repositories:
----------> Parent Classloader:
sun.misc.Launcher$AppClassLoader@fabe9
com.google.gwt.dev.shell.GWTShellServlet
java.lang.ClassNotFoundException:
com.google.gwt.dev.shell.GWTShellServlet
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1340)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1189)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:
964)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:
687)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
144)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:
198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
118)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:
160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
799)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
577)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:619)
[WARN] StandardWrapperValve[shell]: Allocate exception for servlet
shell
javax.servlet.ServletException: Wrapper cannot find servlet class
com.google.gwt.dev.shell.GWTShellServlet or a class it depends on
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:
974)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:
687)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
144)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:
198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
118)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:
160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
799)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
577)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:619)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 26.93
sec <<< FAILURE!
I am uploading a "0.0.0" version of GWT to the group files list that
*should* work on Windows and Linux. It won't work on a Mac though. I
haven't confirmed this 100%, but there are 2 issues here.
First, which I corrected, the Embedded tomcat bootstraps against the
System classloader, not the context classloader. I have corrected that
in the interim build I have posted and will submit a patch to the GWT
team on this one.
The mac problem goes to the -XstartOnFirstThread problem. Basically
SWT wants to have its EDT be the root thread for the whole app.
Obviously with all the classloader hacks that M2 cycles through, this
isn't really possible. Even if you alter the surefire forking, you
can't pass -X JVM configs to it. Sorry about that.
Anyway, I am away from having a Windows machine available to test on.
I will try again in the AM and see if I can make this work right.
You can get them here:
http://gwt-maven.googlecode.com/svn/dist/
Exception in thread "Thread-1" org.eclipse.swt.SWTException: Invalid
thread access
at org.eclipse.swt.SWT.error(SWT.java:3374)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:3268)
com.google.gwt.dev.shell.GWTShellServletjava.lang.ClassNotFoundException:
com.google.gwt.dev.shell.GWTShellServlet
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1340)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1189)
I thought that just specifying:
<google.webtoolkit.extrajvmargs>-XstartOnFirstThread</
google.webtoolkit.extrajvmargs>
I also tried setting MAVEN_OPTS:
MAVEN_OPTS='-XstartOnFirstThread' mvn test
Am I somehow misconfiguring this plugin?
Have you tried:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>pertest</forkMode>
<argLine>-XstartOnFirstThread</argLine>
</configuration>
</plugin>
to see if it works for Mac? If it works, you might need to do more
clever configuring so other platforms don't pass teh -
XstartOnFirstThread param.
--Will
Thanks,
--Will
java.lang.UnsatisfiedLinkError: Can't load library: /Users/dsumm/.m2/
repository/com/google/gwt/gwt-dev-mac/1.3.3/libswt-pi-
carbon-3235.jnilib
I wasn't making any progress with just the surefire entry. I also
added the dev library to surefire's classpath. Here is the relevant
part of my pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>pertest</forkMode>
<argLine>-XstartOnFirstThread</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev-mac</artifactId>
<version>1.3.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>darwin - gwt-1.3.3</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<google.webtoolkit.home>/Users/dsumm/Documents/Java/
gwt-mac-1.3.3</google.webtoolkit.home>
<google.webtoolkit.extrajvmargs>-XstartOnFirstThread</
google.webtoolkit.extrajvmargs>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev-mac</artifactId>
<version>1.3.3</version>
</dependency>
</dependencies>
</profile>
</profiles>
Any idea what else I might be missing? It looks like its looking in
the wrong folder for the .jnilib files - I did try copying those into
the directory it is looking in, but that gave me this error:
java.lang.UnsatisfiedLinkError: Unable to load required native library
'gwt-webkit'
Your GWT installation may be corrupt
at
com.google.gwt.dev.shell.mac.LowLevelSaf.init(LowLevelSaf.java:235)