SSL context init failed: Invalid keystore format - ssl

I am trying to create stub for web services using ANT build.
Web Application is deployed on Websphere.
I am using default keystore and truststore files of the Websphere.
Following are the arguments I set as ANT_OPTS inside environment variable
-Djavax.net.ssl.trustStore=true -Djavax.net.ssl.keyStoreType=pkcs12 -Djavax.net.ssl.trustStore="D:\App Servers\Websphere 8.5\WAS server\profiles\AppSrv02\config\cells\SACHINANode02Cell\nodes\SACHINANode02\trust.p12" -Djavax.net.ssl.trustStorePassword="WebAS"
When I run the build using ANT command I am getting the error as follows
D:\Scrap\July 2013\classes for eqube610>ant generate-client
Buildfile: build.xml
setup:
generate-client:
[wsimport] Consider using / so that wsimport won't do unnecessary compilation
[wsimport] parsing WSDL...
[wsimport] [ERROR] Default SSL context init failed: Invalid keystore format
[wsimport] Failed to read the WSDL document: https://sachina.technologic.com:9444/eq610s/eQSOASingleton?wsdl,
because 1) could not find the document; /2) the document could not be read; 3) the root element of
the document is not .
[wsimport] [ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):
[wsimport] At least one WSDL with at least one service definition needs to be provided.
[wsimport] Failed to parse the WSDL.
[wsimport] Command invoked: wsimport "C:\Program Files (x86)\Java\jdk1.5.0_16\jre\bin\java.exe" -d
"D:\Scrap\July 2013\classes for eqube610\build" -g -keep https://sachina.technologic.com:9444/eq610s/eQSOASing
leton?wsdl -p com.eqtechnologic.eqube.webservice
BUILD FAILED
D:\Scrap\July 2013\classes for eqube610\build.xml:35: wsimport failed
Please let me know where I am going wrong.

Related

In STS, server up error : org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class

In STS after converting from Java 11 to Java 17. While making the server up, getting the following error.
{"#timestamp":"2022-12-21T11:09:36.129-08:00","#version":"1","message":"Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.package.name]","logger_name":"org.springframework.context.annotation.AnnotationConfigApplicationContext","thread_name":"main","level":"WARN"}
{"#timestamp":"2022-12-21T11:09:36.147-08:00","#version":"1","message":"\r\n\r\nError starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.","logger_name":"org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLogger","thread_name":"main","level":"INFO"}
{"#timestamp":"2022-12-21T11:09:36.193-08:00","#version":"1","message":"Application run failed","logger_name":"org.springframework.boot.SpringApplication","thread_name":"main","level":"ERROR","stack_trace":"org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class
Build is successfull. But unable to up the server. Is any config or dependency are missing ? Converting from java 11 to Java 17 in STS.

Error occurred during initialization of boot layer - javafx.controller in NetBeans

So, I'm attempting to build a simple JavaFX application in Apache Netbeans 11.1 using the non-modular from IDE instructions from this site:
https://openjfx.io/openjfx-docs/
I'm using JDK 13 and JavaFX 13.
The instructions work up until the point when they tell you to modify the VM options under Properties --> Run. I add the --module-path and --add-modules arguments as indicated, but still get an error:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 0 seconds)
Ant set to Verbose using Tools-->Options-->Java-->Ant, verbosity level set to verbose.
Output with verbose:
Detected Java version: 13 in: D:\Programs\JavaStuff\jdk-13
Detected OS: Windows 10
Trying to override old definition of task java
Trying to override old definition of task input
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/extide/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/extide/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml from a zip file
Trying to override old definition of task javac
Trying to override old definition of task delete
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml from a zip file
parsing buildfile C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml with URI = file:/C:/Users/BLAHBLAH/AppData/Local/NetBeans/Cache/11.1/executor-snippets/run.xml
Project base dir set to: C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets
Build sequence for target(s) `run' is [-init-paths, -init-macrodef-java-with-modules, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-modules, run]
Complete build sequence is [-init-paths, -init-macrodef-java-with-modules, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-modules, run, ]
-init-paths:
Override ignored for property "run.jvmargs"
Override ignored for property "work.dir"
Override ignored for property "application.args"
-init-macrodef-java-with-modules:
Skipped because property 'named.module.internal' not set.
-init-macrodef-java-with-unnamed-module:
creating macro call-java
-init-macrodef-java-without-modules:
Skipped because property 'modules.supported.internal' set.
run:
Executing 'D:\Programs\JavaStuff\jdk-13\bin\java.exe' with arguments:
'-Dfile.encoding=UTF-8'
'--module-path=D:\Programs\JavaStuff\javafx-sdk-13\lib\'
'--add-modules=javafx.controls,javafx.fxml'
'-classpath'
'D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx-swt.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.base.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.controls.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.fxml.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.graphics.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.media.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.swing.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.web.jar;C:\Users\BLAHBLAH\OneDrive\Documents\NetBeansProjects\HelloFX1\build\classes'
'--module-path'
'C:\Users\BLAHBLAH\OneDrive\Documents\NetBeansProjects\HelloFX1\build\classes'
'hellofx.HelloFX'
The ' characters around the executable and arguments are
not part of the command.
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:68: Java returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:566)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
BUILD FAILED (total time: 0 seconds)
Any ideas?
I appreciate the responses I received - they helped me to do more research and document a solution thoroughly for myself, my colleagues, and my students.
So, I hope that this will help others who are receiving similar errors and issues while trying to install OpenJDK, NetBeans 11.1, OpenJFX (Open JavaFX), and Scene Builder.
I uploaded a PDF and sample projects to which I refer in said PDF, to the following repository:
https://github.com/profjpbaugh/apache-netbeans-openjdk-openjfx
Thanks!

How can I effectively use a JKS file from IntelliJ's resources folder?

I am developing a Kotlin project in IntelliJ that needs to access an HTTPS-enabled website using Jsoup. Testing uncovered a javax.net.ssl.SSLHandshakeException, so I saved the security certificate for the site and made a JKS file. Since I can't make guarantees about the JVM that'll be running the eventual JAR file, I thought it'd be best to save the JKS file in the resources folder and load it in the program. Nevertheless, when I test this function:
fun getHomePage(): Connection.Response {
System.setProperty("javax.net.ssl.trustStore", "/resources/certificate.jks")
return Jsoup.connect("https://www.something.com/")
.method(Connection.Method.GET)
.execute()
}
...I still get the following error:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.ssl.Alerts.getSSLException(Alerts.java:198)
at java.base/sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1974)
at java.base/sun.security.ssl.Handshaker.fatalSE(Handshaker.java:345)
at java.base/sun.security.ssl.Handshaker.fatalSE(Handshaker.java:339)
at java.base/sun.security.ssl.ClientHandshaker.checkServerCerts(ClientHandshaker.java:1968)
at java.base/sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1777)
at java.base/sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:264)
at java.base/sun.security.ssl.Handshaker.processLoop(Handshaker.java:1098)
at java.base/sun.security.ssl.Handshaker.processRecord(Handshaker.java:1026)
at java.base/sun.security.ssl.SSLSocketImpl.processInputRecord(SSLSocketImpl.java:1137)
at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1074)
at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at java.base/sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1402)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1429)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:163)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:746)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:722)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:306)
[...]
I imagine I need something other than System.setProperty("javax.net.ssl.trustStore", "/resources/certificate.jks") (courtesy of https://stackoverflow.com/a/7745706/990549) here. I just don't know what.

Sonatype Nexus upload fails with Certificate for nexus.xyz.corp doesn't match common name of the certificate subject: wiki.xyz.corp

I get the following error when trying to upload files to Nexus using Gradle:
Certificate for doesn't match common name of the certificate subject: wiki.xyz.corp
Details:
C:\data\Workspaces\httpstest>gradlew uploadArchives
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar SKIPPED
:uploadArchives
Could not transfer artifact com.xyz:httpstest:jar:1.0.0 from/to remo
te (https://nexus.xyz.corp/nexus/content/repositories/1st-rel/): Cer
tificate for <nexus.xyz.corp> doesn't match common name of the certi
ficate subject: wiki.xyz.corp
Could not transfer artifact com.xyz:httpstest:pom:1.0.0 from/to remo
te (https://nexus.xyz.corp/nexus/content/repositories/1st-rel/): Cer
tificate for <nexus.xyz.corp> doesn't match common name of the certi
ficate subject: wiki.xyz.corp
:uploadArchives FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':uploadArchives'.
> Could not publish configuration 'archives'
> Failed to deploy artifacts: Could not transfer artifact com.xyz
:httpstest:jar:1.0.0 from/to remote (https://nexus.xyz.corp/nexus/co
ntent/repositories/1st-rel/): Certificate for <nexus.xyz.corp> doesn
't match common name of the certificate subject: wiki.xyz.corp
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 5.511 secs
Downloading via HTTPS works fine, but uploading does not.
The certificate for nexus.xyz.corp has the correct common name, and NOT wiki.xyz.corp as the error message implies.
However, wiki.xyz.corp is a different site running on the same server.
What's the problem here?
This occurs when the different domains (wiki.xyz.corp and nexus.xyz.corp) are shared using SNI.
It occurs at least in versions Gradle 2.5 - Gradle 2.13. The reason is that Gradle uses the Maven Wagon Library in a version that does not support SNI. In this case, the webserver returns a default certificate. It seems, that wiki.xyz.corp was defined as default certificate.
This is discussed in Gradle Discussion and Gradle Issues.
Possible workarounds:
Define nexus.xyz.corp as default certificate, but beware of problems on the other site
Replace Maven Wagon with Maven Publish, but this is currently in beta. See Maven Publish.
try to configure your system without SNI
start Gradle in a way that host checking is disabled (this is a security leak!):
gradlew -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true uploadArchives

Cargo start up error

I am running 'mvn clean install -Dmaven.test.skip=true' command for a web application. but it gives following error. I set the catalina home as an environment variable. i am using maven 3.1.1 version. Please help me
FATAL ERROR in native method: JDWP No transports i
nitialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
[WARNING] [talledLocalContainer] ERROR: transport error 202: bind failed: Addres
s already in use
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.4:star
t (start-container) on project RCMigrationWebApp: Execution start-container of g
oal org.codehaus.cargo:cargo-maven2-plugin:1.2.4:start failed: Failed to start t
he Tomcat 7.x container. Deployable [http://localhost:8080/cargocpc/index.html]
failed to finish deploying within the timeout period [120000]. The Deployable st
ate is thus unknown. -> [Help 1]
Probably you have to kill any process running at 8080, looks like the port is already in use..
ERROR: transport error 202: bind failed: Address already in use
Port in use. Run netstat -bv if you are using Windows. You will get to know which process is holding up the port. With your stackTrace, it looks very obvious.
Let me know if it helps.