Official spring-boot SSL examples failing - spring-boot

I'm finding that the SSL examples provided in the spring-boot project are not working for me.
For this example:
https://github.com/spring-projects/spring-boot/tree/1.5.x/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/main/java/sample/tomcat/ssl
And this example:
https://github.com/spring-projects/spring-boot/tree/1.5.x/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors
Instead of getting 'hello world', I get
The startup log does not seem to show any issues.
Do these sample projects work for others?

For me, it works well. Here is what I did:
Clone the Spring Boot repository:
git clone https://github.com/spring-projects/spring-boot
Checkout the 1.5.7 branch
git checkout v1.5.7.RELEASE
Build
mvn package
Run
java -jar target/spring-boot-sample-tomcat-ssl-1.5.7.RELEASE.jar
Then open a browser on https://localhost:8443, accept the self-signed certificate and read the hello word message.
P.S.: I'm using Oracle JDK 1.8.0_144 and maven 3.5.0

Related

Importing old Play 2.3.4 project into IntelliJ gives SERVER ERROR: HTTPS Required

When importing a Play project (Play 2.3.4, Scala 2.11.4, sbt 0.13.5) into IntelliJ IDEA I get the following error message:
SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/jline/jline/2.11/jline-2.11.pom
According to the latest IntelliJ docs, only Play versions 2.4 and later are supported. So I downloaded an old IntelliJ version from 2016 (2016.2.5), which should have worked because the project was in active development with this IDE version back then. After finding a this article stating the Maven repo has deprecated http in favor of https, I'm not sure if the IntelliJ version mismatch is even the cause of this issue. However, the build was ok in 2016, and now I cannot fix this problem even if I create a settings.xml for Maven as described here... I still get the same error. I also tried to enable the "Override" setting in IntelliJ->Preferences->Build->Build Tools->Maven->User Settings File and pointed it to a settings.xml copy in a different folder. In both IntelliJ versions (2019.3.3 and 2016.2.5) I installed the Scala plugin directly in the IDE.
What am I doing wrong? How can I get IntelliJ to use the mirrors from my custom settings.xml?
Command-line already ran only by overriding the sbt repository as shown in this answer, IDE-based build still didn't recognize this file.
Finally solved it by bumping the sbt version at least one minor version up, to >=0.13.6 (source), from then on sbt itself uses a secure connection to the Maven repository.

Heroku deployment of Gradle application: pom.xml missing

I have an existing Maven based application on Heroku that I want to replace with a JHipster generated, Gradle based one. The steps I took were:
Develop the new Gradle based application using JHipster
run jhipster heroku
git merge heroku --strategy ours
git push heroku
Most of the deployment succeeds (Node.js app detected, webpack logging), but then I get an error:
Could not find a pom.xml file! Please check that it exists and is committed to Git.
It is correct that there is no pom.xml, because now it is a Gradle application. But apparently, Heroku still expects a Maven based one. Where is this knowledge stored and how can I reset it?
Already found out. You have to run this command, to remove the Maven build pack:
heroku buildpacks:clear
Additionally, in my case I also had to set:
heroku buildpacks:set heroku/nodejs
Or Heroku didn't know whether to run as Gradle or NodeJS. The latter is needed for JHipster based applications.

Error while executing Simple Spring Boot Application in Spring Tool Suite

I have recently installed Spring Tool Suite 4.0.1 on Ubuntu 18.04 and tried to run hello world spring application but it gives the following compile-time error. I have searched on google a lot but cannot find the relevant info.
Error:
"Description Resource Path Location Type
Archive for required library: '/home/anshul/.m2/repository/org/springframework/spring-test/5.1.2.RELEASE/spring-test-5.1.2.RELEASE.jar' in project 'demo' cannot be read or is not a valid ZIP file"
It looks like the JAR file in your local Maven repository is corrupted. The easiest way to solve this is to completely wipe out the local Maven repo (delete everything under .m2/repository and kick off an Update Maven Project... in STS. That will trigger Maven to download the dependencies again.

Build failed using Gradle for spring source files

I followed https://github.com/SpringSource/spring-framework link.
I successfully downloaded spring source with command
git clone git://github.com/SpringSource/spring-framework.git
But when i run
./gradlew build excpetion is thrown with message Execution failed for task':spring-core:compile Java. I am so confused .How to solve this ?
From https://github.com/SpringSource/spring-framework#building-from-source:
prerequisites: Git and the latest Early Access build of OpenJDK 1.8.

Is it possible to deploy a heroku war app with Java 1.7?

I tried updating system.properties to say 1.7, but it seems to stay at 1.6.
When I deploy via maven, system.properties works.
When I deploy via:
heroku deploy:war --war
it reverts back to 1.6 ignoring my system.properties. any ideas?
I'm wondering whether perhaps deploying with "heroku deploy:war" doesn't pick up the system.properties file. Try deploying by pushing your Git repo instead.

Resources