Gwt Tomcat Deploy : Just Does Nothing - gwt

if I deploy my project to the Tomcat server which uses just client side code , it works perfectly.
But if my project has a server side code , for example, a button which uses RPC , when i clicked the button, project does nothing at all. No Warnings, no errors etc. Just does nothing at all.
And also, when I deploy "the default GWT example ( greetings project )" to the Tomcat server, it doesn't work.
( I mean my problem is not related with my project's code )
p.s. : My project works perfectly in the Dev Mode.
Could you help me please?

Let us say, wWhen you run on dev mode, your URL was
localhost:port#/page1.
And that the war file name is happy.
Therefore, when you deploy to Tomcat, the server no longer serves it as localhost:port#/page1.
Your app would now be served as
localhost:port#/happy/page1
In your rpc remote service interface file you would have specified the relative path as "/page1".
However, you have to check your web.xml and make sure the servlets are specified in relative paths as well. Check your web.xml to ensure the servlet paths are not hard-coded to
localhost:port#/page1.

Related

starting tomcat manually via startup.bat doesn't seem to work

I have a jsp web-project which i wrote in eclipse. I can run it within eclipse, no problems there.
Now i have the final war-file and can access it via firefox (localhost:8080/program) WHEN the tomcat server is still up within eclipse.
The thing is, i want the program for other people to test it, but without having them to start tomcat via eclipse.
So i tried to start tomcat manually via bin/startup.bat - no success.
I tried changing the port number within the server.xml and excluded the localhost from proxy in the firefox settings. Still no success.
What did i miss? Can you please help me, give me some clue?
I'd highly appreciate!
Greetings from Germany
---edit(03-17-2016)---
Some more information:
I tried to access (i started the server via eclipse beforehand) the default examples ROOT/index.jsp + manager/index.jsp and got the following exception:
HTTP Status 404 - /manager/index.jsp
type Status report message
/manager/index.jsp description
The requested resource is not
available. Apache Tomcat/7.0.67
On my program i only get
address unkown
Firefox can not connect to the server at localhost:8080
Website might be temporary out of order
Consider enabling Proxy
P.S.: I translated the last exception myself so it's not the real exception

Cannot load anything on Tomcat 7 : configuration issue

I'm currently developing a web project running on Tomcat 7 and I cannot see anything who's suppose to be on Tomcat (blank page when I do a HTTP request in my browser).
My Modus Operandi:
I launch a new instance of server in locahost (apache-tomcat-7.0.34) within Eclipse (I work with Indigo and tried with Juno as well)
Tomcat's ROOT folder has been pasted in the 'wtpwebapps' folder of all my servers in my Workspace
I add a simple web project on this server instance and try to access it from a HTTP request and I get a blank page. If I try to run a .html file of this web project on this server, I get a 'HTTP 404 Not Found' Error.
What I tried:
I tried to build the whole configuration from scratch (new Eclipse, new Apache-Tomcat) and I still get the same result. But when I do that from my personal computer at home, everything's working fine!!
I tried to put an old version of my code or a tutorial project, but nothing can be launched (therefore, it must be a configuration issue).
I checked the server.xml and web.xml files and nothing looks suspicious (I can paste them if you want but those are the same than those who worked at home)
The only thing I can think of is that I changed the internet connection (and the IP address) of the computer I'm working on, but I don't think it could make any difference when trying to reach localhost, right?
When I follow the steps of the very good tutorial, I do get a blank page on the 'Run Tomcat' topic, but I don't get the Tomcat welcome page once I copied the ROOT folder into "wtpwebapps".
Does someone have any idea where it could come from?
Ok guys, finally got the solution.
I was about to format my computer when i realize that the port 8009 was actually used by another process.
I thought that's the kind of things who are checked when you launch a Tomcat server within Eclipse but it didn't show any error.
The HTTP request went through the port 80, but as the default AJP port is already in use, Apache could not forward this request to Tomcat, therefore a blank page was returned.
At least that's my understanding of this situation...
Hopefully this may help someone who'd run into a similar situation.
Thanks for your help.

Need help setting up a (Tomcat) web app in Eclipse for debugging

I've been using both eclipse and tomcat for years but have always deployed my web apps externally and never had a problem. Now I'd like to use eclipse to debug my web app and I can't figure out how to make it work. I started by trying to get my existing web app to deploy through eclipse but after hours of trying different things I decided to start fresh. Unfortunately, I didn't get much further. I'm hoping if I can figure out how things work with a fresh webapp I can get things to work on my existing. Sorry, this will be long, but here are the steps I tried on the latest eclipse (Juno):
Installed new version of tomcat 7.0.34 at /usr/java.
In eclipse, used "servers" view to add server, pointing to the new install (I didn't add any resources because there weren't any available yet). Starting the server worked and got a 404 as expected at http://localhost:8080/ ... then I stopped it.
Created a new "dynamic web project", named it TomcatDebug, set the location to ~/tomcat-debug, chose the server just created above (the only one), chose default config, tomcat-debug is empty so chose defaults for build paths, defaults for module settings and had it generate web.xml.
In the "tomcat-debug" folder it creates WebContent, build, and src. I throw a sample "hello, world" index.html into WebContent.
Now the project TomcatDebug is created so I try to run it, tell it to "run on server", and it goes to http://localhost:8080/TomcatDebug/ but gives a 404. I even try to add index.html but it still gives a 404.
This is about as basic as it can possibly get so what did I do wrong?
Continuing to try and figure this out I stop the server, change the server setting to "use tomcat installation", but still get a 404 in the same way when I restart. I tried changing my module context path and still 404.
I'm completely stumped. I believe I followed all the wizards as basically as possible. Where did I go wrong?
Thanks for taking a look.
I haven't run tomcat through eclipse in a while, so can't answer that aspect of the question. But, to get at the heart of what you're trying to do (debug a webapp in eclipse through tomcat), you shouldn't necessarily need to. This may serve you instead:
EDIT: Eh, look here for instructions ("Debugging" section). The below is how I did it (JUNO and TC 7) and has an annoying quirk in point #1.
edit the startup.sh (assuming *NIX/OS X) - the last line will probably be
exec "$PRGDIR"/"$EXECUTABLE" start "$#"
change this to
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$#"
to activate debugging. (there are other ways to do this that may be better - i think tomcat/the VM may pause for listeners before proceeding, so when you aren't debugging this is not ideal)
Create a Debug Configuration in eclipse, under the "Remote Java Application" set. Default port should be fine, and presumably host. Choose your project.
Add sources of relevance to your debugging in the Source tab.
Start server and run your new debug configuration. App should stop at breakpoints you've set.
Right Click your index.html Run As -> Run On Server you will see Tomcat will automatically run the page.

GWT works on localhost, but shows 404 on remote tomcat

I use eclipse's GWT toolkit to compile my project. And I deploy it in my localhost, it works. But when I upload it to a remote tomcat, it shows 404. I use GWT.getHostPageBaseURL() to get the host URL.
In the local tomcat, url is localhost:8080/M/M.html. In the remote tomcat, it is http://p.i.edu:8080/M/M.html
I have the same problem.what is worse,my project delopyed can not start at all.When I check it by tomcat manager,I got the negative infos as below:
FAIL - Application at context path /GwtTest could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/GwtTest]]
Several days before ,I deploy a similar one (without any changes just creating it by Eclipse)successfully to the same remote tomcat.
I checked the project files carefully,and now confirm the cause is in web.xml.I defined a servlet in it,but the remote tomcat seems to be unknown it.After change the server-class's content to any(even wrone),the 404 is gone,but the servlet can not work! while on local windows tomcat,the servlet works fine!
You can use:
GWT.getModuleBaseUrl();
It will return you the complete url your are looking for. I hope this will solve your problem.

tomcat6 application deployment error

I am new to tomcat and servlets and am trying to deploy my first web application in tomcat and the index.jsp page is showing up blank.
It works fine in eclipse. I have the web.xml for the application setup to have the index.jsp as the default page. I am able to run the application and debug it in eclipse but when I export it as a WAR file and deploy it in tomcat and try to access it through a regular browser I get a blank page.
What am I missing here? Any help is greatly appreciated.
Thanks,
- Vas
If you ever get a blank page, the most important information you (and we) need are:
The request URL.
The already sent data -if any- (webbrowser > View Source).
The response headers (Firebug? Webdeveloper Toolbar?).
The server logs (stdout, stderr, webapp).
This usually indicate a wrong URL (to be proven by 1), or an exception halfway a JSP page (to be proven by 2 and 4), or an internal server error without an error page (to be proven by 3 and 4).
You need to configure your server.xml file and declare a context for your web application. You can find the documentation here: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
But a blank page is kind of weird, because I think if your web application wasn't deploy correctly, you will get a Http 404 error.