Home » Java » java – ERROR : com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions-Exceptionshub

java – ERROR : com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

These classes i am using Can Any on help of this error?

@XmlRootElement(name="TESTBatchXML",namespace="www.test.com")
@XmlType(propOrder = {"formTypeCode", "act"})
@XmlAccessorType(XmlAccessType.FIELD)
public class EFilingBatchXML {

    private long actCount;

    private String formCode;
    private List<Activity> act;


    @XmlAttribute(name="ActCount")
    public long getActCount() {
         return actCount;
    }

    public void setActCount(long actCount) {
        this.actCount = actCount;
    }


    @XmlElement(name="Act",namespace="www.test.com")
    public List<Activity> getActivity() {
        return activity;
    }

    public void setActivity(List<Activity> activity) {
        this.activity = activity;
    }

    @XmlElement(name="FormType",namespace="www.test.com")
    public String getFormType() {
        return formType;
    }

    public void setFormType(String formType) {
        this.formType = formType;
    }
}
@XmlType(propOrder = {"filingDateText","parties"})
public class Activity {

    private long seqNum;
    private List<Party> parties;
    private String filingDateText;



    @XmlAttribute(name = "SeqNum")
    public long getSeqNum() {
        return seqNum;
    }

    public void setSeqNum(long seqNum) {
        this.seqNum = seqNum;
    }


    @XmlElement(name = "FilingDateText", namespace = "www.test.com")
    public String getFilingDateText() {
        return filingDateText;
    }

    public void setFilingDateText(String filingDateText) {
        this.filingDateText = filingDateText;
    }

    @XmlElement(name = "Party", namespace = "www.test.com")
    public List<Party> getParties() {
        return parties;
    }

    public void setParties(List<Party> parties) {
        this.parties = parties;
    }

}


Blockquote

com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:76) ~[jaxb-runtime-2.3.2.jar:2.3.2]
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:441) ~[jaxb-runtime-2.3.2.jar:2.3.2]
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:273) ~[jaxb-runtime-2.3.2.jar:2.3.2]
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:109) ~[jaxb-runtime-2.3.2.jar:2.3.2]
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1126) ~[jaxb-runtime-2.3.2.jar:2.3.2]
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:135) ~[jaxb-runtime-2.3.2.jar:2.3.2]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:297) ~[jaxb-api-2.3.1.jar:2.3.0]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:286) ~[jaxb-api-2.3.1.jar:2.3.0]
at javax.xml.bind.ContextFinder.find(ContextFinder.java:409) ~[jaxb-api-2.3.1.jar:2.3.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:721) ~[jaxb-api-2.3.1.jar:2.3.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:662) ~[jaxb-api-2.3.1.jar:2.3.0]
at io.pointchain.fincenscheduler.services.MrbReportGenerator.createReport(MrbReportGenerator.java:238) ~[classes/:na]
at io.pointchain.fincenscheduler.ScheduledTask.scheduleTaskWithCronExpression(ScheduledTask.java:35) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

How to&Answers: