Looking for help?

Submit a request

Running Spring Boot JPA apps in WebSphere 8.5.5

Follow

Comments

8 comments

  • Avatar
    Rodrigo Ribeiro

    I'm following your guide, but my .war still has some tomcat dependencies like tomcat-juli-7.0.59.jar and tomcat-jdbc-7.0.59.jar because they are transitive dependencies of spring-boot-starter-data-jpa

    Did you exclude them as well? Changed to runtime provided?

    When I try to remove them I'm getting Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver

    It's weird because I have the dependency to the PostgreSQL driver already added.

  • Avatar
    David Parish

    The tomcat dependencies shouldn't have an affect on the postgres driver so that's a weird one.  If you are using gradle run:

    gradle dependencies

    That will show you where and how dependencies are being pulled in.

    As for the tomcat deps, here is how I'm declaring that in build.gradle:

    providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
  • Avatar
    Zachary Lee

    David,

    First off, thank you for sharing your experience!

    Can you please clarify if you had to package your WAR file as suggested here: Create a deployable war file, in addition to making tomcat "provided". I followed the suggestion there and was able to deploy my WAR file to Tomcat and WebSphere. It runs perfect with Tomcat with no problem BUT it does not work with WebSphere (Got "Error 404: SRVE0190E: File not found: {0}" when trying to access a page (any page) ). 

    About my environment: WebSphere Server 8.5.5.0 with either Java 1.7 or 1.6. My Spring Boot project does not use JPA.

    Any comment/help would be greatly appreciated. 

    Regards.

    Zach

  • Avatar
    David Parish

    >>Got "Error 404: SRVE0190E: File not found: {0}" when trying to access a page (any page) 

    That's probably not a spring boot problem at all.  Take a look at your SystemOut.log file and see if there is an error when the webapp starts.

  • Avatar
    Rodrigo Ribeiro

    This is a pom.xml file for enabling spring-boot to run on WAS 8.5.5.5 and jdk1.6

    https://gist.github.com/rodrik/5eae35432d8ab49d91ad

    I could successfully deploy and run it.

     

    Thanks David for the guide.

  • Avatar
    David Parish

    Rodrigo,

    Thanks for contributing. That's very helpful.

  • Avatar
    Swapnil Khandelwal

    I follow all above steps but got error Error 404: SRVE0190E: File not found: {0}

    i use db2 database and created simple rest api using spring boot my server log is as bellow

    [13/07/16 12:19:49:766 IST] 00000001 SystemErr R java.io.FileNotFoundException: D:\user\local\was\was85\profiles\AppSrv01\temp\swapnil\server1\_extensionregistry\loader.xml (The system cannot find the file specified.)
    [13/07/16 12:19:49:766 IST] 00000001 SystemErr R at java.io.FileInputStream.<init>(FileInputStream.java:124)
    [13/07/16 12:19:49:766 IST] 00000001 SystemErr R at java.io.FileInputStream.<init>(FileInputStream.java:84)
    [13/07/16 12:19:49:766 IST] 00000001 SystemErr R at com.ibm.wkplc.extensionregistry.RegistryLoader.restore(RegistryLoader.java:120)
    [13/07/16 12:19:49:766 IST] 00000001 SystemErr R at com.ibm.wkplc.extensionregistry.ExtensionRegistry.<init>(ExtensionRegistry.java:62)
    [13/07/16 12:19:49:766 IST] 00000001 SystemErr R at com.ibm.wkplc.extensionregistry.ExtensionRegistryFactory.<clinit>(ExtensionRegistryFactory.java:47)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at java.lang.J9VMInternals.initializeImpl(Native Method)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at java.lang.J9VMInternals.initialize(J9VMInternals.java:236)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.wkplc.extensionregistry.wasservice.ExtensionRegistryService.start(ExtensionRegistryService.java:250)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerHelper.startComponents(ContainerHelper.java:539)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:627)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:618)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:252)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerHelper.startComponents(ContainerHelper.java:539)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:627)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:618)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:523)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:310)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:223)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.WsServerImpl.main(WsServerImpl.java:686)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.ws.runtime.WsServer.main(WsServer.java:59)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at java.lang.reflect.Method.invoke(Method.java:611)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:234)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:96)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:77)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at java.lang.reflect.Method.invoke(Method.java:611)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at java.lang.reflect.Method.invoke(Method.java:611)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at org.eclipse.core.launcher.Main.run(Main.java:981)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:379)
    [13/07/16 12:19:49:782 IST] 00000001 SystemErr R at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:150)

  • Avatar
    JNGerbaux

    Hello,

    I'm trying to build a websphere 8.5.5.7 projet using SpringBoot 1.5.9.In a first step I've sucessfully run this project in SpringBoot embedded Tomcat. As a second step, I'm trying to deploy it on WebSphere. Your guide was helpfull: The project deploys correctly, but do not start because of the fellowing error raise when SpringBoot starts:

    Field myObjectRepository in fr.xx.xx.xx.soap.MyObjectEndPoint required a bean named 'entityManagerFactory' that could not be found.

    My project has a multiple module configuration: The first one is a SOAP Web Application producing a war which is holding SpringBoot main configuration. It's in this project the error rise (It holds the MyObjectEndPoint class). The second module is dependency of the first one and is managing database access. I suppose, this one has to provide the entityManager (factory ?)

    Pom of the war module:

    <groupId>my-project</groupId>
    <artifactId>
    my-object-ws</artifactId>
    <packaging>war</packaging>
    <name>MyObjectWS</name>

    <dependencies>
    <!-- Voir : http://www.adeveloperdiary.com/java/spring-boot/deploy-spring-boot-application-ibm-liberty-8-5/ -->
    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <scope>provided</scope>
    </dependency>

    <!-- Spring boot dependencies -->
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web-services</artifactId>
    <exclusions>
    <exclusion>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
    </exclusion>
    </exclusions>
    </dependency>
    <dependency>
    <groupId>wsdl4j</groupId>
    <artifactId>wsdl4j</artifactId>
    </dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-legacy</artifactId>
    <version>1.0.2.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.2.20.Final</version>
    </dependency>

    <dependency>
    <groupId>my-project</groupId>
    <artifactId>
    my-object</artifactId>
    <version>${project.version}</version>
    <!-- On exclut hibernate de ce package car c'est la version de Spring boot qui est pris -->
    <exclusions>
    <exclusion>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    </exclusion>
    <exclusion>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    </exclusion>
    </exclusions>
    </dependency>
    </dependencies>

    <!-- Add dependency management to have acces to Springboot parent pom -->
    <!-- @See: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-maven-without-a-parent -->
    <dependencyManagement>
    <!-- @See: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-maven-without-a-parent -->
    <dependencies>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-dependencies</artifactId>
    <version>${spring.boot.version}</version>
    <type>pom</type>
    <scope>import</scope>
    </dependency>
    </dependencies>
    </dependencyManagement>

    <build>
    <plugins>
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>${spring.boot.version}</version>
    <configuration>
    <folders>
    <folder>target/generated</folder>
    </folders>
    </configuration>
    <executions>
    <execution>
    <goals>
    <goal>repackage</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>

    Pom of the second module:

    <parent>
    <groupId>my-project</groupId>
    <artifactId>my-object-ws</artifactId>
    <version>${project.version}</version>
    </parent>

    <artifactId>my-object-data</artifactId>
    <name>MyProjectData</name>
    <dependencies>
    <!-- Pour Spring data -->
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
    <version>1.5.9.RELEASE</version>
    <!--Pour ne pas utiliser JPA 2.1 qui n'est pas supporté par WebSphere -->
    <exclusions>
    <exclusion>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    </exclusion>
    <exclusion>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    </exclusion>
    </exclusions>
    </dependency>
    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.2.20.Final</version>
    </dependency>
    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>4.2.20.Final</version>
    </dependency>

    <!-- Pour Spring Test -->
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <version>1.5.9.RELEASE</version>
    <scope>test</scope>
    </dependency>

    Any idea ? Or could you please provide a link to a project exemple ?

    Anyway, thanks for informations !

    JNGrx

Please sign in to leave a comment.