4 Replies Latest reply on Dec 15, 2017 10:07 AM by Daniel Ku

    java.net.ConnectException: wildflys apache cxf does not use internal XSDs

    hamsterbau Newbie

      Hi,

       

      i have a really big problem: I do not get it working that my application (with a webservice client) running in a wildfly 11 container is usable without internet connection. The webservice client always wants to connect to w3.org:

       

      Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xsd:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://www.w3.org/2005/05/xmlmime'.: java.net.ConnectException: Connection refused (Connection refus
      ed)
              at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198)
              at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:830)
              at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:864)
              at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:654)
              at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(WSDLReaderImpl.java:610)
              at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:320)
              at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2352)
              at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2338)
              at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:236)
              at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163)
              at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:85)
              ... 101 more
      

       

      I tried to use a jax-ws-catalog.xml file in my web-client.jar, but without success.

      Now my question: Is it possible to configure Apache CXF in wildfly, so the internal schema (/schemas/wsdl/xmime.xsd) will be used instead?

       

      Thanks in advance,

       

      Daniel

       

      PS: Proxy configuration is not an option, because no external calls are allowed for security purposes.

        • 1. Re: java.net.ConnectException: wildflys apache cxf does not use internal XSDs
          jaikiran pai Master

          Can you please post the complete stacktrace? To me this look like a bug, but asoldano knows more about this area so he may be able to help/confirm.

          • 2. Re: java.net.ConnectException: wildflys apache cxf does not use internal XSDs
            hamsterbau Newbie

            Thanks for your answer.

             

            To me this seems like a bug, too. Problem occurred in test environment, because of the short downtime of w3.org yesterday.

            The problem can simply be reproduced by removing a needed proxy or blocking calls to w3.org.

            So currently you cannot run a webclient in JBoss Wildfly without internet connection from my point of view.

             

            A colleague tested under the same conditions with Glassfish, where client stub generation was still possible (fallback to included XSDs).

            But as far as i know Glassfish uses Metro instead of Apache CXF.

             

            The whole stacktrace:

            2017-11-30 17:13:16,495 ERROR [my.package.PortalServiceBean] (default task-23) Failed to create service.: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
                at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:87)
                at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:394)
                at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528)
                at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:263)
                at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
                at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
                at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
                at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:159)
                at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
                at my.package.ApacheCXFWebserviceFactory.createWebserviceStub(ApacheCXFWebserviceFactory.java:56)
                at my.package.PortalServiceBean.initWebserviceStubs(PortalServiceBean.java:47)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:97)
                at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:80)
                at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:122)
                at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:162)
                at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
                at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
                at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.get(ContextualInstanceStrategy.java:140)
                at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
                at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
                at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125)
                at my.package.PortalServiceBean$Proxy$_$$_WeldClientProxy.getPortalWs(Unknown Source)
                at my.package.UserSessionBean.loadUser(UserSessionBean.java:274)
                at my.package.UserSessionBean.trackLogin(UserSessionBean.java:256)
                at my.package.UserSessionBean.login(UserSessionBean.java:158)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at com.sun.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:181)
                at com.sun.el.parser.AstValue.invoke(AstValue.java:289)
                at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
                at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
                at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
                at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
                at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
                at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
                at org.apache.deltaspike.jsf.impl.config.view.ViewControllerActionListener.processAction(ViewControllerActionListener.java:63)
                at org.apache.deltaspike.jsf.impl.listener.action.DeltaSpikeActionListener.processAction(DeltaSpikeActionListener.java:51)
                at javax.faces.component.UICommand.broadcast(UICommand.java:315)
                at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
                at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
                at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)
                at javax.faces.lifecycle.LifecycleWrapper.execute(LifecycleWrapper.java:77)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
                at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
                at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
                at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:78)
                at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                at my.package.CustomHeaderFilter.doFilter(CustomHeaderFilter.java:78)
                at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
                at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
                at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
                at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
                at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
                at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
                at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)
                at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
                at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
                at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)
                at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
                at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
                at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
                at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
                at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
                at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
                at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
                at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
                at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
                at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
                at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
                at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
                at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
                at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
                at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
                at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
                at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
                at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
                at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
                at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
                at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
                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)
            Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xsd:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://www.w3.org/2005/05/xmlmime'.: java.net.ConnectException: Connection refused (Connection refused)
                at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198)
                at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:830)
                at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:864)
                at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:654)
                at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(WSDLReaderImpl.java:610)
                at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:320)
                at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2352)
                at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2338)
                at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:236)
                at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163)
                at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:85)
                ... 101 more
            Caused by: java.net.ConnectException: Connection refused (Connection refused)
                at java.net.PlainSocketImpl.socketConnect(Native Method)
                at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
                at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
                at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
                at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
                at java.net.Socket.connect(Socket.java:589)
                at java.net.Socket.connect(Socket.java:538)
                at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
                at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
                at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
                at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
                at sun.net.www.http.HttpClient.New(HttpClient.java:339)
                at sun.net.www.http.HttpClient.New(HttpClient.java:357)
                at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
                at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
                at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
                at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
                at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
                at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
                at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:991)
                at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:144)
                at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:832)
                at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)
                at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
                at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
                at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
                at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)
                ... 111 more
            

             

            With best regards,

             

            Daniel

            • 3. Re: java.net.ConnectException: wildflys apache cxf does not use internal XSDs
              jaikiran pai Master

              at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)

              Can you paste the list of jars that are part of your _deployed_ application? If it's a war file you should be able to list the jars from .war/WEB-INF/lib folder. If it's a .ear, even include the listing of .ear/lib directory, if there's one.

              • 4. Re: java.net.ConnectException: wildflys apache cxf does not use internal XSDs
                Daniel Ku Newbie

                Why is this important?

                 

                The problem happens in a bundled class from Apache CXF (WSDL4J to be precise).

                And i already mentioned how to reproduce the failure or did you try to block w3.org and

                you have no problem with your webservice in JBoss Wildfly?

                 

                Thanks in advance,

                 

                Daniel

                 

                PS: I think the bug is described here for Apache CXF in general ([CXF-1505] Problem parsing /schemas/xmldsig-core-schema.xsd (Issue CXF-1200) - ASF JIRA) -> Web Services Description Language for Ja / Bugs / #34 External EntityResolver). But the thing is, that the used classes are JBoss specific (changed by JBoss), right?