Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot application does not start

I have a Spring Boot application which we install in some little servers for our products. It has always worked. This evening we have installed it in one of our servers and it did not start.

Every server is an image from a common image, so the OS is the same.

When we launch the .jar we are getting:

Oct 05, 2016 11:16:45 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Oct 05, 2016 11:16:45 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.5
Oct 05, 2016 11:16:46 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring embedded WebApplicationContext
Oct 05, 2016 11:17:03 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Tomcat

This is our application.properties which regards hibernate

# Username and password
spring.datasource.username = parkuser
spring.datasource.password = xxxxxxxxxxxxxxxxxxxxxx
spring.datasource.url= jdbc:mysql://xxxxxxxxxxxxxxxxxxxxxxxxx:3306/SMARTPARK?useSSL=false

# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
spring.jpa.show-sql = false

# Hibernate ddl auto (create, create-drop, update): with "update" the database
# schema will be automatically updated accordingly to java entities found in
# the project
spring.jpa.hibernate.ddl-auto = update

# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy

# Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate4.SpringSessionContext

In our pom.xml we have

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.1.RELEASE</version>
    </parent>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j</artifactId>
            <version>1.3.8.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>

        </dependency>

This is our StartServer.class

@SpringBootApplication
@EnableScheduling
public class StartServer extends SpringBootServletInitializer{
    public static void main(String[] args){

        SpringApplication.run(StartServer.class, args);

    }


    @Bean
    public HibernateJpaSessionFactoryBean sessionFactory() {
        return new HibernateJpaSessionFactoryBean();
    }
}

I cannot understand why the same jar works in a device and gives this error in another one and i cannot understand which is the error...

like image 762
MarioC Avatar asked Oct 29 '22 19:10

MarioC


1 Answers

I ran into same problem. Then after cleaning my local maven repository the application was up and running. Clean your local maven repo (due to corrupted dependency) and try again!

like image 197
Thribhuvan Krishnamurthy Avatar answered Nov 15 '22 05:11

Thribhuvan Krishnamurthy