BUG: org.apache.commons.httpclient.HttpException: 400
Posted: Tue Feb 13, 2007 3:30 pm
Within an extension jar (in the Oxygen lib folder) we have a Java method which returns a node set to be used in a transform.
This works fine in our production environment and fine when the transform is run directly from the cmd line, but when run within Oxygen it fails (with the Stack Trace at the bottom of this message)
Basically within the method:
com.bbc.cmc.documentum.cis.MDRemoteManager.requestFromServer
this code gets called:
URL serverServlet = new URL(“some urlâ€);
URLConnection urlConn = serverServlet.openConnection();
urlConn.setDoInput(true);
urlConn.setDoOutput(true);
urlConn.setUseCaches(false);
urlConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
// Send POST output.
printout = new DataOutputStream(urlConn.getOutputStream());
printout.writeBytes(urlEncodedRequestString);
printout.flush();
printout.close();
// Get response data.
final ObjectInputStream input = new ObjectInputStream(urlConn.getInputStream());
When run within Oxygen urlConn is an instance of ro.sync.net.protocol.http.A.A and when run elsewhere it is an instance of sun.net.www.protocol.http.HttpURLConnection
I would suspect the problem is something to do with how ro.sync.net.protocol.http.A.A deals with post requests.
Can any one in support shed any light on this?
Thanks.
Stack trace follows:
------------------------------------------------------------------------
LOG: MDRemoteManager IOException thrown connecting to Metadata Server: org.apache.commons.httpclient.HttpException: 400 Bad Request for: http://bbcdev2004.national.core.bbc.co. ... tconnector
org.apache.commons.httpclient.HttpException: 400 Bad Request for: http://bbcdev2004.national.core.bbc.co. ... tconnector
at ro.sync.net.protocol.http.A.A(Unknown Source)
at ro.sync.net.protocol.http.A.A(Unknown Source)
at ro.sync.net.protocol.http.WebdavHttpURLConnection$_B.close(Unknown Source)
at java.io.FilterOutputStream.close(Unknown Source)
at com.bbc.cmc.documentum.cis.MDRemoteManager.requestFromServer(Unknown Source)
at com.bbc.cmc.documentum.cis.MDRemoteManager.getConceptsByGuids(Unknown Source)
at com.bbc.cmc.documentum.cis.MDRemoteManager.getConceptsByGuids(Unknown Source)
at com.bbc.cmc.xsl.XSLUtils.getMetaDataInfo(XSLUtils.java:4051)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:394)
at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:438)
at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:220)
at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:473)
at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:206)
at org.apache.xpath.axes.FilterExprIteratorSimple.executeFilterExpr(FilterExprIteratorSimple.java:114)
at org.apache.xpath.axes.FilterExprWalker.setRoot(FilterExprWalker.java:129)
at org.apache.xpath.axes.WalkingIterator.setRoot(WalkingIterator.java:154)
at org.apache.xpath.axes.NodeSequence.setRoot(NodeSequence.java:213)
at org.apache.xpath.axes.LocPathIterator.asIterator(LocPathIterator.java:267)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:205)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262)
at ro.sync.exml.G.V.j.A(Unknown Source)
at ro.sync.exml.G.V.j.A(Unknown Source)
at ro.sync.exml.G.V.j$7.?(Unknown Source)
at ro.sync.ui.application.A.run(Unknown Source)
This works fine in our production environment and fine when the transform is run directly from the cmd line, but when run within Oxygen it fails (with the Stack Trace at the bottom of this message)
Basically within the method:
com.bbc.cmc.documentum.cis.MDRemoteManager.requestFromServer
this code gets called:
URL serverServlet = new URL(“some urlâ€);
URLConnection urlConn = serverServlet.openConnection();
urlConn.setDoInput(true);
urlConn.setDoOutput(true);
urlConn.setUseCaches(false);
urlConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
// Send POST output.
printout = new DataOutputStream(urlConn.getOutputStream());
printout.writeBytes(urlEncodedRequestString);
printout.flush();
printout.close();
// Get response data.
final ObjectInputStream input = new ObjectInputStream(urlConn.getInputStream());
When run within Oxygen urlConn is an instance of ro.sync.net.protocol.http.A.A and when run elsewhere it is an instance of sun.net.www.protocol.http.HttpURLConnection
I would suspect the problem is something to do with how ro.sync.net.protocol.http.A.A deals with post requests.
Can any one in support shed any light on this?
Thanks.
Stack trace follows:
------------------------------------------------------------------------
LOG: MDRemoteManager IOException thrown connecting to Metadata Server: org.apache.commons.httpclient.HttpException: 400 Bad Request for: http://bbcdev2004.national.core.bbc.co. ... tconnector
org.apache.commons.httpclient.HttpException: 400 Bad Request for: http://bbcdev2004.national.core.bbc.co. ... tconnector
at ro.sync.net.protocol.http.A.A(Unknown Source)
at ro.sync.net.protocol.http.A.A(Unknown Source)
at ro.sync.net.protocol.http.WebdavHttpURLConnection$_B.close(Unknown Source)
at java.io.FilterOutputStream.close(Unknown Source)
at com.bbc.cmc.documentum.cis.MDRemoteManager.requestFromServer(Unknown Source)
at com.bbc.cmc.documentum.cis.MDRemoteManager.getConceptsByGuids(Unknown Source)
at com.bbc.cmc.documentum.cis.MDRemoteManager.getConceptsByGuids(Unknown Source)
at com.bbc.cmc.xsl.XSLUtils.getMetaDataInfo(XSLUtils.java:4051)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:394)
at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:438)
at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:220)
at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:473)
at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:206)
at org.apache.xpath.axes.FilterExprIteratorSimple.executeFilterExpr(FilterExprIteratorSimple.java:114)
at org.apache.xpath.axes.FilterExprWalker.setRoot(FilterExprWalker.java:129)
at org.apache.xpath.axes.WalkingIterator.setRoot(WalkingIterator.java:154)
at org.apache.xpath.axes.NodeSequence.setRoot(NodeSequence.java:213)
at org.apache.xpath.axes.LocPathIterator.asIterator(LocPathIterator.java:267)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:205)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262)
at ro.sync.exml.G.V.j.A(Unknown Source)
at ro.sync.exml.G.V.j.A(Unknown Source)
at ro.sync.exml.G.V.j$7.?(Unknown Source)
at ro.sync.ui.application.A.run(Unknown Source)