Programming :: Java - Many Redirects On HTTP Connection?
Feb 1, 2011
I'm trying to open a web page to automate some data checking, and I'm getting a "too many redirects" exception. I'm not experienced enough with Java to know what to try next, and would like some help.
I'll show the code for what I've tried, but first, details about the website:[URL].. The website is a series of aspx pages. Going to the above address in a browser gets you to "default.aspx"--a search page. You don't see the redirects (specifically to a Login.aspx page--which redirects back to default.aspx). I can get the search page with either Firefox or wget--and on the same computer that I'm writing the Java code on. So, Firefox and wget are doing something that my code isn't. Also, I'm not behind a proxy.
I've searched about the redirect exception, and one or two pages blame poor website development. That may be true, but I don't have any control over the website. So, fixing the website is not an option.
I did find this page where someone has the same issue. I used some code given in one of the responses to discover the default.aspx->Login.aspx->default.aspx redirection loop.
Much of my code was pulled from the Working with URLs and Working with Cookies tutorials from Oracle. I tried adding the cookie handler thinking that maybe Login.aspx was trying to create a session ID or some other connection-specific identifier. But either cookies are not the solution OR I just didn't code it the right way.
[Code]...
After more searching, I'm 99% certain it's a cookie-handling issue. I added some more code (not included in the above) that examines the full response from the redirect to the Login.aspx page. The response includes a Set-Cookie header for "ASP.NET_SessionId". Now to find some code that will store and send the session ID.
View 1 Replies
ADVERTISEMENT
Mar 31, 2011
Iam using socket programming in one of my problem. The scenario is like this.
=>one module is working as a socket server(process p1) is able to handle client sockets on that port.
=>one module is working as socket client (process p2) is connected to server socket and Tx/Rx data on this socket. This module has some more threads, based on received data from server socket it will connect to http on other thread and get information...
=>one more module is working as socket client (process p3) is also connected to server socket and doing some other transactions.
Here my problem is when in presence of p2, p3 http connection taking more time than the expected. If we wont start p3(means only one server-client socket) then http connection is fast enough.
View 1 Replies
View Related
Jun 8, 2011
Fedora 14. I have Apache HTTP Server installed and running fine. I am interested in doing some java servlet pages. Am I correct that in addition to the above I need to install another server - for example Tomcat - that knows how to process java servlets? I see that yum has tomcat. And that Tomcat is not an add on to the HTTP Server, but an alternative to it? i.e I start one or the other?
View 2 Replies
View Related
Feb 6, 2010
My problem is the following:I can only connect to the internet and download through the FTP, but not through HTTP.I am in a hospital at this moment and have a netbook (Lemote Yeelong). Also there is a computer here with internet access.I would like to access the internet by using the cable from the computer.I configured my netbook just like the local computer (same host name, same MAC address, DHCP), just to be sure.I can ping google.com and I also can download from ftp.debian.org though ftp.However, when I try to connect to google.com through epiphany, it just loads and loads without success
View 4 Replies
View Related
Jul 7, 2010
we have a Red Hat server and I'm using wget in crontab to run some PHP scripts. We've been doing this for some time now and it's been working fine.I tried to add another script using wget to run a PHP script behind HTTP authentication. However, despite the fact that the URL works fine and the username and password are correct, we are getting Connection Timed Out errors each time. What might cause wget to work for unauthenticated URLs, but not authenticated ones?
I've tried --user=/--password=, --http-user=/--http-password and Username:Password@ in the URL and all three fail the same way. Here's the command in question:
[blahblah user]# wget -t 5 -O /dev/null 'http://Username:Password1!@test.example.com/sub/dir/file-name.php'
--2010-07-07 10:11:55-- http://Username:*password*@test.example.com/sub/dir/file-name.php
Resolving test.example.com... 000.000.000.000
[code]....
Again, wget works, the file with authentication works, but wget calling the file with authentication does not work.
UPDATE: Actually, I get the same timeout if I access the authenticated URL without authentication. Could that mean that Apache is rejecting wget requests for authentication outright?
View 2 Replies
View Related
Apr 20, 2009
I need to install a program by using the address http://255.255.255.255. However, when I type this address in my browser, I get the following error: "Failed to connect. Firefox can't establish a connection to the server at 255.255.255.255. Though the site seems valid, the browser was unable to establish a connection." Is there an easy way to put this site into the air?
View 3 Replies
View Related
Sep 14, 2009
Dear all,
My application has to listen to http request and it must be able to read the http header and then forward the request from proxy. All these things must be done on C/C++. please help me. Awaiting for your reply.
Thank in advance
View 4 Replies
View Related
May 29, 2011
I'm trying to add HTTP authentication to my app (it's a rss reader). As the app is in written in C and uses Libxml2, I've been searching in Libxml2 doc, but it seems it's not possible. Maybe someone could point me to a link to relevant info about how I could achieve that?
View 6 Replies
View Related
Dec 9, 2010
I have a web page that has links to a php script that sends pdf files to the browser when clicked.
The links are like this:
Code:
<a href="getfile.php?id=1201234">
The files sent are shown embedded in the browser, which is what I want.
The problem is: the title of the browser window or tab in which the pdf file is opened is "getfile.php?id=1201234"), and not the actual file name of the pdf file.
Is it possible to send the file by a php script in a way that the window/tab title becomes the filename and not the link by which it has been accessed?
View 5 Replies
View Related
Mar 7, 2010
Groovy is an object-oriented programming language for the Java platform. I do not have experience in Java, only perl and shell scripts. Recently I have been asked to maintain a software written in groovy (also to make enhancements). So can I learn groovy without knowing java language. or isit I have to learn java before venturing into groovy.
View 1 Replies
View Related
Dec 10, 2010
Been at this all morning and fail on every attempt.
I have a file called sitemapindex.xml
Its contents just are names of the other sitemaps. Google gets pissy because it isn't in a http:// format.
So, I need "<loc>sitemap-c1mediawiki-............</loc>" to be replaced with "<loc>http://domain.tld/sitemap-c1mediawiki-............</loc>".
Here's the expression I've been trying:
find /path/to/site/sitemap-index-c1mediawiki* -type f | xargs sed -i 's/[<loc>sitemap]/[<loc>http://domain.tld/]/'
It fails.
I've tried with and without brackets.
View 4 Replies
View Related
Sep 27, 2010
Using netcat, nc(1), craft a valid http/1.1 request for getting http headers (not the html file itself!) for the main index page of www dot aalto dot fi. What request method did you use? Which headers did you need to send to the server? What was the status code for the request? Which headers did the server return? Explain the purpose of each header.
nc -v www dot aalto dot fi 8080
HEAD / HTML/1.1
host: www dot aalto dot fi
And it returns:
200 OK
Content-Length: 858
Content-Type: text/html
Last-Modified: Thu, 02 Sep 2010 12:46:01 GMT
[Code]....
I really don't know what does it mean. Question 2: Using netcat, nc(1), start a bogus web server listening on the loopback interface port 8080. Verify with netstat(, that the server really is listening where it should be. Direct your browser to the bogus server and capture the User-Agent: header "Direct your browser to the bogus server and capture the User-Agent: header" I don't understand this question.
View 2 Replies
View Related
Oct 15, 2009
I would like to execute an already written C program that I am running on my embedded Linux, but from afar - through a HTML page. I am running an embedded Linux on my FPGA prototype board with a MicroBlaze soft processor. On this Linux i am running a httpd web server - I can serve html web pages to the outside through Ethernet connection. Now, I have a program written in C in this embedded Linux in /bin/gpio-test that does some stuff with my IO devices. Now I would like to control these IO devices through HTML web page - so I would like to be able to run this gpio-test program from a html web page and possibly send the program some parameters.
View 2 Replies
View Related
Apr 1, 2011
Code:
Andrew@Mac:~$ g++ -march=athlon64-sse3 -O2 Projects/omgarrays.cpp -o Desktop/omg
Projects/omgarrays.cpp:1: error: bad value (athlon64-sse3) for -march= switch
[code]....
View 4 Replies
View Related
Aug 15, 2010
I am trying to figure out a way to pull http links out of text files and then output the results in a log. The text files are in folders like this inside a source directory.
/source
./folder1
...folder1.txt
./folder2
...folder1.txt
[Code]....
View 4 Replies
View Related
Jul 8, 2011
Hi, is it possible to send a request to a http server without using sockets?
View 7 Replies
View Related
Jun 13, 2011
I want the LAMP server to present an upload page to the user The user uploads a zip file containing txt files which are tables in clear-text format The server : opens the zip validates the text files (going to skip this for now, but will try to make later) converts the files as here imports them to MYSQL tables All this is supposed to happen automatically, then the user can immediately use the website with the updated data How to implement this (esp. the first part with the zip file)
View 1 Replies
View Related
Aug 4, 2010
I installed Nagios on my Ubuntu 10.04 server using apt-get and when I accessed the web console, everything was OK. I made some changes to apache (creating some new virtual sites) and since then Nagios gives me a warning message for HTTP with the message, HTTP WARNING: HTTP/1.1 404 Not Found. The sites that I created are working perfectly. I noticed that the attemps are 4/4. Does this need to be reset or does Nagios automatically reset that once it detects the issue is resolved?
View 1 Replies
View Related
Sep 15, 2010
I'm looking for a programmatic way to run the equivalent of the below statement using SuSEfirewall2 and make it persistent:
iptables -t nat -A PREROUTING -s 192.168.1.4/32 -p udp --dport 514 -j REDIRECT --to-ports 51414
Yes I know I can add it to FW_REDIRECT in the config, but I really need to handle this on the CLI at run time (which the above statement does do), however... is there an iptables-save equivalent in SuSEfirewall2?
View 3 Replies
View Related
Apr 30, 2011
I've been using pipes and redirects for a long time and just realized that I don't know exactly how they are different. I just know that if you want to store the output in a file, then you use >. Otherwise most of the time you just use |. difference between pipes and redirects?
View 1 Replies
View Related
May 9, 2011
I would like that my java program continues executing when I close the ssh connection, how can I do that? I suppose I have to create a service, but I have no idea how to do it!
View 3 Replies
View Related
Jan 5, 2010
I am trying to install OpenSwan VPN but get the following [FAILED] errors. I also changed the redirects but it still reports them as failed?Quote:
[root@localhost /]# /sbin/sysctl -w net.ipv4.conf.all.accept_redirects=0
net.ipv4.conf.all.accept_redirects = 0
[root@localhost /]# /sbin/sysctl -w net.ipv4.conf.all.send_redirects=0
net.ipv4.conf.all.send_redirects = 0
[root@localhost /]# ipsec verify
[Code]...
View 1 Replies
View Related
Feb 24, 2011
due to some issues i uninstalled openjdk shipped default on my opensuse 11.3 and installed jdk 1_6_21 from a .bin file. Its installed to usr/java/jdk.The mysql connector is also present in the same but running a java program that connects to mysql gives me the errorjava.sql.SQLException: Unknown initial character set index '192' received from server. Initial client character set can be forced via the 'characterEncoding' property.the code i tried is
import java.sql.*;
import java.io.*;
class mysql_conn_tester
[code]...
View 3 Replies
View Related
Feb 23, 2010
I have just installed opensuse and the codecs to replace windows on my laptop. This is my third day using open suse and some of the websites i try to open (amazon.co.uk, gmail.com and others) redirect to a chinese website called www.net.cn) This is the same with the firefox and opera browsers.
View 6 Replies
View Related
Jun 9, 2011
For some reason my soundcard is recording every playback sound. This become apparent when I was trying to make a Skype call and the other people couldn't hear me. I checked my sound preferences and noted that the input was recording what they say (they could hear an echo). Also if I played back anything it would redirect to them. This has never happened to me and I've made a lot of calls in the past.
I tested with Audacity and it records fine, but when I play back the recording, it redirects to the input channel so it's not a problem with Skype. (my soundcard is a VIA VT1708B 8-Ch). Somewhere I read that the output of aplay -l is useful.
Here it is:
View 9 Replies
View Related
Dec 28, 2008
I use an external hdd (fat32 1tb usb) on my ps3 for music, movies and I'd like to create a folder containing a top 10 movies. Like a kind of playlist. Simple shortcuts wont do because my ps3 only recognizes avi , mp4 , etc. So I need to create a virtual file which redirects to its original. Without the ^shortcut^ taking any space.
View 2 Replies
View Related
Mar 7, 2011
I'm running Ubuntu 10.10. I have a problem with any client side network communication from any java based program/application. I've tried to run the following code:
Code:
public static void main(String[] args) throws Exception {
long start = System.currentTimeMillis();
Socket s = new Socket("ubuntuforums.org", 80);
System.out.println("1. connection created in "+ (System.currentTimeMillis() - start)/1000.0 +" s");
s.close(); start = System.currentTimeMillis();
s = new Socket("ubuntuforums.org", 80);
System.out.println("2. connection created in "+ (System.currentTimeMillis() - start)/1000.0 +" s");
s.close(); }
The result is the following:
Code:
1. connection created in 189.31 s
2. connection created in 0.085 s
I've tried both java-1.6.0-openjdk and java-6-sun-1.6.0.24 with almost the same results. During the extremely long 189 seconds, the processor is doing almost nothing (java thread has 0 %). I've tried also a wireshark to check what is going on, but the first packet was released after those 189 seconds. There is nothing in log files, I have no exceptions or errors, and the connections work (after the first long delay) just fine.
View 2 Replies
View Related
Mar 9, 2011
Struggling to get my Linux server accept ICMP redirects not originating from default gateway. No problem to get it working if the redirects is originating from def gw.I know it's not a good solution security wise, but my network is so cluttered I'm forced to do so.
View 1 Replies
View Related
Jun 2, 2011
I have installed the new phpMyadmin3.4.1 on a server running Ubuntu 9.10 with apache and mysql. It runs on php5.2.10The apache config seems fine as the virtual directory that I configured works fine. http://<ip-of-server>/phpmyadminlink works. The home page is displayed. But when I enter the user name and password, instead of logging into the console, it again redirects me to the index page of the site. There are no errors displayed. I have checked that cookies on browser are enabled.The server is hosted on amazon web services, if that makes any difference
View 7 Replies
View Related
Oct 31, 2009
Im new to fedora 11 and iptables, and i need to set the following set of instruction so VirtuaBox can accept request from lan, to the mailServer in the guest os, but after restart fedora i have to input it all again.How can it become permanent entry in iptables.
View 2 Replies
View Related