我試圖生成我的web服務的WSDL,但我得到這個錯誤:無法創建JAXBContext而創建我的WSDL
Note: ap round: 2 Exception in thread "main" javax.xml.ws.WebServiceException: Unable to create JAXBContext at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153) at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:83) at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:244) at com.sun.tools.internal.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:229) at com.sun.tools.internal.ws.wscompile.WsgenTool.run(WsgenTool.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:105) at com.sun.tools.internal.ws.WsGen.main(WsGen.java:41) Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions java.lang.StackTraceElement does not have a no-arg default constructor. this problem is related to the following location: at java.lang.StackTraceElement at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace() at java.lang.Throwable at java.lang.Exception at java.sql.SQLException at private java.sql.SQLException wsdb.jaxws.SQLExceptionBean.nextException at wsdb.jaxws.SQLExceptionBean at java.security.AccessController.doPrivileged(Native Method) at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:140) ... 10 more Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions java.lang.StackTraceElement does not have a no-arg default constructor. this problem is related to the following location: at java.lang.StackTraceElement at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace() at java.lang.Throwable at java.lang.Exception at java.sql.SQLException at private java.sql.SQLException wsdb.jaxws.SQLExceptionBean.nextException at wsdb.jaxws.SQLExceptionBean at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:436) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:277) at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1100) at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:143) at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:95) at com.sun.xml.internal.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:97) at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:148) at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:140) ... 12 more
我看到網上關於這幾個discusion與建設開始構造所有的班級,直到創建另一個xml規範。事實是,這沒有一個真正的答案或我測試的解決方案不起作用。
我在這裏讀到關於這個問題的討論,但它沒有終止,我不知道如何解決。如果有人對此有所瞭解,我很高興能將我加入嚴謹的方向以避免這種情況發生。
我在JDK 6中使用Debian Squezze,Java 1.6_20,JAX-WS JAX-WS RI 2.1.6和wsgen來生成wsdl。它正確的第一步,用bean類生成jaxws目錄。
這可能與:http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6974244 –
@KevinWong:該鏈接現在看來破... –