5 Replies Latest reply on Nov 30, 2010 11:32 AM by Gaurav Nigam

    Error calling listener method in cxfbc provider endpoint

    Gaurav Nigam Newbie

      Hi,

      I am trying to create a cxfbc provider endpoint to post a soap message to a Web Service. I am using apache-servicemix-4.3.0-fuse-00-00 version of servicemix. Here is the endpoint:

       

      <constructor-arg value="$" />

       

      <entry key="user" value="$" />

       

      -


      cxf.xml:

       

       

               

              <http:conduit name="ServicePort.http-conduit">

                      <http:tlsClientParameters>

                              <sec:trustManagers>

                                      <sec:keyStore type="JKS" password="******" resource="classpath:keystores/keystore.jks" />

                              </sec:trustManagers>

                              <sec:cipherSuitesFilter>

                                         <sec:include>.EXPORT.</sec:include>

                                         <sec:include>.EXPORT1024.</sec:include>

                                         <sec:include>.WITHDES_.</sec:include>

                                         <sec:include>.WITHNULL_.</sec:include>

                                         <sec:exclude>.DHanon_.(EndpointTracker.java:77)[90:servicemix-common:2010.02.0.fuse-00-00]

           at org.apache.servicemix.common.osgi.EndpointTracker.register(EndpointTracker.java:58)[90:servicemix-common:2010.02.0.fuse-00-00]

           ... 38 more

      Caused by: java.lang.NullPointerException

           at org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:418)[131:servicemix-cxf-bc:2010.02.0.fuse-00-00]

           ... 40 more

       

      Can anyone please help me understand what this error means and how to get rid of it?

       

      Thanks,

      Gaurav

        • 1. Re: Error calling listener method in cxfbc provider endpoint
          Freeman(Yue) Fang Master

          Hi,

           

          Given the root exception

           

          Caused by: java.lang.NullPointerException

          at org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:418)

           

          CxfBcProvider.java:418 is

           

          definition = getBus().getExtension(WSDLManager.class)

                                      .getDefinition(wsdl.getURL());

           

          I think somehow the wsdl you specified for cxfbc:provider is null,  maybe caused by incorrect path.

           

          Freeman

          • 2. Re: Error calling listener method in cxfbc provider endpoint
            Gaurav Nigam Newbie

            Hi Freeman,

            I tried giving a fake location for wsdl and at that time, it throws FileNotFoundException. It means that there is something wrong while validating the wsdl. I added the following in cxfbc endpoint xml:

             

             

             

            Then I started getting following error:

             

            20:12:59,741 | ERROR | xtenderThread-69 | ContextLoaderListener            | BundleApplicationContextListener   50 | 72 - org.springframework.osgi.extender - 1

            2.0 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=MssPwsEndpoint, config=osgibundle:/META-INF/spring/*.xml))

            org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath

            endpoints/endpoints.xml]

            Offending resource: URL bundle://171.0:0/META-INF/spring/xbean.xml; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingExcept

            on: Configuration problem: Failed to import bean definitions from URL location classpath:wsdl/secpws.wsdl

            Offending resource: OSGi resource[classpath:endpoints/endpoints.xml|bnd.id=171|bnd.sym=PwsEndpoint]; nested exception is org.springframework.beans.factory.x

            l.XmlBeanDefinitionStoreException: Line 11 in XML document from OSGi resource[classpath:wsdl/secpws.wsdl|bnd.id=171|bnd.sym=PwsEndpoint] is invalid; nested

            xception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'definitions'.

                    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)[59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)[59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:192)

            59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)[59:org.s

            ringframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)[59:org.

            pringframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)[59:or

            .springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[59:org.springframework.beans

            3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[59:org.springframework.beans:3

            0.3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[59:org.springframework.beans:3.0

            3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[59:org.springframework.beans:3.0

            3.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[59:org.springframe

            ork.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)[59:org.springframe

            ork.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)[59:org.springframe

            ork.beans:3.0.3.RELEASE]

                    at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)[71:org.spring

            ramework.osgi.core:1.2.0]

                    at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)[71:org.spring

            ramework.osgi.core:1.2.0]

                    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[60:org.

            pringframework.context:3.0.3.RELEASE]

                    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)[60:org.springframework.co

            text:3.0.3.RELEASE]

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:6

            )[71:org.springframework.osgi.core:1.2.0]

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)[7

            :org.springframework.osgi.core:1.2.0]

                    at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[71:org.springframework.osgi.core:1.2.0]

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java

            247)[71:org.springframework.osgi.core:1.2.0]

                    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationConte

            tExecutor.java:222)[72:org.springframework.osgi.extender:1.2.0]

                    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContex

            Executor.java:175)[72:org.springframework.osgi.extender:1.2.0]

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)

            71:org.springframework.osgi.core:1.2.0]

                    at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)[72:org.springframework.osgi.extende

            :1.2.0]

                    at java.lang.Thread.run(Thread.java:662)[:1.6.0_22]

            Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location

            classpath:wsdl/secpws.wsdl

            Offending resource: OSGi resource[classpath:endpoints/endpoints.xml|bnd.id=171|bnd.sym=MssPwsEndpoint]; nested exception is org.springframework.beans.factory.x

            l.XmlBeanDefinitionStoreException: Line 11 in XML document from OSGi resource[classpath:wsdl/secpws.wsdl|bnd.id=171|bnd.sym=MssPwsEndpoint] is invalid; nested

            xception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'definitions'.

                    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)[59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)[59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:192)

            59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)[59:org.s

            ringframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)[59:org.

            pringframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)[59:or

            .springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[59:org.springframework.beans

            3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[59:org.springframework.beans:3

            0.3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[59:org.springframework.beans:3.0

            3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[59:org.springframework.beans:3.0

            3.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[59:org.springframe

            ork.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)[59:org.springframe

            ork.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:186)

            59:org.springframework.beans:3.0.3.RELEASE]

                    ... 23 more

            Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 11 in XML document from OSGi resource[classpath:wsdl/secpws.wsdl|bnd.id=

            71|bnd.sym=MssPwsEndpoint] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'definitions'.

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)[59:org.springframework.beans:3

            0.3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[59:org.springframework.beans:3.0

            3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[59:org.springframework.beans:3.0

            3.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[59:org.springframe

            ork.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)[59:org.springframe

            ork.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:186)

            59:org.springframework.beans:3.0.3.RELEASE]

                    ... 33 more

            Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'definitions'.

                    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1916)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)[:1.6.0_2

            ]

                    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)[:1.6.0_22]

                    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)[:1.6.0_22]

                    at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)[59:org.springframework.beans:3.0.3.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)[59:org.springframework.beans:3

            0.3.RELEASE]

                    ... 38 more

             

            My wsdl has got the element "definitions" with proper namespace. In wsdl, definitions element starts like this:

             

             

            Can you please suggest any solution?

             

            Thanks,

            Gaurav

            • 3. Re: Error calling listener method in cxfbc provider endpoint
              Freeman(Yue) Fang Master

              Hi,

               

              You can't do

               

               

              in your spring bean, as wsdl file isn't a spring bean configuration file.

               

              If you wanna see if this wsdl is valid, you can use wsdl2java tool shipped with cxf,

              wsdl2java your_wsdl_file

               

              This can give you more info about if the wsdl is valid or not.

               

              Freeman

              • 4. Re: Error calling listener method in cxfbc provider endpoint
                Gaurav Nigam Newbie

                Hi Freeman,

                I tried wsdl2java  and it did not throw any error. So wsdl seems to be valid. We were able to get this endpoint deployed successfully when we added those certificates in jre folder and we did not have "providedBus" configuration in the endpoint. So it must have something to do with that. I removed the import statement for wsdl and I am again getting the same NullPointerException. Do you have any idea what it might be?

                 

                Thanks,

                Gaurav

                • 5. Re: Error calling listener method in cxfbc provider endpoint
                  Gaurav Nigam Newbie

                  Hi Freeman,

                  I figured that this NullPointerException was occurring because I had not imported the cxf-extension-soap.xml. Now it is throwing me an exception saying..

                   

                  Could not load keystore resource classpath:keystores/keystore.jks

                   

                  I have seen your post regarding the same thing and you had suggested to create a fragment bundle having the keystore. Can you please point me to some example which describes how I can create fragment bundle using build tool as maven.

                   

                  Thanks,

                  Gaurav