无法为具有循环引用的类创建j2me webservice客户端

时间:2011-06-19 05:46:36

标签: java web-services java-me

服务器

import javax.jws.WebService;
@WebService(endpointInterface = "SomeService")
public class SomeServiceImpl implements SomeService{
        @Override
        public Parent getParent() {
            return new Parent();
        }
}

public class Parent {   
     private Child child;
        //Getter,Setter
}

public class Child {    
    private Parent parent;
        //Getter,Setter
}

J2ME客户端

C:\WTK2.5.2_01\bin>wscompile.exe -gen -cldc1.1 -verbose config.xml
[RemoteInterfaceGenerator: Generating Java class for: SomeService.java]
[CustomClassGenerator: generating JavaClass for: getParent]
[CutomClassGenerator: generating JavaClass for: getParentResponse]
[CustomClassGenerator: generating JavaClass for: parent]
[CustomClassGenerator: generating JavaClass for: child]
Exception in thread "main" java.lang.StackOverflowError
    at com.sun.j2mews.sg.StubGenerator.isValid(Unknown Source)
    at com.sun.j2mews.sg.StubGenerator.isValid(Unknown Source)
    at com.sun.j2mews.sg.StubGenerator.isValid(Unknown Source)
    at com.sun.j2mews.sg.StubGenerator.isValid(Unknown Source)
    at com.sun.j2mews.sg.StubGenerator.isValid(Unknown Source)
    at com.sun.j2mews.sg.StubGenerator.isValid(Unknown Source)

0 个答案:

没有答案