Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error postgresql while deploy AOP 6.1 in Tomcat (docker) #122

Open
anisharkouk opened this issue May 9, 2023 · 0 comments
Open

Error postgresql while deploy AOP 6.1 in Tomcat (docker) #122

anisharkouk opened this issue May 9, 2023 · 0 comments

Comments

@anisharkouk
Copy link

Context : Hello i am trying to deploy AOP 6.1 on my local computer with docker but i have an psql error. For information the build works correctly (create a war file)

I followed the tutorial : https://docs.axelor.com/adk/latest/tutorial/step1.html
I already verified that :

  • That the database is created (manually).
  • We can connect to the database from our Tomcat.
  • The config file has the right credentials.
  • ./gradlew --no-daemon run (got same error as below).

My docker compose :

version: '3.5'

services:

  postgres:
    container_name: postgres_aop
    image: postgres:14
    environment:
      POSTGRES_USER: axelor
      POSTGRES_PASSWORD: axelor
      POSTGRES_DB: axelor
      PGDATA: /data/postgres
    ports:
      - "5432:5432"
    networks:
      - postgres-network
    restart: unless-stopped

  tomcat:
    container_name: tomcat_aop
    build: Aop-image
    depends_on:
      - postgres
    environment:
      JAVA_OPTS: "-Daxelor.config=/usr/local/tomcat/axelor-demo/src/main/resources/META-INF/axelor-config.properties"
    ports:
      - "8080:8080"
    networks:
      - postgres-network
      - tomcat_network
    restart: on-failure

networks:
  postgres-network:
  tomcat_network:
    driver: bridge

The Tomcat Dockerfile :

FROM tomcat:9.0.48-jdk11-openjdk-buster

COPY ./axelor-demo/ /usr/local/tomcat/axelor-demo

WORKDIR /usr/local/tomcat/axelor-demo

RUN apt update && apt upgrade -y && apt install -y nano
RUN ./gradlew -xtest clean build && apt install -y postgresql-client
RUN mv /usr/local/tomcat/axelor-demo/build/libs/*.war ../webapps/aos.war

CMD ["catalina.sh", "run"]

axelor-config.properties :

`# PostgreSQL
db.default.ddl = update
db.default.url = jdbc:postgresql://postgres_aop:5432/axelor
db.default.user = axelor
db.default.password = axelor`

I got the error :

2023-05-09 15:13:40.841  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2023-05-09 15:13:40.891  INFO 1 --- [           main] o.h.s.i.AbstractServiceRegistryImpl      : HHH000369: Error stopping service [class org.hibernate.hikaricp.internal.HikariCPConnectionProvider]
java.lang.NullPointerException: null
	at org.hibernate.hikaricp.internal.HikariCPConnectionProvider.stop(HikariCPConnectionProvider.java:122)
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.stopService(AbstractServiceRegistryImpl.java:390)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.cleanup(EntityManagerFactoryBuilderImpl.java:1449)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1508)
	at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
	at com.google.inject.persist.jpa.JpaPersistService.start(JpaPersistService.java:110)
	at com.google.inject.persist.PersistFilter.init(PersistFilter.java:77)
	at com.google.inject.servlet.FilterDefinition.init(FilterDefinition.java:110)
	at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:98)
	at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:232)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:271)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:252)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4613)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1388)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:921)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:437)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:934)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
2023-05-09 15:13:40.892 DEBUG 1 --- [           main] o.hibernate.service.spi.ServiceBinding   : Overriding existing service binding [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
`

axeloradmin pushed a commit that referenced this issue Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant