JDK-8029815 : Constants in seis not allowed, contrary to the jax-ws specification
  • Type: Bug
  • Component: xml
  • Sub-Component: jax-ws
  • Affected Version: 7u45
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-12-09
  • Updated: 2016-09-23
  • Resolved: 2014-04-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Description
SHORT SUMMARY:


Constants in SEIs not allowed, contrary to the JAX-WS specification


DESCRIPTION:


The reference implementation of JAX-WS does not allow constants in SEIs, but
no such limitation exists in the specification. Appendix B.7 on page 161 of
the JAX-WS 2.2 specification (entitled "Changes Since Early Draft 2")
indicates that constants were disallowed in an early draft of the
specification, but the restriction was subsequently removed:

        ? Removed requirement that SEIs MUST NOT have constants, see section
3.4.

        
http://download.oracle.com/otn-pub/jcp/jaxws-2_2a-mrel4-eval-spec/jaxws-2_2a-m
rel4-eval-spec.pdf

The same note can be seen in the JAX-WS 2.1 specification in section B.5 on
page 1.4.8:

        
http://download.oracle.com/otn-pub/jcp/jaxws-2.1-mrel2-eval-oth-JSpec/jaxws-2_
1-mrel2-spec.pdf

It appears that the implementation was never updated to reflect this change
in the specification.

The check for validity of the SEI is in this method:

        
com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.isLeg

alSEI()

TESTCASE
--------
Attached.

REPRODUCTION INSTRUCTIONS
-------------------------
1. Extract testcase package
2. Run:  javac sampleTestCase\*.java
3. Run:  wsgen -cp . sampleTestCase.HelloServiceImpl

Wsgen will fail with the following output:

warning: The apt tool and its associated API are planned to be
removed in the next major JDK release.  These features have been
superseded by javac and the standardized annotation processing API,
javax.annotation.processing and javax.lang.model.  Users are
recommended to migrate to the annotation processing features of
javac; see the javac man page for more information.
Problem encountered during annotation processing;
see stacktrace below for more information.
com.sun.tools.internal.ws.processor.modeler.ModelerException: [failed to
localize] An service endpoint interface cannot contain constant declaration:
Interface: sampleTestCase.HelloService field: defaultGreeting.()
        at
com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.onError(We

bServiceAP.java:219)
        at
com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.isLeg

alSEI(WebServiceVisitor.java:583)
        at
com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.shoul

dProcessWebService(WebServiceVisitor.java:308)
        at
com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.visit

InterfaceDeclaration(WebServiceVisitor.java:95)
        at
com.sun.tools.apt.mirror.declaration.InterfaceDeclarationImpl.accept(Interface

DeclarationImpl.java:50)
        at
com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.inspe

ctEndpointInterface(WebServiceVisitor.java:408)
        at
com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.visit

ClassDeclaration(WebServiceVisitor.java:129)
        at
com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarat

ionImpl.java:113)
        at
com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.buildModel

(WebServiceAP.java:319)
        at
com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.process(We

bServiceAP.java:260)
        at
com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(A

nnotationProcessors.java:84)
        at com.sun.tools.apt.comp.Apt.main(Apt.java:480)
        at
com.sun.tools.apt.main.AptJavaCompiler.compile(AptJavaCompiler.java:270)
        at com.sun.tools.apt.main.Main.compile(Main.java:1127)
        at com.sun.tools.apt.main.Main.compile(Main.java:989)
        at com.sun.tools.apt.Main.processing(Main.java:113)
        at com.sun.tools.apt.Main.process(Main.java:103)
        at com.sun.tools.apt.Main.process(Main.java:85)
        at
com.sun.tools.internal.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:207)
        at
com.sun.tools.internal.ws.wscompile.WsgenTool.run(WsgenTool.java:111)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j

ava:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:120)
        at com.sun.tools.internal.ws.WsGen.main(WsGen.java:42)
error: compilation failed, errors should have been reported 


Comments
New JAXWS integrated.
01-04-2014

Fix: https://github.com/gf-metro/jaxws/commit/f1e530a55b722d8b6e3ef904966a9e3a7b5974ae
16-12-2013