Wonder whether you are using the jaxws tools from Geronimo or from CXF ? From the stack, think that there is a jaxb 2.1 API is used, the required() method is only available in jaxb 2.2. IIRC, some old JDK 6 versions still shipped the 2.1 api. 

2012/1/19 Venkat <ven12344@yahoo.com>
Hi, thanks for your reply.

I have installed jdk 6 and it is working fine. But still I am not able to
create the stubs.

I am using CXF 2.5.1 to create the stubs in Eclipse 3.7, please see the
exceptions



Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -d
C:\Users\501971347\workspace\PANDeviceRegistrationWS\.cxftmp/src -classdir
C:\Users\501971347\workspace\PANDeviceRegistrationWS\build\classes -p
http://drms.energy.ge.com/smartgrid/datamodel/services/enddevicemanagement/pandeviceregistrationservice=com.ge.energy.drms.smartgrid.datamodel.services.enddevicemanagement.pandeviceregistrationservice
-impl
-validate -exsh false -dns true -dex true -wsdlLocation
http://localhost:20510/PANDeviceRegistrationService/SoapPort?wsdl -verbose
-defaultValues -fe jaxws -db jaxb -wv 1.1
file:/C:/Users/501971347/workspace/PANDeviceRegistrationWS/WebContent/wsdl/PANDeviceRegistrationService.wsdl
wsdl2java - Apache CXF 2.5.1


WSDLToJava Error: java.lang.reflect.UndeclaredThrowableException

org.apache.cxf.tools.common.ToolException:
java.lang.reflect.UndeclaredThrowableException
       at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:294)
       at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
       at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
       at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
       at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
Caused by: java.lang.reflect.UndeclaredThrowableException
       at $Proxy43.required(Unknown Source)
       at
com.sun.tools.xjc.generator.bean.field.AbstractField.annotateReference(AbstractField.java:192)
       at
com.sun.tools.xjc.generator.bean.field.AbstractField.annotate(AbstractField.java:161)
       at
com.sun.tools.xjc.generator.bean.field.AbstractFieldWithVar.createField(AbstractFieldWithVar.java:80)
       at
com.sun.tools.xjc.generator.bean.field.SingleField.<init>(SingleField.java:94)
       at
com.sun.tools.xjc.generator.bean.field.SingleField.<init>(SingleField.java:81)
       at sun.reflect.GeneratedConstructorAccessor17.newInstance(Unknown Source)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at
com.sun.tools.xjc.generator.bean.field.GenericFieldRenderer.generate(GenericFieldRenderer.java:69)
       at
com.sun.tools.xjc.generator.bean.field.DefaultFieldRenderer.generate(DefaultFieldRenderer.java:82)
       at
com.sun.tools.xjc.generator.bean.BeanGenerator.generateFieldDecl(BeanGenerator.java:774)
       at
com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassBody(BeanGenerator.java:555)
       at
com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:258)
       at
com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:166)
       at com.sun.tools.xjc.model.Model.generateCode(Model.java:290)
       at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:283)
       at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:94)
       at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:391)
       at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:591)
       at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:243)
       at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138)
       at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
       ... 4 more
Caused by: java.lang.NoSuchMethodException:
javax.xml.bind.annotation.XmlElementRef.required()
       at java.lang.Class.getDeclaredMethod(Class.java:1937)
       at
com.sun.codemodel.TypedAnnotationWriter.invoke(TypedAnnotationWriter.java:112)
       ... 27 more


--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Problem-in-creating-Web-Service-in-Eclipse-using-2-1-8-Geronimo-tp3672504p3672687.html
Sent from the Users mailing list archive at Nabble.com.



--
Ivan