How to solve error in GWT Project - gwt

I created a web application project. It ran successfully, but shows one message.
i.e. GWT Module needs to BE (re)compiled message displayed. How to solve this error/warning?

"GWT Module need to BE (re)compiled" - that means, you should call the app with the gwt.codesvr parameter, for example:
http://localhost:8080/MyProject/index.html?gwt.codesvr=172.16.0.43:9997

This message must be coming If you are running GWT in Development mode? check if you have installed the GWT browser plugin properly, check if there are any errors shown in the development mode tab(in eclipse).

Related

Entreprise-Application deployed succesfully but it is not running

I am trying to develop my first web-application based on java-EE. This application should be deployed on WildFly application server. For That purpose, I made my inspiration from https://bitbucket.org/lassitercg/example/src.
I made some modifications on my Code.
I am developing this application using IntelliJ-Community. The Application was successfully deployed.
whenever I try to access the application using the following URL localhost:8080/startweb, I get the http status code 404. The code can be found unter this link https://github.com/amitakCsNew/startweb
Since I using Intellij Community edition, I am forced to deploy the application then set the breakpoint in the Controller of the application. The application seems to be succesfully deployed, but I am not jumping to the first breakpoint.
any Idea how I can solve this problem ?
Your webapp layout is wrong. Please refer to the standard Maven directories layout.
You need to move webapp directory to src/main. Then update pom.xml file reference to web.xml, then move META-INF from resources into webapp then fix your syntax errors in index.xhtml (the same h namespace is associated with 2 different URLs), then fix/implement your database, then add faces servlet in web.xml, add faces-config.xml, then your web app should be available at http://localhost:8080/startweb/.
Once you resolve all the problems and the controller code finally executes, you will be able to debug it from the IDE using Remote debug configuration.
If you are new to all of this, I'd suggest starting with something more simple, like a single JSP page and a single Java servlet.
Post the new questions if you have issues describing what you did to solve the problem and what exactly didn't work. The current question is too broad and your sample project has too many issues to cover in the single answer.

Create GAE eclipse project

I have installed Eclipse Java EE Luna Release (4.4.0) and App Engine SDK 1.9.10
I have created a new Google - Web Application Project and selected the Generate Project Sample Code option. I changed nothing about the project.
The generated project successfully deploys and runs locally. However when I deploy this to AppSpot I get an error message "Remote Procedure Call - Failure" when clicking on the "Send" button on the sample form.
Are there other steps I need to perform in order for the generated project to be successfully deployed to AppSpot?
My goal is to have a starting application that deploys so I can start learning to use Objectify and GWT to build applications. If there is a better way to go about this please suggest it.
Kind regards
Sean
I think seem to remember that sample code for the GWT builds a RPC-based HelloWorld or greeting example. In the auto-generated sample interface you type a name, a RPC call is made to server side and you get "Hello"+yourName or similar as a callback.
Check this link:
http://www.gwtproject.org/doc/latest/tutorial/appengine.html
This is a more advanced app, StockWatcher, from the GWT tutorials which is also RPC based and adapted for the GAE. You could start here: http://www.gwtproject.org/doc/latest/tutorial/gettingstarted.html to build this app (is really easy) and follow to the link above to deploy StockWatcher on the GAE, or check directly the steps on the first link and try to deploy the GWT "Greetings" example.
If you have already tried this or you do and there's still a problem, please provide the full stack trace, or the code you think might be causing the problem, so we have a better insight of the problem.

Gwt hosted mode stopped working from Eclipse on adding a special dependency via maven

On integrating a library on server side of my gwt app (maven, gwt 2.4) the development/hosted mode stopped working. The app works fine if deployed or run with "gwt:run" and all unit tests and integration tests pass as before.
If i start development mode (run/debug as web application) from Eclipse the develpoment mode view pops up but nothing else happens. normally the console should show some output but console keeps empty. So i don't even have a hint whats going wrong.
Can someone give some advice where to look / what to do to get at least a hint what's wrong?
if i check out the revision before integrating the library the development mode works! - at the moment i add the dependency (only adding not using it) it stops working.
Background about library i added (don't know if my problem relates to this):I had some problem on integrating the library. the library uses eclipse birt charting engine. This engine has a dependency to Apache derby db, this conflicted with another library. i solved this by excluding the derby dependency via maven. the second problem was a "command line too long" error on unit test - this was solved by updating the maven-surefire-plugin.
The Problem was hard but the solution is simple: With Java 7 it is working!
The problem could be reproduced on 2 of 3 machines. The machine without the problem is the only one that uses java 7. So i installed java 7 on my machine and linked eclipse to it - now hosted mode (from eclipse) works again :-).

plugin failed to connect to development mode server at 127.0.0.1

I am using GWT 2.3.0 as a plugin for Eclipse to develop a web based application
Unfortunately, when I try to run my application I get:
plugin failed to connect to developer mode server at 127.0.0.1:9997
and
onModuleLoad() threw an exception :java.lang.reflect.InvocationTargetException
I have installed the Gwt developer plugin for Google Chrome and every time I run my project it requires me to install this plugin and restart the browser, after which I get the above mentioned problem.
You can solve this issue by:
Right click on your web project -> Run as -> Run configurations.
Select 'Server' and 'GWT' tabs respectively and check on 'Automatically select an unused port'
Clear Cache from your Chrome browser (do the same on Firefox if you are using Firefox, remember the GWT plugin is not available on the latest Firefox versions, 3-10 I believe).
Run and hopefully enjoy.
I know it's an old question but,
I ran into the same problem today.
For some reason (quite unknown to me) deleting the ":9997" from the end of the address fixed it, and the application came up nicely.
Hope this helps.
Look at http://notepad2.blogspot.com/2010/12/debug-google-web-toolkit-applications.html for a step by step instruction on how to set up chrome, particularly the last part on how to setup the plugin using an external web server.
For the first problem that you faced : plugin failed to connect to developer mode server at 127.0.0.1:9997 , just clear your browser cache and try once again.
Just happend to me today too, and I've managed to fix it:
It turns out that the set of the GWT modules to be loaded is configureable; by referring to one of the GWT html's from the browser, it appears I was actually trying to connect to a page under a module that has been removed from the run-config's modules list. So, one more thing to do is to verify the list's content:
In eclipse: "Run Configurations" > Web Application > (your app) > GWT tab > Available Modules
In IntelliJ (that's what I've used): Edit Configurations > (select your GWT config) > GWT Modules to load
The GWT Plugin may be need to restarted
First Clear Browser cash
Second : try the following on chrome browser
-
open : chrome://extensions/
Go to : GWT Developer Plugin
uncheck the Enabled box
check the Enabled box
Open URL again and have fun :)
I fixed the issue by only clearing the browser cache. I am working with Firefox 15.0.1

Where does GWT's Hosted Mode Jetty Run From?

I'm trying to call a web service in my back end java code when it's
running in hosted mode. Everything loads fine, the GWT RPC call works
and I can see it on the server, then as soon as it tries to call an
external web service (using jax-ws) the jetty falls over with a
Internal Server Error (500).
I have cranked the log all the way up to
ALL but I still don't see any stack traces or cause for this error. I just get one line about the 500 Error with the request header and response.
Does anyone know if the internal jetty keeps a log file somewhere, or
how I can go about debugging what's wrong?
I'm running GWT 1.7 on OS X 10.6.1
Edit: I know that I can use the -noserver option, but I'm genuinely interested in finding out where this thing lives!
From the documentation:
You can also use a real production
server while debugging in hosted mode.
This can be useful if you are adding
GWT to an existing application, or if
your server-side requirements have
become more than the embedded web
server can handle. See this article on
how to use an external server in
hosted mode.
So the simplest solution would be to use the -noserver option and use your own Java server - much less limitations that way, without any drawbacks (that I know of).
If you are using the Google Plugin for Eclipse, it's easily set up in the properties of the project. Detailed information on configuration can be found on the official site.
Edit: you could try bypassing the Hosted Mode TreeLogger, as described here: http://blog.kornr.net/index.php/2009/01/27/gently-asking-the-gwt-hosted-mode-to-not):
Just create a file called
"commons-logging.properties" at the
root of your classpath, and add the
following line:
[to use the Log4j backend]
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
[to use the JDK14 backend]
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
[to use the SimpleLog backend]
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
Edit2: the trunk of GWT now also supports the -logfile parameter to enable file logging, but it probably won't help in this case, since the problem lies in the way the Hosted Mode treats the exceptions, not the way it presents them.