javac cannot find symbol constructor Service

后端 未结 3 505
深忆病人
深忆病人 2021-01-02 12:53

I am in the process of learning CXF with the help of this Apache CXF Web Service Development book but, alas, one of the book\'s sample projects won\'t even compile!

相关标签:
3条回答
  • 2021-01-02 13:26

    Endorsing the 2.2 version of the jaxws-api jar should work. You could also pass the "-fe jaxws21" flag to the CXF wsdl2java command to make it generate 2.1 compatible code instead.

    0 讨论(0)
  • 2021-01-02 13:29

    From your description this sounds similar to the problem described in this post.

    To get around this issue, You can simply copy jaxb-api.jar, jaxws-api.jar to JDK's JRE's /lib/endorsed

    Note that "endorsing" means placing the relevant JAR files (jaxb-api.jar, jaxws-api.jar in this case) in %JAVA_HOME%\jre\lib\endorsed (note the jre in the path). Do not create the endorsed directory directly under the JDK's lib directory.

    or... if you prefer not to touch your JDK install, use these env vars is using wsimport and wsgen (where JAXWS_HOME points to JAX-WS 2.1 installation):

    WSIMPORT_OPTS=-Djava.endorsed.dirs=%JAXWS_HOME%/lib
    WSGEN_OPTS=-Djava.endorsed.dirs=%JAXWS_HOME%/lib
    

    or... If you use ant tasks, you can pass -Djava.endorsed.dirs=%JAXWS_HOME%/lib as jvmarg while calling wsimport and wsgen ant tasks (for this to work, you need to set fork="true" attribute of wsimport and wsgen ant tasks).

    Credit goes to Rama Pulavarthi.

    0 讨论(0)
  • 2021-01-02 13:31

    Adding webservices-api-2.2.jar alone in %JAVA_HOME%\jre\lib\endorsed has resolved issue for me.

    0 讨论(0)
提交回复
热议问题