basic spring gwt application on Cloudfoundry hangs on loading screen - gwt

I deployed a very simple Spring ROO Java (6) app using GWT and HSQL/Hibernate to Cloudfoundry. It is deployed and running but when accessed, the browser window simply states "Loading" and seems to hang indefinitely. It runs fine locally via Maven goal 'gwt:run'.
FYI, I had already built a similar app the same way only using MVC instead of GWT and it is deployed and running fine. The MVC app utilizes several HSQL tables.
I have reduced the GWT app to a single table containing a single field and still cannot get it to display. Any suggestions on where to start looking?

Question was answered by user asking the question: "Well, I found my own answer, posted on the Springsource website: Thread: how to deploy a gwt project to tomcat? http://forum.springsource.org/showthread.php?105346-how-to-deploy-a-gwt-project-to-tomcat"

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.

Web framework with user-friendly desktop deployment?

I'm building a web app with Backbone.js (I'm not tied to Backbone yet though). I need a back-end framework only for persistence to a database via a RESTful API. However, I also need to able to deploy it as a 'desktop' app for off-line use, i.e. running a local server and launching a browser window, but I don't want users to have to start a server from the command line to run the application.
I can use SQLite as a database since it's only a single user application, it's just the framework that I'm stuck on. I have looked at the following:
Rails and Django: Default web servers are too flimsy, requires Ruby/Python and runs from the command line. I'm aware of the Bitnami stacks but at 99mb it's too big of a dependency and not exactly hidden from the user.
Sproutcore: Run from command line, also too bulky.
Pyjamas Desktop - Depends on MSHTML which I suspect limits my ability to use HTML5 features.
I'm leaning towards creating a Java app that starts a Scala/Lift server instance and opens a web browser, then sits in the system tray (kind of like WAMP). Is anyone familiar with a tool or framework built for user-friendly deployment as a standalone desktop app?
I do not know if PHP is an option for you? Then I would recommend phpdock.
web2py has a standalone deploy-to-desktop feature with no dependency on Python: http://web2py.com/books/default/chapter/29/14#How-to-distribute-your-applications-as-binaries
As Eydun said, phpdock is an option but it's commercially licensed .
I settled on using Java/Spring/H2/Hibernate/Jetty. I find that Jetty serves requests VERY quickly so the application looks real-time when launched in a browser. There is a tutorial on embedding the Jetty server here. I imagine it's quite trivial to build a GUI that launches the server and a browser.
Another Java option is to use the Play Framework, which may be more at home to those coming from a Django/Rails background. However, the documentation for "creating a standalone version of your application" for Play 2.0+ indicates that they have ditched using Java EE containers (Tomcat/Jetty) and WAR files in favor of running the JARs with the bundled copy of JBoss Netty, so it may take a bit of work to get it running the way you want it.
I would recommend the Play Framework approach if you're OK with using/learning Scala.

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 :-).

Speeding up code changes in Eclipse Web Browser?

I'm developing an application using the Vaadin framework in Eclipse. I'm using the Tomcat v6.0 servlet and run the application in the Eclipse Web Browser. A problem I've been having though is to have recent changes show in the browser when I test the application.
No matter how many times I restart Tomcat, clean all published resources and restart the Eclipse Web Browser the changes still won't take effect. The changes seem to take effect randomly where time is the biggest factor, which is of great frustration when developing...
So my question is if anyone else has noticed this problem and have any ideas of how to solve it, if there is a configuration I can do or if I'm missing a step in the restart which blocks the changes from taking effect..?
Any help would be greatly appreciated!
In Vaadin most of the code runs in the server and is contained in normal Java files. There are three levels of resource/class changes:
The runtime "hot code replacement". If running Tomcat in debug mode some Java class changes can be published without redeploying the web application. However, if the Tomcat is configured to "auto publish" (check your server settings in Eclipse), the redeployment is automatically done whenever classes change and this causes full context reload and sessions serialization (see #2) . Hot code replacement can be enhanced using tools like JRebel.
Web application deployment. This is essentially deploying a new war file to the server. Causes the previous version to be undeployed and deploys the new version of all classes and resources. Sometimes there are some resources left in the servers work directory or classes are not reloaded, in which case the server restart (#3) is needed.
Server restart. This makes the whole JVM to reload and all the classes and web applications are also reloaded. Still cleaning the work directory separately is needed to make sure everything is reloaded.
In addition to this there is the client-side part of Vaadin (essentially a JavaScript compiled with GWT), which is treated as a static resource by Tomcat. If you modify the client-side Java code the GWT is used to recompile the JavaScript. Deployment should be simply file copying. The browsers cache the generated HTML/JS files, but GWT includes mechanism to avoid this.
You should first try to change the server settings for automatic publishing and see if that helps. Also, I've noticed that different Tomcat version behave differently. This is unfortunate, but the only thing you can do is to try to find the versions/set-up that works for you.
Just to make sure: you have been adding ?restartApplication in the URL to force application to restart on page reload, haven't you?

GWT in its web-mode throws StatusCodeException but in its hosted-mode , it's working perfect

I am new to this forum.
Actually I have an issue here regarding my application which is
hibernate+struts based application. Recently we have decided to
integrate GWT into our application. We are using gwt 1.5.3 build.
We have set up everything exactly as we find in documentation and
various blogs. Yeah I am now in a very nervy state as gwt in its web-
mode is treating me in a very embarassing manner. But it is compiling
and working perfectly fine in its hosted-mode and everything works
fine as we expected and designed. When I try to integrate GWT with our
application i.e. running in tomcat (http://localhost:8080/myapps/example.do?
reqCode=takeMeToGWT&userId=12&templateId=10). The gwt page is loaded
partially and in the midst it throws an exception i.e.
StatusCodeException. This doesn't happen when I run the gwt
application in hosted-mode ( http://localhost:8888/com.myapp.gwt.MyApp/Home.html
) .
I am using Intellij Idea 8, struts 1.3 ,hibernate 3 and tomcat 5.5 .
Expecting your responses at the earliest possible time.
Thanking you
B Roshnikanta Sharma
broshnikanta#gmail.com