Enabling the cache gets stuck in a loop and creates a file that won't stop
growing
----------------------------------------------------------------------------------
Key: AXIS2-1970
URL: https://issues.apache.org/jira/browse/AXIS2-1970
Project: Apache Axis 2.0 (Axis2)
Issue Type: Bug
Affects Versions: 1.1.1
Environment: Windows
Reporter: Andrew York
Priority: Blocker
I marked this as a blocker because cache can't be enabled on the client side.
The following program will create a file that does not stop growing until I
terminate the process:
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMText;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
public class Client {
public static void main(String[] args) throws Exception {
String endPoint =
"http://localhost:9080/axis2/services/UserGuideSampleService";
ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(".",
"client.axis2.xml");
ServiceClient client = new ServiceClient(ctx, null);
Options options = new Options();
options.setAction("urn:echo");
options.setTo(new EndpointReference(endPoint));
options.setProperty(Constants.Configuration.CACHE_ATTACHMENTS,Constants.VALUE_TRUE);
options.setProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR,
"temp");
options.setProperty(Constants.Configuration.FILE_SIZE_THRESHOLD,
"4000");
client.setOptions(options);
OMElement response = client.sendReceive(getPayload("Hello world"));
System.out.println(response);
}
private static OMElement getPayload(String value) {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns =
factory.createOMNamespace("http://ws.apache.org/axis2/xsd","ns1");
OMElement elem = factory.createOMElement("echo", ns);
OMElement childElem = factory.createOMElement("param0", null);
childElem.setText(value);
elem.addChild(childElem);
//User can set optimized to false by using the following
//textData.doOptimize(false);
return elem;
}
}
The file that is created contains the response plus a whole lot of 0xFFs. A
hex dump of the file follow. The beginning of the file is what is expected.
The rest isn't.
<ns:echoResponse xmlns:ns="http://ws.apache.org/axis2/xsd"><ns:return>Hello
world</ns:return></ns:echoResponse>
3C 3F 78 6D 6C 20 76 65 72 73 69 6F 6E 3D 27 31 2E 30 27 20 65 6E 63 6F 64 69
6E 67 3D 27 55 54 46 2D 38 27 3F 3E 3C 73 6F 61 70 65 6E 76 3A 45 6E 76 65 6C
6F 70 65 20 78 6D 6C 6E 73 3A 73 6F 61 70 65 6E 76 3D 22 68 74 74 70 3A 2F 2F
73 63 68 65 6D 61 73 2E 78 6D 6C 73 6F 61 70 2E 6F 72 67 2F 73 6F 61 70 2F 65
6E 76 65 6C 6F 70 65 2F 22 3E 3C 73 6F 61 70 65 6E 76 3A 48 65 61 64 65 72 20
2F 3E 3C 73 6F 61 70 65 6E 76 3A 42 6F 64 79 3E 3C 6E 73 3A 65 63 68 6F 52 65
73 70 6F 6E 73 65 20 78 6D 6C 6E 73 3A 6E 73 3D 22 68 74 74 70 3A 2F 2F 77 73
2E 61 70 61 63 68 65 2E 6F 72 67 2F 61 78 69 73 32 2F 78 73 64 22 3E 3C 6E 73
3A 72 65 74 75 72 6E 3E 48 65 6C 6C 6F 20 77 6F 72 6C 64 3C 2F 6E 73 3A 72 65
74 75 72 6E 3E 3C 2F 6E 73 3A 65 63 68 6F 52 65 73 70 6F 6E 73 65 3E 3C 2F 73
6F 61 70 65 6E 76 3A 42 6F 64 79 3E 3C 2F 73 6F 61 70 65 6E 76 3A 45 6E 76 65
6C 6F 70 65 3E FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF. . . . . .
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]