I used com.vaadin.tapio.googlemaps.GoogleMap component to connect with Google map from vaadin.
I tried the below code.(Vaadin 7.0.2)
public class StoresMainView extends VerticalLayout implements View {
#Override
public void enter(ViewChangeEvent event) {
setSizeFull();
GoogleMap googleMap = new GoogleMap(new LatLon(-27.47101, 153.02429), 10.0, "");
googleMap.setSizeFull();
googleMap.setImmediate(true);
googleMap.setMinZoom(4.0);
addComponent(googleMap);
}
But it gives the below error when running.I added the dependency in my pom.
Widgetset does not contain implementation for com.vaadin.tapio.googlemaps.GoogleMap. Check its component connector's #Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.
In my web.xml I have define the Widget set as below
<init-param>
<param-name>widgetset</param-name>
<param-value>com.client.DashboardWidgetSet</param-value>
</init-param>
And my DashboardWidgetSet as below
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.DefaultWidgetSet" />
<inherits name="org.vaadin.cssinject.Cssinject_addonWidgetset" />
<!-- -->
<set-configuration-property name="devModeRedirectEnabled"
value="true" />
<!-- Uncomment the following to compile the widgetset for one browser only.
This can reduce the GWT compilation time significantly when debugging. The
line should be commented out before deployment to production environments.
Multiple browsers can be specified for GWT 1.7 as a comma separated list.
The supported user agents at the moment of writing were: ie6,ie8,gecko,gecko1_8,safari,opera
The value gecko1_8 is used for Firefox 3 and later and safari is used for
webkit based browsers including Google Chrome. -->
<!-- <set-property name="user.agent" value="safari"/> -->
<!-- WidgetSetOptimizer -->
<inherits name="org.vaadin.easyuploads.Widgetset" />
<inherits name="com.vaadin.tapio.googlemaps.WidgetSet" />
</module>
Any help is really appreciated.
You need to make sure that the widgetset init-param in your web.xml points to the right widgetset. The default one does not contain any information about the Google Map component's widgets.
Related
I have a substantial web-app that is built using GWT-2.5.1 and Java 8. With the deprecation of Java 8, I need to migrate this to Java 10 / 11.
I've managed to get past a few issues, but I've hit one I cannot get past.
When building the app, I get the following error:
[INFO] Compiling module com.<xxx>
[INFO] [ERROR] Unable to find type 'java.lang.Object'
[INFO] [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')
Looking at the gwt.xml files, it looks correct to me:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to="xxxx">
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.user.theme.clean.Clean" />
<inherits name="com.google.gwt.logging.Logging" />
<inherits name="com.XXXXCoreBase" />
<!-- Delete non-0inherits stuyff -->
</module>
<!-- XXXXCoreBase -->
<?xml version="1.0" encoding="UTF-8"?>
<module>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.query.Query"/>
<!-- Other module inherits -->
<inherits name="com.google.gwt.gen2.gen2" />
<inherits name="com.Microsoft" />
<inherits name="org.Org" />
<source path="client" />
<source path="shared" />
</module>
This compile quite happily with Java 8. What do I need to do to fix this?
According to the Release_Notes_2_8_2
Supports running in Java 9. Note that this does not yet mean that GWT
can compile Java 9 sources, or support the Java 9 JRE changes, but
that a Java 9 JRE can be used to compile a GWT project. Do note that
the new --module-path flag is not supported, but -classpath must still
be used as in the past.
and the discussion here -
If you aren't using java 9 modules, the latest release will work. It
does this by reading the classpath from
System.getProperty("java.class.path"), so if you are using standard
tools for creating classpath, everything should work fine. If you are
doing anything non-standard for assigning classpaths, or if you are
using java 9 modules (i.e. you supply a modulepath instead of
classpath), this will very likely not work for you.
It seems as if, the most you can do is to upgrade to gwt-2.8.2, with a restriction of using just the classpath and not making your application modular.
Also, here is a read further for the Java10 support discussion.
I'm using Vaadin 7.6.3 with Spring Boot. I'm trying to use the PopupButton add-on (but I don't think the issue is specific to the add-on).
I added the add-on as a dependency to gradle. This is the code for creating a PopupButton:
PopupButton btn = new PopupButton("Test Button");
btn.setContent(new Label("Test"));
layout.addComponent(btn);
Via the Vaadin plugin for Gradle I ran the task vaadinCompile which created the file src/main/resources/addon/client/ListaideWidgetset.gwt.xml and serveral files in src/main/webapp/VAADIN/gwt-unitCache and
src/main/webapp/VAADIN/widgetsets/addon.client.ListaideWidgetset. I also added #Widgetset("addon.client.ListaideWidgetset") to my UI. I confirmed that the widgetset is used via the client's ?debug mode.
Content of ListaideWidgetset.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Vaadin//DTD Vaadin 7//EN" "https://raw.github.com/vaadin/gwt/master/distro-source/core/src/gwt-module.dtd">
<!-- WS Compiler: manually edited -->
<module>
<inherits name="com.vaadin.DefaultWidgetSet" />
<set-configuration-property name="devModeRedirectEnabled" value="true" />
<set-property name="user.agent" value="ie8,ie9,gecko1_8,safari,ie10" />
<source path="client" />
<source path="shared" />
<collapse-all-properties />
<set-property name="compiler.useSymbolMaps" value="true" />
</module>
The problem is that on the client the button shows up as a standard button (no chevron) and doesn't open a popup when clicked.
Your widgetset does not contain the addon. See the the example:
<inherits name="org.vaadin.hene.popupbutton.widgetset.PopupbuttonWidgetset" />
Once added, recompile the widgetset, restart your application.
Usually the gradle plugin can handle this for you, but that feature can be disabled and or some other configuration error could prevent it. Hard to tell without the build.gradle...
edit
The gradle vaadin plugin seems not to be able to handle this addon properly. As a workaround disable the automatic management for widgetset, which prevents regeneration of the gwt.xml. See manageWidgetset in https://github.com/johndevs/gradle-vaadin-plugin/wiki/Tasks-and-configuration-DSL). E.g. add vaadinCompile.manageWidgetset = false in your vaadin{}-block.
I am a newbie to GWT and at the moment I have the problem that I created two modules (see appendix 1/2) with two entry point classes in my project. So I made two run configurations (see appendix 5/6) in Eclipse to either address the HTML page for module one (It_projekt.html) or the HTML page for module two (Reportgenerator.html). For authentication purposes, I added a LoginService class.
But now, when I start the HTML page for my second module (reportgenerator.gwt.xml) in the browser, there will be no login screen. On the other hand, when I start the HTML page for module one (It_projekt.gwt.xml) in the browser, there will appear a login screen.
So my question is: how can I make it possible (if it's possible) to have one LoginService and two HTML pages, where I as a user have to login at It_projekt.html and also Reportgenerator.html (condition: it has to be two modules with two entry point classes)? Is it maybe only possible with two different LoginService classes?
For test purposes, I added a variant of the LoginService class (as you can see in the web.xml). But the second LoginService idea didn't work either. And there is definitely some code in "onModuleLoad()" in the entry point class of the second module (reportgenerator.gwt.xml).
Maybe it might depend on a small detail, but I am unable to see it at the moment. I appended all necessary resources that I could think of. Please help me!
Appendixes:
1) It_projekt.gwt.xml:
<?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.6.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.6.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='it_projekt'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.logging.Logging'/>
<!-- 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.hdm.team7.client.It_projekt'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe"/>
</module>
2) reportgenerator.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.6.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.6.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='reportgenerator'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.logging.Logging' />
<!-- 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 paths for translatable code -->
<source path='client' />
<source path='shared' />
<entry-point class="de.hdm.team7.client.Reportgenerator"></entry-point>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe" />
</module>
3) web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee">
<!-- Servlets -->
<servlet>
<servlet-name>Stuecklistenverwaltung</servlet-name>
<servlet-class>de.hdm.team7.server.StuecklistenVerwaltungImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Stuecklistenverwaltung</servlet-name>
<url-pattern>/it_projekt/stuecklistenverwaltung</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Reportgenerator</servlet-name>
<servlet-class>de.hdm.team7.server.ReportGeneratorImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Reportgenerator</servlet-name>
<url-pattern>/it_projekt/reportgenerator</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>LoginService</servlet-name>
<servlet-class>de.hdm.team7.server.LoginServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginService</servlet-name>
<url-pattern>/it_projekt/login</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>LoginServiceReports</servlet-name>
<servlet-class>de.hdm.team7.server.LoginServiceReportsImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginServiceReports</servlet-name>
<url-pattern>/reportgenerator/loginreports</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>It_projekt.html</welcome-file>
</welcome-file-list>
</web-app>
4) LoginService.java:
package de.hdm.team7.client;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
#RemoteServiceRelativePath("login")
public interface LoginService extends RemoteService {
// String login(User user);
public LoginInfo login(String requestUri);
}// end interface
5) Run configuration:
It_projekt.html
-superDevMode -server com.google.appengine.tools.development.gwt.AppEngineLauncher -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl It_projekt.html -logLevel INFO -codeServerPort auto -port auto -war C:\Users\dev\git\it-projekt\it-projekt\war de.hdm.team7.It_projekt de.hdm.team7.reportgenerator
6) Run configuration:
Reportgenerator.html
-remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl Reportgenerator.html -logLevel INFO -codeServerPort 9997 -port 8888 -server com.google.appengine.tools.development.gwt.AppEngineLauncher -superDevMode -war C:\Users\dev\git\it-projekt\it-projekt\war de.hdm.team7.reportgenerator de.hdm.team7.It_projekt
Upon attempting to run my Google Web Application I've been working on in Eclipse using GWT, it gives me this error:
"Loading modules
com.example.pbot.Pbot
Loading inherited module 'com.example.pbot.Pbot'
[ERROR] Unable to find 'com/example/pbot/Pbot.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] shell failed in doStartup method"
All of my packages are com.pbot, com.pbot.client, com.pbot.server, etc; I don't know where it's seeing com.example.
The entry-point class in the gwt.xml file is com.pbot.client.Pbot, which is my entry point class. Here's the full gwt.xml:
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='pbot'>
<!-- 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='com.pbot.client.Pbot'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
</module>
I've cleaned, refreshed and restarted the project, I don't know what else to do. Where is it reading "com.example?" Please help!
Check the run configurations -> Arguments. There will be a reference of com.example.pbot.Pbot.
I think, this is what Thomas mentioned.
Check the project properties, in the GWT page, it probably references the com.example that you initially created.
My GWT app, using UiBinder, won't load in Internet Explorer. However, it loads just fine in Firefox, Safari, and on the iPhone.
In trying to isolate the problem, I've been stripping out parts trying to find the root cause. I'm down to basically a Label and it still works in FF but not IE.
Here's the EntryPoint:
public class Core implements EntryPoint {
private static Core instance;
public static Core instance() {
return instance;
}
#Override
public void onModuleLoad() {
instance = this;
RootPanel container = RootPanel.get("container");
container.add(new Label("hi"));
}
}
Here's my index.jsp:
<!doctype html>
<html>
<head>
<script type="text/javascript" src="core/core.nocache.js"></script>
</head>
<body>
<div id="container"></div>
</body>
</html>
Here's my appengine-web.xml:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>realAppNameHere</application>
<version>andrew</version>
<static-files>
<include path="**" />
<!-- The following line requires App Engine 1.3.2 SDK -->
<include path="**.nocache.*" expiration="0s" />
<include path="**.cache.*" expiration="365d" />
<exclude path="**.gwt.rpc" />
</static-files>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
</appengine-web-app>
And here's my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Even with this stripped-down version of everything, it still works in Firefox but not IE. Now there aren't even any bugs thrown, not even in Firebug... it just doesn't show the label in IE, but it will show the label in FF. I have no idea why this isn't running.
Anyone have any idea?
Edit 3:
Forgot the module.gwt.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='core'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.ajaxloader.AjaxLoader'/>
<inherits name="com.google.gwt.logging.Logging"/>
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<entry-point class='com.company.core.client.Core'/>
<source path='client'/>
<source path='shared'/>
<set-property name="gwt.logging.logLevel" value="SEVERE"/>
<set-property name="gwt.logging.enabled" value="FALSE"/>
<set-property name="gwt.logging.consoleHandler" value="ENABLED"/>
<set-property name="gwt.logging.simpleRemoteHandler" value="DISABLED" />
</module>
Some of the things won't come up in IE6 but it will definitely get loaded. The first thing you need to see is whether you have added an User agent for IE6 as
<set-property name="user.agent" value="ie6"/>
in your .gwt.xml file.
Next thing you need to check that whether you added an exception for localhost in your browser security settings.
If all this is done and still not working try to cleanup your project and recompile it.
From testing on an actual copy of IE (not the IE plugin for Firefox) we were able to see an error "console is not defined".
Turns out, this was throwing an exception in IE, preventing the page from loading:
public native static void log(String inString)
/*-{
console.log(inString);
}-*/;
So to solve this, we'll take out that reference to console and replace with a cross-browser logging library, such as GWT-Log