Building SOAP Wer Service Client using Spring Boot - web-services

I am new to Spring Boot and not familiar with how SOAP web service work.
I am trying to consume a SOAP web service using Spring Boot. I am following the reference given at the official website : https://spring.io/guides/gs/consuming-web-service/
My code is exactly the same as given in the reference. When I try to run the code using mvn clean install, it throws following compilation error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project springboot-demo: Compilation fail
ure: Compilation failure:
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\QuoteClient.java:[9,17] error: package hello.wsdl does not exist
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\QuoteClient.java:[10,17] error: package hello.wsdl does not exist
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\QuoteClient.java:[16,11] error: cannot find symbol
[ERROR] symbol: class GetQuoteResponse
[ERROR] location: class QuoteClient
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\Application.java:[3,17] error: package hello.wsdl does not exist
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\QuoteClient.java:[18,8] error: cannot find symbol
[ERROR] symbol: class GetQuote
[ERROR] location: class QuoteClient
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\QuoteClient.java:[18,31] error: cannot find symbol
[ERROR] symbol: class GetQuote
[ERROR] location: class QuoteClient
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\QuoteClient.java:[23,8] error: cannot find symbol
[ERROR] symbol: class GetQuoteResponse
[ERROR] location: class QuoteClient
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\QuoteClient.java:[23,37] error: cannot find symbol
[ERROR] symbol: class GetQuoteResponse
[ERROR] location: class QuoteClient
[ERROR] C:\Users\Archit\IdeaProjects\springboot-demo\src\main\java\hello\Application.java:[25,12] error: cannot find symbol
[ERROR] -> [Help 1]
The code which I am running is at: https://github.com/spring-guides/gs-consuming-web-service/tree/master/complete.

The contract driven SOAP web-service development is you need to get the WSDL file and generate the Java domain classes and stub (via jaxb utilities), and you can then develop client to talk to the server.
And the error message you pasted means your client stub classes did not get generated successfully. I could not find any WSDL file copy locally in that github repo, and the access to the WSDL file seems go 404 error as well .
So you probably need to try some other tutorials like CXF ones. It is very straightforward as well.

Related

WSO2 and VSCODE build .car file fail

I want to switch from Integration stuido to VSCode, I followed the tutorial, installed java 11 and maeven 3.8, created a simple Proxy then run the command "wso2ei:Build integration project" here is the problem I get :
Can you tell me the procedure?
1000 thanks in advance
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.wso2.maven:vscode-car-plugin:5.2.29 or one of its dependencies could not be resolved: Failed to collect dependencies at org.wso2.maven:vscode-car-plugin:jar:5.2.29 -> org.wso2.maven:org.wso2.maven.core:jar:5.2.29 -> org.apache.ws.commons.axiom.wso2:axiom:jar:1.2.11.wso2v4 #
[ERROR] Unknown packaging: car # line 24, column 16
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.test.esb:com.test.esb.project:1.0-SNAPSHOT (c:\Users\Shadow\Documents\2023-VS-WSO2\TestEsbProjectV0.75\com.test.esb.project\pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin org.wso2.maven:vscode-car-plugin:5.2.29 or one of its dependencies could not be resolved: Failed to collect dependencies at org.wso2.maven:vscode-car-plugin:jar:5.2.29 -> org.wso2.maven:org.wso2.maven.core:jar:5.2.29 -> org.apache.ws.commons.axiom.wso2:axiom:jar:1.2.11.wso2v4: Failed to read artifact descriptor for org.apache.ws.commons.axiom.wso2:axiom:jar:1.2.11.wso2v4: Could not transfer artifact org.apache.ws.commons.axiom.wso2:axiom:pom:1.2.11.wso2v4 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [wso2.releases (http://maven.wso2.org/nexus/content/repositories/releases/, default, releases+snapshots), wso2.snapshots (http://maven.wso2.org/nexus/content/repositories/snapshots/, default, snapshots), wso2-nexus (http://maven.wso2.org/nexus/content/groups/wso2-public/, default, releases+snapshots)] -> [Help 2]
[ERROR] Unknown packaging: car # line 24, column 16
[ERROR]
[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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
I tried to modify the pom.xml file
find the vscode.car.plugin
try with the last version 5.2.39
Change in your pom.xml files, addresses of repositories and pluginRepositories url from http://... to https://...
From version 3.8.1 maven blocks external HTTP repositories by default. What is showing like that:
maven-default-http-blocker (http://0.0.0.0/) ...
And some other workaround:
https://stackoverflow.com/a/67002852/2760506

Vaadin with using Jetty Server -> ERROR: Jetty server existing

I recently started studying Vaadin. At the beginning I am using Vaadin 8 and have started a small Vaadin project in eclipse for practice purposes. I always started and opened this project via Jetty on my localhost:8080. That worked great for the first few days, but since yesterday
my localhost:8080 wants username and password at once and the application is no longer opening there.
The only difference is that the day before yesterday I installed an Oracle database (OracleXE 11 g) - could that have something to do with it?
Here is a snipppet if the error-message that I am getting:
Sep. 12, 2021 10:51:20 VORM. org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFORMATION: Installed AtmosphereInterceptor Track Message Size Interceptor using | with priority BEFORE_DEFAULT
[INFO] Started o.e.j.m.p.JettyWebAppContext#60b616c8{/,file:///C:/Repositories/ProgrammingCourses/Vaadin-and-Maven_Crash-Course/VaadinFirstSteps/src/main/webapp/,AVAILABLE}{file:///C:/Repositories/ProgrammingCourses/Vaadin-and-Maven_Crash-Course/VaadinFirstSteps/src/main/webapp/}
[INFO] Jetty server exiting.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.520 s
[INFO] Finished at: 2021-09-12T10:51:20+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run (default-cli) on project VaadinFirstSteps: Failure: Address already in use: bind -> [Help 1]
[ERROR]
[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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Anyone know how to get Vaadin up and running again? I am grateful fur any help,
Zrebna :)
"Failure: Address already in use: bind" means that you are trying to start web application server on localhost port 8080 while there is already web application server running and owning that port. Hence new one cannot be started.
You need to check you processes already running and kill the old one.

Testlink: Getting 500 internal server error on importing test cases

I am trying to import test cases from XML file, but getting below error in the browser console.
"Failed to load resource: the server responded with a status of 500
(Internal Server Error)" in file "/lib/testcases/tcImport.php"
In testlink server, administrator need to install php-xml module for import xml files.
Check for Error logs in testlink server, following error is displayed when user try to import xml without php-xml module.
[php7:error] [pid 12367] [client XXX.XXX.XXX.XXX:40469] PHP Fatal error: Uncaught Error: Call to undefined function simplexml_load_string() in /var/www/html/lib/functions/xml.inc.php:35\nStack trace:\n#0 /var/www/html/lib/testcases/tcImport.php(553): simplexml_load_file_wrapper('/var/www/html/g...')\n#1 /var/www/html/lib/testcases/tcImport.php(56): check_xml_tc_tsuite('/var/www/html/g...', '0')\n#2 {main}\n thrown in /var/www/html/lib/functions/xml.inc.php on line 35, referer: https://testlink.xxxxx.com/lib/testcases/tcImport.php?containerID=535

hue installation error on AWS EC2

Hello I am trying to install Hue on AWS EC2 instance.
Following below link.
https://github.com/cloudera/hue
While doing step make apps I am getting below error.
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 1.6.0-30 is not in the allowed range [1.7.0,1.7.1000].
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.717s
[INFO] Finished at: Sun Mar 09 13:18:59 EDT 2014
[INFO] Final Memory: 5M/25M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce (default) on project hue-parent: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I have java version
java -version
java version "1.7.0_25"
OpenJDK Runtime Environment (rhel-2.3.10.4.el6_4-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
Additional information can be provided. Thanks for your help.
You can also remove the JDK 7 check by editing:
vim maven/pom.xml
And replacing the '7' by '6':
<javaVersion>1.7</javaVersion>
<sourceJavaVersion>1.7</sourceJavaVersion>
<targetJavaVersion>1.7</targetJavaVersion>
(obviously you should it might be better to make sure Java 7 is the default if you plan to use 7)
It looks like you have another Java version in your system too. Based on what your installation says:
Detected JDK Version: 1.6.0-30
Make sure your JAVA_HOME variable points to the home of your Java 1.7 installation.

Gradle - Execution failed for task 'sonarAnalyze' - java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String

I have this error when running sonar with my gradle build script.
gradle sonarAnalyze
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter]
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarAnalyze'.
15:41:02.934 [ERROR] [org.gradle.BuildExceptionReporter] > java.util.ArrayList cannot be cast to java.lang.String
My sonar
sonar {
server {
url = "http://server.com:9000"
}
database {
url="jdbc:mysql://server:3306/sonar?useUnicode=true&characterEncoding=utf8"
driverClassName="com.mysql.jdbc.Driver"
username="sonar"
password="sonar"
}
project {
coberturaReportPath=file("$buildDir/reports/cobertura/coverage.xml")
language = "java"
}
}
What could be the problem?
What version of Sonar are you running? I was having this problem when running Sonar 4.1.1 because I was using the same Gradle Sonar plugin that you are. I switched to the Gradle Sonar Runner plugin, and the problem was resolved.