Announcement Announcement Module
Collapse
No announcement yet.
JibxSystemException on Request and Response objects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JibxSystemException on Request and Response objects

    Hi All,
    I'm new to this forum and to spring web services so be gentle.
    I have just attempted to create my first spring web service and have hit a massive wall.
    I keep getting the following error on attempting to run my junit tests.

    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'marshaller' defined in class path resource [applicationContext-memberservice.xml]: Invocation of init method failed; nested exception is org.springframework.oxm.jibx.JibxSystemException: Binding information for class org.bk.memberservice.message.MemberDetailsResponse must be regenerated with current binding compiler; nested exception is org.jibx.runtime.JiBXException

    Caused by: org.springframework.oxm.jibx.JibxSystemException: Binding information for class org.bk.memberservice.message.MemberDetailsResponse must be regenerated with current binding compiler; nested exception is org.jibx.runtime.JiBXException: Binding information for class org.bk.memberservice.message.MemberDetailsResponse must be regenerated with current binding compiler

    The code that I'm trying to get working is as follows:-
    file:memberservice_jibx_binding.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>  
    <binding>  
        <namespace prefix="ms" 
                         uri="http://bk.org/memberservice/" default="all"/>  
        <mapping name="MemberDetailsRequest"                    class="org.bk.memberservice.message.MemberDetailsRequest">  
            <value name="id" field="id" />  
        </mapping>  
        <mapping name="MemberDetailsResponse" class="org.bk.memberservice.message.MemberDetailsResponse">  
            <structure name="memberdetail" ordered="false">  
                <value name="name" field="name" />  
                <value name="city" field="city" />  
                <value name="phone" field="phone" />  
                <value name="state" field="state" />  
            </structure>  
        </mapping>  
    </binding>
    file:MemberDetailsRequest.java
    Code:
    package org.bk.memberservice.message;
    public class MemberDetailsRequest {
    	public MemberDetailsRequest() {
    	}
    	public MemberDetailsRequest(String id) {
    		this.id = id;
    	}
    	private String id;
    	public String getId() {
    		return id;
    	}
    	public void setId(String id) {
    		this.id = id;
    	}
    }
    file:MemberDetailsResponse.java
    Code:
    package org.bk.memberservice.message;
    import org.bk.memberservice.types.MemberDetail;
    public class MemberDetailsResponse {
    	public MemberDetailsResponse() {
    	}
    	private MemberDetail memberDetail;
    
    	public MemberDetailsResponse(MemberDetail memberDetail) {
    		this.memberDetail = memberDetail;
    	}
    	public MemberDetail getMemberDetail() {
    		return memberDetail;
    	}
    	public void setMemberDetail(MemberDetail memberDetail) {
    		this.memberDetail = memberDetail;
    	}
    }
    file:MemberDetail.java
    Code:
    package org.bk.memberservice.types;
    public class MemberDetail {
       public MemberDetail() {}
       public MemberDetail(String name, String phone, String city, String state) {
    		this.name = name;
    		this.phone = phone;
    		this.city = city;
    		this.state = state;
    	}
    	private String name;
    	private String phone;
    	private String city;
    	private String state;
    
    	public String getName() {
    		return name;
    	}
    	public void setName(String name) {
    		this.name = name;
    	}
    	public String getPhone() {
    		return phone;
    	}
    	public void setPhone(String phone) {
    		this.phone = phone;
    	}
    	public String getCity() {
    		return city;
    	}
    	public void setCity(String city) {
    		this.city = city;
    	}
    	public String getState() {
    		return state;
    	}
    	public void setState(String state) {
    		this.state = state;
    	}
    }
    file:GetMemberDetailsEndpoint
    Code:
    package org.bk.memberservice.endpoint;
    import org.bk.memberservice.message.MemberDetailsRequest;
    import org.bk.memberservice.message.MemberDetailsResponse;
    import org.bk.memberservice.service.MemberManager;
    import org.bk.memberservice.types.MemberDetail;
    import org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint;
    
    public class GetMemberDetailsEndpoint extends AbstractMarshallingPayloadEndpoint 
    {
       private MemberManager memberManager;
       @Override
       protected Object invokeInternal(Object requestObject) throws Exception 
       {
          MemberDetailsRequest request = (MemberDetailsRequest) requestObject;
          MemberDetail memberDetail = 
          memberManager.getMemberDetails(request.getId());
          MemberDetailsResponse response = 
          new MemberDetailsResponse(memberDetail);
          return response;
        }
    
        public void setMemberManager(MemberManager memberManager) 
        {
          this.memberManager = memberManager;
        }
    }
    file:applicationContext-memberservice.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:jee="http://www.springframework.org/schema/jee"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
    
    <bean id="payloadMapping"
     class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
       <property name="endpointMap">
         <map>
            <entry key="{http://bk.org/memberservice/}MemberDetailsRequest"
    	     value-ref="getMemberDetailsEndpoint" />
          </map>
       </property>
    </bean>
    
    <bean id="memberManager" class="org.bk.memberservice.service.MemberManagerImpl"></bean>
    	
     <bean id="getMemberDetailsEndpoint" class="org.bk.memberservice.endpoint.GetMemberDetailsEndpoint">
        <property name="marshaller" ref="marshaller" />
        <property name="unmarshaller" ref="unmarshaller" />
        <property name="memberManager" ref="memberManager" />
    </bean>
    
    <bean id="MemberDetailsRequest"
         class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
       <property name="wsdl" value="classpath:/memberservice.wsdl" />
    </bean>
    
    <bean id="marshaller" class="org.springframework.oxm.jibx.JibxMarshaller">
       <property name="targetClass"
        value="org.bk.memberservice.message.MemberDetailsResponse" />
    </bean>
    
    <bean id="unmarshaller" class="org.springframework.oxm.jibx.JibxMarshaller">
        <property name="targetClass"
            value="org.bk.memberservice.message.MemberDetailsRequest" />
    </bean>
    </beans>
    file:memberservice.wsdl
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <wsdl:definitions xmlns:ms="http://bk.org/memberservice/"
    	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    	xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="memberservice"
    	targetNamespace="http://bk.org/memberservice/">
    <wsdl:types>
     <xsd:schema targetNamespace="http://bk.org/memberservice/" elementFormDefault="qualified">
       <xsd:complexType name="MemberDetailType">
          <xsd:sequence>
    	  <xsd:element name="name" type="xsd:string" />
    	  <xsd:element name="phone" type="xsd:string" />
    	  <xsd:element name="city" type="xsd:string" />
    	  <xsd:element name="state" type="xsd:string" />
           </xsd:sequence>
       </xsd:complexType>
      <xsd:element name="MemberDetailsRequest">
    				<xsd:complexType>
    					<xsd:sequence>
    						<xsd:element name="id" type="xsd:string" />
    					</xsd:sequence>
    				</xsd:complexType>
    			</xsd:element>
    			<xsd:element name="MemberDetailsResponse">
    				<xsd:complexType>
    					<xsd:sequence>
    						<xsd:element name="memberdetail" type="ms:MemberDetailType" />
    					</xsd:sequence>
    				</xsd:complexType>
    			</xsd:element>
    		</xsd:schema>
    	</wsdl:types>
    	<wsdl:message name="MemberDetailsRequest">
    		<wsdl:part element="ms:MemberDetailsRequest" name="parameters" />
    	</wsdl:message>
    	<wsdl:message name="MemberDetailsResponse">
    		<wsdl:part element="ms:MemberDetailsResponse" name="parameters" />
    	</wsdl:message>
    	<wsdl:portType name="memberservice">
    		<wsdl:operation name="GetMemberDetails">
    			<wsdl:input message="ms:MemberDetailsRequest" />
    			<wsdl:output message="ms:MemberDetailsResponse" />
    		</wsdl:operation>
    	</wsdl:portType>
    	<wsdl:binding name="memberserviceSOAP" type="ms:memberservice">
    		<soap:binding style="document"
    			transport="http://schemas.xmlsoap.org/soap/http" />
    		<wsdl:operation name="GetMemberDetails">
    			<soap:operation soapAction="http://bk.org/memberservice/GetMemberDetails" />
    			<wsdl:input>
    				<soap:body use="literal" />
    			</wsdl:input>
    			<wsdl:output>
    				<soap:body use="literal" />
    			</wsdl:output>
    		</wsdl:operation>
    	</wsdl:binding>
    	<wsdl:service name="memberservice">
    		<wsdl:port binding="ms:memberserviceSOAP" name="memberserviceSOAP">
    			<soap:address location="http://localhost:8081/TuesdayWebService/services/MemberDetailsRequest" />
    		</wsdl:port>
    	</wsdl:service>
    </wsdl:definitions>
    I have set up a build.xml, so that if I refresh my project it automaticaly uses org.jibx.binding.ant.CompileTask with file memberservice_jibx_binding.xml to bind my request and response objects.

    If anybody can help me with this, I will buy them a drink

    Anthony
Working...
X