Java Axis2生成ArrayStoreException

Java Axis2生成ArrayStoreException,java,axis2,Java,Axis2,在以下代码段中将XML解析为Java类时,我遇到了ArrayStoreException: 757 StringReader in = new StringReader( xmlString ); 758 XMLStreamReader reader = StAXUtils.createXMLStreamReader( in ); 759 760 try 761 { 762 ManageContentRequest.Fac

在以下代码段中将XML解析为Java类时,我遇到了ArrayStoreException:

757        StringReader in = new StringReader( xmlString );
758        XMLStreamReader reader = StAXUtils.createXMLStreamReader( in );
759
760        try
761        {
762          ManageContentRequest.Factory.parse( reader );
763        }
764        catch ( Exception e )
765        {
766          this.log.error( xmlString );
767          this.log.info( e.getLocalizedMessage(), e );
768          e.printStackTrace();
769        }
2011-11-21 15:37:05  INFO  com.geometryit.blis.production.Publish  -   - java.lang.ArrayStoreException
org.apache.axis2.databinding.utils.ConverterUtil$ObjectConversionException: java.lang.ArrayStoreException
  at org.apache.axis2.databinding.utils.ConverterUtil.ConvertToArbitraryObjectArray(ConverterUtil.java:1211)
  at org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(ConverterUtil.java:1172)
  at au.gov.business.ablis._2011_09.data.ServiceType$Factory.parse(ServiceType.java:3864)
  at au.gov.business.ablis._2011_09.messages.contentmanagement.RequestItemChoice_type0$Factory.parse(RequestItemChoice_type0.java:1202)
  at au.gov.business.ablis._2011_09.messages.contentmanagement.RequestItem_type0$Factory.parse(RequestItem_type0.java:463)
  at au.gov.business.ablis._2011_09.messages.contentmanagement.ManageContentRequest$Factory.parse(ManageContentRequest.java:544)
  **at com.geometryit.blis.production.Publish.publishLicenceUsingWebService(Publish.java:762)
  at com.geometryit.blis.production.Publish.publishCommonwealthLicence(Publish.java:616)
  at com.geometryit.blis.production.Publish.publishLicence(Publish.java:489)
  at com.geometryit.blis.production.Publish.processRequest(Publish.java:246)
  at com.geometryit.blis.AppServlet.doPost(AppServlet.java:235)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
  at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)
  at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
  at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1684)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ArrayStoreException
  at java.lang.System.arraycopy(Native Method)
  at java.util.ArrayList.toArray(ArrayList.java:306)
  at org.apache.axis2.databinding.utils.ConverterUtil.ConvertToArbitraryObjectArray(ConverterUtil.java:1207)
  ... 27 more
stacktrace为(带**前缀的行与上述代码段匹配):

从wsdl和xsd文件中,我使用Axis2 v1.6.1在Java 1.6.0_24、Windows 7和64位上生成了Java类。xsd的相关部分用**前缀突出显示

<xs:complexType name="ServiceType">
  <xs:sequence>
    <xs:element name="Id" type="tns:AblisId" />
    <xs:element name="TierOfGovernment" type="tns:TierOfGovernmentType" minOccurs="0"/>
    <xs:element name="Jurisdiction" type="tns:JurisdictionType" minOccurs="1" />
    <xs:element name="Status" type="tns:ServiceStatusType" minOccurs="1" maxOccurs="unbounded" />
    <xs:element name="Type" type="tns:ServiceTypeType" />
    <xs:element name="Name" type="tns:String256"  minOccurs="0"/>
    <xs:element name="DescriptiveName" type="tns:String256" minOccurs="0" />
    <xs:element name="AlternativeName" type="tns:String256" minOccurs="0" maxOccurs="1" />
    <xs:element name="Description" type="xs:string"  minOccurs="0"/>
    <xs:element name="ShortDescription" type="tns:String250" minOccurs="0"/>
    <xs:element name="EligibilityRequirements" type="xs:string" minOccurs="0"/>
    <xs:element name="Coverage" type="xs:string" minOccurs="0"/>
    <xs:element name="DisqualifiedPersonsOrEntities" type="xs:string" minOccurs="0" />
    <xs:element name="Duration" type="tns:String255" minOccurs="0" />
    <xs:element name="Exemptions" type="xs:string" minOccurs="0"/>
    <xs:element name="MutualRecognition" type="xs:boolean" minOccurs="0" />
    <xs:element name="OngoingEligibilityRequirements" type="xs:string" minOccurs="0" />
    <xs:element name="StartDate" type="xs:dateTime" minOccurs="0" />
    <xs:element name="EndDate" type="xs:dateTime" minOccurs="0" />
    <xs:element name="Priority" type="xs:boolean" minOccurs="0" />
    <xs:element name="ApprovedTime" type="tns:String255" minOccurs="0"/>
    <xs:element name="WhenRequired" type="xs:string" minOccurs="0" />
    <xs:element name="AdditionalInformation" type="xs:string" minOccurs="0" />
    <xs:element name="Transfer" type="xs:string" minOccurs="0" />
    **<xs:element name="URL" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="VersionNumber" type="xs:int" minOccurs="0" />
    <xs:element name="AttributeOverride" type="tns:String100" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="BusinessStructure" type="tns:BusinessStructureType" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="TopicName" type="tns:String100" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="Term" type="tns:TermDefinitionType" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="AssociatedService" minOccurs="0" maxOccurs="unbounded">
      <xs:complexType>
        <xs:sequence>
          <xs:choice>
            <xs:element name="ServiceId" type="tns:AblisId" />
            <xs:element name="Service" type="tns:ServiceType" />
          </xs:choice>
          <xs:element name="Type" type="tns:ServiceAssociationTypeType" />
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="AssociatedBusinessActivity" minOccurs="0" maxOccurs="unbounded" >
      <xs:complexType>
        <xs:sequence>
          <xs:element name="BusinessActivityCode" type="tns:BusinessActivityCodeType" />
          <xs:element name="Principal" type="xs:boolean" minOccurs="0"/>
          <xs:element name="AskYesNoAnswer" type="xs:boolean" minOccurs="0"/>
          <xs:element name="AskMultiAnswer" type="xs:boolean" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="AssociatedKeyword" minOccurs="0" maxOccurs="unbounded">
      <xs:complexType>
        <xs:sequence>
          <xs:choice>
            <xs:element name="KeywordId" type="tns:AblisId" />
            <xs:element name="Keyword" type="tns:KeywordAliasType" />
          </xs:choice>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="AssociatedLegislation" minOccurs="0" maxOccurs="unbounded">
      <xs:complexType>
        <xs:sequence>
          <xs:choice>
            <xs:element name="LegislationId" type="tns:AblisId" />
            <xs:element name="Legislation" type="tns:LegislationType" />
          </xs:choice>
          <xs:element name="Reference" type="tns:String1024" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="AssociatedPrerequisite" minOccurs="0" maxOccurs="unbounded">
      <xs:complexType>
        <xs:sequence>
          <xs:choice>
            <xs:element name="PrerequisiteId" type="tns:AblisId" />
            <xs:element name="Prerequisite" type="tns:PrerequisiteType" />
          </xs:choice>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="AssociatedOrganisation" maxOccurs="unbounded">
      <xs:complexType>
        <xs:sequence>
          <xs:choice>
            <xs:element name="OrganisationId" type="tns:AblisId" />
            <xs:element name="Organisation" type="tns:OrganisationType" />
          </xs:choice>
          <xs:element name="Role" type="tns:OrganisationRoleType" />
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="AssociatedAnswer" minOccurs="0" maxOccurs="unbounded">
      <xs:complexType>
        <xs:sequence>
          <xs:choice>
            <xs:element name="AnswerId" type="tns:AblisId" />
            <xs:element name="Answer" type="tns:AnswerType" />
          </xs:choice>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  </xs:sequence>
</xs:complexType>

**
我已经查看了org.apache.axis2.databinding.utils.converteru的源代码,直到了解了其中的情况。上述代码段执行了数百次(>500)。我强烈怀疑之前调用过ConverterUtil.convertToArray

你知道这是怎么回事吗

编辑:xmlString的相关部分是:

    <Service>
        <tns:Id>
          <tns:InternalId xsi:nil="true" />
            <tns:ExternalId>C0444</tns:ExternalId>
        </tns:Id>
        <tns:TierOfGovernment>Commonwealth</tns:TierOfGovernment>
        <tns:Jurisdiction>WA</tns:Jurisdiction>
        <tns:Status>Published</tns:Status>
        <tns:Type>Licence</tns:Type>
        <tns:Name>Certificate of Plant Breeder's Rights</tns:Name>
        <tns:DescriptiveName></tns:DescriptiveName>
        <tns:Description>You will require this certificate if you are the original breeder of a new variety of plant or if you are acquiring ownership rights from an original breeder.
This certificate will provide exclusive commercial rights to the new plant variety. It provide rights to exclude others from producing propagating material, conditioning propagating material (including cleaning, coating, sorting, packaging and grading), offering propagating material for sale, importing and exporting and stocking propagating material of protected varieties. 

Please consult the Contact Officer for further details.</tns:Description>
        <tns:EligibilityRequirements>As the applicant you must: 

- be the original breeder or have acquired legal ownership; 
- demonstrate that the plant variety is new or recently exploited and is unique (distinct, uniform, stable); and
- have an acceptable name; and
- pay the required fees.

A recently exploited variety is one which had been sold with the breeder's consent in either:

- Australia - not more than 12 months prior to lodging the application; or 
- not more than 6 years (trees and vines) or 4 years (all other species) in another country which is a member of the International Union for the Protection of New Varieties of Plants.

In order to demonstrate that the plant is distinct, uniform and stable (DUS), the applicant will be required to nominate an accredited Qualified Person (QP) as part of the application process. This person will be responsible for conducting a comparative growing trial in order to demonstrate the DUS of the plant.

Please consult the Contact Officer for further details.</tns:EligibilityRequirements>
        <tns:MutualRecognition>false</tns:MutualRecognition>
        <tns:Priority>false</tns:Priority>
        <tns:URL>http://www.ipaustralia.gov.au/get-the-right-ip/plant-breeders-rights/`</tns:URL>
        <tns:BusinessStructure>SoleTrader</tns:BusinessStructure>
  <tns:TopicName></tns:TopicName>

        <tns:AssociatedKeyword>
          <tns:Keyword>
            <tns:Id>
                <tns:InternalId xsi:nil="true" />
                <tns:ExternalId xsi:nil="true" />
            </tns:Id>
            <tns:Keyword>Breeder's</tns:Keyword>
          </tns:Keyword>
        </tns:AssociatedKeyword>
        <tns:AssociatedKeyword>
          <tns:Keyword>
            <tns:Id>
                <tns:InternalId xsi:nil="true" />
                <tns:ExternalId xsi:nil="true" />
            </tns:Id>
            <tns:Keyword>Certificate</tns:Keyword>
          </tns:Keyword>
        </tns:AssociatedKeyword>
        <tns:AssociatedKeyword>
          <tns:Keyword>
            <tns:Id>
                <tns:InternalId xsi:nil="true" />
                <tns:ExternalId xsi:nil="true" />
            </tns:Id>
            <tns:Keyword>Plant</tns:Keyword>
          </tns:Keyword>
        </tns:AssociatedKeyword>
        <tns:AssociatedKeyword>
          <tns:Keyword>
            <tns:Id>
                <tns:InternalId xsi:nil="true" />
                <tns:ExternalId xsi:nil="true" />
            </tns:Id>
            <tns:Keyword>Rights</tns:Keyword>
          </tns:Keyword>
        </tns:AssociatedKeyword>
  <tns:AssociatedOrganisation>
    <tns:OrganisationId>
              <tns:InternalId xsi:nil="true" />
                <tns:ExternalId>BDP_0</tns:ExternalId>
    </tns:OrganisationId>
    <tns:Role>Owner</tns:Role>
  </tns:AssociatedOrganisation>
    </Service>

C0444
英联邦
华盛顿州
出版
许可证
植物种植者权利证书
如果您是新品种植物的原始繁殖者,或者如果您从原始繁殖者处获得所有权,您将需要此证书。
该证书将为新植物品种提供独家商业权利。它规定禁止他人生产繁殖材料、调节繁殖材料(包括清洁、涂层、分类、包装和分级)、提供供销售的繁殖材料、进出口和储存受保护品种的繁殖材料的权利。
请咨询联络官以了解更多详细信息。
作为申请人,您必须:
-是原始繁殖者或已获得合法所有权;
-证明该植物品种是新的或最近开发的,且独特(独特、统一、稳定);和
-具有可接受的名称;和
-支付所需费用。
最近开发的品种是指经繁殖者同意出售的品种:
-澳大利亚-提交申请前不超过12个月;或
-在国际植物新品种保护联盟成员国的另一个国家,不超过6年(树木和葡萄藤)或4年(所有其他物种)。
为了证明工厂是独特、统一和稳定的(DUS),申请人需要提名一名合格人员(QP)作为申请过程的一部分。该人员将负责进行比较生长试验,以证明植物的DUS。
请咨询联络官以了解更多详细信息。
错误的
错误的
http://www.ipaustralia.gov.au/get-the-right-ip/plant-breeders-rights/`
太阳贸易商
育种者的
证明书
植物
权利
BDP_0
物主

我已经解决了这个问题。问题的根本原因是我的错误数据。导致问题的URI包含严重的重音(`)。这导致抛出一个畸形的DurieException,但被忽略。它甚至没有被记录下来

有关更多信息,请参阅