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.
Related
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.
From GWT tutorial (http://www.gwtproject.org/doc/latest/DevGuideUiCss.html), we know there are multiple approaches for associating CSS files with your module. Therein, one way is using the <stylesheet> element in the module XML file.
When I used the way to do it, I got the warning message below. It seems the way doesn't work.
Here's the contents of module1.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.7.0/distro-source/core/src/gwt-module.dtd">
<module rename-to="entry1">
<inherits name="com.google.gwt.user.User" />
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<source path="client" />
<entry-point class="com.jst.gwt2.client.Entry1"></entry-point>
<stylesheet src="../entry1.css" />
<source path='client' />
<source path='rpc' />
</module>
Here's the warning message:
GET /entry1.css
[WARN] ignored get request: /entry1.css
[WARN] not handled: /entry1.css
quoting #Thomas Broyer:
to get the full explanation click here
You'll have to change either
the path to your CSS (e.g. /entry1.css, but that won't necessarily work once deployed in production)
the location of your CSS (e.g. put it in your module's public path and reference it as <stylesheet src="entry1.css"/>)
the way you load it (e.g. inject it from your onModuleLoad, either as a StyleElement added to the Document; or possibly as a TextResource
that you inject using StyleInjector –and use one less request to the
server)
Is it possible to use the Elemental collections (elemental.util.Collections, elemental.util.ArrayOfInt, elemental.util.MapFromStringTo, etc) in a non-elemental GWT app. I'm using these modules already:
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Inherit the RequestBuilder stuff. -->
<inherits name="com.google.gwt.http.HTTP" />
<!-- Inherit GQuery -->
<inherits name='com.google.gwt.query.Query' />
But I'd like to start using the lightweight Elemental collections rather than Java ArrayList and HashMap. Is that possible? Would it be fairly easy to port from Elemental into it's own module for this purpose? Thanks for you help.
Sure, all you have to do is include the following declaration in your module descriptor (*.gwt.xml):
<inherits name="elemental.Elemental"/>
See the elemental example on the GWT trunk.
I could not get the GWT Elemental projects silvercomet or simple to execute in FireFox.
However a below simple elemental test code executes in FireFox and Chrome along with gwt user and http modules.
Module File.
<module rename-to="HelloElemental">
<inherits name="elemental.Elemental" />
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Inherit the RequestBuilder stuff. -->
<inherits name="com.google.gwt.http.HTTP" />
<add-linker name="xsiframe" />
<set-configuration-property name="devModeRedirectEnabled" value="true" />
<entry-point class="com.google.silvercomet.client.Main" />
</module>
Entry Point Class -
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import elemental.util.ArrayOf;
import elemental.util.Collections;
public class Main implements EntryPoint
{
public void onModuleLoad()
{
ArrayOf<String> items = Collections.arrayOf();
items.insert( 0, "First" );
Window.alert( items.get( 0 ) );
}
}
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
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' />