I have two web application  hosted on two different tomcat instances say T1
and T2(xwiki is on T2). I  am making below method
in a java class on T1 to retrieve  java xwikiUserObject named  from T2


    private Properties checkContentChanges() {

    Properties reply = null;
    try {
        String urlStr = "
http://myApp:8080/wiki/bin/view/?checkContent=true&Name=dummy;";
      URL url;
      reply = new Properties();
      try {
        url = new URL(urlStr);
//sun.net.www.protocol.http.HttpURLConnection conn =
(sun.net.www.protocol.http.HttpURLConnection) url
            .openConnection();//line 1
          URLConnection conn =  url
            .openConnection();// line 2
        conn.addRequestProperty("User-Agent",
            "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64;
Trident/5.0)");
        InputStream is = conn.getInputStream();// line3
        reply.load(conn.getInputStream());
      }
      catch (MalformedURLException e) {
        e.printStackTrace();
      }
      catch (IOException e) {
        e.printStackTrace();//line 5
      }

    }



But at line 3 i am getting error  java.io.IOException: Server returned HTTP
response code: 403 for URL: http://myApp:8080/wiki/... Though the call goes
to method on T2 and
it returns expected  user object. So T2 side works fine but once it return
i get above exception at line 5 at T1 . I tried line 1 too instead of line
2 but same exception? As i tried to find it out on net especially on
http://en.wikipedia.org/wiki/HTTP_403 looks like its due to some config on
xwiki side. Not getting whats the exact issue?


Though thru the brower same url works fine

.
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to