GWT error even on official tutorials: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly - gwt

I am learning GWT and was trying to run this tutorial by Vogella and also the official GWT tutorial.
Using the Eclipse GWT plugin 3.0 on Windows 10 and JDK 11
I marked the Maven Project checkbox.
When I right-click and Run As
Turning off precompile in incremental mode.
Super Dev Mode starting up
workDir: C:\Users\My\AppData\Local\Temp\gwt-codeserver-8137229043727681777.tmp
2021-04-29 12:03:13.494:INFO::main: Logging initialized #718ms
Loading Java files in de.vogella.gwt.helloworld.De_vogella_gwt_helloworld.
[ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')
I see that it is inheriting User
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.1//EN"
"http://www.gwtproject.org/doctype/2.8.1/gwt-module.dtd">
<module rename-to='de_vogella_gwt_helloworld'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='de.vogella.gwt.helloworld.client.De_vogella_gwt_helloworld'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe"/>
</module>
This SO question was not relevant to my issue.

Almost certainly you are either missing gwt-user.jar from your classpath, or somehow the gwt-user.jar version doesn't match the gwt-dev.jar, which will cause problems. Every module automatically inherits com.google.gwt.core.Core (despite the error message), and as your .gwt.xml shows, you already have User added.
--
Additionally, from your linked SO post, do check the comments - there are some better, more modern tutorials listed.

Related

Grails + SmartGWT

Trying to make Grails + smartgwt work together.
Setup:
Grails 2.2.1 (installed both, gwt + smartgwt plugin)
SmartGWT 3.1
GWT 2.5
After a couple of hours playing around with it, tomcat finally started.
(created application and compiled the modules)
Project resides under:
zuhause:8080/gwt3/
Default module is foo.bar
Default index.gsp looks ok
<script>
var isomorphicDir = "${createLinkTo(dir: 'gwt/foo.bar.fooBar/sc/')}";
</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" src="${createLinkTo(dir: 'gwt/foo.bar.foobar', file: 'foo.bar.foobar.nocache.js')}"></script>
The nocache.js is found
Inside the compiled "nocache.js" there is a reference to
zuhause:8080/gwt3/static/gwt/foo.bar.foobar/sc/modules/ISC_Core.js 404 (Not Found)
The path reference to "static" is the one I have no idea where it is configured.
The module xml looks like:
<module>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.google.gwt.user.User"/>
<!-- Smart GWT -->
<inherits name="com.smartgwt.SmartGwt"/>
<inherits name="com.smartgwt.tools.SmartGwtTools"/>
<!-- Specify the module entry point class. -->
<entry-point class="foo.bar.client.foobar"/>
I have scanned my complete project, but "static" has never been defined in one of the config files.
Any idea ?
Thanks in advance
The static is added by the resources plugin.

Gwt And Amazon S3 Integration getting error

package com.wa.test.client;
import com.google.gwt.core.client.EntryPoint;
import com.nubotech.gwt.oss.client.OnlineStorageService;
import com.nubotech.gwt.oss.client.OnlineStorageServiceFactory;
import com.nubotech.gwt.oss.client.auth.Credential;
public class TestAmazon implements EntryPoint {
public void onModuleLoad() {
Credential credential = new Credential("xyz#gmail.com", "QFTG8an1yTB");
OnlineStorageService storageService = OnlineStorageServiceFactory.getService(credential);
storageService.createBucket("myFirstBucket");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='testamazon'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.nubotech.gwt.oss.Oss'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='com.wa.test.client.TestAmazon'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
![enter image description here][1]</module>
This is my code and also include jar file gwt-s3-api-0.9.3.
Its give an error as follow:
12:40:38.347 [ERROR] [testamazon] Errors in 'jar:file:/D:/Technologies/Java/Amazon/jar/
gwt-s3-api-0.9.3.jar!/com/nubotech/gwt/oss/client/s3/MockS3OnlineStorageService.java'
[ERROR] [testamazon] - Line 28: The import com.google.gwt.user.client.HTTPRequest
cannot be resolved
You are using mismatched version of jars. com.google.gwt.user.client.HTTPRequest was available in older version of GWT gwt-servlet.jar and gwt-user.jar . It got deprecated in GWT 1.5 and in latest GWT it is eliminated. You should be using GWT RequestBuilder.
<inherits name='com.google.gwt.http.HTTP'/>
In Java code.
import com.google.gwt.http.client.RequestBuilder
Reference - http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/HTTPRequest.html
The third party jar you are using is very old and not updated for 3 years.
In your case the MockS3OnlineStorageService.java inside the gwt-s3-api-0.9.3.jar is using HTTPRequest class which is no longer supported in GWT 2.4

not able to use smart GWT

trying to use smart GWT
Using smart gwt 2.5 dowloded from link below
smartgwt 2.5
Firefox 6.0
I made a small web application project(without smart GWT) which is working fine.
Now in the *same project i added smartGwt 2.5
and added <inherits name="com.smartgwt.SmartGwt"/>
in myprojet.gwt.xml file.
but now when i am running the project it gives me following error:
[ERROR] [myprojet] - Unable to load module entry point class
com.smartgwt.client.SmartGwtEntryPoint (see associated exception for details)
com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.isc is undefined
at com.google.gwt.dev.shell.BrowserChannelServer.invo keJavascript(BrowserChannelServer.java:248)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke (ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative( ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeV oid(ModuleSpace.java:289)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNati veVoid(JavaScriptHost.java:107)
at com.smartgwt.client.SmartGwtEntryPoint.init(SmartG wtEntryPoint.java)
at com.smartgwt.client.SmartGwtEntryPoint.onModuleLoa d(SmartGwtEntryPoint.java:239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(Module Space.java:396)
at com.google.gwt.dev.shell.OophmSessionHandler.loadM odule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.proc essConnection(BrowserChannelServer.java:525)
at com.google.gwt.dev.shell.BrowserChannelServer.run( BrowserChannelServer.java:363)
at java.lang.Thread.run(Thread.java:662)
when i remove the <inherits name="com.smartgwt.SmartGwt"/>
from myprojet.gwt.xml file the project works fine
XML
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.user.theme.clean.Clean' />
<!-- Other module inherits -->
<inherits name="com.smartgwt.SmartGwt"/>
<!-- Specify the app entry point class. -->
<entry-point class='com.example.client.MyProjet' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
Your gwt.xml seems correct.
GWT Compile and cleaning brwoser cache should work.

errors in GWT program

I am developing a simple app (using GWT RPC & Hibernate) to insert data into database & retrieve. It was working fine with adding user method.
Now I write a method to retrieve data from database & display. It is raising source path errors when module is loaded into browser.
The structure of project in eclipse is:
-src
-user.hbm.xml
-hibernate.cfg.xml
->rpctest
->Rpctest.gwt.xml
->rpctest.hibDomain
->User.java
->rpctest.client
->Rpctest.java
->service interfaces
->rpctest.server
->service implementation
->HibernateUtil.java
Here is stack trace:
[DEBUG] [rpctest] - Validating newly compiled units
[TRACE] [rpctest] - Finding entry point classes
[ERROR] [rpctest] - Unable to find type 'rpctest.client.Rpctest'
[ERROR] [rpctest] - Hint: Previous compiler errors may have made this type unavailable
[ERROR] [rpctest] - Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] [rpctest] - Failed to load module 'rpctest' from user agent 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)' at 127.0.0.1:49465
Rpctest.gwt.xml
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='rpctest'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='rpctest.client.Rpctest'/>
<!-- Specify the paths for translatable code -->
<source path='rpctest.client.Rpctest'/>
<source path='server'/>
<source path='hibDomain.User'/>
</module>
The class User in the hibDomain package is not included in your gwt source path
You can configure the classes that the gwt compiler should translate to javascript by adding them in your gwt xml file. Take a look at the docs: http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml

GWT - Unable to find type 'com.myapp.launcher.client.LauncherInitializer' multi-module architecture

I have a project with the following structure:
com.myapp.gwt:
Basic.gwt.xml
Launcher.gwt.xml - inherits Basic.gwt.xml
Module1.gwt.xml - inherits Basic.gwt.xml
com.myapp.gwt.ui.basic.client:
AppActivityMapper.java
AppHistoryManager.java
AppPlaceHistoryMapper.java
BasicInitializer.java - this is a daddy class for all entry points
MainClientFactory.java
MainClientFactoryImpl.java
com.myapp.gwt.ui.launcher.client: - all the stuff for the launcher module is here
LauncherInitializer.java (extends BasicInitializer, launcher module's EntryPoint)
com.myapp.gwt.ui.launcher.client.places:
Places and activities for the launcher module
com.myapp.gwt.ui.module1.client: - all the stuff for the module1 module is here
Module1Initializer.java (extends BasicInitializer, module1 module's EntryPoint)
com.myapp.gwt.ui.module1.client.places:
Places and activities for the module1 module
com.myapp.gwt.shared:
Stuff shared between the client and the server (interfaces, dtos)
com.myapp.gwt.server:
Code that works only on the server
what i have in my Basic.gwt.xml is this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.3.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='myapp'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean' />
<inherits name="com.google.gwt.place.Place" />
<inherits name="com.google.gwt.activity.Activity" />
<inherits name="com.google.gwt.editor.Editor" />
<!-- Specify the paths for translatable code -->
<source path='ui.basic.client' />
<source path='shared' />
<replace-with class="com.myapp.gwt.ui.basic.client.ClientFactoryImpl">
<when-type-is class="com.myapp.gwt.ui.basic.client.ClientFactory" />
</replace-with>
<set-configuration-property name="UiBinder.useSafeHtmlTemplates" value="true" />
</module>
what i have in my Launcher.gwt.xml is this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.3.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='launcher'>
<!-- Other module inherits -->
<inherits name="com.myapp.gwt.Basic" />
<!-- Specify the paths for translatable code -->
<source path="ui.launcher.client"></source>
<!-- Specify the app entry point class. -->
<entry-point class='com.myapp.gwt.ui.launcher.client.LauncherInitializer' />
</module>
None of my classes residing inside the com.myapp.gwt.ui.basic.client package have reference to any of the classes inside the other module packages. The other module packages on the other hand have lots of references to the basic module and some of the classes even extend the classes inside the basic package.
The problem is that i'm getting this error during compiling to javascript launcher module:
[TRACE] [launcher] - Finding entry point classes
[ERROR] [launcher] - Unable to find type 'com.myapp.gwt.ui.launcher.client.LauncherInitializer'
[ERROR] [launcher] - Hint: Previous compiler errors may have made this type unavailable
[ERROR] [launcher] - Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] [launcher] - Failed to load module 'launcher' from user agent 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0' at localhost:61253
Also please tell me if you see something worth changing in the stuff i've done.
Just a quick guess: did you try : <source path='ui/basic/client' />