mSorok / NPlsWeb

NaPLeS - Natural Product Likeness Scorer Web Application
https://naples.naturalproducts.net
MIT License
6 stars 3 forks source link

Several errors #3

Open Adoro opened 4 years ago

Adoro commented 4 years ago

When trying to start the project I run into several errors, among them are:

Steps to reproduce:

Docker containers start, web application results in error:

web_npls         | Caused by: org.hibernate.cfg.beanvalidation.IntegrationException: Error activating Bean Validation integration
web_npls         |  at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:138) ~[hibernate-core-5.2.17.Final.jar!/:5.2.17.Final]
web_npls         |  at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:281) ~[hibernate-core-5.2.17.Final.jar!/:5.2.17.Final]
web_npls         |  at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462) ~[hibernate-core-5.2.17.Final.jar!/:5.2.17.Final]
web_npls         |  at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892) ~[hibernate-core-5.2.17.Final.jar!/:5.2.17.Final]
web_npls         |  at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) ~[spring-orm-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
web_npls         |  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
web_npls         |  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) ~[spring-orm-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
web_npls         |  ... 28 common frames omitted
web_npls         | Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.valueextraction.ValueExtractorManager
web_npls         |  at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:140) ~[hibernate-validator-6.0.11.Final.jar!/:6.0.11.Final]
web_npls         |  at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:38) ~[hibernate-validator-6.0.11.Final.jar!/:6.0.11.Final]
web_npls         |  at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:364) ~[hibernate-validator-6.0.11.Final.jar!/:6.0.11.Final]
web_npls         |  at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:103) ~[validation-api-2.0.1.Final.jar!/:na]
web_npls         |  at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:501) ~[hibernate-core-5.2.17.Final.jar!/:5.2.17.Final]
web_npls         |  at org.hibernate.cfg.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:84) ~[hibernate-core-5.2.17.Final.jar!/:5.2.17.Final]
web_npls         |  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
web_npls         |  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
web_npls         |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
web_npls         |  at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
web_npls         |  at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:132) ~[hibernate-core-5.2.17.Final.jar!/:5.2.17.Final]
web_npls         |  ... 34 common frames omitted
web_npls         |
web_npls exited with code 1

I believe youre missing this dependency:

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.0.1.Final</version>
        </dependency>

Also the file inchiPet.jar is not build into the target directory (you copy it from the root of the project in the NPdatabaseFiller project). Therefor the docker container can not be build

In the readme the following line is mentioned:

  • verify that the file NPlikenessDB.sql is in the "mysql" folder Where is this file? What should it contain?

In order to run the web application properly I assume the following steps must be performed:

  1. Create a NPdatabaseFiller container to fill the database with data (/nplsmol/molecular_file_locations.txt fromScratch)
  2. Keep database container running
  3. Start the web application (edit application properties to point to db container)
  4. Open de web application in the browser
  5. Update database with NPdatabaseFiller Is this the correct flow?
mSorok commented 4 years ago

Regarding the last points, the flow that you described is one correct flow, yes.

  1. You can use directly the database dump (found here: https://zenodo.org/record/2652356)
  2. You can keep the db container running. Personally, I re-create one as I'm still developing the filler, to improve some of the cheminformatics analyses on the db filler one.
  3. If you just start the web application, you don't need to edit the application.properties Point 4 is not mandatory for correct execution.

Otherwise, the SQL dump can be found here: https://zenodo.org/record/2652356

I don't recall ever encountering the Hibernate error you're describing, in my setup, I don't need the dependency you suggested. From my experience, this kind of errors is created either by a different Java version, either by the inability of Hibernate to find a connection to the database. I would be interested in seeing if adding this new dependency, you solved this problem.

Adoro commented 4 years ago

Alright, it was my understanding the databasefiller project was required aswell. I got it working now by adding the hibernate-validator dependency. What Java version do you compile with? I used OpenJDK 13.

I believe the spring-boot-starter-data-jpa dependency default to the 6.1.2.Final version of the Hibernate validator which seems incompatible for the target Docker JVM? I'm not sure.

mSorok commented 4 years ago

That's the problem, Spring with Hibernate works well only with Java 8, it creates errors in my system with higher versions.