Sonarqube lts-community with docker compose not work - docker-compose

I've been trying to run sonarqube with docker compose for a long time. The database is running but sonarqube is not running. I use portainer for the implementation.
I use the following docker-compose file to start-up sonarqube:
version: "3"
services:
sonarqube:
image: sonarqube:lts-community
container_name: sonarqube
restart: unless-stopped
environment:
- SONARQUBE_JDBC_USERNAME=admin
- SONARQUBE_JDBC_PASSWORD=admin
- SONARQUBE_JDBC_URL=jdbc:postgresql://sonar_db:5432/sonarqube
networks:
- sonarnet
ports:
- "9901:9000"
- "9092:9092"
volumes:
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
sonar_db:
image: postgres:latest
container_name: sonar_db
restart: unless-stopped
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=sonarqube
volumes:
- sonarqube_db:/var/lib/postgresql10
- postgresql_data:/var/lib/postgresql10/data
networks:
- sonarnet
volumes:
postgresql_data:
sonarqube_bundled-plugins:
sonarqube_conf:
sonarqube_data:
sonarqube_db:
sonarqube_extensions:
networks:
sonarnet:
I get the following error:
2022.07.03 12:32:22 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2022.07.03 12:32:22 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:46345]
2022.07.03 12:32:22 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2022.07.03 12:32:22 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
2022.07.03 12:32:25 INFO es[][o.e.n.Node] version[7.16.2], pid[37], build[default/tar/2b937c44140b6559905130a8650c64dbd0879cfb/2021-12-18T19:42:46.604893745Z], OS[Linux/5.15.0-40-generic/amd64], JVM[Eclipse Adoptium/OpenJDK 64-Bit Server VM/11.0.13/11.0.13+8]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] JVM home [/opt/java/openjdk]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djna.tmpdir=/opt/sonarqube/temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=false]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [analysis-common]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [lang-painless]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] no plugins loaded
2022.07.03 12:32:25 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/opt/sonarqube/data (/dev/mapper/vg00-lv01)]], net usable_space [205.6gb], net total_space [237.2gb], types [ext4]
2022.07.03 12:32:25 INFO es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] node name [sonarqube], node ID [WAGp0sgmR0GCiwR4b935Hw], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2022.07.03 12:32:30 INFO es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}]
2022.07.03 12:32:30 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2022.07.03 12:32:31 INFO es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2022.07.03 12:32:31 INFO es[][o.e.n.Node] initialized
2022.07.03 12:32:31 INFO es[][o.e.n.Node] starting ...
2022.07.03 12:32:31 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:46345}, bound_addresses {127.0.0.1:46345}
2022.07.03 12:32:32 INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /opt/sonarqube/logs/sonarqube.log
2022.07.03 12:32:32 INFO es[][o.e.n.Node] stopping ...
2022.07.03 12:32:32 INFO es[][o.e.n.Node] stopped
2022.07.03 12:32:32 INFO es[][o.e.n.Node] closing ...
2022.07.03 12:32:32 INFO es[][o.e.n.Node] closed
2022.07.03 12:32:32 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 78
2022.07.03 12:32:32 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2022.07.03 12:32:32 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
sonarqube image: sonarqube:lts-community (version 8.9.9.56886 )
docker-compose version: 1.27.4
postgres image: 14.4-1
Can anyone help me?

Related

Keycloak does not use postgres database and tries to connect h2 database

I am trying to configure Keycloak to use postgres using docker-compose.
Docker compose file for reference:
version: "3.9"
services:
keycloak-postgres:
image: postgres:latest
restart: unless-stopped
ports:
- 5432:5432
environment:
POSTGRES_DB: ${POSTGRESQL_DB}
POSTGRES_USER: ${POSTGRESQL_USER}
POSTGRES_PASSWORD: ${POSTGRESQL_PASS}
volumes:
- postgres_data:/var/lib/postgresql/data
keycloak:
depends_on:
- keycloak-postgres
image: quay.io/keycloak/keycloak
container_name: keycloak
ports:
- 8030:8080
environment:
KC_DB: postgres
KC_DB_URL_HOST: keycloak-postgres
KC_DB_URL_DATABASE: ${POSTGRESQL_DB}
KC_DB_USERNAME: ${POSTGRESQL_USER}
KC_DB_PASSWORD: ${POSTGRESQL_PASS}
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
KC_HOSTNAME: ${KEYCLOAK_HOSTNAME}
KC_PROXY: edge
KC_HTTP_ENABLED: true
restart: unless-stopped
command:
- start --optimized
volumes:
postgres_data:
driver: local
I have found that if I run start without the optimized flag, keycloak starts without any issues, but also does not use the postgres database - as there are no tables or anything created by Keycloak when I connect to the DB.
When I run with the optimized flag, I get the following error:
URL format error; must be "jdbc:h2:{ {.|mem:}[name] | [file:]fileName | {tcp|ssl}:[//]server[:port][,server2[:port]]/name }[;key=value...]" but is "jdbc:postgresql://keycloak-postgres:5432/keycloak" [90046-214]
From what I can make out the postgres connection string which Keycloak has generated is correct. However it is trying to connect to a h2 database, which is clearly incorrect.
I have looked through all the configuration options and just can't make out why:
a) Keycloak isn't storing any data in postgres in start mode.
b) Keycloak is trying to access a H2 database in --optimized mode.
Update
Following advice from sonOfRa and to try and simplify the problem I have now tried the following:
Run postgres as a seperate docker.
Created the below Dockerfile as per the documentation (have also tried with sonOfRa's cut down Dockerfile):
FROM quay.io/keycloak/keycloak:latest as builder
# Enable health and metrics support
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
# Configure a database vendor
ENV KC_DB=postgres
RUN /opt/keycloak/bin/kc.sh build
FROM quay.io/keycloak/keycloak:latest
COPY --from=builder /opt/keycloak/ /opt/keycloak/
ENV KC_DB_URL_HOST=192.168.1.25
ENV KC_DB_USERNAME=keycloak
ENV KC_DB_PASSWORD=keycloak_db_password
ENV KC_HOSTNAME=localhost
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
Run the following command to build the new Dockerfile:
docker build . -t mykeycloak
Run the following command to start Keycloak:
docker run --name mykeycloak \
-p 8030:8080 \
-e KEYCLOAK_ADMIN=admin \
-e KEYCLOAK_ADMIN_PASSWORD=change_me \
-e KC_HOSTNAME=auth.url.com \
-e KC_PROXY=edge \
-e KC_HTTP_ENABLED=true \
mykeycloak start
Output from console:
2023-01-11 14:06:19,961 INFO [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: Base URL: <unset>, Hostname: auth.url.com, Strict HTTPS: true, Path: <request>, Strict BackChannel: false, Admin URL: <unset>, Admin: <request>, Port: -1, Proxied: true
2023-01-11 14:06:25,844 WARN [io.quarkus.agroal.runtime.DataSources] (main) Datasource <default> enables XA but transaction recovery is not enabled. Please enable transaction recovery by setting quarkus.transaction-manager.enable-recovery=true, otherwise data may be lost if the application is terminated abruptly
2023-01-11 14:06:28,797 INFO [org.infinispan.server.core.transport.EPollAvailable] (keycloak-cache-init) ISPN005028: Native Epoll transport not available, using NIO instead: java.lang.UnsatisfiedLinkError: could not load a native library: netty_transport_native_epoll_aarch_64
2023-01-11 14:06:29,311 WARN [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
2023-01-11 14:06:29,436 WARN [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
2023-01-11 14:06:29,541 INFO [org.keycloak.broker.provider.AbstractIdentityProviderMapper] (main) Registering class org.keycloak.broker.provider.mappersync.ConfigSyncEventListener
2023-01-11 14:06:29,581 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
2023-01-11 14:06:30,440 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000128: Infinispan version: Infinispan 'Triskaidekaphobia' 13.0.10.Final
2023-01-11 14:06:30,819 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000078: Starting JGroups channel `ISPN`
2023-01-11 14:06:30,820 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!
2023-01-11 14:06:31,143 WARN [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the send buffer of socket MulticastSocket was set to 1.00MB, but the OS only allocated 212.99KB
2023-01-11 14:06:31,144 WARN [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the receive buffer of socket MulticastSocket was set to 20.00MB, but the OS only allocated 212.99KB
2023-01-11 14:06:31,146 WARN [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the send buffer of socket MulticastSocket was set to 1.00MB, but the OS only allocated 212.99KB
2023-01-11 14:06:31,147 WARN [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the receive buffer of socket MulticastSocket was set to 25.00MB, but the OS only allocated 212.99KB
2023-01-11 14:06:33,179 INFO [org.jgroups.protocols.pbcast.GMS] (keycloak-cache-init) cb354516ab9d-30183: no members discovered after 2009 ms: creating cluster as coordinator
2023-01-11 14:06:33,213 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000094: Received new cluster view for channel ISPN: [cb354516ab9d-30183|0] (1) [cb354516ab9d-30183]
2023-01-11 14:06:33,228 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000079: Channel `ISPN` local address is `cb354516ab9d-30183`, physical addresses are `[172.17.0.2:52593]`
2023-01-11 14:06:35,021 INFO [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: cb354516ab9d-30183, Site name: null
2023-01-11 14:06:41,372 INFO [org.keycloak.quarkus.runtime.storage.legacy.liquibase.QuarkusJpaUpdaterProvider] (main) Initializing database schema. Using changelog META-INF/jpa-changelog-master.xml
2023-01-11 14:06:53,286 INFO [org.keycloak.services] (main) KC-SERVICES0050: Initializing master realm
2023-01-11 14:07:00,559 INFO [io.quarkus] (main) Keycloak 20.0.2 on JVM (powered by Quarkus 2.13.3.Final) started in 45.755s. Listening on: http://0.0.0.0:8080
2023-01-11 14:07:00,561 INFO [io.quarkus] (main) Profile prod activated.
2023-01-11 14:07:00,562 INFO [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, jdbc-h2, jdbc-mariadb, jdbc-mssql, jdbc-mysql, jdbc-oracle, jdbc-postgresql, keycloak, logging-gelf, narayana-jta, reactive-routes, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-health, smallrye-metrics, vault, vertx]
2023-01-11 14:07:02,212 INFO [org.keycloak.services] (main) KC-SERVICES0009: Added user 'admin' to realm 'master'
Unforuntely the result is the same.
I can access keycloak from the set URL and login using the admin user created on run. Everything seemingly works on the UI, except it does not store any data in the postgres database.
This is due to your use of the --optimized parameter. If you use it, it is assumed that you have already ran "build", which you did not do. It is recommended to create your own docker image which uses the upstream docker image as a base. This is described in the documentation here.
Essentially, you need to run the build command with --db=postgres (or the KC_DB=postgres environment variable), in order to tell Quarkus to build an optimized image that will later use postgres. That image can then be started with --optimized and it will correctly use postgres instead of H2.
Step 1 is to create a Dockerfile (not a docker-compose.yml!)
FROM quay.io/keycloak/keycloak
# Configure a database vendor
ENV KC_DB=postgres
WORKDIR /opt/keycloak
RUN /opt/keycloak/bin/kc.sh build
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
You can also include additional things at this point, like custom providers, but this is the minimal data that you need in order to make it work.
Now you have 2 options: You can build this image with docker build and push it to your own docker registry with docker push, or you can use it directly from your docker-compose.yaml. If you build and push, replace the image: quay.io/keycloak/keycloak line with image: your.registry/wherever/you/pushed. If you want to use it directly in your compose-file, you can remove the image: line completely, and replace it with
build: .
When doing this, you must ensure that the Dockerfile is in the same directory as the docker-compose.yaml

Need help nuxeo-platform-login-keycloak plugin build

I have tried to install the nuxeo-platform-login-keycloak plugin on Nuxeo 7.10 to connect to KeyCloak 19.0.3 following the instructions in the Readme
https://github.com/nikes/nuxeo-platform-login-keycloak
Modified the POM.xml to point to Nuxeo 10.10, as 10.2-SNAPSHOT is not available anymore.
Added the keycloak tomcat adapters for 19.0.3 from here
https://www.keycloak.org/archive/downloads-19.0.3.html
with a basic config file ( realm, certificate etc..)
The problem is that Nuxeo does not start when I upload the plugins and config to /nxserver/
this is the server-error.log
======================================================================
= Starting Nuxeo Framework
======================================================================
* Server home = /opt/nuxeo/server
* Runtime home = /opt/nuxeo/server/nxserver
* Data Directory = /var/lib/nuxeo/data
* Log Directory = /var/log/nuxeo
* Configuration Directory = /opt/nuxeo/server/nxserver/config
* Temp Directory = /opt/nuxeo/server/tmp
======================================================================
2022-11-26 14:21:04,652 WARN [localhost-startStop-1] [org.nuxeo.runtime.model.impl.ComponentManagerImpl] Component org.nuxeo.runtime.trackers.files.threadstracking.config was blacklisted. Ignoring.
2022-11-26 14:21:05,187 INFO [localhost-startStop-1] [org.nuxeo.elasticsearch.ElasticSearchComponent] Registering local embedded configuration: EsLocalConfig(nuxeoCluster, /var/lib/nuxeo/data/elasticsearch, true, mmapfs), loaded from service:org.nuxeo.elasticsearch.defaultConfig
2022-11-26 14:21:05,188 INFO [localhost-startStop-1] [org.nuxeo.elasticsearch.ElasticSearchComponent] Registering index configuration: EsIndexConfig(nuxeo, default, doc), loaded from service:org.nuxeo.elasticsearch.defaultConfig
2022-11-26 14:21:05,188 INFO [localhost-startStop-1] [org.nuxeo.elasticsearch.ElasticSearchComponent] Registering index configuration: EsIndexConfig(nuxeo-audit, null, entry), loaded from service:org.nuxeo.elasticsearch.index.audit.contrib
2022-11-26 14:21:05,188 INFO [localhost-startStop-1] [org.nuxeo.elasticsearch.ElasticSearchComponent] Registering index configuration: EsIndexConfig(nuxeo-uidgen, null, seqId), loaded from service:org.nuxeo.elasticsearch.index.sequence.contrib
2022-11-26 14:21:06,487 WARN [localhost-startStop-1] [org.nuxeo.runtime.model.impl.ComponentManagerImpl] Component org.nuxeo.runtime.trackers.files.threadstracking.config was blacklisted. Ignoring.
2022-11-26 14:21:06,666 WARN [localhost-startStop-1] [org.nuxeo.automation.scripting.internals.ScriptingFactory] Class Filter is not available. jdk8u40 is required to activate Automation Javascript imports security.
2022-11-26 14:21:07,261 ERROR [localhost-startStop-1] [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/nuxeo]] Exception sending context initialized event to listener instance of class org.nuxeo.runtime.deployment.NuxeoStarter
java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.getReadCapabilities()Lcom/fasterxml/jackson/core/util/JacksonFeatureSet;
at com.fasterxml.jackson.databind.DeserializationContext.<init>(DeserializationContext.java:212)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.<init>(DefaultDeserializationContext.java:50)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.<init>(DefaultDeserializationContext.java:391)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.createInstance(DefaultDeserializationContext.java:413)
at com.fasterxml.jackson.databind.ObjectMapper.createDeserializationContext(ObjectMapper.java:4737)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4666)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3666)
at org.keycloak.adapters.KeycloakDeploymentBuilder.loadAdapterConfig(KeycloakDeploymentBuilder.java:196)
at org.keycloak.adapters.KeycloakDeploymentBuilder.build(KeycloakDeploymentBuilder.java:187)
at org.nuxeo.ecm.platform.ui.web.keycloak.KeycloakAuthenticationPlugin.initPlugin(KeycloakAuthenticationPlugin.java:87)
at org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService.registerContribution(PluggableAuthenticationService.java:142)
at org.nuxeo.runtime.model.DefaultComponent.registerExtension(DefaultComponent.java:46)
at org.nuxeo.runtime.model.impl.ComponentInstanceImpl.registerExtension(ComponentInstanceImpl.java:193)
at org.nuxeo.runtime.model.impl.ComponentManagerImpl.registerExtension(ComponentManagerImpl.java:254)
at org.nuxeo.runtime.model.impl.RegistrationInfoImpl.activate(RegistrationInfoImpl.java:358)
at org.nuxeo.runtime.model.impl.RegistrationInfoImpl.resolve(RegistrationInfoImpl.java:436)
at org.nuxeo.runtime.model.impl.ComponentRegistry.resolveComponent(ComponentRegistry.java:177)
at org.nuxeo.runtime.model.impl.ComponentRegistry.addComponent(ComponentRegistry.java:125)
at org.nuxeo.runtime.model.impl.ComponentManagerImpl.register(ComponentManagerImpl.java:154)
at org.nuxeo.runtime.model.impl.DefaultRuntimeContext.deploy(DefaultRuntimeContext.java:121)
at org.nuxeo.runtime.model.impl.DefaultRuntimeContext.deploy(DefaultRuntimeContext.java:96)
at org.nuxeo.runtime.osgi.OSGiRuntimeService.loadComponents(OSGiRuntimeService.java:224)
at org.nuxeo.runtime.osgi.OSGiRuntimeService.createContext(OSGiRuntimeService.java:168)
at org.nuxeo.runtime.osgi.OSGiComponentLoader.bundleChanged(OSGiComponentLoader.java:100)
at org.nuxeo.osgi.OSGiAdapter.fireBundleEvent(OSGiAdapter.java:260)
at org.nuxeo.osgi.BundleImpl.setStarting(BundleImpl.java:394)
at org.nuxeo.osgi.BundleImpl.start(BundleImpl.java:290)
at org.nuxeo.osgi.BundleRegistry.doRegister(BundleRegistry.java:177)
at org.nuxeo.osgi.BundleRegistry.register(BundleRegistry.java:125)
at org.nuxeo.osgi.BundleRegistry.install(BundleRegistry.java:98)
at org.nuxeo.osgi.OSGiAdapter.install(OSGiAdapter.java:186)
at org.nuxeo.osgi.application.loader.FrameworkLoader.install(FrameworkLoader.java:278)
at org.nuxeo.osgi.application.loader.FrameworkLoader.doStart(FrameworkLoader.java:234)
at org.nuxeo.osgi.application.loader.FrameworkLoader.start(FrameworkLoader.java:126)
at org.nuxeo.runtime.deployment.NuxeoStarter.start(NuxeoStarter.java:118)
at org.nuxeo.runtime.deployment.NuxeoStarter.contextInitialized(NuxeoStarter.java:91)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1912)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
2022-11-26 14:21:07,484 WARN [localhost-startStop-1] [org.nuxeo.ecm.platform.ui.web.application.config.JSFAnnotationProvider] container scanned classes unavailable, applying default scanning
2022-11-26 14:21:09,807 WARN [localhost-startStop-1] [org.jboss.seam.security.permission.PersistentPermissionResolver] no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.
2022-11-26 14:21:09,841 ERROR [localhost-startStop-1] [org.apache.catalina.core.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2022-11-26 14:21:09,845 ERROR [localhost-startStop-1] [org.apache.catalina.core.StandardContext] Context [/nuxeo] startup failed due to previous errors
2022-11-26 14:21:09,876 WARN [localhost-startStop-1] [org.nuxeo.runtime.deployment.NuxeoStarter] Deregister JDBC driver: org.h2.Driver#1784cb97
2022-11-26 14:21:09,876 WARN [localhost-startStop-1] [org.nuxeo.runtime.deployment.NuxeoStarter] Deregister JDBC driver: org.apache.derby.jdbc.AutoloadedDriver40#208ed2cf
2022-11-26 14:21:09,885 INFO [localhost-startStop-1] [org.apache.catalina.startup.HostConfig] Deployment of configuration descriptor /opt/nuxeo/server/conf/Catalina/localhost/nuxeo.xml has finished in 6,057 ms
2022-11-26 14:21:09,886 INFO [localhost-startStop-1] [org.apache.catalina.startup.HostConfig] Deploying web application directory /opt/nuxeo/server/webapps/manager
2022-11-26 14:21:10,053 INFO [localhost-startStop-1] [org.apache.catalina.startup.TldConfig] At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2022-11-26 14:21:10,073 INFO [localhost-startStop-1] [org.apache.catalina.startup.HostConfig] Deployment of web application directory /opt/nuxeo/server/webapps/manager has finished in 187 ms
2022-11-26 14:21:10,073 INFO [localhost-startStop-1] [org.apache.catalina.startup.HostConfig] Deploying web application directory /opt/nuxeo/server/webapps/ROOT
2022-11-26 14:21:10,197 INFO [localhost-startStop-1] [org.apache.catalina.startup.TldConfig] At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2022-11-26 14:21:10,199 INFO [localhost-startStop-1] [org.apache.catalina.startup.HostConfig] Deployment of web application directory /opt/nuxeo/server/webapps/ROOT has finished in 126 ms
2022-11-26 14:21:10,199 INFO [localhost-startStop-1] [org.apache.catalina.startup.HostConfig] Deploying web application directory /opt/nuxeo/server/webapps/host-manager
2022-11-26 14:21:10,322 INFO [localhost-startStop-1] [org.apache.catalina.startup.TldConfig] At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2022-11-26 14:21:10,325 INFO [localhost-startStop-1] [org.apache.catalina.startup.HostConfig] Deployment of web application directory /opt/nuxeo/server/webapps/host-manager has finished in 126 ms
2022-11-26 14:21:10,326 INFO [main] [org.apache.coyote.http11.Http11Protocol] Starting ProtocolHandler ["http-bio-0.0.0.0-8080"]
2022-11-26 14:21:10,335 INFO [main] [org.apache.coyote.ajp.AjpProtocol] Starting ProtocolHandler ["ajp-bio-0.0.0.0-8009"]
2022-11-26 14:21:10,336 INFO [main] [org.apache.catalina.startup.Catalina] Server startup in 7370 ms

Error while initializing actor system wavesplatform com.protonail.leveldb.jna.LevelDBException

I want to fork the waves blockchain in which I wanted to change the coin. I first change the name of coin in waves node
link : https://github.com/wavesplatform/Waves/blob/version-1.2.x/node/src/main/scala/com/wavesplatform/transaction/assets/exchange/AssetPair.scala
according to the link I deployed on windows and I got this error.
ERROR: 18:28:45,568 ERROR [main] c.w.actor.RootActorSystem$ - Error while initializing actor system wavesplatform com.protonail.leveldb.jna.LevelDBException: IO error: /root/.local/share/waves-testnet/data: Invalid argument
(note : full error is given below)
software details:
openjdk11
ubuntu 18.04LTS
I am deploying in windows through ubuntu 18.04LTS by following steps for installing in windows and installing deb file.
link for installing: https://docs.waves.tech/en/waves-node/how-to-install-a-node/on-windows
command: java -jar node/target/waves-all-1.2.15-DIRTY.jar node/target/classes/application.conf
I got error while initializing it with wavesplatform.
root#WJLP-1220:/mnt/c/Users/swatim/Desktop/wavesProject/Waves/node/target# java -jar waves-all-1.2.15-DIRTY.jar classes/application.conf
2021-01-04 18:28:44,524 INFO [main] c.w.Application$ - Starting...
2021-01-04 18:28:45,082 INFO [ctor.default-dispatcher-4] a.event.slf4j.Slf4jLogger - Slf4jLogger started 2021-01-04 18:28:45,193 INFO [main] c.w.Application$ - Waves v1.2.15-DIRTY Blockchain Id: T
2021-01-04 18:28:45,271 INFO [main] c.w.d.LevelDBFactory$ - Loaded com.wavesplatform.database.jna.LevelDBJNADBFactory with com.wavesplatform.database.jna.LevelDBJNADBFactory#72ba28ee
2021-01-04 18:28:45,568 ERROR [main] c.w.actor.RootActorSystem$ - Error while initializing actor system wavesplatform com.protonail.leveldb.jna.LevelDBException: IO error: /root/.local/share/waves-testnet/data: Invalid argument
at com.protonail.leveldb.jna.LevelDBNative.checkError(LevelDBNative.java:295)
at com.protonail.leveldb.jna.LevelDB.(LevelDB.java:16) at com.wavesplatform.database.jna.LevelDBJNADBFactory.openJnaDatabase(LevelDBJNADBFactory.scala:11)
at com.wavesplatform.database.jna.LevelDBJNADBFactory.open(LevelDBJNADBFactory.scala:15)
at com.wavesplatform.database.package$.openDB(package.scala:51)
at com.wavesplatform.Application.(Application.scala:69)
at com.wavesplatform.Application$.$anonfun$startNode$4(Application.scala:558)
at com.wavesplatform.Application$.$anonfun$startNode$4$adapted(Application.scala:555)
at com.wavesplatform.actor.RootActorSystem$.start(RootActorSystem.scala:25)
at com.wavesplatform.Application$.startNode(Application.scala:555)
at com.wavesplatform.Application$.main(Application.scala:524)
at com.wavesplatform.Application.main(Application.scala)

Getting tomcat 404 error when accessing artifactory docker

I created an instance of Artifactoy in docker. I mapped its 8081 port to local 3007 port:
ports:
- "3007:8081"
These are done on a remote server (the docker is running on a remote server on the company network)
When accessing it using http://server-domain-name:3007, i get the following error:
HTTP Status 404 – Not Found
Type Status Report
Message /ui/
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/8.5.51
but if i run curl http://server-domain-name:3007, i get the following which shows that Artifactory is running:
<!--
~ Artifactory is a binaries repository manager.
~ Copyright (C) 2018 JFrog Ltd.
~
~ Artifactory is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Artifactory is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with Artifactory. If not, see <http://www.gnu.org/licenses/>.
-->
<html>
<head>
<meta http-equiv="refresh" content="0;URL=/artifactory">
</head>
<body>
</body>
</html>
I suspect it's something related to artifactory proxy settings, but not sure!
Any idea why I get this error and can not access it??
These are the tomcat logs within the docker container:
/opt/jfrog/artifactory/var/log/tomcat# cat tomcat-catalina-2020-03-24.log
24-Mar-2020 10:57:42.185 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8081"]
24-Mar-2020 10:57:42.200 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Mar-2020 10:57:42.208 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8040"]
24-Mar-2020 10:57:42.209 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Mar-2020 10:57:42.214 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
24-Mar-2020 10:57:42.214 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.51
24-Mar-2020 10:57:42.233 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [/opt/jfrog/artifactory/app/artifactory/tomcat/conf/Catalina/localhost/access.xml]
24-Mar-2020 10:57:42.233 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [/opt/jfrog/artifactory/app/artifactory/tomcat/conf/Catalina/localhost/artifactory.xml]
24-Mar-2020 10:57:42.252 WARNING [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDescriptor A docBase [/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/artifactory.war] inside the host appBase has been specified, and will be ignored
24-Mar-2020 10:57:42.252 WARNING [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor A docBase [/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/access.war] inside the host appBase has been specified, and will be ignored
24-Mar-2020 10:57:50.670 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/opt/jfrog/artifactory/app/artifactory/tomcat/conf/Catalina/localhost/artifactory.xml] has finished in [8,436] ms
24-Mar-2020 10:57:52.693 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/opt/jfrog/artifactory/app/artifactory/tomcat/conf/Catalina/localhost/access.xml] has finished in [10,460] ms
24-Mar-2020 10:57:52.694 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/ROOT]
24-Mar-2020 10:57:52.705 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/ROOT] has finished in [11] ms
24-Mar-2020 10:57:52.708 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8081"]
24-Mar-2020 10:57:52.724 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8040"]
24-Mar-2020 12:20:14.606 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
24-Mar-2020 12:20:14.606 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8081"]
24-Mar-2020 12:20:14.612 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8040"]
24-Mar-2020 12:20:14.617 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
24-Mar-2020 12:20:19.751 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8081"]
24-Mar-2020 12:20:19.751 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8040"]
24-Mar-2020 12:20:19.752 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8081"]
24-Mar-2020 12:20:19.753 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8040"]
24-Mar-2020 12:20:26.296 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8081"]
24-Mar-2020 12:20:26.312 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Mar-2020 12:20:26.320 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8040"]
24-Mar-2020 12:20:26.321 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Mar-2020 12:20:26.326 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
24-Mar-2020 12:20:26.326 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.51
24-Mar-2020 12:20:26.339 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [/opt/jfrog/artifactory/app/artifactory/tomcat/conf/Catalina/localhost/access.xml]
24-Mar-2020 12:20:26.339 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [/opt/jfrog/artifactory/app/artifactory/tomcat/conf/Catalina/localhost/artifactory.xml]
24-Mar-2020 12:20:26.363 WARNING [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor A docBase [/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/access.war] inside the host appBase has been specified, and will be ignored
24-Mar-2020 12:20:26.363 WARNING [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDescriptor A docBase [/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/artifactory.war] inside the host appBase has been specified, and will be ignored
24-Mar-2020 12:20:28.904 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/opt/jfrog/artifactory/app/artifactory/tomcat/conf/Catalina/localhost/artifactory.xml] has finished in [2,564] ms
24-Mar-2020 12:20:35.030 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/opt/jfrog/artifactory/app/artifactory/tomcat/conf/Catalina/localhost/access.xml] has finished in [8,691] ms
24-Mar-2020 12:20:35.031 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/ROOT]
24-Mar-2020 12:20:35.048 INFO [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/ROOT] has finished in [17] ms
24-Mar-2020 12:20:35.050 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8081"]
24-Mar-2020 12:20:35.060 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8040"]
/opt/jfrog/artifactory/var/log/tomcat# cat tomcat-localhost-2020-03-24.log
24-Mar-2020 10:57:42.907 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log 1 Spring WebApplicationInitializers detected on classpath
24-Mar-2020 10:57:45.680 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring embedded WebApplicationContext
24-Mar-2020 12:20:14.651 INFO [localhost-startStop-3] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
24-Mar-2020 12:20:26.965 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log 1 Spring WebApplicationInitializers detected on classpath
24-Mar-2020 12:20:29.632 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring embedded WebApplicationContext
Update:
If I ssh into the docker container and run
curl --head http://localhost:8081/artifactory/webapp/#/login
I get this:
HTTP/1.1 200 OK
Server: Artifactory/7.3.2
X-Artifactory-Id: 7c88d7b6c0e91efc:e615a11:17111dedc15:-8000
X-Artifactory-Node-Id: 2dd09e552f22
Cache-Control: no-store,max-age=0
X-FRAME-OPTIONS: DENY
Accept-Ranges: bytes
ETag: W/"2239-1584804418000"
Last-Modified: Sat, 21 Mar 2020 15:26:58 GMT
Content-Type: text/html
Content-Length: 2239
Date: Wed, 25 Mar 2020 13:50:46 GMT
it looks like artifactory is working ok but not accessible when port 8081 is mapped to 3007 external port.
Can this be related to Apache Tomcat config inside the docker container?

Docker Compose (TOMCAT + POSTGRES) - Spring Boot app: connection issue between containers

I have a spring-boot service with a connection to postgresql.The application setup works fine when I run the app with TOMCAT 9.0.6 and a docker container for postgresql (just the DB in a container).
But when I try to run the application with docker compose, it doesn't show any content.
My docker-compose.yml
version: "3.3"
services:
webserver:
build:
context: ./appserver
image: webserver
container_name: webserver
depends_on:
- mypostgres
ports:
- "8080:8080"
- "8000:8000"
networks:
- front-tier
- back-tier
mypostgres:
build:
context: ./database
image: postgresdb
container_name: postgresdb
ports:
- "5432:5432"
environment:
- POSTGRES_DB=ggal1701
volumes:
- type: volume
source: psql_data
target: /var/lib/postgresql/data
networks:
- back-tier
volumes:
psql_data:
networks:
front-tier:
back-tier:
My dockerfile into ./database:
FROM postgres:9.5
# Copy the database initialize script:
# Contents of /docker-entrypoint-initdb.d are run on postgres startup
ADD docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d/
# Default values for passwords and database name. Can be overridden on docker run
# ENV MYSQL_ROOT_PASSWORD=my-secret-pw # Not defaulted for security reasons!
ENV POSTGRES_USER=postgres
ENV POSTGRES_PASSWORD=postgres
My dockerfile into ./appserver:
FROM tomcat:9.0.6-jre8
# tomcat-users.xml sets up user accounts for the Tomcat manager GUI
ADD tomcat/tomcat-users.xml $CATALINA_HOME/conf/
# ADD tomcat/catalina.sh $CATALINA_HOME/bin/
ADD tomcat/run.sh $CATALINA_HOME/bin/run.sh
RUN chmod +x $CATALINA_HOME/bin/run.sh
# create mount point for volume with application
WORKDIR $CATALINA_HOME/webapps/
COPY dos.war .
# add MySQL JDBC driver jar
ADD tomcat/postgresql-42.2.2.jar $CATALINA_HOME/lib/
# add tomcat jpda debugging environmental variables
#ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
ENV JPDA_ADDRESS="8000"
ENV JPDA_TRANSPORT="dt_socket"
# start tomcat8 with remote debugging
EXPOSE 8080
CMD ["run.sh"]
And finally, my Spring Boot configuration into an application.yml:
spring:
# Configuración de la BASE DE DATOS
datasource:
dataSourceClassName: org.postgresql.ds.PGSimpleDataSource
url: jdbc:postgresql://mypostgres:5432/ggal1701
username: postgres
password: postgres
maximum-pool-size: 5
application:
url: http://webserver:8080
profiles:
active: prod
devtools:
restart:
enabled: false
livereload:
enabled: false
server:
compression:
enabled: true
mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json
I use javamelody and when I go to the path it loads it correctly.
But in the app path it only loads the title of the page in the tab and nothing else.
Tomcat logs looks ok, except this (nothing about connection):
webserver | 09:50:43.673 [main] WARN es.asd.GGAL1701.ApplicationWebXml - No Spring profile configured, running with default configuracion
webserver | 09:50:44.466 [main] DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.exception-conversion-word]
webserver | 09:50:44.467 [main] DEBUG org.springframework.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.exception-conversion-word] not found - trying original name [logging.exception-conversion-word]. javax.naming.NameNotFoundException: Name [logging.exception-conversion-word] is not bound in this Context. Unable to find [logging.exception-conversion-word].
webserver | 09:50:44.467 [main] DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.exception-conversion-word]
webserver | 09:50:44.467 [main] DEBUG org.springframework.jndi.JndiPropertySource - JNDI lookup for name [logging.exception-conversion-word] threw NamingException with message: Name [logging.exception-conversion-word] is not bound in this Context. Unable to find [logging.exception-conversion-word].. Returning null.
Any idea is welcome. The database seems to be working correctly since it works well with tomcat on localhost. But by dockerizing Tomcat, it fails.
Edit nº1: Attempting to run it on local first, then upload it to the cloud. These failures are local.
Edit nº2: Some new logs from tomcat docker:
t ot#281078c55f64:/usr/local/tomcat/logs# cat localhost_access_log.2018-04-11.txt
172.18.0.1 - - [11/Apr/2018:08:28:28 +0000] "GET /dos HTTP/1.1" 302 -
172.18.0.1 - - [11/Apr/2018:08:28:28 +0000] "GET /dos/ HTTP/1.1" 200 964
172.18.0.1 - - [11/Apr/2018:08:28:28 +0000] "GET /assets/css/main-c4c779892e.css HTTP/1.1" 404 1111
172.18.0.1 - - [11/Apr/2018:08:28:28 +0000] "GET /app/vendor-511f175b57.js HTTP/1.1" 404 1101
root#281078c55f64:/usr/local/tomcat/logs# cat localhost.2018-04-11.log
11-Apr-2018 08:27:57.363 INFO [main] org.apache.catalina.core.ApplicationContext.log 2 Spring WebApplicationInitializers detected on classpath
11-Apr-2018 08:28:14.958 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
11-Apr-2018 08:28:14.959 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
11-Apr-2018 08:28:14.960 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker#267f6b32')
root#281078c55f64:/usr/local/tomcat/logs# cat catalina.2018-04-11.log 11-Apr-2018 08:27:54.581 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.6 11-Apr-2018 08:27:54.583 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 5 2018 09:34:35 UTC 11-Apr-2018 08:27:54.583 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:
9.0.6.0 11-Apr-2018 08:27:54.583 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux 11-Apr-2018 08:27:54.583 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:
3.16.0-5-amd64 11-Apr-2018 08:27:54.583 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 11-Apr-2018 08:27:54.583 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre 11-Apr-2018 08:27:54.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_162-8u162-b12-1~deb9u1-b12 11-Apr-2018 08:27:54.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 11-Apr-2018 08:27:54.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat 11-Apr-2018 08:27:54.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat 11-Apr-2018 08:27:54.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:
-Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties 11-Apr-2018 08:27:54.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 11-Apr-2018 08:27:54.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 11-Apr-2018 08:27:54.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources 11-Apr-2018 08:27:54.585 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument:
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n 11-Apr-2018 08:27:54.585 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 11-Apr-2018 08:27:54.585 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat 11-Apr-2018 08:27:54.585 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat 11-Apr-2018 08:27:54.585 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp 11-Apr-2018 08:27:54.585 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.5.2]. 11-Apr-2018 08:27:54.585 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 11-Apr-2018 08:27:54.585 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 11-Apr-2018 08:27:54.588 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.0f 25 May 2017] 11-Apr-2018 08:27:54.654 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"] 11-Apr-2018 08:27:54.664 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 11-Apr-2018 08:27:54.675 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"] 11-Apr-2018 08:27:54.676 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 11-Apr-2018 08:27:54.677 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 406 ms 11-Apr-2018 08:27:54.703 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 11-Apr-2018 08:27:54.704 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.6 11-Apr-2018 08:27:54.723 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/dos.war] 11-Apr-2018 08:27:57.309 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 11-Apr-2018 08:28:14.765 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/dos.war] has finished in [20,041] ms 11-Apr-2018 08:28:14.767 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples] 11-Apr-2018 08:28:14.967 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [199] ms 11-Apr-2018 08:28:14.967 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT] 11-Apr-2018 08:28:15.022 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [55] ms 11-Apr-2018 08:28:15.022 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs] 11-Apr-2018 08:28:15.075 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [53] ms 11-Apr-2018 08:28:15.076 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/host-manager] 11-Apr-2018 08:28:15.138 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [62] ms 11-Apr-2018 08:28:15.138 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager] 11-Apr-2018 08:28:15.197 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [59] ms 11-Apr-2018 08:28:15.202 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 11-Apr-2018 08:28:15.212 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 11-Apr-2018 08:28:15.225 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 20547 ms 11-Apr-2018 08:28:25.201 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/log] 11-Apr-2018 08:28:25.256 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/log] has finished in [55] ms
I also tried to pass the parameters through JAVA_OPTS, but it still doesn't show the application when I docker the tomcat.
environment:
- "JAVA_OPTS=-Ddatasource.jdbcUrl=jdbc:postgresql://mypostgres:5432/ggal1701 -Ddatasource.user=postgres -Ddatasource.password=postgres"
Edit nº3: Connecting to an external database (RDS AWS) does not work either, while in local, the same version of Tomcat connects without problems. So all the trouble seems to be coming from the dockerized Tomcat.
I don't understand why yet, but changing the version of Tomcat has gone. It is not a question of using an earlier or later version. With Tomcat version 8 it works or not according to the selected jre, but it is also no problem with the version of the jre because trying the same one in another version does not work.
With tomcat running in localhost my application works perfectly. With docker, using the same version 9.0.6, it does not.
My current docker-compose in case someone might find it useful:
version: "3.3"
services:
mytomcat:
build:
context: ./appserver
image: webserver
container_name: webserver
hostname: webserver
ports:
- "8080:8080"
- "8000:8000"
# links:
# - mypostgres:postgresdb
networks:
- main
mypostgres:
build:
context: ./database
image: postgresdb
container_name: postgresdb
hostname: postgresdb
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
networks:
- main
volumes:
db-data:
networks:
main:
I don't give my answer as the solution, because I don't think it is. The solution would be that it works with the same version that it does in localhost; so alternative answers, explanations or solutions are welcome.