我有以下类结构:
@XmlRootElement
public class A{
private String s;
private B b;
//getter and setter
}
@XmlRootElement
public class B{
private String ss;
//getter and setter
}
如何使用 schemagen 为 A 类生成模式?
我能够为 B 类生成模式:
schemagen B.java
在 cmd ,但是当我对 A 类使用相同时,即:
schemagen A.java
我收到以下错误:
Problem encountered during annotation processing;
see stacktrace below for more information.
java.lang.NullPointerException
.
.
.
A.java:14: cannot find symbol
symbol : class B
location: class beans.A
public B getB() {
^
A.java:18: cannot find symbol
symbol : class B
location: class beans.A
public void setB(B b) {
^
A.java:22: cannot find symbol
symbol : class B
location: class beans.A
private B b;
^
3 errors