cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CXF-3190) cvc-elt.1: Cannot find the declaration of element 'mappings'. at /com/webservice/Employee.aegis.xml
Date Sat, 08 Jan 2011 00:31:47 GMT

     [ https://issues.apache.org/jira/browse/CXF-3190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Kulp updated CXF-3190:
-----------------------------

    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:

{code}
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)

{code}


My mapping file is Employee.aegis.xml:

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

Employee bean:

{code:java}
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;
    }

}
{code}

Client program :
{code:java}
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);
    }
{code}


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.




  was:
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:

{code}
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)

{code}

######################################################################

My mapping file is Employee.aegis.xml:

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

######## Employee bean:

{code:java}
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;
    }

}
{code}

########## Client program :
{code:java}
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);
    }
{code}


###############################

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.





> cvc-elt.1: Cannot find the declaration of element 'mappings'. at /com/webservice/Employee.aegis.xml
> ---------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3190
>                 URL: https://issues.apache.org/jira/browse/CXF-3190
>             Project: CXF
>          Issue Type: Bug
>          Components: Aegis Databinding
>    Affects Versions: 2.2.9
>         Environment: Windows XP, JDK 1.6.0_13, Eclipse 3.4 Ganemyde, 
>            Reporter: Asif Ali Mohammed
>            Priority: Critical
>
> 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:
> {code}
> 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)
> {code}
> My mapping file is Employee.aegis.xml:
> {code:xml}
> <mappings xmlns="http://webservice.com" >
> 	<mapping name="Employee" >
> 		<property name="name" mappedName="Name" />
> 		<property name="title" mappedName="Title" />
> 	</mapping>
> </mappings>
> {code}
> Employee bean:
> {code:java}
> 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;
>     }
> }
> {code}
> Client program :
> {code:java}
> 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);
>     }
> {code}
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message