Access solr api using java class - https

Can any on tell me how to access solr api using java class.
i want to access https://localhost:8443/solr4/alfresco/afts?q=DOC_TYPE:UnindexedNode api using java class.but the problem is that when i am calling with java class its giving "javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching localhost found".I tried all possible to resolve that. i added certificate in keystore that present in jdk and jre and when i just use a validator to validate then its giving "pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable to find valid certification path to requested target" .i am using alfresco 5.0.

You can turn it off, go around it.
http://docs.alfresco.com/4.2/tasks/running-without-ssl.html

Check out how we connect to Solr in our Trackers. See the solr4-ssl profile in the solr4 pom. This also may help you: Alfresco Solr Trackers Showcase

Related

SunCertPathBuilderException : unable to find valid certification path to requested target but different issue

I am trying to import a gradle project and when I try to create a Spring starter project in Spring tool suite (STS 4), I see this error.
I looked online and have added the certs for both start.spring.io and services.gradle.org but I still see the error. Could anyone help me figure this out as to what else am I missing?

NoSuchAlgorithmException: DH KeyPairGenerator not available on camel-ftp

I'm using Apache Camel in a project and when I needed to use the camel-ftp component to send some files to an remote server, I've got this exception:
com.jcraft.jsch.JSchException: Session.connect: java.security.NoSuchAlgorithmException: DH KeyPairGenerator not available
I was wondering why it could be happening in my project. So, I've started a quick small project with camel-core and camel-ftp components only and I pasted the route there and it worked fine.
from("file:data/input?noop=true")
.log("Uploading file ${file:name}")
.to("sftp://www.mydestination.com:22/../opt/tmp?autoCreate=false&username=MyUser&password=MyPassword&passiveMode=true")
.log("Uploaded file ${file:name} complete.");
I'm using Apache Karaf to run OSGI Bundles (my application is one of them). I've checked in different environments but the result still beeing the exception.
I really don't know what it could be. Anyone has some ideas about what can be the possible cause of it?
DH KeyPair Generator is normally part of the JRE/JSE and should be included if your JDK (>BTW which exact JDK version are you using ?).
Given that, your error is probably due to a wrong classpath.
I suggest you to check the value of "-Djava.ext.dirs" property (and the contents of the corresponding folders), for instance:
Windows:
java -Djava.ext.dirs="C:\Program Files\Java\jdk1.6.0_07\jre\lib\ext;C:\dir2"
Unix:
java -Djava.ext.dirs=$JAVA_HOME/jre/lib/ext:/dir2
You also need to specify/modify the Karaf security provider, take a look at:
https://karaf.apache.org/manual/latest/security

Spring RestTemplate GET: reading directories from Apache

apache server is used for static contents. We are able to GET required resource having fully qualified path:(e.g. http://cmsTest.com/content/otp.txt). However, now we need to scan all folder available under
http://cmsTest.com/content
I need to access directories available at particular location via Spring REST GET api. When I am trying to access(http://cmsTest.com/content) it, getting 404 error.
Could you please provide suggestion for the same?

Migrated my Spring application to another server and receive "Signature trust establishment failed for metadata entry" upon Tomcat startup

I have recently migrated my application from one server to another, and upon startup of Tomcat, I'm receiving an exception when Spring SAML is trying to verify the trust of the signature held in my metadata file.
ERROR 2016-10-24 18:34:56,728 AbstractReloadingMetadataProvider:398 processNonExpiredMetadata-> Error filtering metadata from /sites/thisapplication/webapps/rts/WEB-INF/classes/blablabla.xml org.opensaml.saml2.metadata.provider.FilterException: Signature trust establishment failed for metadata entry
Does anyone have any idea why this might be failing? The configured Java keystore hasn't changed, and I can still see the correct certificate when I view all certificates within the keystore.
I know I can set the argument metadataTrustCheck to false in my ExtendedMetadataDelegate bean, but I'd rather ensure the issue is addressed than ignored.
Just in case this is useful, the old server uses Sun/Oracle's version of Java 6, but the new one uses OpenJDK Java 6.
Thanks in advance!
P.S. I'm using the latest Spring SAML release (1.0.2.RELEASE) alongside Spring 3.1.1.
Make sure that the new JDK has the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for JDK/JRE 8 installed. It's the most likely cause of this regression.

Configuration issue with Mule ftpExt transport

I am using mule esb to transfer file from ftp to local directory. I am not using the standard FTP connector but the extended one.
I am getting an error:
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://localhost/schemaftpext/mule-ftpext.xsd'.
Actually I am new to Mule ESB, so i do not what is the url "http://localhost/schemaftpext/mule-ftpext.xsd" says that. I need to put anything in localhost?
FYI: I am using the example "http://code.google.com/p/mule-ftpext/source/browse/trunk/Test/mule-config.xml?spec=svn23&r=23". What should i do for that localhost URL?
http://localhost/schemaftpext/mule-ftpext.xsd is just a schema URI location: there is no need to have anything available there, it is just used as an identifier. Mule's configuration loader will resolve this URI to an actual location at load-up time. The actual location is within ftpExt-1.0-SNAPSHOT.jar.
Now this implies that you need to have is the ftpExt-1.0-SNAPSHOT.jar available in Mule's classpath. Is that the case?

Resources