Mike Douglass created CXF-9103:
----------------------------------

             Summary: Apparent memory related issues calling getPort
                 Key: CXF-9103
                 URL: https://issues.apache.org/jira/browse/CXF-9103
             Project: CXF
          Issue Type: Bug
          Components: WS-* Components
    Affects Versions: 3.4.10
            Reporter: Mike Douglass


Running a service for many years making batches of SOAP requests to query and 
update a system. Recently made updates which required a move to Java17 with 
wildfly 26.3

Started getting intermittent exceptions as shown in the stack trace below. 
These were only showing up in the deployed prod system - not on the dev system 
or my laptop. Eventually discovered it was the heap allocated to the jvm which 
triggered it. With a 2G heap after about 40 calls to getPort it failed as below.

The main problem I have with this is that there is no indication what the real 
error is and the error message doesn't help. Looking at the code there is some 
logging at FINE level - DEBUG might be more useful. Also there are a whole 
bunch of possible failures which all get expressed as "Unable to 
locate/load..." (Mosytly looked at the code in CatalogXmlSchemaURIResolver and 
what it called.)

It's probable the code was making an excesssive number of calls to 
getService().getPort(...) (every request). I made changes to only create a 
Service object once for each URI and only create the port once. This seems to 
have fixed my issue. However, lacking any more detailed messages I've had to 
guess at this solution. It also leaves open the possibility that this will fail 
in the future if memory gets tight for some other reason.

I'd also note that the garbage collection stats don't seem to reflect any major 
problems.

I've seen references in other ssues to WeakReference's - is it possible 
something is being removed and causing this issue?

 

Failed to create service.
    at 
[email protected]//org.bedework.synch.shared.cnctrs.AbstractConnector.getPort(AbstractConnector.java:270)
    at 
[email protected]//org.bedework.synch.cnctrs.bedework.BedeworkConnector.getPort(BedeworkConnector.java:213)
    at 
[email protected]//org.bedework.synch.cnctrs.bedework.BedeworkConnectorInstance.fetchItem(BedeworkConnectorIn
stance.java:286)
    at 
[email protected]//org.bedework.synch.Synchling.processUpdates(Synchling.java:983)
    at 
[email protected]//org.bedework.synch.Synchling.reSynch(Synchling.java:736)
    at 
[email protected]//org.bedework.synch.Synchling.handleNotification(Synchling.java:132)
    at 
[email protected]//org.bedework.synch.SynchEngineImpl.handleNotification(SynchEngineImpl.java:825)
    at 
[email protected]//org.bedework.synch.SynchEngineImpl$NotificationInThread.run(SynchEngineImpl.java:227)
Caused by: javax.xml.ws.WebServiceException: 
org.apache.cxf.service.factory.ServiceConstructionException: Failed to create 
service.
    at 
org.apache.cxf.impl//org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:360)
    at 
org.apache.cxf.impl//org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:349)
    at 
[email protected]//javax.xml.ws.Service.getPort(Service.java:139)
    at 
[email protected]//org.bedework.synch.wsmessages.SynchRemoteService.getSynchRSPort(SynchRemoteService.java:72
)
    at 
[email protected]//org.bedework.synch.shared.cnctrs.AbstractConnector.getPort(AbstractConnector.java:266)
    ... 7 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed 
to create service.
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:169)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionService
FactoryBean.java:407)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServi
ceFactoryBean.java:527)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.ja
va:262)
    at 
org.apache.cxf.impl//org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
    at 
org.apache.cxf.impl//org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactor
y.java:103)
    at 
org.apache.cxf.impl//org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
    at 
org.apache.cxf.impl//org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:159)
    at 
org.apache.cxf.impl//org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
    at 
org.apache.cxf.impl//org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:492)
    at 
[email protected]//org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImp
l.java:580)
    at 
org.apache.cxf.impl//org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:358)
    ... 11 more
Caused by: org.apache.ws.commons.schema.XmlSchemaException: Unable to locate 
imported document at 'http://www.w3.org/2001/xml.xsd', rel
ative to 'https://docs.oasis-open.org/xri/xrd/v1.0/os/xrd-1.0-os.xsd'.
    at 
[email protected]//org.apache.cxf.catalog.CatalogXmlSchemaURIResolver.resolveEntity(CatalogXmlSchemaURIResolver.java:76)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:682)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:536)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleSchemaElementChild(SchemaBuilder.java:1524)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:656)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:154)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:509)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:717)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:703)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:536)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleSchemaElementChild(SchemaBuilder.java:1524)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:656)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:154)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:509)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:717)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:703)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:536)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleSchemaElementChild(SchemaBuilder.java:1524)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:656)
    at 
org.apache.ws.xmlschema//org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:551)
    at 
[email protected]//org.apache.cxf.common.xmlschema.SchemaCollection.read(SchemaCollection.java:129)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.SchemaUtil.extractSchema(SchemaUtil.java:145)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:74)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:66)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:61)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.WSDLServiceBuilder.getSchemas(WSDLServiceBuilder.java:378)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:345)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:209)
    at 
org.apache.cxf.impl//org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:161)
    ... 22 more



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to