I get "Can't find any GWT Modules on this page" - gwt

I am trying to set up my eclipse with gwt and after I installed Jdk 8 and eclipse 2019-06 and gwt eclipse plugin 3.0 I created the sample project with code generated and when I try to run the sample code in GWT Development mode it gives me url http://localhost:9876 and when I open it I get "Can't find any GWT Modules on this page" Can you please help why It is giving me Can't find any GWT Modules on this page. I am assuming if I am running it in development mode I don't need to set up web server so I didn't. I didn't used gwt for long time and I am lost why it is giving me this can't find gwt module message when I load the page. Can you please help?

You still need a server, if you want to run any java code on your server. Such as code for talking to your database.
Gwt only does 2 things:
1: is is handling the client side, where it generate javascript from your java code.
2: It includes a .jar file, which can be used together with a java servlet server such as apache tomcat to serialize java objects which can then be send between the client and the server. And this .jar file will serialize all needed objects. And gwt will generate the needed javascript code.
Gwt does not itself include any http server. The address http://localhost:9876 is only used to configure gwt. It is just a page with 2 buttons to turn dev mode on/off.
The eclipse plugin does include a embeded webserver which can be used for gwt development. I have newer done this and I think that installing an independent java tomcat server is the best solution.
But if you want to use the eclipse embeded webserver you need the "Run in development mode with Jetty." - Jetty is the name of the embeded java servlet server.

Are you using the plugin from Google ?
If so, this is outdated. I advice you to use the plugin from branflake. You can find this plugin on GitHub : https://github.com/gwt-plugins/gwt-eclipse-plugin
Also on that GitHub page a lot of documentation is available. Like a link to a very helpfull YouTube playlist: https://www.youtube.com/watch?v=DU7ZQVLR5Zo&list=PLBbgqtDgdc_TqzA-qXrjgTFMC_6DKAQyT
My advice is to watch these YouTube videos to get you started. If you follow them all should be working without a problem.
I haven't used this plugin for a while since I switched to IntelliJ. But I did use it in GWT2.8.2 so it should still work fine.

Related

How to run/debug java web service project in eclipse

I have a Java Web Service project which was just handed over to me by a colleague who just resigned (no one is assisting me in my new company). Im new to Java (J2EE) and my background is .Net + frontend + azure so I am pretty much very confused with setting up and running the java project. Also, Since my background is .Net Im referencing everything with how things work in Visual Studio from running a project, setting up a project to setting up and debugging a WCF project which I realized now is very different from eclipse + java.
I would really appreciate if someone could explain to me how I can run this project which is supposedly a java web service (as I was told)?
First I have a project that is like this:
Im assuming that the project boxed as blue is the webservice (and the rest are just libraries)? Is this correct? if so how do I run and debug the project using eclipse
Second when I click on debug as -> debug on server this is all I see:
Another colleague told me to install JBOSS (I haven't installed a server in eclipse) because that is what they used. Is there good documentation (step-by-step guide) on how to install JBOSS to run in eclipse. Im assuming that JBOSS + eclipse is like IIS express + Visual studio. Are there also other alternatives to JBOSS + eclipse like perhaps tomcat + ecplise that I can configure.
I really really find it hard to setup the java web service project in eclipse I have little to no prior experience with java j2ee programming especially with web services so any clarifications with my questions would be much appreciated. To sum up:
How would I really know that the project is a java webservice?
If so, how do I run the project and host the project using debugging in eclipse with tomcat or jboss?
I would appreciate if anyone can point me to the right direction of figuring out the source code
From here we can only guide you, you will have to go through some tutorials to understand how java projects work.
Your project is a webservice project according to your web.xml file because its having context params for rest.
the context param sets a front url to your webservice which in this case is gametime.
Check these tutorials and you will understand how it works
http://www.mkyong.com/tutorials/jax-rs-tutorials/
Create simple examples given in the above tutorial and then you can execute your's program
Jboss is a application server which we use to run our app.
You can install jboss in eclipse or you can use it externally also.
To install eclipse and jboss you can follow the link
http://theopentutorials.com/tutorials/java-ee/installing-jboss-tools-in-eclipse/
The other option is to download eclipse and jboss seperately
and use them.
Go to jbosshome/bin
If you download both of them seperately
then in that case for jboss
Invoke the add-user.sh or add-user.bat script. ...
Choose to add a Management user. ...
Choose the realm for the user. ...
Enter the desired username and password. ...
Choose whether the user represents a remote JBoss Enterprise Application Platform 6 server instance. ...
Enter additional users. ...
Create users non-interactively.
After this go to eclipse and follow steps of below link to add jboss to eclipse
http://www.mastertheboss.com/eclipse/jboss-eclipse/jboss-and-eclipse
A Java web application among other things has a predefined directory structure including folders named WEB-INF, WEB-CONTENT etc.
On how to deploy a web application to Tomcat via Eclipse you can follow the steps in this tutorial.

How to install or set up Ext JS 5 or 6 in Eclipse Luna or Juno... Need detailed process to make Ext JS work

I have found a video link with Ext JS 4 set up. But I also found two different videos on youtube... One explained with help of pre installed XAMPP and the other video using spket IDE plugin. So Iam bit confused. Whats the difference? Can I use Ext JS without installing XAMPP ( I already have tomcat server integrated with my Eclipse ). Please help me with step by step process to set up Ext JS 5 or 6 on my eclipse.
Even I recently started with extjs 5 and 6, it was a bit of a pain to understand the complete folder structure but Its not that though.
Yes you can use it with a pre-installed Apache Tomcat.
Create a normal dynamic web project, in its WebContent folder add the required extjs dependencies(ex. ext-all.js, etc)
Although i would suggest you to maintain the heirarchy while copying the dependencies.
And now all remains is for you to create a html or jsp file and start coding and giving the proper path for your dependencies.
The two videos you mentioned seem to address two compeltely different issues.
You need a server application to run your ExtJs applications properly, and you need IDE integration to be able to use Inellisense/Autocomplete while writing code in your IDE.
You need both:
1) Use your tomcat server to run the application.
2) Spket is the best option for Eclipse Integration I ever used.I I highly recommend it.

Java Web development in eclipse

I am building a web application using java servlets and jsp.
Every thing is working fine but I can't see the source code of the files like
HttpServlet from my eclipse IDE.
I think I need to download J2EE sdk. Right ??
Please tell the steps
Thank you all
There's a cool tool called jad that will do this for you.
Here's a link that explains how to install it:
http://www.mkyong.com/java/java-decompiler-plugin-for-eclipse/

lost in deployment: session.getAttribute() returns NULL in some Tomcat configurations

I am experiencing several issues that I can't understand from the first glances. The story is pretty simple, but I guess that the solution is behind some real configuration/deployment problem(s)/inconsistencies.
I have defined a JSP and two servlets. The JSP puts something in the session and the servlets are supposed to fetch the data and to manipulate it. The main symptom is that the servlets do not see the session data, when seeing JSPs in Chrome and Firefox. Interesting, that the JSP/servlets do share the data, when using Eclipse internal browser and also when using Internet Explorer (working on Win7).
Here is a bit long description along with some information (and subsequent symptoms) regarding the local configuration (and, as I believe, there lies the problem): I have installed Eclipse (Helios) under c:\labs\eclipse and unpacked Tomcat (7.0.12) under c:\labs\tomcat. I have also installed the Sysdeo plugin that launches Tomcat.
First, when I launch Tomcat with Sysdeo Eclipse plugin button and then try to access some application-related URL from an external browser - then the main Tomcat page is found, but not the application JSP/pages. However, when I launch Tomcat using the "play/run" Eclipse button (when some JSP page from the Eclipse web project is being selected) - then I can see the rendered JSP page both from Eclipse internal browser AND from any external browser. What is the difference between those two launch modes?
Second, when launching Tomcat via "play/run" Eclipse button only, and calling JSP and servlets either from an internal Eclipse browser or from external Internet Explorer browser, then all the data is being shared correctly by JSP and servlets. However (just for the same launch mode) if I am trying to access the JSP/servlets from external Chrome/Firefox browsers - then the JSP/servlets ARE found, but the data seems NOT to be shared via http session (printed the session id and verified that it is correct).
Third, when I launch Tomcat via "pay/run" button, then I can see the servlet log() printings in Eclipse console ONLY when using the internal Eclipse browser. When JSP/servlets are called from the external browsers - I couldn't find the log printings (but only a few access-related lines in files that reside in Tomcat logs directory).
Tried to summarize the tech issues that look odd to me - I most probably miss some valuable deployment/configuration-related info. Please advice what I am doing wrong and which is the better / correct configuration that will allow the session data to be shared when calling the application resources from all the external browsers. If you need any additional details regarding my configuration/environment - just ask.
Appreciate
Ensure that you're using Eclipse for Java EE developers, not Eclipse for Java developers. It already ships with a Tomcat server plugin builtin. The Sysdeo plugin is pretty old, you don't need it at all and I won't be surprised if that is after all the culprit some of the described problems.
As to running JSP/Servlet using the internal Eclipse browser versus a normal webbrowser, I have myself had bad experiences with the internal browser, I wouldn't recommend to use it for other than "quick testing". However, that it doesn't share the session with another browser is normal behaviour. They do not share the same browser instance anyway. Sessions are not computer-specific, they are browser-specific.
I'd just integrate Tomcat in Eclipse using the EE-provided plugin, start and stop it by the server properties (and not by rightclicking JSP/Servlet and choosing Run or something) and use a real webbrowser to access the pages. To properly getting started with developing JSP/Servlet using Eclipse and Tomcat, I warmly recommend you to use the Coreservlets.com tutorials. At the bottom of our servlets wiki page you can find several direct links.

GWT integration in existing Java EE application

I am new to GWT. I have developed a GWT application in version-1.6.4 and it is working fine. Now I want to integrate with that project in existing Java EE application. I don't know how to go ahead.
Where to copy the GWT source code in this existing Java EE application? I am also using RPC in GWT.
Can anyone provide help on this?
GWT is just a set of javascript and HTML files, so the most basic form of integration is just to put them in a folder in the same place your as your web pages go.
One step up from there would be to integrate the gwt Compiler in with your build process. If you use Netbeans there is a good plugin called GWT4NB that will handle all of this process for you, so that when you build the WAR of your project it will build the GWT portions of it as well. There would probably be something similar for Eclipse. You could also do all this by hand using maven or ant.
You would tell the compiler where you want it to put the generated files, which again, would be in the same location you put your web pages for your WAR project. The RPC side of it will still work just fine no matter where you put the files.