Skip to content

Tag: spring-boot

Best practice for configuring Spring LdapTemplate via annotations instead of XML?

For a Spring Boot application, I successfully configured a Spring LdapTemplate using annotations, including the LdapContextSource dependency with @Values from (Woot! I couldn’t find an example, so maybe this will help others.) The snippets (below) setup the context source, inject it into an LdapTemplate, and autowire that into my DirectoryService. Is there a better/cleaner way to setup the ContextSource

Spring Boot + JPA : Column name annotation ignored

I have a Spring Boot application with dependency spring-boot-starter-data-jpa. My entity class has a column annotation with a column name. For example: SQL generated by this created test_name as the columns name. After looking for a solution I have found that spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy solved the problem (column name is taken from column annotation). Still, my question is why without naming_strategy set

How to pass JVM options from bootRun

I’m developing simple Spring web application that communicates with remote host and I would like to test it locally behind corporate proxy. I use “Spring Boot” gradle plugin and the question is how can I specify proxy settings for JVM? I have try several ways to do it: gradle -Dhttp.proxyHost=X.X.X.X -Dhttp.proxyPort=8080 bootRun export JAVA_OPTS=”-Dhttp.proxyHost=X.X.X.X -Dhttp.proxyPort=8080″ export GRADLE_OPTS=”-Dhttp.proxyHost=X.X.X.X -Dhttp.proxyPort=8080″ But it

mvn spring-boot:run doesn’t start spring

ANSWER: I changed the version tag from 0.0.1-SNAPSHOT to 1.0.2.RELEASE and it worked, see answer below. I am following this documentation and have created the as instructed. When I run mvn spring-boot:run spring doesn’t start it just says BUILD SUCCESS. It’s my understanding that Spring should start and Tomcat serving up the page. Here are some details: located

List of ALL Spring Boot application properties

Is there a list of ALL properties that are available in a application.yml or file when using Spring Boot? I only seem to find the common ones. Answer As rightly pointed out by earlier answers you may find the “common” application properties listed here. But incase you need the comprehensive list of all properties, you may refer to spring-configuration-metadata.json.

Spring Boot: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

I am totally new to Spring and started to do the official guides from this site: I’d like to do this guide: I get the following Exception: The application starter class is this: As you can see, the main method contains a commented line. I’ve already done a tutorial, namely this one: It’s up and running. But

Add context path to Spring Boot application

I am trying to set a Spring Boot applications context root programmatically. The reason for the context root is we want the app to be accessed from localhost:port/{app_name} and have all the controller paths append to it. Here is the application configuration file for the web-app. Here is the index controller for the main page. The new root of the