I/O exception <java.net.SocketException> in Solr startup - java

When I start up Solr, I get the following error
I/O exception caught when connecting to https://localhost:;
java.security.NoSuchAlgorithmException:
Error construct:sun.security.ssl.SSLContextImpl$DefaultSSLContext
Did anyone ever come across the same issue before?
What is causing this error and how can I fix it?

Try to connect using http://localhost. You are using https and it requires proper certificates and extra configuration. For localhost http is ok but is high recommend that you use https on production.

Related

Handshake failed due to invalid Upgrade header: null with Springboot and Tomacat

The following is the error I'm getting in the server logs.
04:42:53.259 [41] [http-nio-8080-exec-8] ERROR org.springframework.web.socket.server.support.DefaultHandshakeHandler - Handshake failed due to invalid Upgrade header: null
I have gone through almost all questions out there regarding the similar issue but none seems to solve the issue. For me the issue is occurring intermittently, not every requests fails. There is also no proxy involved.
The application is deployed in kubernetes. Is there any other reason other that proxies that this issue can occur?

Problem writing SAAJ model to stream: Unable to create MessageFactory: Provider for javax.xml.soap.MessageFactory cannot be found

I need to communicate with webservice via SoapHttpPort.
Machine run Apache Tomcat 8.5.23 and Apache Karaf 4.
Webservice need settings of authorization in Soap "Authorization - Basic" and "Outgoing-wss".
When I call port, I receive WebServiceException:
javax.xml.ws.WebServiceException: org.apache.cxf.binding.soap.SoapFault: Error on verifying message against security policy Error code:1000
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:159)
First fix
I tried recommended fix (SecurityHandler class).
JAX-WS Password Type PasswordText
But this fix didn´t solve problem.
I receive another exception.
javax.xml.ws.WebServiceException: org.apache.cxf.binding.soap.SoapFault: Problem writing SAAJ model to stream:Unable to create MessageFactory: Provider for javax.xml.soap.MessageFactory cannot be found
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:159)
Second fix
I tried recommended fixes.
https://github.com/apache/camel/tree/master/examples/camel-example-reportincident-wssecurity
http://forum.spring.io/forum/spring-projects/web-services/38499-unable-to-create-message-factory-for-soap-provider-org-apache-axis-soap-messagefacto
But this fixes didn´t solve problem. WebServiceException is still the same.
Any help would be appreciated.
Thank you very much.

Capturing HTTP traffic using Fiddler from Java applicaiton

I'm having difficulty using Fiddler to diagnose a problem in a Java application to connect to Microsoft Graph's API. Here's my basic environment:
JDK: 1.8.0_131
Apache HttpClient: 4.4
Fiddler: 4.6
The endpoint I'm trying to reach is https://login.microsoftonline.com/common/oauth2/authorize The problem I have is that the traffic is not captured by Fiddler.
I've tried various things as suggested by Googling for this problem, but have not got it to work. In my application, I set the proxy settings as follows:
httpClientBuilder.setProxy(new HttpHost(proxyServer, proxyPort, proxyScheme));
httpClientBuilder.build();
If I use ("127.0.0.1", 8888, "https"): then the error that I see is:
Unrecognized SSL message, plaintext connection?
If I use
("127.0.0.1", 8888, "http"): then the error that I see is: I/O
exception (org.apache.http.conn.UnsupportedSchemeException) caught
when processing request to
{tls}->http://127.0.0.1:8888->https://login.microsoftonline.com:443:
http protocol is not supported
I've tried other things (for example "localhost", "localhost.", and so on as suggested, and setting: -Djsse.enableSNIExtension=false), but so far no luck. Hopefully I am missing something obvious! Thanks for any help.
It turns out that the second configuration for the proxy is the correct one to use (using "http"), but what I had forgotten was that I was setting a ConnectionSocketFactoryRegistry in my HttpClientBuilder. I had not registered a ConnectionSocketFactory for "http" and this caused the second configuration to fail. I added this to the HttpClientBuilder, and now I can see traffic being captured by Fiddler:
connectionSocketFactoryRegistryBuilder.register("http", new PlainConnectionSocketFactory());

wso2 emm 500: Something has gone wrong

After general server configuration i'm able to log in to carbon, store or publisher without any issue with default admin login.
Unfortunately when i sign in EMM: https://myserver:port/emm -> sso/login
i end up in /emm/acs - "500: Something has gone wrong" page.
Debug: 2 errors in live terminal:
*[2015-06-12 20:35:21,254] ERROR {org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject} - Connection refused java.net.ConnectException: Connection refused*
*[2015-06-12 20:35:21,261] ERROR {org.jaggeryjs.jaggery.core.manager.WebAppManager} - org.mozilla.javascript.WrappedException: Wrapped org.jaggeryjs.scriptengine.exceptions.ScriptException: java.net.ConnectException: Connection refused (http#220)
org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.WrappedException: Wrapped org.jaggeryjs.scriptengine.exceptions.ScriptException: java.net.ConnectException: Connection refused (http#220)*
And i got another 2 errors after wso2server startup:
*[2015-06-12 21:44:34,231] ERROR {org.wso2.carbon.apimgt.keymgt.internal.APIKeyMgtServiceComponent} - Error in initializing thrift transport
org.apache.thrift.transport.TTransportException: Could not bind to port 10397*
*[2015-06-12 21:44:34,247] ERROR {org.wso2.carbon.apimgt.keymgt.internal.APIKeyMgtServiceComponent} - Failed to initialize key management service.
java.lang.Exception: Error in initializing thrift transport*
Any hints?
Regards,
Lukas
I encountered with the /emm/acs redirection issue, actually I don't know why it has been happening, but when it happens, I do a refresh on the page, everything works fine.
The second issue you have mentioned, is nothing to do with the first one, it says that Apache Thrift Transport layer could not bind the port. Since EMM does not require Thrift, you can simply disable by editing the following XML configuration files.
Change true to false for the following config files, under the target folder.
./repository/conf/api-manager.xml:280: <EnableThriftServer>true</EnableThriftServer>
./repository/conf/identity.xml:218: <EnableThriftService>true</EnableThriftService>

How to solve sun.security.provider.certpath.SunCertPathBuilderException?

I have written some code to connect to my mail server and read emails. I am using POP3 using SSL connection. I have also added SSL certificate to the java keystore. But still i am getting the same exception. Please help. Thanks in advance.
Possible cause this exception would be the cert from the keystore does not match the cert from the server.
Checkout these link might be helpful to you:
Unable to Connect to SSL Services due to PKIX Path Building Failed sun.security.provider.certpath.SunCertPathBuilderException
How to handle invalid SSL certificates with Apache HttpClient?
I got the same error, I disabled always scan encrypted connections in the settings of my antivirus software, and it worked.
I have groovy script, and I was using #Grab(group='org.apache.commons', module='commons-collections4', version='4.2')
I could not runt it because of an error Error grabbing Grapes -- [unresolved dependency: org.apache.commons#commons-collections4;4.2: not found]
Using -Divy.message.logger.level=4 I saw I was having the following problem:
Server access error at url https://repo1.maven.org/maven2/org/apache/commons/commons-collections4/4.2/commons-collections4-4.2.pom (javax.net.ssl.SSLException: Received fatal alert: protocol_version)
My qick fix was to use JDK8 instead of JDK7 it seems that JDK8 has updated certificates and it worked

Categories