When creating a new WebApplication with GWT SDK 2.0.3 and App Engine SDK 1.3.3 in eclipse using the Instantiations WindowBuilder Pro or GWT Designer, the following error occors when trying to launch the “GWT application” (google calls this “Development Mode”).
Exception in thread “main” java.lang.NoSuchMethodError: org.mortbay.thread.Timeout.<init>(Ljava/lang/Object;)V
at org.mortbay.io.nio.SelectorManager$SelectSet.<init>(SelectorManager.java:306)
at org.mortbay.io.nio.SelectorManager.doStart(SelectorManager.java:223)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:303)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.Server.doStart(Server.java:233)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:543)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:421)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1035)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:783)
at com.google.gwt.dev.DevMode.main(DevMode.java:275)
I could not figure out what is happening and why this exception is raised, but I found a workaround for this:
Instead of using the App Engine SDK 1.3.3 on creation of the new Web Application Project, select the App Engine SDK 1.3.1. Create the new project, then right-click the project-folder and select the Properties. In Google>App Engine you can now switch from App Engine 1.3.1 to App Engine 1.3.3 and your project will run cleanly under the new engine.
Missing required argument ‘module[s]‘
Google Web Toolkit 2.0.3
DevMode [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logdir directory] [-logLevel level] [-gen dir] [-bindAddress host-name-or-address] [-codeServerPort port-number | "auto"] [-server servletContainerLauncher[:args]] [-startupUrl url] [-war dir] [-extra dir] [-workDir dir] module[s]where
-noserver Prevents the embedded web server from running
-port Specifies the TCP port for the embedded web server (defaults to 8888)
-whitelist Allows the user to browse URLs that match the specified regexes (comma or space separated)
-blacklist Prevents the user browsing URLs that match the specified regexes (comma or space separated)
-logdir Logs to a file in the given directory, as well as graphically
-logLevel The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
-gen Debugging: causes normally-transient generated types to be saved in the specified directory
-bindAddress Specifies the bind address for the code server and web server (defaults to 127.0.0.1)
-codeServerPort Specifies the TCP port for the code server (defaults to 9997)
-server Specify a different embedded web server to run (must implement ServletContainerLauncher)
-startupUrl Automatically launches the specified URL
-war The directory into which deployable output files will be written (defaults to ‘war’)
-extra The directory into which extra files, not intended for deployment, will be written
-workDir The compiler’s working directory for internal use (must be writeable; defaults to a system temp dir)
and
module[s] Specifies the name(s) of the module(s) to host
After working for a little while with GWT in eclipse, the project can not be run any more as “GWT application”. I’m still about to figure out what is happening. In the meanwhile I want to give you a simple and quick workaround for the problem:
1) Select “Run Configurations …” from you “Run” menu in eclipse
2) Delete the configurations of your project under “GWT Application” and “Web Application”
That’s it. Now you can again run your project from the selector and Jetty will start without any problems.
There are only two simple steps to take, to build a .war from your GWT project:
Short version:
The first step is building a .jar from your src-folder and putting the .jar into the lib-folder of the .war-folder of your GWT-project. The second step is building a .war-file from your war-folder and deploying the .war to your tomcat server. To make the second step more compfortable, I wrote a little Ant-script, that will create the .war.
More detailed – Step 1:
| 1) Right-click the src folder inside your project. | |
| 2) The following PopUp-menu will appear.
Select “Export …” from this menu. |
|
| 3) Select “JAR file” from the next window | |
| 4) Make sure, only the “src”-folder of your project is checked in the next window.
Select the export destination like this: <folder of your project>/war/WEB-INF/lib/<projectname>.jar – then click “Finish” |
Now your GWT-project is ready to be packed into a .war, that can be deployed to a tomcat server.
More detailed – Step 2:
1) Create a new ANT-script in your project (Right-click your project folder and select “New” and then select “File” from the submenu. Call the new file “warbuilder.xml” or something like this.).
2) Copy the following content into the newly created file. Replace <projectname> with the name of your project:
<project name="<projectname>" basedir="." default="default"> <target name="default" depends="buildwar,deploy"></target> <target name="buildwar"> <war basedir="war" destfile=" <projectname>.war" webxml="war/WEB-INF/web.xml"> <exclude name="WEB-INF/**" /> <webinf dir="war/WEB-INF/"> <include name="**/*.jar" /> </webinf> </war> </target> <target name="deploy"> <copy file=" <projectname>.war" todir="." /> </target> </project>
3) The first two steps must be done only once. You can reuse the warbuilder.xml and do not have to build it every time. Now simply right-click the “warbuilder.xml” and select “Run As” and “Ant Build” from the PopUp-menu.
The .war-File will be created by this ANT-script. You will find the .war-file in your ProjectFolder.
My workbench often gets corrupted, and all good advice on the net does not work, since the hints there are based on the fact, that eclipse starts up. But what happens, if eclipse refuses to start due to the corrupted workbench (the usual situation I have)?
First of all, check the log message. You’ll find your eclispe-log in your workbench-folder. It’s named “.metadata”. In this folder you’ll find a file called “.log”. Open this file and see if you can get some usefull information from there. Here is the file I just got today:
!ENTRY org.eclipse.osgi 4 0 2009-06-25 18:56:21.330 !MESSAGE Application error !STACK 1 org.apache.commons.lang.exception.NestableError: Java Model Exception: Java Model Status [src/net/project/windows [in project] does not exist] at com.instantiations.designer.core.utils.execution.ExecutionUtils.runRethrow(ExecutionUtils.java:66) at com.instantiations.designer.core.editor.DesignPage.initialize(DesignPage.java:96) at com.instantiations.designer.core.editor.multi.MultiMode.create(MultiMode.java:74) at com.instantiations.designer.core.editor.multi.MultiPagesMode.create(MultiPagesMode.java:63) at com.instantiations.designer.core.editor.multi.MultiPageEditor.createPartControl(MultiPageEditor.java:57) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:428) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:306) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180) at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270) at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473) at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256) at org.eclipse.ui.internal.PartStack.handleDeferredEvents(PartStack.java:1224) at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400) at org.eclipse.ui.internal.PartSashContainer.handleDeferredEvents(PartSashContainer.java:1401) at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400) at org.eclipse.ui.internal.WorkbenchPage.handleDeferredEvents(WorkbenchPage.java:1383) at org.eclipse.ui.internal.WorkbenchPage.deferUpdates(WorkbenchPage.java:1373) at org.eclipse.ui.internal.WorkbenchPage.access$14(WorkbenchPage.java:1364) at org.eclipse.ui.internal.WorkbenchPage$15.runWithException(WorkbenchPage.java:3261) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3342) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3071) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803) at org.eclipse.ui.internal.Workbench$27.runWithException(Workbench.java:1363) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3342) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3071) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2295) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) Caused by: Java Model Exception: Java Model Status [src/net/siteduke/windows [in SiteDuke] does not exist] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:491) at org.eclipse.jdt.internal.core.PackageFragmentRoot.getUnderlyingResource(PackageFragmentRoot.java:678) at org.eclipse.jdt.internal.core.PackageFragment.getUnderlyingResource(PackageFragment.java:337) at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource(Openable.java:333) at org.eclipse.jdt.internal.core.CompilationUnit.getUnderlyingResource(CompilationUnit.java:916) at com.instantiations.designer.core.editor.UndoManager.<init>(UndoManager.java:62) at com.instantiations.designer.core.editor.DesignPage$2.run(DesignPage.java:99) at com.instantiations.designer.core.utils.execution.ExecutionUtils.runRethrow(ExecutionUtils.java:64) ... 52 more !ENTRY org.eclipse.osgi 2 0 2009-06-25 18:56:21.409 !MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists: !SUBENTRY 1 org.eclipse.osgi 2 0 2009-06-25 18:56:21.409 !MESSAGE Bundle reference:file:plugins/org.eclipse.jdt.apt.pluggable.core_1.0.101.R34x_v20081108-1950.jar [216] was not resolved. !SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2009-06-25 18:56:21.410 !MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.tool_0.0.0. !SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2009-06-25 18:56:21.410 !MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.dispatch_0.0.0. !SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2009-06-25 18:56:21.410 !MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.model_0.0.0. !SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2009-06-25 18:56:21.411 !MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.util_0.0.0. !SUBENTRY 1 org.eclipse.osgi 2 0 2009-06-25 18:56:21.411 !MESSAGE Bundle reference:file:plugins/org.eclipse.jdt.compiler.apt_1.0.101.R34x_v20090114-1205.jar [218] was not resolved. !SUBENTRY 2 org.eclipse.jdt.compiler.apt 2 0 2009-06-25 18:56:21.412 !MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.tool_0.0.0. !SUBENTRY 1 org.eclipse.osgi 2 0 2009-06-25 18:56:21.412 !MESSAGE Bundle reference:file:plugins/org.eclipse.jdt.compiler.tool_1.0.100.v_894_R34x.jar [219] was not resolved. !SUBENTRY 1 org.eclipse.osgi 2 0 2009-06-25 18:56:21.412 !MESSAGE Bundle reference:file:plugins/com.instantiations.designer.swing.java6_7.0.0.200905010653.jar [417] was not resolved.
The usefull information in this special case is: org.apache.commons.lang.exception.NestableError: Java Model Exception: Java Model Status [src/net/project/windows [in project] does not exist] for any reason, eclipse can not open a special file on the workbench. After several tries I found a way to solve this problem:
Hint: BackUp your complete workbench often!
Please keep in mind: You use this advice at your very own risk
Developing web applications and portals using eclipse, GWT (google web toolkit) and apache tomcat is one of the most effective ways to get your work done: The result will always be a very high-performance AJAX application. To exchange data from the AJAX surface to the tomcat-server, I decided to use the GWT RPC, exchanging XML data structures.
Therefor GWT provides a nice package: com.google.gwt.xml.client.*
com.google.gwt.xml.client.* is a complete toolkit to deal with xml data-structures on the JavaScript clientside in a high perfomant way.
After having importing the needed packages as usual, I wrote some code to create a new XMLDom stucture. But when running the new code, the following error occured:
Line 52: No source code is available for type com.google.gwt.xml.client.Document; did you forget to inherit a required module?
Up to this point I was used to the fact, that eclipse did everything for me; so I had absolutly no idea what to do, since google returned no hints to this problem. I started to study the documentation and the project in detail and found the solution:
To “inherit” the XML module in GWT, you have to add the following line to the gwt.xml:
<inherits name="com.google.gwt.xml.XML" />
The gwt.xml file can be found under your project in the path: <project>/src/<your domain>/<project>.gwt.xml
After adding this line, dealing with XMLs is really simple. I’ll post an article here with examples, as soon as I can get a little time for my blog again.