GWT using OSM causes Exception - java

i have problems with gwt using openlayers and openstreetmaps to get a simple
example projekt to work.
When i run the projekt it always throws an exception:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:406)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:5 26)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Unknown Source) Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) #org.gwtopenmaps.openlayers.client.layer.OSMImpl::Osmarender(Ljava/lang/String;)([string: 'Osmarender']): $wnd.OpenLayers.Layer.OSM.Osmarender is not a constructor
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:24 9)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at org.gwtopenmaps.openlayers.client.layer.OSMImpl.Osmarender(OSMImpl.java)
at org.gwtopenmaps.openlayers.client.layer.OSM.Osmarender(OSM.java:38)
at de.iisys.sara2.sara2lightWebclient.client.View.initMap(View.java:33)
at de.iisys.sara2.sara2lightWebclient.client.View.onModuleLoad(View.java:26) ... 9 more
My Example Code:
public class View implements EntryPoint {
public View() {
}
public void onModuleLoad() {
initMap();
}
private void initMap() {
MapOptions defaultMapOptions = new MapOptions();
MapWidget mapWidget = new MapWidget("684px", "330px", defaultMapOptions);
OSM osm_1 = OSM.Osmarender("Osmarender");
OSM osm_2 = OSM.Mapnik("Mapnik");
OSM osm_3 = OSM.CycleMap("CycleMap");
OSM osm_4 = OSM.Maplint("Maplint");
osm_1.setIsBaseLayer(true);
osm_2.setIsBaseLayer(true);
osm_3.setIsBaseLayer(true);
osm_4.setIsBaseLayer(true);
Map map = mapWidget.getMap();
map.addLayer(osm_1);
map.addLayer(osm_2);
map.addLayer(osm_3);
map.addLayer(osm_4);
map.addControl(new LayerSwitcher());
map.addControl(new MousePosition());
LonLat lonLat = new LonLat(6.95, 50.94);
lonLat.transform("EPSG:4326", "EPSG:900913");
map.setCenter(lonLat, 12);
RootPanel.get().add(mapWidget);
}
Does anybody know how to solve this problem?

After some research I can tell you that osmarender as well as maplint are not supported anymore: http://wiki.openstreetmap.org/wiki/Tiles#home
If you delete those to layers from your function (osm_1 and osm_4) everything works perfectly.

Related

Target Exception throws by media player on javaFX

I'm writing a simple application with java and trying to play sounds but I can't get it to work when I create the Media object it throws
java.lang.reflect.InvocationTargetException , the file name is correct , and i tried the full file path name and i get the same error
my code is :
`
public class Try extends Application {
#Override
public void start(Stage primaryStage) throws Exception {
Pane pane = new Pane () ;
Button b = new Button("click here ") ;
Media m = new Media ("music.mp3");
MediaPlayer md = new MediaPlayer(m) ;
b.setOnAction(e -> {
md.play();
System.out.println("clicked");
});
pane.getChildren().add(b) ;
Scene s = new Scene(pane , 300 ,300 ) ;
primaryStage.setScene(s);
primaryStage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
i tried .wav files and get same error .
the full error :
`
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$159(LauncherImpl.java:182)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: uri.getScheme() == null! uri == 'music.mp3'
at com.sun.media.jfxmedia.locator.Locator.<init>(Locator.java:218)
at javafx.scene.media.Media.<init>(Media.java:393)
at ttry.Try.start(Try.java:17)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$166(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$179(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$177(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$178(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$152(WinApplication.java:177)
... 1 more
Exception running application ttry.Try
`

FactoryConfigurationError thrown when trying to load jar from ByteArray with custom ClassLoader

I want to dynamically load JAR Files using a ClassLoader from a ByteArray. It works fine with every executable JAR Files I've tried it with so far, except a Program using WebLaF. I always get the following set of Errors:
javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
at javax.xml.parsers.FactoryFinder.findServiceProvider(Unknown Source)
at javax.xml.parsers.FactoryFinder.find(Unknown Source)
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
at com.thoughtworks.xstream.io.xml.DomDriver.<init>(DomDriver.java:64)
at com.thoughtworks.xstream.io.xml.DomDriver.<init>(DomDriver.java:56)
at com.thoughtworks.xstream.io.xml.DomDriver.<init>(DomDriver.java:48)
at com.alee.utils.XmlUtils.initializeXStream(XmlUtils.java:90)
at com.alee.utils.XmlUtils.getXStream(XmlUtils.java:77)
at com.alee.utils.XmlUtils.processAnnotations(XmlUtils.java:141)
at com.alee.laf.WebLookAndFeel$2.propertyChange(WebLookAndFeel.java:855)
at java.beans.PropertyChangeSupport.fire(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
at com.alee.laf.WebLookAndFeel.install(WebLookAndFeel.java:932)
at com.alee.laf.WebLookAndFeel.install(WebLookAndFeel.java:918)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at xx.ByteCodeClassLoader.main(ByteCodeClassLoader.java:178)
Caused by: java.lang.RuntimeException: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
... 24 more
Caused by: java.util.ServiceConfigurationError: javax.xml.parsers.DocumentBuilderFactory: Error locating configuration files
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$100(Unknown Source)
at java.util.ServiceLoader$LazyIterator.hasNextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.hasNext(Unknown Source)
at java.util.ServiceLoader$1.hasNext(Unknown Source)
at javax.xml.parsers.FactoryFinder$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 24 more
Caused by: java.io.IOException: Cannot fetch URL out of res
at xx.ByteCodeClassLoader.findResources(ByteCodeClassLoader.java:72)
at java.lang.ClassLoader.getResources(Unknown Source)
... 29 more
java.lang.NullPointerException
at com.alee.utils.XmlUtils.processAnnotations(XmlUtils.java:141)
at com.alee.laf.WebLookAndFeel$2.propertyChange(WebLookAndFeel.java:855)
at java.beans.PropertyChangeSupport.fire(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
at com.alee.laf.WebLookAndFeel.install(WebLookAndFeel.java:932)
at com.alee.laf.WebLookAndFeel.install(WebLookAndFeel.java:918)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at xx.ByteCodeClassLoader.main(ByteCodeClassLoader.java:178)
After this, the JAR runs successfully until it has to load the GUI. Then it crashes with another error:
javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
My Code is the following:
public class ByteCodeClassLoader extends ClassLoader {
final Map<String, byte[]> classes;
final Map<String, byte[]> res;
-snip-
#Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
byte[] code = classes.get(name);
if (code != null){
return defineClass(name, code, 0, code.length);
}
return super.findClass(name);
}
#Override
public URL getResource(String name) {
URL ur = ByteCodeClassLoader.class.getResource(name);
if (ur != null) {
return ur;
}
try {
return new URL(null, "bytes:///" + name, new BytesHandler());
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
#Override
public InputStream getResourceAsStream(String name) {
return new ByteArrayInputStream(res.get(name));
}
#Override
protected Enumeration<URL> findResources(String name) throws IOException {
throw new IOException("Cannot fetch URL out of res");
}
-snip-
If you know a solution to this issue, it would help me greatly. Even just a lead in the right direction would be awesome. I hope I supplied all the important information.

Playing a YouTube video with JavaFX

I've watched a lot of posts about playing YouTube videos, and also watched Oracle learning tutorials. They used this code and it worked perfectly to them, but I get errors. And can't find a way to fix it.
#Override
public void start(Stage window) throws Exception
{
Media media = new Media("https://www.youtube.com/watch?v=Q0oIoR9mLwc");
MediaPlayer player = new MediaPlayer(media);
MediaView view = new MediaView(player);
player.setAutoPlay(true);
StackPane sp = new StackPane(view);
Scene sc = new Scene(sp,500,500);
window.setScene(sc);
window.show();
}
ERRORS I GET
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsupportedOperationException: Unsupported protocol "https"
at com.sun.media.jfxmedia.locator.Locator.<init>(Unknown Source)
at javafx.scene.media.Media.<init>(Unknown Source)
at PlayVideo.Main.start(Main.java:34)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(Unknown Source)
... 1 more
Exception running application PlayVideo.Main
I also checked this link on stackoverflow but couldn't find solution. Link
Also tried it this way but video won't load.
#Override public void start(Stage stage) throws Exception {
WebView webview = new WebView();
webview.getEngine().load(
"https://www.youtube.com/watch?v=jaPUbzfJx2A"
);
webview.setPrefSize(640, 390);
stage.setScene(new Scene(webview));
stage.show();
}
}

How to fill the treeTableView correctly

I have a record in database which being get must be in the tree table view. Here is the filling method:
private void updateGoods(){
goodsPane.setCenter(goodTreeTableView);
List<Good> goodAndFoldersList;
try {
goodAndFoldersList = goodsService.getGoods();//database query
}catch (SQLException e){
goodAndFoldersList = new ArrayList<>();
log.log(Level.ERROR, e.getMessage());
}
List<Good> goods = new ArrayList<Good>();//list for roots
List<Good> roots = new ArrayList<Good>();//list for goods themselves
for (Good good : goodAndFoldersList) {
if (good.isIs_folder()) {
roots.add(good);
} else {
goods.add(good);
}
}
TreeItem<Good> rootItem = new TreeItem<>();//the main root
for (Good root : roots) {
Long folderId = root.getId();
TreeItem<Good> rootTreeItem = new TreeItem<>(root);
for (Good good : goods) {//looking for goods for each folder
if (good.getFolderId() == folderId) {
TreeItem<Good> goodTreeItem = new TreeItem<>(good);
rootTreeItem.getChildren().add(goodTreeItem);
}
}
rootItem.getChildren().add(rootTreeItem);//adding every folder to the main root
}
goodTreeTableView = new TreeTableView<>(rootItem);
}
after this method user doesn't see anything in the treeTableView. Maybe there nessessary to define cell content, but this code being put before goodTreeTableView = new TreeTableView<>(rootItem); drops NullPointerException:
goodName.setCellValueFactory((TreeTableColumn.CellDataFeatures<Good, String> param) ->
new ReadOnlyStringWrapper(param.getValue().getValue().getName()));
folderId.setCellValueFactory((TreeTableColumn.CellDataFeatures<Good, Number> param) ->
new ReadOnlyLongWrapper(param.getValue().getValue().getFolderId()));
is_folder.setCellValueFactory((TreeTableColumn.CellDataFeatures<Good, Boolean> param) ->
new ReadOnlyBooleanWrapper(param.getValue().getValue().isIs_folder()));
I guess this is the reason of my problem but why this drops NPE I can't figure out.
UPD: if I add setting cell value factory I get the following stacktrace:
javafx.fxml.LoadException:
/D:/javaEdi/linkserver/ediagent/target/classes/com/ediagent/edi/gui/Main.fxml
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2595)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2565)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2435)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2403)
at com.ediagent.edi.gui.Main.initRootLayout(Main.java:44)
at com.ediagent.edi.gui.Main.start(Main.java:27)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821)
at com.sun.javafx.application.LauncherImpl$$Lambda$51/1546859350.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323)
at com.sun.javafx.application.PlatformImpl$$Lambda$44/1712669532.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/157858792.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/1225373914.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/152005629.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2560)
... 18 more
Caused by: java.lang.NullPointerException
at com.ediagent.edi.gui.MainController.updateGoods(MainController.java:309)
at com.ediagent.edi.gui.MainController.initialize(MainController.java:328)
... 28 more
**UPD:**rootItem:
You are adding the data to an GUI element on FXML, by re-initializing it. Avoid re-initialization of FXML elements.
You can change the signature of updateGoods() to :
public TreeItem<Good> updateGoods() {
...
}
and use it in the MainController to set items
goodTreeTableView.setRoot(updateGoods());
Preferably, you can also return only data(List) from updateGoods() instead of returning a TreeItem. Create it in the Controller and set it as the root of goodTreeTableView.

gwt RPC is not working

what is the wrong in my code..
Public MyServiceAsync my=GWT.create(MyService.class);
HTML serverResponseLabel = new HTML();
public void onModuleLoad() {
final Label errorLabel = new Label();
RootPanel rootPanel = RootPanel.get();
rootPanel.setSize("100%", "100%");
rootPanel.add(errorLabel);
serverResponseLabel=new HTML();
rootPanel.add(serverResponseLabel);
Button btnSearch = new Button("Search");
rootPanel.add(btnSearch, 558, 110);
btnSearch.setSize("63px", "29px");
btnSearch.addClickHandler(this);
}
#Override
public void onClick(ClickEvent event) {
// TODO Auto-generated method stub
System.out.println("clicked");
my.myMethod("ka",new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
serverResponseLabel.setHTML(SERVER_ERROR);
}
public void onSuccess(String result) {
serverResponseLabel.setHTML(result);
}
});
}
Sync
public interface MyService extends RemoteService {
public String myMethod(String s);
}
Async
public interface MyServiceAsync {
public void myMethod(String s, AsyncCallback<String> callback);
}
synImple
public class MyServiceImpl extends RemoteServiceServlet implements MyService {
public String myMethod(String s) {
return s+"example";
}
}
i am getting an uncaught exception escaped error.....
com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:214)
at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:96)
at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:107)
at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:155)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gwt.user.client.rpc.ServiceDefTarget$NoServiceEntryPointSpecifiedException: Service implementation URL not specified
at com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.doPrepareRequestBuilderImpl(RemoteServiceProxy.java:326)
at com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.doInvoke(RemoteServiceProxy.java:265)
at com.test.test.client.MyService_Proxy.myMethod(MyService_Proxy.java:37)
at com.test.test.client.Test.onClick(Test.java:70)
at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:204)
at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:96)
at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:107)
at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:155)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Unknown Source)
You need to add #RemoteServiceRelativePath("some.path") to you interface.
See this tutorial.
When running your RPC call, development mode displays an exception NoServiceEntryPointSpecifiedException: Service implementation URL not specified. This error means that you did not specify a #RemoteServiceRelativePath in your service interface, and you also did not manually set target path by calling ServiceDefTarget.setServiceEntryPoint().
ServiceDefTarget target = (ServiceDefTarget) yourService;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "yourpath");
Also note this one that's closely related to above one,
If invoking your RPC call fails with a 404 StatusCodeException, your web.xml may be misconfigured. Make sure you specified a #RemoteServiceRelativePath and that the specified in your web.xml matches this value, prepended with the location of your GWT output directory within the war directory.
For every annotation definition given above, corresponding entry for service impl should be given in web deployment descriptor i.e web.xml. As an example,
<servlet>
<servlet-name>sampleServlet</servlet-name>
<servlet-class>samples.gwt.SampleServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>sampleServlet</servlet-name>
<url-pattern>/sample-gwt-module/sampleService</url-pattern>
</servlet-mapping>
where
sample-gwt-module
is the (alternate) name of the sample GWT module as defined in module definition as

Categories

Resources