Usage of existing dblayer modules implementing spring JPA repositories

I have a problem that drives me completly nuts. I am using the vadin 17 standard application as start point (vanilla and aout of the box as produced by the (https://start.vaadin.com/?preset=latest) link. I have added the predeterminge person form just oget an example of a data bound form.

I download the system, extract the files, and import them to intellij and runs it using mvn spring-boot:run. everything works splendidly. I duly notes that a data source is detected (one jpa repository, which seams all nice an dandy.

The first thing I want to do is to add a dependency (no java code change at all so far, just editing the pom and adding the dependency) to a specific module using spring 2.3.3 release (the project from the vaadin site uses 2.3.2. could this be problematic?). I stop the running process, and run mvn clean compile, followed by mvn spring-boot:run. The server starts up and detects 25 JPA repositories (hooray, thats correct! So it seems to find the package and include it in the build), and then consider it self to be finished. It doesnt start the frontend application at all… Just sits there indefinitely without any obvious errors messages stack dumps or nothing. Simply not dishing out the site.

The module is built to be standalone module, and to be imported to whatever spring application where it is to be used. This particular module is tested in a rest layer, which is packaged in an free standing application (which works well). It contains 25 repositories (marked with @Repository), 4 services (which have some convinience functionally, marked with @Service) and 25 entities, marked with @Entity.

In this particular case I would like to use the db layer directly (yes, sure I am aware this is perhaps not perfect, but this is a small scale proof of concept, and it should work well enough for the purpose). But the darned things just refuses to start up and I cant figure out why.

Its more likely than not a question of me doing something stupid here, but some pointers would be greatly appreciated.

Hi John

Glad to hear that you are tying out Vaadin 17. Without a reproducible example project, it’s hard to say what went wrong. Few things I can recommend to give it a try:

  1. Update the spring boot version in the downloaded project to 2.3.3 to see if it helps.
  2. Run mvn spring-boot:run from command line if you were running it inside your IDE.
  3. There might be some hanging thread(s) after you stopped the process, maybe you can try to restart your computer to see it would make a difference.
  4. Very unlikely but just in case, check your disk space. I vaguely remember I ran into sth similar when the disk space is running out.

The example project is straight from the link given. The alteration I introduced are the following;

        <!-- PostgreSQL JH downwards  -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>se.sj</groupId>
            <artifactId>sj-commercial-time-table-dblayer</artifactId>
            <version>1.0.0</version>
        </dependency>

If I comment out the change the project starts nicely, when I add them (as above) the sample project fails to start. It should be noted (also) that the behaviour is the same whether i include the postgresql dependency or not. SO it is isolated to the second dependency.

I have tested your first and second point. Point 3 is unlikely as when i add a comment around the dependency things start to work again… :-). ANd I have, just for the sake of it restarted the computer as well (I really hate to do that). I have about 27gigabyte of free space on the drive, note plentiful, but should be ok. I am working on a windows based machine (shoot me).

Hi John, Seems that the sj-commercial-time-table-dblayer is a proprietary artifact, so I cannot try it here. May I ask you to help trying out two more things to identify the problem?

  1. Does it work if you run in production mode (mvn -Pproduction) for the V17 project?
  2. Does it work if you download a V14 project from the starter with your extra dependencies?

Hi! I will try out your suggestions this evening! Thanks alot for your great help! An yes its kind of proprietary (rules and stuff regarding the code). However this module seems to work well when i cobine it with another module defining a rest layer and then put them both in a a spring boot application. The endpoitns gets registered, teh repositories are up and running and so forth. And from the logs i can see tha the repositories are indeed recognized as repositories. Weird stuff. Will try uout your production suggestion.

Hmm -Pproduction did the trick. But I dont know why… Need to look into that and get some theory…