GWT servlets not called at all - gwt

I have ported GWT basic Hello World application to jetty-maven-plugin based app.
Everything goes fine, gwt convert client side classes to Javascript and application run properly in dev mode but no response for server side servlet. I do not get any error or exception.
Any idea what is going wrong.
Thanks

There is not much information to gave 100% answer. But be sure to check:
Server log output (could be some exception there)
If there are no exceptions on server side open console in Firebug or Google Dev Tools and load the page in browser. Probably there will be 404 not found errors.

Check if your servlet is correctly defined in : war->WEB-INF->web.xml.
Definition of servlet is:
I'm sorry but I can't put code example. I don't understand why.
Anna

Related

SmartGWT DataSource adding QueryString to REST call

So, I have a Spring-MVC RESTful backend, that is cross-domain enabled. It is unit-tested, I can call my web-services and get back the correct JSON.
I have a SmartGWT 5.1p and GWT 2.7.0 front-end application that works great in SuperDev mode or Classic Dev Mode, either works great. When I do this, I am using the old Firefox 24 browser with the GWT plugin, and I can see my app work just great. My datasources are tied to RESTful web-services, and I can create, retrieve, update, and delete records via my DataSources.
I can compile the whole app via Maven, and get a WAR created just fine. I tried moving this WAR over to a tomcat server, and it deploys correctly. I can see the app running in tomcat with no errors in the logs.
Then when I go to the first page, the app comes up s normal with no errors. The first thing I do is add a username and password into a form, and then it is supposed to call a LoginDataSource which is tied into a LoginCOntroller, or login web-service.
What I can see from firebug is that when I make my call, rather than just calling:
http://mydomain:8080/admin/login/user/myusername/pwd/mypassword
I get:
http://mydomain:8080/admin/login/user/myusername/pwd/mypassword?0{and a whole lotta stuff after this) ... the query string I presume.
When I hit the Submit button, I get a SERVER TRANSPORT error, and that's it, I don't get any more information that that. There is nothing else to report from firebug except that the OPTIONS and GET add a whole lot of query string nonsense after the password.
I can look in the tomcat logs, and I don't see any errors in there at all. I don't even see the URL call to the web-service.
Any help on this would be much appreciated. I've been dealing with SmartGWT for years, and switched to back-end development for a while, and not I am trying to make my SmartGWT front-end work as well. But, I am a little rusty as to what is happening now.
Thanks!
The problem is not the querystring, it's the old base url I have in the datasource. There is a method in each datasource called: getServiceRoot
In getServiceRoot, I was using a hardcoded "localhost:8080", which in client code that doesn't work. That means whoever is running the app in their browser, "localhost" means their machine. So, I had to change the getServiceRoot to do the following:
protected String getServiceRoot()
{
String baseUrl = "http://" + Window.Location.getHostName();
return baseUrl + UrlConstants.SOME_URL_REST_ENDPOINT;
}
Since I have two WAR's on the same machine;
one WAR is a Spring MVC back-end RESTful web-services
the other WAR is the front-end, SmartGWT client application
This is a problem I run into ... I think just because both are on the same machine, that to the front-end, just call the code on the localhost, because it is there. But to the browser, that could be any other machine.
I suppose I could have just hard-coded the public IP address of the machine running tomcat, and then the client-side SmartGWT would then certainly find the RESTful web-services. Or, I could have used a Spring Env Profile to make that happen as well. But the code change I made should work, provided both WARS are on the same machine.
I just got to remember that client-side code in a browser is relevant to the machine the browser is running on.
So, this is fixed. If anyone needs any clarification, please let me know.

GWT site works fine but will not render in SuperDevMode

I have spent the day trying to get my GWT 2.6 project to use SuperDevMode. I got to the point where I can get SuperDevMode, codeserver etc fired up in Chrome (Also tested in Firefox, linux and windows) however no amount of research seems adequate to progress me beyond the point I'm stuck on:
The site works fine when run as a normal server, (And it used to work fine in Classic Devmode) I'm reasonably convinced there's nothing fundamentally wrong with it, but as soon as I switch to SuperDevMode the GWT module won't load. I get the static content only.
First off I found an error in the Console of Chrome Developer Tools. I get a stack trace that claims that the method getCalendarFactory of my ClientFactory can't be called on an undefined reference (But again, without SuperDevMode this doesn't happen)
Uncaught com.google.web.bindery.event.shared.UmbrellaException: Exception caught: Exception caught: Exception caught: (TypeError) : Cannot read property 'getCalendarFactory' of undefined
SimpleEventBus.java:203
$doFire_0 SimpleEventBus.java:203
$fireEvent_1 SimpleEventBus.java:88
fireEvent_7 SimpleEventBus.java:52
$goTo PlaceController.java:156
$handleHistoryToken PlaceHistoryHandler.java:192
$handleCurrentHistory PlaceHistoryHandler.java:118
$onModuleLoad XXXAppController.java:62init_1 com_00046XXX_00046XXX_00046XXX__EntryMethodHolder.java:3
apply_0 Impl.java:283
entry0 Impl.java:347
(anonymous function) Impl.java:92gwtOnLoad XXX-0.js:46819
(anonymous function) Comparators.java:32
I've looked very hard through this but I'm still at a loss to understand the stack trace. After a few hours I decided to comment out a line from my AppController class (Which is serving as the entry-point in the gwt.xml):
// historyHandler.handleCurrentHistory();
However now when I load the page in SuperDevMode, I don't get the exception anymore, I get nothing except static content, no errors or output from the GWT module, so the UmbrellaException is gone but nothing else has changed really.
Any help or direction would be very gratefully received.
Did you use maven? If that's the case, have you lunch your superDevMode server on a container as Tomcat/Jetty ?
To see if your superDevMode's server works, you need to go to the url "127.0.0.1/9876". If you have no server which responds that's your superDevMode is not lunch.
More information on :
http://www.gwtproject.org/articles/superdevmode.html

https://api.parse.com/crossdomain.xml not found error

I'm using parse platform for unity3d game development. And I receive 404 not found error when
I try to run the game in safari web player on facebook canvas.
Looking into console gave me the error 404 on https://api.parse.com/crossdomain.xml
But the same thing perfectly works on chrome and firefox, though when I try to open the xml file directly using url in chrome incognito it still can't be found.
Has anybody met something like that or knows how to fix it ?
Thxs.
Could it just be an error on Parse's side? I'm getting the same issue, never seen it before. Looks like the file just doesn't exist.
The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with a given server, but the server could not find what was requested.
Are you using any third party plugins?
Some plugins do not work with certain browsers.
Try checking if there is any 'web-site root' that you had given in the program.

GWT - spring security - caching issue

I have a GWT application which is secured by Spring Security. I have a Main.html which serves the application and Login.html for login. For most part everything works fine everytime. But sometimes after restarting my application I can still access Main.html - although most of the widgets on the page are unusable. I can see the Login.html's HTML in the console being printed as exception. On refreshing, it takes me to login page. Has anyone ran into similar issue? Is this some kind of caching issue? How can this be avoided?
It seems that in your case your bootstrap file is beining cached and thus a wrong version of your app is being loaded.
You have to make sure that your bootstrap file (the one which is named nocache) is never cached. See here for more details.
You can check if your bootstrap file is cached by using Firebug and looking at the HTTP requests for your scripts. You can check two things:
If the correct <md5>.cache.html are loaded (compare it to the ones in your gwt output folder).
The response type of your .nocache. file is not 304 or so.
Adding meta tag on top of my Main.html - helped me resolve my issue for now.
Read this for more details : HTML http-equiv Attribute

Apps>Menu>Basic 405 Method Not Allowed

I am hosting my pages on my doamain. I put the following info. When I go to view the app it shows 405 Method Not Allowed..Not sure what I am doing wrong.
*
The first page load a APP makes is a POST request.
Seems your server could be rejecting them.
Its worth checking the server side error log for further information.
Indeed, it will most probably be a setting on your server. I had the same problem, my server didn't allow POST method on .html pages, changed my canvas page source to .php and all works fine now.
If you can look at your apache logs, it will provide a more clear error that we can help you debug with. Though a 405 error typically signifies a problem with the server and usually stems for a POST request.
I have made the mistake 2 times of creating my site in html instead of using a scripting extension. For example, if you are running on a Windows server and coding in Visual Studio, it is tempting to just create .htm or .html files. However, most web servers will not allow a POST operation to these pages. Instead, create .aspx pages, which will still allow you to use the same exact static HTML and JavaScript. This solved my problem in both cases.