Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3190

cvc-elt.1: Cannot find the declaration of element 'mappings'. at /com/webservice/Employee.aegis.xml

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.9
    • Fix Version/s: Invalid
    • Component/s: Aegis Databinding
    • Labels:
      None
    • Environment:

      Windows XP, JDK 1.6.0_13, Eclipse 3.4 Ganemyde,

    • Estimated Complexity:
      Unknown

      Description

      I have deployed a webservice on JBoss succesfully and was able to access it. Now i want to include Aegis Databinding for the request and response XMLs. For that i have written a mapping file on my client side with name Employee.aegis.xml for the Employee bean and have done the configurations in my client program. But when I try to execute my client prorgam I'm getting the following error:

      Dec 14, 2010 4:43:02 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean checkServiceClassAnnotations
      WARNING: A JAX-WS Annotation was found on com.webservice.EmployeeServicePortType while using the Simple frontend.  For better results, use the JAX-WS frontend.
      Dec 14, 2010 4:43:03 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
      INFO: Creating Service {http://webservice.com/}EmployeeServicePortType from class com.webservice.EmployeeServicePortType
      Dec 14, 2010 4:43:04 PM org.apache.cxf.aegis.type.XMLTypeCreator$1 error
      SEVERE: cvc-elt.1: Cannot find the declaration of element 'mappings'. at /com/webservice/Employee.aegis.xml line 1 column 42.
      org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'mappings'.
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
      	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
      	at org.apache.cxf.aegis.type.XMLTypeCreator.readAegisFile(XMLTypeCreator.java:181)
      	at org.apache.cxf.aegis.type.XMLTypeCreator.getDocument(XMLTypeCreator.java:206)
      	at org.apache.cxf.aegis.type.XMLTypeCreator.findMapping(XMLTypeCreator.java:265)
      	at org.apache.cxf.aegis.type.XMLTypeCreator.isEnum(XMLTypeCreator.java:217)
      	at org.apache.cxf.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:118)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:634)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:345)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:303)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:270)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:467)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:530)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:278)
      	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:99)
      	at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
      	at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
      	at com.webservice.EmployeeServicePortType_EmployeeServicePort_Client.main(EmployeeServicePortType_EmployeeServicePort_Client.java:39)
      Exception in thread "main" org.apache.cxf.aegis.DatabindingException: Error initializing parameters for operation {http://webservice.com/}getEmployee: cvc-elt.1: Cannot find the declaration of element 'mappings'. at /com/webservice/Employee.aegis.xml line 1 column 42. cvc-elt.1: Cannot find the declaration of element 'mappings'. at /com/webservice/Employee.aegis.xml line 1 column 42.
      	at org.apache.cxf.aegis.type.XMLTypeCreator$1.throwDatabindingException(XMLTypeCreator.java:157)
      	at org.apache.cxf.aegis.type.XMLTypeCreator$1.error(XMLTypeCreator.java:165)
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
      	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
      	at org.apache.cxf.aegis.type.XMLTypeCreator.readAegisFile(XMLTypeCreator.java:181)
      	at org.apache.cxf.aegis.type.XMLTypeCreator.getDocument(XMLTypeCreator.java:206)
      	at org.apache.cxf.aegis.type.XMLTypeCreator.findMapping(XMLTypeCreator.java:265)
      	at org.apache.cxf.aegis.type.XMLTypeCreator.isEnum(XMLTypeCreator.java:217)
      	at org.apache.cxf.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:118)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:634)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:345)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:303)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:270)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:467)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:530)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:278)
      	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:99)
      	at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
      	at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
      	at com.webservice.EmployeeServicePortType_EmployeeServicePort_Client.main(EmployeeServicePortType_EmployeeServicePort_Client.java:39)
      
      

      My mapping file is Employee.aegis.xml:

      <mappings xmlns="http://webservice.com" >
      	<mapping name="Employee" >
      		<property name="name" mappedName="Name" />
      		<property name="title" mappedName="Title" />
      	</mapping>
      </mappings>
      

      Employee bean:

      public class Employee {
      
          protected String name;
          protected String title;
      
         public String getName() {
              return name;
          }
      
          public void setName(String value) {
              this.name = value;
          }
      
            public String getTitle() {
              return title;
          }
      
         public void setTitle(String value) {
              this.title = value;
          }
      
      }
      

      Client program :

      public static void main(String args[]) throws Exception {
          	
          	ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
          	factory.getInInterceptors().add(new LoggingInInterceptor());
          	factory.getOutInterceptors().add(new LoggingOutInterceptor());    	
          	
      	    factory.setServiceClass(EmployeeServicePortType.class);
      	    AegisDatabinding db = new AegisDatabinding();
      	    factory.setDataBinding(db);
      	 
      	    factory.setAddress("http://localhost:8080/EmployeeWebservice/EmployeeService");
      	    EmployeeServicePortType service = (EmployeeServicePortType)factory.create();
              {
              System.out.println("Invoking getEmployee...");
              Employee _getEmployee_arg0 = new Employee();
              _getEmployee_arg0.setName("Ali");
              _getEmployee_arg0.setTitle("PA");
              Employee _getEmployee__return = service.getEmployee(_getEmployee_arg0);
              System.out.println("getEmployee.result=" + _getEmployee__return);
      
      
              }
      
              System.exit(0);
          }
      

      Please tell me if my configurations for aegis databinding are correct and what could be the issue with the above piece of code.

      Thanks in advance,
      Asif Ali Mohammed.
      Cognizant Technology Solutions.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              asifali Asif Ali Mohammed
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: