|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Problem (302 moved error)I have the following java class:
package com.secmgmt.xmlrpc.change_status; import org.apache.log4j.Logger; public class ChangeStatus { public static final int SUCCESS = 0; public static final int INVALID_LOGIN = 1; public static final int EID_NOT_FOUND = 2; public static final int SERVER_NOT_PRIMARY = 3; public static final int NO_CHANGE_NEEDED = 4; private static Logger l = Logger.getLogger(ChangeStatus.class); public static final String ACTIVE = "ACTIVE"; public static final String INACTIVE = "INACTIVE"; public static final int PP_ACTIVE = 0; public static final int PP_INACTIVE = 1; public ChangeStatus() { l.debug("Created the status xmlrpc class"); } public boolean ping() { return true; } public int add(int one, int two) { l.debug("Adding " + one + " and " + two); return one + two; } public int changeStatus(String eid, String user, String password, String status) { return SUCCESS; } } The following in the properties file: ChangeStatus=com.secmgmt.xmlrpc.picture.four.change_status.ChangeStatus My webapp deploys properly, and I never see an error in the logs anywhere when I hit it. My python program is: #!/usr/bin/python2 import xmlrpclib from pprint import pprint p = xmlrpclib.ServerProxy("http://192.168.1.15:8080/xmlrpc-status") print "Server created" try: #print p.system.listMethods() #print dir(p) p._ServerProxy__verbose = 1 print "Ping result: %s" % (p.ChangeStatus.ping()) except xmlrpclib.Error, v: print "ERROR", v pass print "Done" Here is the output: Server created connect: (192.168.1.15, 8080) send: 'POST /xmlrpc-status HTTP/1.0\r\nHost: 192.168.1.15:8080\r\nUser-Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com)\r\nContent-Type: text/xml\r\nContent-Length: 111\r\n\r\n' send: "<?xml version='1.0'?>\n<methodCall>\n<methodName>ChangeStatus.ping</methodName>\n< params>\n</params>\n</methodCall>\n" reply: 'HTTP/1.1 302 Moved Temporarily\r\n' header: Server: Apache-Coyote/1.1 header: Location: http://192.168.1.15:8080/xmlrpc-status/ header: Date: Wed, 28 Oct 2009 19:47:50 GMT header: Connection: close ERROR <ProtocolError for 192.168.1.15:8080/xmlrpc-status: 302 Moved Temporarily> Done Any idea why I get the 302 error? My XML-RPC appears to be correct. |
|
|
RE: Problem (302 moved error)Here is the web.xml, also:
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>Security Managment Consulting</display-name> <servlet> <servlet-name>XmlRpcServlet</servlet-name> <servlet-class>org.apache.xmlrpc.webserver.XmlRpcServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>XmlRpcServlet</servlet-name> <url-pattern>/xmlrpc-status/*</url-pattern> </servlet-mapping> </web-app> >-----Original Message----- >From: Mike Baranski [mailto:list-subscriptions@...] >Sent: Wednesday, October 28, 2009 3:49 PM >To: xmlrpc-dev@... >Subject: Problem (302 moved error) > >I have the following java class: > >package com.secmgmt.xmlrpc.change_status; >import org.apache.log4j.Logger; > >public class ChangeStatus >{ > public static final int SUCCESS = 0; > public static final int INVALID_LOGIN = 1; > public static final int EID_NOT_FOUND = 2; > public static final int SERVER_NOT_PRIMARY = 3; > public static final int NO_CHANGE_NEEDED = 4; > > private static Logger l = Logger.getLogger(ChangeStatus.class); > > public static final String ACTIVE = "ACTIVE"; > public static final String INACTIVE = "INACTIVE"; > > public static final int PP_ACTIVE = 0; > public static final int PP_INACTIVE = 1; > > public ChangeStatus() > { > l.debug("Created the status xmlrpc class"); > } > > public boolean ping() > { > return true; > } > > public int add(int one, int two) > { > l.debug("Adding " + one + " and " + two); > return one + two; > } > > public int changeStatus(String eid, String user, String password, >String >status) > { > return SUCCESS; > } >} > >The following in the properties file: >ChangeStatus=com.secmgmt.xmlrpc.picture.four.change_status.ChangeStatus > >My webapp deploys properly, and I never see an error in the logs >anywhere >when I hit it. My python program is: > >#!/usr/bin/python2 >import xmlrpclib >from pprint import pprint > >p = xmlrpclib.ServerProxy("http://192.168.1.15:8080/xmlrpc-status") >print "Server created" >try: > #print p.system.listMethods() > #print dir(p) > p._ServerProxy__verbose = 1 > print "Ping result: %s" % (p.ChangeStatus.ping()) >except xmlrpclib.Error, v: > print "ERROR", v > pass > >print "Done" > >Here is the output: > >Server created >connect: (192.168.1.15, 8080) >send: 'POST /xmlrpc-status HTTP/1.0\r\nHost: >192.168.1.15:8080\r\nUser-Agent: xmlrpclib.py/1.0.1 (by >www.pythonware.com)\r\nContent-Type: text/xml\r\nContent-Length: >111\r\n\r\n' >send: "<?xml >version='1.0'?>\n<methodCall>\n<methodName>ChangeStatus.ping</methodName >>\n< >params>\n</params>\n</methodCall>\n" >reply: 'HTTP/1.1 302 Moved Temporarily\r\n' >header: Server: Apache-Coyote/1.1 >header: Location: http://192.168.1.15:8080/xmlrpc-status/ >header: Date: Wed, 28 Oct 2009 19:47:50 GMT >header: Connection: close >ERROR <ProtocolError for 192.168.1.15:8080/xmlrpc-status: 302 Moved >Temporarily> >Done > >Any idea why I get the 302 error? My XML-RPC appears to be correct. |
|
|
Re: Problem (302 moved error)Try using the URL from the location header. In other words, add a "/"
to the URL. On Wed, Oct 28, 2009 at 8:49 PM, Mike Baranski <list-subscriptions@...> wrote: > I have the following java class: > > package com.secmgmt.xmlrpc.change_status; > import org.apache.log4j.Logger; > > public class ChangeStatus > { > public static final int SUCCESS = 0; > public static final int INVALID_LOGIN = 1; > public static final int EID_NOT_FOUND = 2; > public static final int SERVER_NOT_PRIMARY = 3; > public static final int NO_CHANGE_NEEDED = 4; > > private static Logger l = Logger.getLogger(ChangeStatus.class); > > public static final String ACTIVE = "ACTIVE"; > public static final String INACTIVE = "INACTIVE"; > > public static final int PP_ACTIVE = 0; > public static final int PP_INACTIVE = 1; > > public ChangeStatus() > { > l.debug("Created the status xmlrpc class"); > } > > public boolean ping() > { > return true; > } > > public int add(int one, int two) > { > l.debug("Adding " + one + " and " + two); > return one + two; > } > > public int changeStatus(String eid, String user, String password, String > status) > { > return SUCCESS; > } > } > > The following in the properties file: > ChangeStatus=com.secmgmt.xmlrpc.picture.four.change_status.ChangeStatus > > My webapp deploys properly, and I never see an error in the logs anywhere > when I hit it. My python program is: > > #!/usr/bin/python2 > import xmlrpclib > from pprint import pprint > > p = xmlrpclib.ServerProxy("http://192.168.1.15:8080/xmlrpc-status") > print "Server created" > try: > #print p.system.listMethods() > #print dir(p) > p._ServerProxy__verbose = 1 > print "Ping result: %s" % (p.ChangeStatus.ping()) > except xmlrpclib.Error, v: > print "ERROR", v > pass > > print "Done" > > Here is the output: > > Server created > connect: (192.168.1.15, 8080) > send: 'POST /xmlrpc-status HTTP/1.0\r\nHost: > 192.168.1.15:8080\r\nUser-Agent: xmlrpclib.py/1.0.1 (by > www.pythonware.com)\r\nContent-Type: text/xml\r\nContent-Length: > 111\r\n\r\n' > send: "<?xml > version='1.0'?>\n<methodCall>\n<methodName>ChangeStatus.ping</methodName>\n< > params>\n</params>\n</methodCall>\n" > reply: 'HTTP/1.1 302 Moved Temporarily\r\n' > header: Server: Apache-Coyote/1.1 > header: Location: http://192.168.1.15:8080/xmlrpc-status/ > header: Date: Wed, 28 Oct 2009 19:47:50 GMT > header: Connection: close > ERROR <ProtocolError for 192.168.1.15:8080/xmlrpc-status: 302 Moved > Temporarily> > Done > > Any idea why I get the 302 error? My XML-RPC appears to be correct. > > > > -- Germanys national anthem is the most boring in the world - how telling! |
|
|
Re: Problem (302 moved error)Alternatively, remove the /* from the pattern below.
On Wed, Oct 28, 2009 at 8:55 PM, Mike Baranski <list-subscriptions@...> wrote: > Here is the web.xml, also: > > <?xml version="1.0" encoding="ISO-8859-1"?> > <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application > 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> > <web-app> > > <display-name>Security Managment Consulting</display-name> > > <servlet> > <servlet-name>XmlRpcServlet</servlet-name> > > <servlet-class>org.apache.xmlrpc.webserver.XmlRpcServlet</servlet-class> > </servlet> > > <servlet-mapping> > <servlet-name>XmlRpcServlet</servlet-name> > <url-pattern>/xmlrpc-status/*</url-pattern> > </servlet-mapping> > > </web-app> > >>-----Original Message----- >>From: Mike Baranski [mailto:list-subscriptions@...] >>Sent: Wednesday, October 28, 2009 3:49 PM >>To: xmlrpc-dev@... >>Subject: Problem (302 moved error) >> >>I have the following java class: >> >>package com.secmgmt.xmlrpc.change_status; >>import org.apache.log4j.Logger; >> >>public class ChangeStatus >>{ >> public static final int SUCCESS = 0; >> public static final int INVALID_LOGIN = 1; >> public static final int EID_NOT_FOUND = 2; >> public static final int SERVER_NOT_PRIMARY = 3; >> public static final int NO_CHANGE_NEEDED = 4; >> >> private static Logger l = Logger.getLogger(ChangeStatus.class); >> >> public static final String ACTIVE = "ACTIVE"; >> public static final String INACTIVE = "INACTIVE"; >> >> public static final int PP_ACTIVE = 0; >> public static final int PP_INACTIVE = 1; >> >> public ChangeStatus() >> { >> l.debug("Created the status xmlrpc class"); >> } >> >> public boolean ping() >> { >> return true; >> } >> >> public int add(int one, int two) >> { >> l.debug("Adding " + one + " and " + two); >> return one + two; >> } >> >> public int changeStatus(String eid, String user, String password, >>String >>status) >> { >> return SUCCESS; >> } >>} >> >>The following in the properties file: >>ChangeStatus=com.secmgmt.xmlrpc.picture.four.change_status.ChangeStatus >> >>My webapp deploys properly, and I never see an error in the logs >>anywhere >>when I hit it. My python program is: >> >>#!/usr/bin/python2 >>import xmlrpclib >>from pprint import pprint >> >>p = xmlrpclib.ServerProxy("http://192.168.1.15:8080/xmlrpc-status") >>print "Server created" >>try: >> #print p.system.listMethods() >> #print dir(p) >> p._ServerProxy__verbose = 1 >> print "Ping result: %s" % (p.ChangeStatus.ping()) >>except xmlrpclib.Error, v: >> print "ERROR", v >> pass >> >>print "Done" >> >>Here is the output: >> >>Server created >>connect: (192.168.1.15, 8080) >>send: 'POST /xmlrpc-status HTTP/1.0\r\nHost: >>192.168.1.15:8080\r\nUser-Agent: xmlrpclib.py/1.0.1 (by >>www.pythonware.com)\r\nContent-Type: text/xml\r\nContent-Length: >>111\r\n\r\n' >>send: "<?xml >>version='1.0'?>\n<methodCall>\n<methodName>ChangeStatus.ping</methodName >>>\n< >>params>\n</params>\n</methodCall>\n" >>reply: 'HTTP/1.1 302 Moved Temporarily\r\n' >>header: Server: Apache-Coyote/1.1 >>header: Location: http://192.168.1.15:8080/xmlrpc-status/ >>header: Date: Wed, 28 Oct 2009 19:47:50 GMT >>header: Connection: close >>ERROR <ProtocolError for 192.168.1.15:8080/xmlrpc-status: 302 Moved >>Temporarily> >>Done >> >>Any idea why I get the 302 error? My XML-RPC appears to be correct. > > > -- Germanys national anthem is the most boring in the world - how telling! |
|
|
RE: Problem (302 moved error)I tried both, removing the /* and leaving the test script gives a 302 error, leaving the /* and adding / to the test script gives 404.
Any other ideas? >-----Original Message----- >From: Jochen Wiedmann [mailto:jochen.wiedmann@...] >Sent: Thursday, October 29, 2009 5:18 AM >To: xmlrpc-dev@... >Subject: Re: Problem (302 moved error) > >Alternatively, remove the /* from the pattern below. > > >On Wed, Oct 28, 2009 at 8:55 PM, Mike Baranski ><list-subscriptions@...> wrote: >> Here is the web.xml, also: >> >> <?xml version="1.0" encoding="ISO-8859-1"?> >> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web >Application >> 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> >> <web-app> >> >> <display-name>Security Managment Consulting</display-name> >> >> <servlet> >> <servlet-name>XmlRpcServlet</servlet-name> >> >> <servlet-class>org.apache.xmlrpc.webserver.XmlRpcServlet</servlet- >class> >> </servlet> >> >> <servlet-mapping> >> <servlet-name>XmlRpcServlet</servlet-name> >> <url-pattern>/xmlrpc-status/*</url-pattern> >> </servlet-mapping> >> >> </web-app> >> >>>-----Original Message----- >>>From: Mike Baranski [mailto:list-subscriptions@...] >>>Sent: Wednesday, October 28, 2009 3:49 PM >>>To: xmlrpc-dev@... >>>Subject: Problem (302 moved error) >>> >>>I have the following java class: >>> >>>package com.secmgmt.xmlrpc.change_status; >>>import org.apache.log4j.Logger; >>> >>>public class ChangeStatus >>>{ >>> public static final int SUCCESS = 0; >>> public static final int INVALID_LOGIN = 1; >>> public static final int EID_NOT_FOUND = 2; >>> public static final int SERVER_NOT_PRIMARY = 3; >>> public static final int NO_CHANGE_NEEDED = 4; >>> >>> private static Logger l = Logger.getLogger(ChangeStatus.class); >>> >>> public static final String ACTIVE = "ACTIVE"; >>> public static final String INACTIVE = "INACTIVE"; >>> >>> public static final int PP_ACTIVE = 0; >>> public static final int PP_INACTIVE = 1; >>> >>> public ChangeStatus() >>> { >>> l.debug("Created the status xmlrpc class"); >>> } >>> >>> public boolean ping() >>> { >>> return true; >>> } >>> >>> public int add(int one, int two) >>> { >>> l.debug("Adding " + one + " and " + two); >>> return one + two; >>> } >>> >>> public int changeStatus(String eid, String user, String password, >>>String >>>status) >>> { >>> return SUCCESS; >>> } >>>} >>> >>>The following in the properties file: >>>ChangeStatus=com.secmgmt.xmlrpc.picture.four.change_status.ChangeStatu >s >>> >>>My webapp deploys properly, and I never see an error in the logs >>>anywhere >>>when I hit it. My python program is: >>> >>>#!/usr/bin/python2 >>>import xmlrpclib >>>from pprint import pprint >>> >>>p = xmlrpclib.ServerProxy("http://192.168.1.15:8080/xmlrpc-status") >>>print "Server created" >>>try: >>> #print p.system.listMethods() >>> #print dir(p) >>> p._ServerProxy__verbose = 1 >>> print "Ping result: %s" % (p.ChangeStatus.ping()) >>>except xmlrpclib.Error, v: >>> print "ERROR", v >>> pass >>> >>>print "Done" >>> >>>Here is the output: >>> >>>Server created >>>connect: (192.168.1.15, 8080) >>>send: 'POST /xmlrpc-status HTTP/1.0\r\nHost: >>>192.168.1.15:8080\r\nUser-Agent: xmlrpclib.py/1.0.1 (by >>>www.pythonware.com)\r\nContent-Type: text/xml\r\nContent-Length: >>>111\r\n\r\n' >>>send: "<?xml >>>version='1.0'?>\n<methodCall>\n<methodName>ChangeStatus.ping</methodNa >me >>>>\n< >>>params>\n</params>\n</methodCall>\n" >>>reply: 'HTTP/1.1 302 Moved Temporarily\r\n' >>>header: Server: Apache-Coyote/1.1 >>>header: Location: http://192.168.1.15:8080/xmlrpc-status/ >>>header: Date: Wed, 28 Oct 2009 19:47:50 GMT >>>header: Connection: close >>>ERROR <ProtocolError for 192.168.1.15:8080/xmlrpc-status: 302 Moved >>>Temporarily> >>>Done >>> >>>Any idea why I get the 302 error? My XML-RPC appears to be correct. >> >> >> > > > >-- >Germanys national anthem is the most boring in the world - how telling! |
|
|
Re: Problem (302 moved error)On Thu, Oct 29, 2009 at 1:42 PM, Mike Baranski
<list-subscriptions@...> wrote: > I tried both, removing the /* and leaving the test script gives a 302 error, leaving the /* and adding / to the test script gives 404. I don't really trust this. I'd expect that you have some problem in your setup, like not properly reloading, or something like that. Anyways, as the problem is way before the XML-RPC code is touched, I suggest that you contact tomcat-user, or a similar mailing list for your web server. Jochen -- Germanys national anthem is the most boring in the world - how telling! |
|
|
RE: Problem (302 moved error)I kind of thought that, since the access log does not even show that I'm connecting.
>-----Original Message----- >From: Jochen Wiedmann [mailto:jochen.wiedmann@...] >Sent: Thursday, October 29, 2009 9:42 AM >To: xmlrpc-dev@... >Subject: Re: Problem (302 moved error) > >On Thu, Oct 29, 2009 at 1:42 PM, Mike Baranski ><list-subscriptions@...> wrote: > >> I tried both, removing the /* and leaving the test script gives a 302 >error, leaving the /* and adding / to the test script gives 404. > >I don't really trust this. I'd expect that you have some problem in >your setup, like not properly reloading, or something like that. > >Anyways, as the problem is way before the XML-RPC code is touched, I >suggest that you contact tomcat-user, or a similar mailing list for >your web server. > >Jochen > > >-- >Germanys national anthem is the most boring in the world - how telling! |
| Free embeddable forum powered by Nabble | Forum Help |