2

I have made a java application with spring boot 1.4.3.release (starter parent dependency) and hibernate 5.0.12 along with a database connection to Oracle 11g which is to be deployed on Websphere 8.5.5. The problem is that the war file of the above app gets deployed on websphere but on starting it error is shown as per the below image.

enter image description here

  • Things I have tried:
    1. Successfully deployed a war file without any database dependency
    2. Successfully deployed a war file with embedded database (H2, Derby)
    3. Providing 3rd party persistence provider on Websphere 8.5.5
    4. Tried with JNDI Datasource

I have also tried checking for any issues with Hibernate version and JPA problems.

The list of dependencies I have added:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.3.RELEASE</version>
</parent>

<properties>
 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>

 <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>



    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>
    <!-- hot swapping, disable cache for template, enable live reload -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>



    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.15</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.15</version>
    </dependency>

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>

     <dependency>  
        <groupId>com.googlecode.json-simple</groupId>  
        <artifactId>json-simple</artifactId>  
    </dependency> 

    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>  
    </dependency> 



    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11.2.0.3</version>
    </dependency>
    <!-- Optional, for bootstrap -->
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>bootstrap</artifactId>
        <version>3.3.7</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>



</dependencies>
<build>
  <finalName>oracleapp</finalName>
    <plugins>
        <!-- Package as an executable jar/war -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Please help me out.

Given below is the project structure

enter image description here

ajay verma
  • 340
  • 1
  • 8

1 Answers1

1

The problem you are having is an issue of where your Main class is located at. You need to move it to the root package, where it can see all other packages. Something like the following structure.

src/main/java
    -> SpringBootWebApplication (which I believe is your Main class)
        -> All other packages

This will allow your main to find the files you are looking for.

Alain Cruz
  • 4,757
  • 3
  • 25
  • 43