Apache CXF Plugin 3.3.12 & 3.4.5 not working under Java 11? - cxf

I am trying to update my tool chain from Java 8 to 11.
Doing so I run into issues compiling WSDLs to java using the Apache CXF maven plugin.
I tried with the latest two available versions:
org.apache.cxf:cxf-codegen-plugin:3.3.12 and
org.apache.cxf:cxf-codegen-plugin:3.4.5
When I run the wsdl2java goal (phase generate-sources) it first seems to read all the WSDLs and XSDs ok but at the end it invariably ends in compile errors (see below). So it seems as if it generates code that can't be compiled under Java 11!?!
What dependencies do I need to add? Or what other steps are necessary to get this working again?
Error:
...
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Projects/KStA_ZH_ZHQuest/code/application/zhquest-sam-web-service/target/generated-sources/cxf/ch/adnovum/nevisidm/ws/services/v1_37/AdminServicePortImpl.java:[10,17] package javax.jws does not exist
...
[ERROR] /D:/Projects/KStA_ZH_ZHQuest/code/application/zhquest-sam-web-service/target/generated-sources/cxf/ch/adnovum/nevisidm/ws/services/v1_37/AdminServicePortImpl.java:[14,22] package javax.jws.soap does not exist
[ERROR] /D:/Projects/KStA_ZH_ZHQuest/code/application/zhquest-sam-web-service/target/generated-sources/cxf/ch/adnovum/nevisidm/ws/services/v1_37/AdminServicePortImpl.java:[15,33] package javax.xml.bind.annotation does not exist
Note: I am aware of these threads: CXF codegen maven plugin doesn't work OpenJDK 11 and What dependencies do I need to run Apache CXF with Spring Boot on Java 11? but the dependencies suggested in either did not fix my issue.

Related

Building flink from source---error of resolving dependencies

I am trying to build Apache Flink from the source. I am strictly following
the instructions given #github flink page. https://github.com/apache/flink
I am facing the error for resolving the dependencies for project
flink-mapr-fs.
Firstly, I tried using latest maven, and afterward, as per instruction at
the flink github page https://github.com/apache/flink
https://github.com/apache/flink , I also tried via maven 3.1.1, but the
same error.
In addition, I tried for flink 1.8.0 and 1.7.2 as well but the same problem exist. The detail of error is as below:
[ERROR] Failed to execute goal on project flink-mapr-fs: Could not resolve dependencies for project org.apache.flink:flink-mapr-fs:jar:1.7.2: Could not transfer artifact com.mapr.hadoop:maprfs:jar:5.2.1-mapr from/to mapr-releases (http://repository.mapr.com/maven/): GET request of: com/mapr/hadoop/maprfs/5.2.1-mapr/maprfs-5.2.1-mapr.jar from mapr-releases failed: Premature end of Content-Length delimited message body (expected: 49411916; received: 39845888 -> [Help 1]

A Maven plugin 1.8.3 to support App Engine requires Maven version 3.1.0

Could someone compile this pom.xml from this tutorial:
https://code.google.com/p/appengine-maven-plugin/
I tried as well this one, but I'm not familiar wtih 'maven invoker plugin configuration' and settings.xml
https://code.google.com/p/appengine-maven-plugin/source/browse/pom.xml
The error I'm getting is the following:
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.8.3:devserver (default-cli) on project nerinorestaurante: The p
lugin com.google.appengine:appengine-maven-plugin:1.8.3 requires Maven version 3.1.0 -> [Help 1]
I think your intention is to use the appengine-maven-plugin?
If so, you need to use version 3.1 of maven. Download it, install it.
It is all clearly explained here : http://maven.apache.org/
Appengine requires JDK 7 (not 8 or 9, for example).
Set JAVA_HOME, JDK_HOME environment variables. E.g.:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home

apache-cxf client works with exec-maven-plugin, but not from outside

I am having problems triying to create a WS client in java.
The libraries I'm using is apache-cxf 2.12. This is an old version but I want the web service to be added to a JBoss application that is already running and uses Spring 2.5.6, so this org.apache.cxf version uses same spring version.
But the question is (I know is quite generic, is related to maven, netbeans and apache-cxf)
When I execute my client project (maven proyect) from netbeans, it works sort of Ok.
When I try to run this class with a script (bot windows an linux) it gives me this error:
"Invocation failed with the following: org.apache.cxf.ws.policy.PolicyException: None of the policy alternatives can be satisfied."
Java versions are the same, I've copied all the dependency jar into lib dir and added then to %classpath%
So, what can be different that when I execute my sample program with maven org.codehaus.mojo:exec-maven-plugin:1.2.1:exec it works and it doesn't when I run it with a srcipt? (I have checked all dependencies, java version, ... )
I guess it has to be related to JAX-WS o JCE (Java Cryptography Architecture) initialization.
¿Is there a way to see what %classpath maven is creating when in runs java.exe?
Maven script that works:
JAVA_HOME=D:\\LOCAL\\Java\\jdk1.5.0_15
D:\\LOCAL\\apache-maven-2.0.9\\bin\\mvn.bat
-Dexec.classpathScope=runtime
-DskipTests=true
"-Dexec.args=-Djavax.net.debug=all -classpath %classpath es.webservice.aaTest TESTFILE"
-Dexec.executable=D:\\LOCAL\\Java\\jdk1.5.0_15\\bin\\java.exe
-Dmaven.repo.local=D:\\bsrepo\\.m2 process-classes
org.codehaus.mojo:exec-maven-plugin:1.2:exec
Thanks

m2eclipse - Mystery Build Failure on Package

I am using Eclipse 3.6 (Helios64) and m2eclipse 0.12.1.20110112-1712. I have a new project that only contains two classes that builds a jar. When I right click the project and select "Run As -> Maven package", I get the following error:
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # switch-provisioning-rest-client --- [INFO] Compiling 2 source files to C:\Devel\EclipseProjects\MyProject\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
javac: invalid flag: -s
...
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
When I set up a run configuration with the Goals "package -X", the project builds without error. If I run a configuration with the goal set to compile, it builds without error and I can then run "Maven package" successfully.
This is the only project I'm having issues with. All my other projects build sucessfully when doing a "Maven package".
There's nothing exceptional about the project pom.xml. It refers to the same parent pom as the other projects and contains its project specific dependencies.
Has anybody got any ideas what could be different about this project?
TIA!
This issue was answered on the m2eclipse mailing list:
http://dev.eclipse.org/mhonarc/lists/m2e-users/msg01818.html
Although my pom had 1.6 as the version, the project configuration hadn't been updated.
From: Benjamin Bentmann
This issue is not really specific to m2e but applies to mvn in general, as such the Maven user list might provide a better audience for help.
IIRC, the specific error means you trying to use a JDK 1.5 while you need JDK 1.6+ where the javac option in question was added. Assuming your project should actually compile against JDK 1.5, downgrading the maven-compiler-plugin version might also do, I would expect it started to use the -s option when the annotation processing support was added.

WSDL2Java tool error Apache CXF

We get the following error when we use WSDL2Java tool to generate stubs. The webservice is up and running.
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsd
l definition from : http://scheduler.heartbeatsoftware.com/scheduler/WebServices
/SampleSNMWebService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.IllegalArgumentExce
ption: InputSource must have a ByteStream or CharacterStream
If we donwload the wsdl and generate stubs from that wsdl, they are generated. But the java client using those stubs throws the same exception as above
Strangely when we deploy the same webservice on our LAN such a problem is not encountered stubs are generated sucessfully and the subsequent java client works well.
The webservice is created using apache cxf version 2.2.5 and hosted on tomcat 6
Any pointers would be appreciated
regards
Sameer
Found solution. Just need to modify the wsdl.java.bat to include proxy settings
-Dhttp.proxyHost= -Dhttp.proxyPort=8080

Resources