Hi,
Can anyone please help me ?
My app works fine in my computer, but after uploaded it to gae server, i
received an error.
* See my log from appengine logs.
[19/May/2011:18:09:41 -0700] "GET /agendaxyzdms HTTP/1.1" 500 0 - "Mozilla/5.0
(Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101
Firefox/4.0.1,gzip(gfe)" "neoageinfo.appspot.com" ms=584 cpu_ms=910
api_cpu_ms=0 cpm_usd=0.025325 loading_request=1
/agenda
javax.servlet.ServletException: Exception during proxy request: Unable to
complete the HTTP request
at
com.gae.dms.proxy.AgendaXyzDmsServlet.service(AgendaXyzDmsServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
I think that the problem is because the authorization property, because in
other urls without the autorization everthing works fine.
".addRequestProperty("Authorization", "Basic " + encode(Name + ":" +
Password));"
* Part of my code:
public void service (HttpServletRequest httpRequest,
HttpServletResponse httpResponse)
throws ServletException
{
try {
URL content = new
URL("http://argos.xx.yy.zzz.br/home/name@mail/Calendar");
URLConnection urlConn = content.openConnection();
String Name = "xxxx";
String Password = "xxxx";
urlConn.addRequestProperty("Authorization", "Basic " + encode(Name +
":" + Password));
// show the client the content type:
String contentType = urlConn.getContentType();
httpResponse.setContentType(contentType);
// get the input stream
InputStream in = urlConn.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
//char[] buffer = new char[1024];
String contentString = "";
String tmp = br.readLine();
do
{
contentString += tmp + "\n";
tmp = br.readLine();
}
while (tmp != null);
//
// Now write the bytes out to the client.
//
byte[] contentBytes = contentString.getBytes();
OutputStream out = httpResponse.getOutputStream();
out.write(contentBytes, 0, contentBytes.length);
out.flush();
out.close();
}
catch (IOException ioe) {
// on open connection:
throw new ServletException("Exception while opening '" + "': " +
ioe.getMessage());
}
catch (Exception e) {
// on reading input:
throw new ServletException("Exception during proxy request: " +
e.getMessage());
}
}
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.