Clive vanHiltenn

Greenhorn
+ Follow
since Feb 03, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Clive vanHiltenn

Update: things go wrong when I log in to Bugzilla through my webapp. If I'm not logged in I can search for bugs (but obviously not update them). If I log in, the search page just 'goes nowhere', i.e. zero bytes are fetched.

Looking closer at the link targets displayed on the various pages within Bugzilla, I can see that when logged in, the link is of type 'http://localhost/bugzilla' when it should be of type 'http://localhost:8080/dash/bugzilla'. When not logged in, the links are correct. The reason zero bytes are returned must be to do with this difference. Very strange .....
13 years ago
I have a webapp running on Jetty 7.2.2. The webapp includes a proxy servlet which forwards requests to a Bugzilla installation running on localhost, port 80 (Apache serves the Bugzilla pages).

When I request a particular URL through the webapp, the Apache access log shows a response as expected; and the jetty request log does the same, but the web page isn't displayed in the browser, and no error message is generated.

Jetty request log

0:0:0:0:0:0:0:1 - - [22/Mar/2011:12:22:17 +0000] "GET /dash/bugs/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=open&product=&content= HTTP/1.1" 200 0

Apache log

127.0.0.1 - - [22/Mar/2011:12:22:17 +0000] "GET /bugzilla/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=open&product=&content= HTTP/1.1" 302 290 "http://localhost:8080/dash/bugs/query.cgi" "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"

127.0.0.1 - - [22/Mar/2011:12:22:19 +0000] "GET /bugzilla/buglist.cgi?query_format=specific&order=relevance%20desc&bug_status=open&list_id=73 HTTP/1.1" 200 4081 "http://localhost:8080/dash/bugs/query.cgi" "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"


Looking closer at the Apache log, I see that the initial request produces HTTP status 302, i.e. that the resource requested has moved. A second request is then made which returns '200 4081', i.e. the request has succeeded and 4081 bytes of data have been returned. However, the Jetty log indicates a '200 0' response, i.e. a successful fetch but zero bytes returned. If I access Bugzilla through Apache (i.e. not through my webapp on localhost:8080), all works just fine.

How can I configure my webapp to ensure that moved resources are displayed? Is it a Jetty configuration issue, or do I have to adjust my Apache configuration?

Thank you,

Clive
13 years ago
Hello all. I am running Jetty 7.2.0 on Ubuntu and have a webapp which makes uses of Jetty's ContinuationFilter and ProxyServlet. Part of my webapp (built using GWT - Google Web Toolkit v2.2.0) enables access to a Bugzilla installation running on Apache (on the localhost). Accessing Bugzilla through http://localhost/bugzilla runs just fine, i.e. Apache and Bugzilla are playing nicely together. Running the webapp in GWT's development mode works just fine.

However, the link to Bugzilla fails with a 404 not found error when I try and access it through my webapp at http://localhost:8080/dash ('dash' is the name of the webapp folder); so there must be some problem with my Jetty setup. The link to Bugzilla is contained in this fragment of GWT code:



Bugzilla's welcome page is index.cgi, and this is found in /var/www/bugzilla on my Ubuntu machine. As I say, accessing http://localhost/bugzilla returns this welcome page and I can use Bugzilla just fine if I go direct rather than via my webapp.

Apache's log file indicates that requests from Jetty don't make it to Apache.

The Jetty request log confirms that the URL requested is not found:


This leads me to believe that Jetty fails to proxy the request to localhost.

I would be really grateful if anyone can help on this. I've spent days on it and posted to both the GWT group on Google groups and on stackoverflow.com, but no success yet. Thank you.

My webapp's web.xml reads as follows, are there any other relevant Jetty config files I need to dig into?

13 years ago
GWT
Many thanks to all who replied.
Thanks Tim, I'll adopt best practice and create new instances.
Hello,

I'd be grateful for a view on the use of PreparedStatements in Java.

I have a class with a number of methods. At the moment I have one PreparedStatement variable which is used by all methods requiring a PreparedStatement. I wonder whether having just one shared PreparedStatement means that I'm losing the benefit of MySQL cacheing the query, because each time a different method uses the PreparedStatement it 'flushes' the previous query from MySQL. Or is that not how it works? Is it a case of once MySQL has the query text it retains it?

Thanks,

Clive