Debugging in eclipse using large URLs - eclipse

I was debugging my application in eclipse on tomcat server by using the URL sent from browser to server (from app logs). However after some change in application the URL formed is pretty large thus I am not able debug it anymore. (I am using GET method).
Is there any way I can make it work ?

Related

http status 302 error in tomcat eclipse

I am developing a Telco application (Dyanamic Web application project to send and receive sms) using Eclipse & tomcate version 7
When I try to run it on
http://localhost:8080/SMS1
It gives an error message HTTP-ERROR-CODE:302
What should I do to resolve this error
This is the link to Application and video tutorial what I am following
https://drive.google.com/file/d/0B3VmCeqDC7SDcFZaWVZhRUNmaTQ/edit?usp=sharing
HTTP code 302 is a standard "redirect" message--that is, it tells your web browser that the page was moved and where the new page can be found. I'm guessing whatever you're using as a web browser (Eclipse?) just doesn't handle that type of redirect. Try using a standard web browser like Chrome or Mozilla to see if that helps...
Also a guess, but the redirect may be trying to move you to HTTPS instead of HTTP, and your certificates may not be set up properly, or the port isn't enabled, or there may be some other problem with your HTTPS configuration. If the app is supposed to work over HTTPS, try going directly to the HTTPS version of the link to see if that's the real issue.
A third guess is the app may be trying to redirect you to a login page if you're not logged in, and maybe it can't find it. I'd need to know a lot more about the built product and I really don't want to mess with some guy's shared Eclipse project. Tell them to use a build tool!

Java Servlets + JDBC + Postgres: How does it all interact?

I'm having trouble wrapping my head around how to use servlets properly
I've set up a postgres database, and downloaded a JDBC driver for it.
What I want to have is my webpages post to the servlet, and the servlet get info from the database. I understand how to code everything (eg add library for driver, open connections, execute queries), but I think I'm lacking knowledge in how to set up the file structure.
I have the postgresql database running on pgAdmin. Do I also need to have a server running to make the servlets work as well? Can't I just make a web.xml file that maps to the servlets, and open the webpages to use the website? If I run the project through an IDE with a server running (glassfish) everything works. If I close the IDE and go to open the webpages on my browser again, I get 404's whenever I submit to a servlet.
Can someone give me a bit of guidance on the big picture of how everything is supposed to interact (with details on servers please). I've been searching the web and I havent found anything that explains the big picture very well.
Thanks
A Java web application is a set of files obeying a well-defined structure, and which can be packaged in a war file.
This web application is deployed into a server (also called container), which understands the file structure, listens to HTTP requests, and calls the appropriate servlet of the appropriate deployed web application when it receives one.
And of course, if you shut down the server, nothing listens to the HTTP requests anymore, so you won't get any response.
You could read the Java EE tutorial for more explanations.

GWT fail to load when I clear browser cache

I have deployed my GWT application on a JBoss server, which is located on a virtual machine. If I open Safari/Firefox/Chrome, clear the cache and then navigate to my app: the app fails to load! I just see a blank screen (the title is loaded).
I use SmartGWT and when I just httpfox to examine the traffic, I can see that most resources (images, javascript) is downloaded, but some SmartGWT js files seems to be hanging.
In the screenshot, ISC_core.js and ISC_Foundation.js has not been completely downloaded, and they never are. (It is not always these two files, it can also be different ones, and it changes everytime I retry).
Now, if I reload the browser my app loads perfectly and when I look in httpfox, the files that were not completely downloaded before, is now fetched from the browser cache.
If I clear the browser cache and try again: blank page and same issue.
Does anyone have a clue about what is causing this behaviour and where I should look to fix it?
Note: this only happens when I deploy on my remote virtual machine. If I deploy locally in the same JBoss server setup, I have no problem and cannot reproduce the above issue. Also no problems when I debug in Eclipse and use the Jetty server.
May be this is an Known issue ..Which is posted on Google groups .
As a side note enable gzip on your jboss also..please refer to this link to do that

Making a GWT app work on my mobile using phoneGap

When you create a GWT app you can run it as a web application and point your browser to the home page and it works. Now, in this case your browser is being served the Javascript from the server and thus all calls to the server from your Javascript work fine.
But, if you then take the generated Java script and rather than have it server from the server just have it saved locally how would you go about getting your server calls to work. Say your server is running on localhost how do you get this to work. What I am trying to do is take a working GWT app and extract the generated Java script and wrap this in a phoneGap enabled app but I can't get my server calls to work.
Instead of trying adhoc approach. You should be looking at options provided by MGWT and PhoneGap - Reference http://www.m-gwt.com/.

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.