Where do I put the keystore file on JBoss AS 7.1 - ssl

Where do I put the keystore file on JBoss AS 7.1 ?
If i put it into: %JBOSS_HOME%/standalone/configuration/ and reference it simply by:
<ssl key-alias="JBoss" password="JBo$$" certificate-key-file="/JBoss.keystore" cipher-suite="ALL" protocol="TLS"/>
I get an:
ERROR [org.apache.tomcat.util.net.jsse.JSSESocketFactory] (MSC service thread 1-1) Failed to load keystore type JKS with path JBoss.keystore due to JBoss.keystore (Das System kann die angegebene Datei nicht finden): java.io.FileNotFoundException: \JBoss.keystore (Das System kann die angegebene Datei nicht finden)
at java.io.FileInputStream.open(Native Method) [rt.jar:1.7.0_10]
If I use an absoulute path for as reference to the keystore file, everything works fine. Is there a workaround so that I an use a relative path?

Use one of the predefined folder variables: jboss.home.dir, jboss.server.base.dir, jboss.server.config.dir, etc. for standalone configuration or jboss.domain.base.dir, jboss.domain.config.dir for managed domain (see full list).
Usage example: certificate-key-file="${jboss.server.config.dir}/JBoss.keystore" for a file copied to JBoss config folder.

Related

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.

IBM MobileFirst Platform ClassPath error during installation

Running MFPF7.0.0.0-IF201506081356 on WebSphere Liberty 8.5.5.5 (that's 8.5.5 with fp 5 applied), IBM Java 7.0.8.10.
After deploying the first runtime to server the following error occurs:
6/10/15 15:25:05:600 CEST] 0000002c com.ibm.ws.webcontainer.webapp E SRVE0293E: [Servlet Error]-[Failed to load listener: com.worklight.server.bundle.project.JeeProjectActivator]: java.lang.NoClassDefFoundError: com.worklight.server.bundle.api.WorklightBundles
at com.ibm.ws.classloading.internal.AppClassLoader.definePackageAndClass(AppClassLoader.java:308)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:252)
at com.ibm.ws.classloading.internal.ParentLastClassLoader.findOrDelegateLoadClass(ParentLastClassLoader.java:81)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:373)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:764)
at java.lang.ClassLoader.loadClass(ClassLoader.java:749)
at com.ibm.ws.classloading.internal.UnifiedClassLoader.loadClass0(UnifiedClassLoader.java:106)
at com.ibm.ws.classloading.internal.UnifiedClassLoader$Delegation.loadClass(UnifiedClassLoader.java:77)
at com.ibm.ws.classloading.internal.UnifiedClassLoader.loadClass(UnifiedClassLoader.java:101)
at com.ibm.ws.classloading.internal.ThreadContextClassLoader.loadClass(ThreadContextClassLoader.java:108)
at java.lang.ClassLoader.loadClass(ClassLoader.java:726)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:283)
at com.sun.beans.finder.ClassFinder.findClass(ClassFinder.java:116)`enter code here`
Any suggestions?
Generally it means that the worklight-jee-library.jar shared library referenced in the server.xml (in each MFP runtime application) is not found. Check the path of this library in the server.xml and that the jar file is present in this path.

Worklight server - Error 500: Could not find required filter class - com.worklight.core.auth.impl.AuthenticationFilter.class

I'm using worklight 6.1 for my mobile app project. My problem is, I got this error message when I try to upload war file into worklight server. I already install worklight server into my websphere.
Error 500: javax.servlet.ServletException: Filter [authenticationFilter]: Could not find required filter class - com.worklight.core.auth.impl.AuthenticationFilter.class
These are steps for uploading war file into worklight server.
1.Build project_name.war file from IBM Worklight Studio v6.1.
2.Deploy the .war file to IBM Websphere Integrated Solutions Console v8.5.5.0.
3.Open the WebSphere enterprise application and click install.
4.Choose the project.war file from the worklight project directory.
5.Click on next button for fast path.
6.Click on next button.
7.Choose the server 1.
8.Choose on the target JNDI.
9.Set the Virtual Host to default_host.
10.Set the context root.
11.Click on finish button.
12.Save directly to master configuration.
13.Start the application.
14.Open the server URL to get into the wroklight server to deploy application, adapter and etc, but failed to open the server URL with this error and the error log as below.
[3/6/14 10:18:50:442 MYT] 0000009e webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor]: java.lang.ClassNotFoundException: class java.lang.ClassNotFoundException: com.worklight.core.auth.impl.AuthenticationFilter
at java.beans.Beans.instantiate(Beans.java:195)
at java.beans.Beans.instantiate(Beans.java:80)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:533)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:475)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:308)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:380)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:892)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3761)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:976)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:283)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
My latest error message on 10 March 2014
Error 500: javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception: java.lang.RuntimeException: FWLSE0206E: The project /rmbp failed to initialize, because the project database schema for data source jdbc:db2://192.168.1.80:50001/APPCNTR is from version N/A, which is not supported by the server from version 6.1.0.00.20131126-0630. Use the Worklight ant tasks to upgrade the project database schema.
You may want to look at this similar post for suggestions:
IBM Worklight 6.0 - Worklight Console does not show up after installing WL 6.0 server on Liberty profile - Error 500
Importantly "you need to make sure that your worklight-jee-library.jar is in the application classloader." Like Idan suggested above you can easily use the ant scripts we provide in order to accomplish this in a more automated fashion:
https://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.deploy.doc%2Fdevref%2Ft_transporting_apps_and_adapters.html

why i am getting these errors in cloud programming?

java.io.FileNotFoundException: simulation.properties (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.cloudbus.cloudsim.ex.mapreduce.Configuration.loadPropertiesFromFile(Configuration.java:35)
In Configuration.java file you must have a code to retrieve Properties From a File. There can be two problems
Either configuration file is missing
If you have configured a path any where in the project that path is invalid after you deploy from local host to cloud

SSL context init failed: Invalid keystore format

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.