This content has been marked as final.
Show 4 replies
-
1. Re: JBOSS 4.2.0 GA and local socket connection
jaikiran Sep 10, 2007 2:09 AM (in response to jova73)How do you open the Socket connection? Can you post the code? Do you use the IP of the server to open the connection?
-
2. Re: JBOSS 4.2.0 GA and local socket connection
jova73 Sep 10, 2007 4:12 AM (in response to jova73)Hi Jaikiran,
here's my code:String urlPath = "http://127.0.0.1:" + pageContext.getRequest().getServerPort() + request.getContextPath() + "/myservlet"; URL url = new URL(urlPath); URLConnection connection = url.openConnection(); String cookie = request.getHeader("Cookie"); connection.setRequestProperty("Cookie", cookie); connection.setRequestProperty("charset", "ISO-8859-1"); connection.setDoOutput(true); OutputStreamWriter ostream = new OutputStreamWriter(connection.getOutputStream()); BufferedWriter out = new BufferedWriter(ostream); ... // write something to the servlet out.flush(); out.close(); is = connection.getInputStream(); ... // read servlet response
Thanks!
Andrea -
3. Re: JBOSS 4.2.0 GA and local socket connection
jaikiran Sep 10, 2007 4:43 AM (in response to jova73)I'm testing our application with JBoss 4.2.0 GA
String urlPath = "http://127.0.0.1:"
+ pageContext.getRequest().getServerPort()
+ request.getContextPath() + "/myservlet";
Try with localhost:String urlPath = "http://localhost:" + pageContext.getRequest().getServerPort() + request.getContextPath() + "/myservlet";
Might be related to this http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss42FAQ -
4. Re: JBOSS 4.2.0 GA and local socket connection
jova73 Sep 10, 2007 10:33 AM (in response to jova73)I tried with localhost: same result.