[
https://issues.apache.org/jira/browse/AXIS-2935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16990677#comment-16990677
]
Robert Lazarski commented on AXIS-2935:
---------------------------------------
Thank you for the patch and the detailed explanation / test case.
The patch does not apply to the axis trunk - it seems to be prepared from the
1.4.1 release from 2006.
Anyways, the problem is clear enough and its just a few lines of code, so I
went and coded it based off the patch.
You can review the trunk code related to this issue here:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-rt-core/src/main/java/org/apache/axis/configuration/FileProvider.java?revision=1871014&view=markup
Trunk checkout:
svn checkout https://svn.apache.org/repos/asf/axis/axis1/java/trunk axis-project
BTW, there have been hundreds of commits to the trunk since 1.4.1, including
security fixes.
Challenges for a new release is mainly supporting JDK 11, it doesn't compile
cleanly and I myself moved onto axis2 even before axis 1.4.1.
> java.io.IOException: Stream closed when setting client handlers in Call object
> ------------------------------------------------------------------------------
>
> Key: AXIS-2935
> URL: https://issues.apache.org/jira/browse/AXIS-2935
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.4.1
> Environment: openjdk version "1.8.0_212"
> OpenJDK Runtime Environment (Zulu 8.38.0.13-CA-win64) (build 1.8.0_212-b04)
> OpenJDK 64-Bit Server VM (Zulu 8.38.0.13-CA-win64) (build 25.212-b04, mixed
> mode)
> Reporter: Hazem Kunhamarakam Mammu
> Priority: Major
> Labels: patch
> Fix For: 1.4.1
>
> Attachments: axis_patch.txt
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> The following exception is thrown when setting client handlers in a Call
> object simultaneously from multiple threads. All these call objects are
> created from a single Service object.
> {code:java}
> org.apache.axis.ConfigurationException: java.io.IOException: Stream
> closedorg.apache.axis.ConfigurationException: java.io.IOException: Stream
> closed
> java.io.IOException: Stream closed at
> java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67) at
> java.util.zip.InflaterInputStream.read(InflaterInputStream.java:121) at
> java.io.FilterInputStream.read(FilterInputStream.java:83) at
> org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.readAndBuffer(Unknown
> Source) at
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) at
> org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
> at
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at
> org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at
> org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at
> org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at
> org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369) at
> org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:388) at
> org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:179)
> at
> org.apache.axis.AxisEngine.init(AxisEngine.java:172) at
> org.apache.axis.AxisEngine.<init>(AxisEngine.java:156) at
> org.apache.axis.client.AxisClient.<init>(AxisClient.java:52) at
> org.apache.axis.client.Service.getAxisClient(Service.java:104) at
> org.apache.axis.client.Call.setSOAPService(Call.java:2910) at
> org.apache.axis.client.Call.setClientHandlers(Call.java:2924) at
> com.fisc.common.axis.TempFileProviderTest.lambda$0(TempFileProviderTest.java:28)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at
> java.util.concurrent.FutureTask.run(FutureTask.java:266) at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at
> java.lang.Thread.run(Thread.java:748)
> {code}
> How to recreate?
> {code:java}
> public static void main( String[] args) throws ServiceException
> {
> ExecutorService executorService = Executors.newCachedThreadPool();
> Service service = new Service();
> service.setMaintainSession( true);
> for (int i = 0; i < 50; i++)
> {
> executorService.submit( () -> {
> Call call;
> try
> {
> call = (Call) service.createCall();
> call.setClientHandlers( new SomeClientRequestHandler(),
> new AnotherClientResponseHandler());
> }
> catch (ServiceException e)
> {
> throw new RuntimeException( e);
> }
> }); }
> }
> {code}
> Reason:
> org.apache.axis.configuration.FileProvider.configureEngine(AxisEngine) uses
> getInputStream() and setInputStream() methods to load the client config wsdd.
> These getter and setter methods read or modify the 'myInputStream' class
> member variable and is not thread-safe
>
> Fix:
> Use a local InputStream method local variable to load the client config file.
> The stream is loaded and consumed in this method, so a local variable is
> appropriate here. Please find attached the unified diff file with the
> proposed fix.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]