XSDから生成されたクラスに基づいてXMLメッセージを構築し、それをWebサービスに感知する単純なJavaクライアントを作成しました。 それは私が私のワークステーションからそれをテストしたときに正常に動作しますが、私は、Oracleデータベースにクラスをロードするとき、私は次のエラーを取得:はクラスからスーパークラスにアクセスできない
Exception in thread "Root Thread" java.lang.IllegalAccessError: cannot access superclass from class
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java)
at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at java.lang.reflect.Proxy.newInstance(Proxy.java)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java)
at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java)
at java.lang.reflect.Field.declaredAnnotations(Field.java)
at java.lang.reflect.Field.getDeclaredAnnotations(Field.java)
at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java)
at com.sun.xml.internal.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllFieldAnnotations(RuntimeInlineAnnotationReader.java)
at com.sun.xml.internal.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getAllFieldAnnotations(RuntimeInlineAnnotationReader.java)
at com.sun.xml.internal.bind.v2.model.impl.ClassInfoImpl.findFieldProperties(ClassInfoImpl.java)
at com.sun.xml.internal.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java)
私はそれが別のパッケージにあるクラスによって引き起こされるかもしれないと思った
はそう、私は移動をすべてクラスを単一のデフォルトパッケージに変更しましたが、それは役に立ちませんでした。 また、保護された/プライベートなフィールド/クラスをすべてpublicに置き換えましたが、それと同じ問題です。
これは、私はそれが失敗したと思うラインです:
JAXBContext context = JAXBContext.newInstance(PurchaseOrder.class);
は、任意の助けに感謝します。ありがとう。
のPurchaseOrderクラス:
<code>
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PurchaseOrder", propOrder = {
"purchaseOptions"
})
@XmlRootElement(name = "PurchaseOrder")
public class PurchaseOrder {
@XmlElement(name = "PurchaseOptions")
public ArrayOfPurchaseOptionDescription purchaseOptions;
public ArrayOfPurchaseOptionDescription getPurchaseOptions() {
return purchaseOptions;
}
public void setPurchaseOptions(ArrayOfPurchaseOptionDescription value) {
this.purchaseOptions = value;
}
}
EDIT:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfPurchaseOptionDescription", propOrder = {
"purchaseOptionDescription"
})
public class ArrayOfPurchaseOptionDescription {
@XmlElement(name = "PurchaseOptionDescription", nillable = true)
public List<PurchaseOptionDescription> purchaseOptionDescription;
public List<PurchaseOptionDescription> getPurchaseOptionDescription() {
if (purchaseOptionDescription == null) {
purchaseOptionDescription = new ArrayList<PurchaseOptionDescription>();
}
return this.purchaseOptionDescription;
}
}
のコードを入力してくださいクラス 'PurchaseOrder.class'です。 –
私はPurchaseOrderクラス –