Cannot get REST response (with Postman). Java, IntelliJ, Tomcat 9, Maven - rest

I'm only a beginner. I have this project that I was working on a training course. It was set up on Eclipse and it was working. I'm now trying to get this same code working using IntelliJ Ultimate and I cannot any rest response. I'm probably doing something wrong but I have no clue what it could be as I do not understand much when it comes setting things up. I tried both browser and Postman and I get error 404. I also tried to set a breakpoint to the code and it does not get activated.
I created a new project, chose Web Aplication and RESTful web services from additional Libraries and Frameworks. I also added Maven framework. I have installed JDK 1.8 and Tomcat 9.
Below is my maven BOM. I'm not sure if all is correct:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wip.controller</groupId>
<artifactId>TestApp</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.25.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.25.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.19.3</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.19.3</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
</dependencies>
</project>
This is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>jersey-serlvet</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.wip.controller</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey-serlvet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
This is an example of one of my controller class.
package com.wip.controller;
import com.wip.bean.FoodGroup;
import com.wip.service.FoodGroupService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;
#Path("/foodgroups")
public class FoodGroupController
{
FoodGroupService foodGroupService = new FoodGroupService();
#GET
#Produces(MediaType.APPLICATION_JSON)
public List<FoodGroup> getFoodGroups()
{
List<FoodGroup> listOfFoodGroups = foodGroupService.getAllFoodGroups();
return listOfFoodGroups;
}
}
I tried to use this on postman "localhost:8080/rest/foodgroups"
This gives me a 404 as below:
<!DOCTYPE html>
<html>
<head>
<title>Apache Tomcat/9.0.0.M17 - Error report</title>
<style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style>
</head>
<body>
<h1>HTTP Status 404 - </h1>
<div class="line"></div>
<p>
<b>type</b> Status report
</p>
<p>
<b>message</b>
<u></u>
</p>
<p>
<b>description</b>
<u>The requested resource is not available.</u>
</p>
<hr class="line">
<h3>Apache Tomcat/9.0.0.M17</h3>
</body>
</html>
There aren't any errors that come up with server log either.
D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17\bin\catalina.bat run
[2017-03-26 07:51:13,166] Artifact TestApp:war exploded: Server is not connected. Deploy is not available.
Using CATALINA_BASE: "C:\Users\laptop\.IntelliJIdea2016.3\system\tomcat\Tomcat_9_0_0_M17_TestApp"
Using CATALINA_HOME: "D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17"
Using CATALINA_TMPDIR: "D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_121"
Using CLASSPATH: "D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17\bin\bootstrap.jar;D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17\bin\tomcat-juli.jar"
Connected to the target VM, address: '127.0.0.1:49794', transport: 'socket'
26-Mar-2017 19:51:13.971 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.0.M17
26-Mar-2017 19:51:13.972 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 10 2017 20:59:20 UTC
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.0.0
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 8.1
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.3
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_121\jre
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_121-b13
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\laptop\.IntelliJIdea2016.3\system\tomcat\Tomcat_9_0_0_M17_TestApp
26-Mar-2017 19:51:13.973 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\laptop\.IntelliJIdea2016.3\system\tomcat\Tomcat_9_0_0_M17_TestApp\conf\logging.properties
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:49794,suspend=y,server=n
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
26-Mar-2017 19:51:13.974 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
26-Mar-2017 19:51:13.975 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\laptop\.IntelliJIdea2016.3\system\tomcat\Tomcat_9_0_0_M17_TestApp
26-Mar-2017 19:51:13.975 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17
26-Mar-2017 19:51:13.975 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17\temp
26-Mar-2017 19:51:13.975 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.10 using APR version 1.5.2.
26-Mar-2017 19:51:13.975 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
26-Mar-2017 19:51:13.975 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
26-Mar-2017 19:51:14.806 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2j 26 Sep 2016)
26-Mar-2017 19:51:14.908 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
26-Mar-2017 19:51:14.922 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
26-Mar-2017 19:51:14.924 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
26-Mar-2017 19:51:14.926 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
26-Mar-2017 19:51:14.926 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1258 ms
26-Mar-2017 19:51:14.949 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
26-Mar-2017 19:51:14.949 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.0.M17
26-Mar-2017 19:51:14.958 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080]
26-Mar-2017 19:51:14.965 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009]
26-Mar-2017 19:51:14.966 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 40 ms
Connected to server
[2017-03-26 07:51:15,313] Artifact TestApp:war exploded: Artifact is being deployed, please wait...
[2017-03-26 07:51:15,673] Artifact TestApp:war exploded: Artifact is deployed successfully
[2017-03-26 07:51:15,674] Artifact TestApp:war exploded: Deploy took 360 milliseconds
26-Mar-2017 19:51:24.965 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17\webapps\manager
26-Mar-2017 19:51:25.034 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory D:\PROJECTS\Programming\apache-tomcat-9.0.0.M17\webapps\manager has finished in 68 ms
I would be super grateful if someone has any ideas what to try next.
EDIT:
Thanks to the link provided by CrazyCoder I have manged to get my REST services to work. Like "localhost:8080/helloworld" works just fine and so some other links to some of my services work fine as well when I tested them through Postman. The only thing I'm struggling now is to get the index.html to come up.
I have tried pretty much every combination in my browser I can think of with no joy:
http://localhost:8080/
http://localhost:8080/index.html
http://localhost:8080/MyProject/index.html
And it keeps saying that This localhost page can’t be found
Latest screenshot of settings
If someone has an idea of what I could try, please advise. I'm just so close to get it running. Thank you.

Related

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?

Connect to Postgres container via Jira container

I made postgres container via docker-compose:
version: "3.7"
services:
postgres:
image: postgres:9.6.15
container_name: some-postgres
volumes:
- postgresql-volume:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=rw_dev
- POSTGRES_USER=rw_dev
- POSTGRES_DB=rw_development
ports:
- "5432:5432"
volumes:
postgresql-volume:
external: true
After inspection i see that it is in devops_default network.
I want to connect not via docker-compose Jira to this database, i tried:
docker run -v jiraVolume:/var/atlassian/application-data/jira --name="jira" -d -p 8080:8080 --env ATL_JDBC_URL=jdbc:postgresql://localhost:5432/rw_development --env ATL_JDBC_USER=rw_dev --env ATL_JDBC_PASSWORD=rw_dev --env ATL_DB_DRIVER=org.postgresql.Driver --env ATL_DB_TYPE=postgres72 --link some-postgres:some-postgres --network devops_default atlassian/jira-software
But i am not sure localhost is accurate?
Cause i run docker on Windows so i have docker-for-windows VM.
When I open localhost:8080 i see:
Database: JIRA couldn't connect to your database
JIRA failed to establish a connection to your database.
This could be because:
Your database isn't running
The configuration of your dbconfig.xml file is incorrect (user, password, or database URL etc.)
There is a network issue between JIRA and your database (e.g. firewall, database doesn't allow remote access etc.)
I've tried also:
docker run -v jiraVolume:/var/atlassian/application-data/jira --name="jira" -d -p 8080:8080 --env ATL_JDBC_URL=jdbc:postgresql://postgres:5432/rw_development --env ATL_JDBC_USER=rw_dev --env ATL_JDBC_PASSWORD=rw_dev --env ATL_DB_DRIVER=org.postgresql.Driver --env ATL_DB_TYPE=postgres72 --link some-postgres:some-postgres --network devops_default atlassian/jira-software
And got the same error.
Update:
docker logs jira
INFO:root:Generating /opt/atlassian/jira/conf/server.xml from template server.xml.j2
INFO:root:Generating /etc/container_id from template container_id.j2
INFO:root:/var/atlassian/application-data/jira/dbconfig.xml exists; skipping.
INFO:root:User is currently root. Will change directory ownership to jira then downgrade permissions
INFO:root:Running Jira with command '/bin/su', arguments ['/bin/su', 'jira', '-c', '/opt/atlassian/jira/bin/start-jira.sh -fg']
executing as current user
`sMMMMMMMMMMMMMM+
MMMMMMMMMMMMMM
:sdMMMMMMMMMMM
MMMMMM
`sMMMMMMMMMMMMMM+ MMMMMM
MMMMMMMMMMMMMM +MMMMM
:sMMMMMMMMMMM MMMMM
MMMMMM `UOJ
`sMMMMMMMMMMMMM+ MMMMMM
MMMMMMMMMMMMMM +MMMMM
:sdMMMMMMMMMM MMMMM
MMMMMM `UOJ
MMMMMM
+MMMMM
MMMMM
`UOJ
Atlassian Jira
Version : 8.5.0
If you encounter issues starting or stopping JIRA, please see the Troubleshooting guide at https://docs.atlassian.com/jira/jadm-docs-085/Troubleshooting+installation
Using JIRA_HOME: /var/atlassian/application-data/jira
Server startup logs are located in /opt/atlassian/jira/logs/catalina.out
06-Nov-2019 10:08:17.722 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'proxyPort' to '' did not find a matching property.
06-Nov-2019 10:08:17.790 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.42
06-Nov-2019 10:08:17.790 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 4 2019 20:29:04 UTC
06-Nov-2019 10:08:17.790 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.42.0
06-Nov-2019 10:08:17.790 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
06-Nov-2019 10:08:17.791 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.9.184-linuxkit
06-Nov-2019 10:08:17.791 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
06-Nov-2019 10:08:17.791 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /opt/java/openjdk/jre
06-Nov-2019 10:08:17.791 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_232-b09
06-Nov-2019 10:08:17.791 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: AdoptOpenJDK
06-Nov-2019 10:08:17.791 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/atlassian/jira
06-Nov-2019 10:08:17.791 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/atlassian/jira
06-Nov-2019 10:08:17.791 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties
06-Nov-2019 10:08:17.792 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
06-Nov-2019 10:08:17.792 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms384m
06-Nov-2019 10:08:17.792 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx2048m
06-Nov-2019 10:08:17.792 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:InitialCodeCacheSize=32m
06-Nov-2019 10:08:17.792 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:ReservedCodeCacheSize=512m
06-Nov-2019 10:08:17.792 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
06-Nov-2019 10:08:17.792 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Datlassian.standalone=JIRA
06-Nov-2019 10:08:17.795 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
06-Nov-2019 10:08:17.795 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dmail.mime.decodeparameters=true
06-Nov-2019 10:08:17.796 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory
06-Nov-2019 10:08:17.796 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:-OmitStackTraceInFastThrow
06-Nov-2019 10:08:17.796 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.locale.providers=COMPAT
06-Nov-2019 10:08:17.796 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djira.home=/var/atlassian/application-data/jira
06-Nov-2019 10:08:17.796 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Datlassian.plugins.startup.options=-fg
06-Nov-2019 10:08:17.796 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
06-Nov-2019 10:08:17.796 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
06-Nov-2019 10:08:17.796 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
06-Nov-2019 10:08:17.797 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xloggc:/opt/atlassian/jira/logs/atlassian-jira-gc-%t.log
06-Nov-2019 10:08:17.797 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseGCLogFileRotation
06-Nov-2019 10:08:17.797 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:NumberOfGCLogFiles=5
06-Nov-2019 10:08:17.797 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:GCLogFileSize=20M
06-Nov-2019 10:08:17.799 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+PrintGCDetails
06-Nov-2019 10:08:17.799 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+PrintGCDateStamps
06-Nov-2019 10:08:17.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+PrintGCTimeStamps
06-Nov-2019 10:08:17.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+PrintGCCause
06-Nov-2019 10:08:17.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
06-Nov-2019 10:08:17.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/atlassian/jira
06-Nov-2019 10:08:17.801 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/atlassian/jira
06-Nov-2019 10:08:17.801 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/atlassian/jira/temp
06-Nov-2019 10:08:17.801 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
06-Nov-2019 10:08:17.903 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
06-Nov-2019 10:08:17.921 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 461 ms
06-Nov-2019 10:08:17.938 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
06-Nov-2019 10:08:17.938 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.42
06-Nov-2019 10:08:17.960 SEVERE [Catalina-startStop-1] org.apache.catalina.startup.HostConfig.beforeStart Unable to create directory for deployment: [/opt/atlassian/jira/conf/Catalina/localhost]
2019-11-06 10:08:20,927 localhost-startStop-1 INFO [c.a.jira.startup.JiraHomeStartupCheck] The jira.home directory '/var/atlassian/application-data/jira' is validated and locked for exclusive use by this instance.
2019-11-06 10:08:21,060 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger]
****************
JIRA starting...
****************
2019-11-06 10:08:21,157 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger]
___ Environment _____________________________
JIRA Build : 8.5.0#805000-sha1:facbf8be6a56ed8ab71dea158b6e159962506101
Build Date : Fri Oct 18 00:00:00 GMT 2019
JIRA Installation Type : Standalone
Application Server : Apache Tomcat/8.5.42 - Servlet API 3.1
Java Version : 1.8.0_232 - AdoptOpenJDK
Current Working Directory : /var/atlassian/application-data/jira
Maximum Allowable Memory : 1820MB
Total Memory : 656MB
Free Memory : 455MB
Used Memory : 201MB
Memory Pool: Code Cache : Code Cache: init = 33554432(32768K) used = 9386560(9166K) committed = 33554432(32768K) max = 536870912(524288K)
Memory Pool: Metaspace : Metaspace: init = 0(0K) used = 20512704(20031K) committed = 21102592(20608K) max = -1(-1K)
Memory Pool: Compressed Class Space : Compressed Class Space: init = 0(0K) used = 2344688(2289K) committed = 2490368(2432K) max = 1073741824(1048576K)
Memory Pool: PS Eden Space : PS Eden Space: init = 100663296(98304K) used = 184082824(179768K) committed = 402653184(393216K) max = 673710080(657920K)
Memory Pool: PS Survivor Space : PS Survivor Space: init = 16777216(16384K) used = 16754848(16362K) committed = 16777216(16384K) max = 16777216(16384K)
Memory Pool: PS Old Gen : PS Old Gen: init = 268435456(262144K) used = 9571752(9347K) committed = 268435456(262144K) max = 1431830528(1398272K)
JVM Input Arguments : -Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms384m -Xmx2048m -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT -Djira.home=/var/atlassian/application-data/jira -Datlassian.plugins.startup.options=-fg -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Xloggc:/opt/atlassian/jira/logs/atlassian-jira-gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -Dignore.endorsed.dirs= -Dcatalina.base=/opt/atlassian/jira -Dcatalina.home=/opt/atlassian/jira -Djava.io.tmpdir=/opt/atlassian/jira/temp
Java Compatibility Information : JIRA version = 8.5.0, Java Version = 1.8.0_232
___ Java System Properties _________________
atlassian.plugins.startup.options : -fg
atlassian.standalone : JIRA
awt.toolkit : sun.awt.X11.XToolkit
catalina.base : /opt/atlassian/jira
catalina.home : /opt/atlassian/jira
catalina.useNaming : true
common.loader : "${catalina.base}/lib",
"${catalina.base}/lib/*.jar",
"${catalina.home}/lib",
"${catalina.home}/lib/*.jar"
file.encoding : UTF-8
file.encoding.pkg : sun.io
ignore.endorsed.dirs :
java.awt.graphicsenv : sun.awt.X11GraphicsEnvironment
java.awt.headless : true
java.awt.printerjob : sun.print.PSPrinterJob
java.class.version : 52.0
java.home : /opt/java/openjdk/jre
java.io.tmpdir : /opt/atlassian/jira/temp
java.locale.providers : COMPAT
java.naming.factory.initial : org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs : org.apache.naming
java.protocol.handler.pkgs : org.apache.catalina.webresources
java.runtime.name : OpenJDK Runtime Environment
java.runtime.version : 1.8.0_232-b09
java.specification.name : Java Platform API Specification
java.specification.vendor : Oracle Corporation
java.specification.version : 1.8
java.util.concurrent.ForkJoinPool.common.threadFactory : org.apache.catalina.startup.SafeForkJoinWorkerThreadFactory
java.util.logging.config.file : /opt/atlassian/jira/conf/logging.properties
java.util.logging.manager : org.apache.juli.ClassLoaderLogManager
java.vendor : AdoptOpenJDK
java.vendor.url : http://java.oracle.com/
java.vendor.url.bug : http://bugreport.sun.com/bugreport/
java.version : 1.8.0_232
java.vm.info : mixed mode
java.vm.name : OpenJDK 64-Bit Server VM
java.vm.specification.name : Java Virtual Machine Specification
java.vm.specification.vendor : Oracle Corporation
java.vm.specification.version : 1.8
java.vm.vendor : AdoptOpenJDK
java.vm.version : 25.232-b09
jdk.tls.ephemeralDHKeySize : 2048
jira.home : /var/atlassian/application-data/jira
mail.mime.decodeparameters : true
org.apache.catalina.security.SecurityListener.UMASK : 0027
org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER : true
org.dom4j.factory : com.atlassian.core.xml.InterningDocumentFactory
os.arch : amd64
os.name : Linux
os.version : 4.9.184-linuxkit
package.access : sun.,
org.apache.catalina.,
org.apache.coyote.,
org.apache.jasper.,
org.apache.tomcat.
package.definition : sun.,
java.,
org.apache.catalina.,
org.apache.coyote.,
org.apache.jasper.,
org.apache.naming.,
org.apache.tomcat.
server.loader :
shared.loader :
sun.arch.data.model : 64
sun.boot.library.path : /opt/java/openjdk/jre/lib/amd64
sun.cpu.endian : little
sun.cpu.isalist :
sun.io.unicode.encoding : UnicodeLittle
sun.java.command : org.apache.catalina.startup.Bootstrap start
sun.java.launcher : SUN_STANDARD
sun.jnu.encoding : UTF-8
sun.management.compiler : HotSpot 64-Bit Tiered Compilers
sun.os.patch.level : unknown
tomcat.util.buf.StringCache.byte.enabled : true
tomcat.util.scan.StandardJarScanFilter.jarsToScan : log4j-taglib*.jar,
log4j-web*.jar,
log4javascript*.jar,
slf4j-taglib*.jar
tomcat.util.scan.StandardJarScanFilter.jarsToSkip : annotations-api.jar,
ant-junit*.jar,
ant-launcher.jar,
ant.jar,
asm-*.jar,
aspectj*.jar,
bootstrap.jar,
catalina-ant.jar,
catalina-ha.jar,
catalina-jmx-remote.jar,
catalina-storeconfig.jar,
catalina-tribes.jar,
catalina-ws.jar,
catalina.jar,
cglib-*.jar,
cobertura-*.jar,
commons-beanutils*.jar,
commons-codec*.jar,
commons-collections*.jar,
commons-daemon.jar,
commons-dbcp*.jar,
commons-digester*.jar,
commons-fileupload*.jar,
commons-httpclient*.jar,
commons-io*.jar,
commons-lang*.jar,
commons-logging*.jar,
commons-math*.jar,
commons-pool*.jar,
dom4j-*.jar,
easymock-*.jar,
ecj-*.jar,
el-api.jar,
geronimo-spec-jaxrpc*.jar,
h2*.jar,
hamcrest-*.jar,
hibernate*.jar,
httpclient*.jar,
icu4j-*.jar,
jasper-el.jar,
jasper.jar,
jaspic-api.jar,
jaxb-*.jar,
jaxen-*.jar,
jdom-*.jar,
jetty-*.jar,
jmx-tools.jar,
jmx.jar,
jsp-api.jar,
jstl.jar,
jta*.jar,
junit-*.jar,
junit.jar,
log4j*.jar,
mail*.jar,
objenesis-*.jar,
oraclepki.jar,
oro-*.jar,
servlet-api-*.jar,
servlet-api.jar,
slf4j*.jar,
taglibs-standard-spec-*.jar,
tagsoup-*.jar,
tomcat-api.jar,
tomcat-coyote.jar,
tomcat-dbcp.jar,
tomcat-i18n-*.jar,
tomcat-jdbc.jar,
tomcat-jni.jar,
tomcat-juli-adapters.jar,
tomcat-juli.jar,
tomcat-util-scan.jar,
tomcat-util.jar,
tomcat-websocket.jar,
tools.jar,
websocket-api.jar,
wsdl4j*.jar,
xercesImpl.jar,
xml-apis.jar,
xmlParserAPIs-*.jar,
xmlParserAPIs.jar,
xom-*.jar
user.country : US
user.dir : /var/atlassian/application-data/jira
user.home : /var/atlassian/application-data/jira
user.language : en
user.name : jira
user.timezone : GMT
06-Nov-2019 10:08:21.443 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
06-Nov-2019 10:08:21.452 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
06-Nov-2019 10:08:21.492 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 3570 ms
2019-11-06 10:08:21,582 JIRA-Bootstrap INFO [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from /var/atlassian/application-data/jira/dbconfig.xml
2019-11-06 10:08:21,665 JIRA-Bootstrap INFO [c.a.j.config.database.DatabaseConfigHandler] Trying to get encrypted password from xml and decrypt it
2019-11-06 10:08:21,678 JIRA-Bootstrap INFO [c.a.j.config.database.DatabaseConfigHandler] Database password decryption not performed.
2019-11-06 10:08:21,933 JIRA-Bootstrap INFO [c.a.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2019-11-06 10:08:21,934 JIRA-Bootstrap FATAL [c.a.jira.startup.JiraStartupLogger] Startup check failed. JIRA will be locked.
2019-11-06 10:08:21,991 JIRA-Bootstrap INFO [c.a.jira.startup.LauncherContextListener] Memory Usage:
---------------------------------------------------------------------------------
Heap memory : Used: 228 MiB. Committed: 913 MiB. Max: 2023 MiB
Non-heap memory : Used: 39 MiB. Committed: 63 MiB. Max: 1536 MiB
---------------------------------------------------------------------------------
TOTAL : Used: 267 MiB. Committed: 976 MiB. Max: 3559 MiB
---------------------------------------------------------------------------------
You should change :
ATL_JDBC_URL=jdbc:postgresql://localhost:5432/rw_development.
to :
ATL_JDBC_URL=jdbc:postgresql://172.17.0.1:5432/rw_development
Or 172.18.0.1
you may change this localhost:5432 to postgres:5432 in your ATL_JDBC_UR since localhost refer to jira docker and you already setup a network beteen them
In my case, I had to add special characters to my password. Evidently numbers and letters is not enough.

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.

404 Error while deploying simple web-app in JBoss AS 6 and JBoss AS 7?

I followed this blog for injecting EJB in REST layer.
Here is the code that I tried deploying in JBOSS AS 6 and 7 using Eclipse:
REST:
package com.example.rest;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
#Stateless
#Path("current")
public class ServiceFacade {
#EJB
ServiceImpl service;
#GET
public String getDate(){
return service.getCurrentDate().toString();
}
}
EJB:
import java.util.Date;
import javax.ejb.Stateless;
#Stateless
public class ServiceImpl {
public Date getCurrentDate(){
return new Date();
}
}
#ApplicationPath("rest")
public class RestApplication extends Application {
}
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample.rest</groupId>
<artifactId>restejb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>simplet project to test ejb injection in rest</description>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<packaging>war</packaging>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
when I access http://localhost:8080/restejb/rest/current, I get 404 page NOT found error.
Here is the log from deployment to JBOSS AS 6:
11:19:23,701 INFO [AbstractJBossASServerBase] Server Configuration:
JBOSS_HOME URL: file:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/
Bootstrap: $JBOSS_HOME/server/default/conf/bootstrap.xml
Common Base: $JBOSS_HOME/common/
Common Library: $JBOSS_HOME/common/lib/
Server Name: default
Server Base: $JBOSS_HOME/server/
Server Library: $JBOSS_HOME/server/default/lib/
Server Config: $JBOSS_HOME/server/default/conf/
Server Home: $JBOSS_HOME/server/default/
Server Data: $JBOSS_HOME/server/default/data/
Server Log: $JBOSS_HOME/server/default/log/
Server Temp: $JBOSS_HOME/server/default/tmp/
11:19:23,706 INFO [AbstractServer] Starting: JBossAS [6.1.0.Final "Neo"]
11:19:27,412 INFO [ServerInfo] Java version: 1.7.0_71,Oracle Corporation
11:19:27,412 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
11:19:27,413 INFO [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 24.71-b01,Oracle Corporation
11:19:27,413 INFO [ServerInfo] OS-System: Mac OS X 10.9.5,x86_64
11:19:27,414 INFO [ServerInfo] VM arguments: -Dprogram.name=JBossTools: JBoss AS 6.x -Xms256m -Xmx768m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.endorsed.dirs=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/lib/endorsed -Djava.library.path=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/bin/native -Dlogging.configuration=file:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/bin/logging.properties -Dfile.encoding=UTF-8
11:19:27,483 INFO [JMXKernel] Legacy JMX core initialized
11:19:35,849 INFO [AbstractServerConfig] JBoss Web Services - Stack CXF Server 3.4.1.GA
11:19:36,679 INFO [JSFImplManagementDeployer] Initialized 3 JSF configurations: [Mojarra-1.2, MyFaces-2.0, Mojarra-2.0]
11:19:47,865 WARNING [FileConfigurationParser] AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
11:19:48,389 INFO [JMXConnector] starting JMXConnector on host localhost:1090
11:19:48,609 INFO [MailService] Mail Service bound to java:/Mail
11:19:49,990 INFO [HornetQServerImpl] live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/data/hornetq/journal,bindingsDirectory=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/data/hornetq/bindings,largeMessagesDirectory=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/data/hornetq/largemessages,pagingDirectory=/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/data/hornetq/paging)
11:19:49,992 INFO [HornetQServerImpl] Waiting to obtain live lock
11:19:50,105 INFO [JournalStorageManager] Using NIO Journal
11:19:50,140 WARNING [HornetQServerImpl] Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to do this.
11:19:50,468 INFO [FileLockNodeManager] Waiting to obtain live lock
11:19:50,469 INFO [FileLockNodeManager] Live Server Obtained live lock
11:19:51,283 INFO [NettyAcceptor] Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5445 for CORE protocol
11:19:51,287 INFO [NettyAcceptor] Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5455 for CORE protocol
11:19:51,290 INFO [HornetQServerImpl] Server is now live
11:19:51,291 INFO [HornetQServerImpl] HornetQ Server version 2.2.5.Final (HQ_2_2_5_FINAL_AS7, 121) [251821f6-c6bb-11e4-9df3-60334b2115c1] started
11:19:51,386 INFO [WebService] Using RMI server codebase: http://localhost:8083/
11:19:51,699 INFO [jbossatx] ARJUNA-32010 JBossTS Recovery Service (tag: JBOSSTS_4_14_0_Final) - JBoss Inc.
11:19:51,711 INFO [arjuna] ARJUNA-12324 Start RecoveryActivators
11:19:51,745 INFO [arjuna] ARJUNA-12296 ExpiredEntryMonitor running at Tue, 10 Mar 2015 11:19:51
11:19:51,903 INFO [arjuna] ARJUNA-12310 Recovery manager listening on endpoint 127.0.0.1:4712
11:19:51,904 INFO [arjuna] ARJUNA-12344 RecoveryManagerImple is ready on port 4712
11:19:51,905 INFO [jbossatx] ARJUNA-32013 Starting transaction recovery manager
11:19:51,933 INFO [arjuna] ARJUNA-12163 Starting service com.arjuna.ats.arjuna.recovery.ActionStatusService on port 4713
11:19:51,934 INFO [arjuna] ARJUNA-12337 TransactionStatusManagerItem host: 127.0.0.1 port: 4713
11:19:51,937 INFO [arjuna] ARJUNA-12170 TransactionStatusManager started on port 4713 and host 127.0.0.1 with service com.arjuna.ats.arjuna.recovery.ActionStatusService
11:19:52,007 INFO [jbossatx] ARJUNA-32017 JBossTS Transaction Service (JTA version - tag: JBOSSTS_4_14_0_Final) - JBoss Inc.
11:19:52,103 INFO [arjuna] ARJUNA-12202 registering bean jboss.jta:type=ObjectStore.
11:19:52,481 INFO [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/bin/native
11:19:52,764 INFO [TomcatDeployment] deploy, ctxPath=/invoker
11:19:53,207 INFO [ModClusterService] Initializing mod_cluster 1.1.0.Final
11:19:53,286 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
11:19:53,308 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
11:19:53,322 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/jms-ra.rar/META-INF/ra.xml
11:19:53,347 INFO [HornetQResourceAdapter] HornetQ resource adaptor started
11:19:53,359 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/mail-ra.rar/META-INF/ra.xml
11:19:53,382 INFO [RARDeployment] Required license terms exist, view vfs:/Users/sridhar1982AQ/Documents/EE7_servers/jboss-6.1.0.Final/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
11:19:53,522 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: Thread-2
11:19:53,574 INFO [SchedulerSignalerImpl] Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
11:19:53,575 INFO [QuartzScheduler] Quartz Scheduler v.1.8.3 created.
11:19:53,579 INFO [RAMJobStore] RAMJobStore initialized.
11:19:53,583 INFO [QuartzScheduler] Scheduler meta-data: Quartz Scheduler (v1.8.3) 'JBossQuartzScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
11:19:53,583 INFO [StdSchedulerFactory] Quartz scheduler 'JBossQuartzScheduler' initialized from an externally opened InputStream.
11:19:53,583 INFO [StdSchedulerFactory] Quartz scheduler version: 1.8.3
11:19:53,584 INFO [QuartzScheduler] Scheduler JBossQuartzScheduler_$_NON_CLUSTERED started.
11:19:54,133 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
11:19:54,533 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
11:19:54,715 INFO [xnio] XNIO Version 2.1.0.CR2
11:19:54,733 INFO [nio] XNIO NIO Implementation Version 2.1.0.CR2
11:19:55,100 INFO [remoting] JBoss Remoting version 3.1.0.Beta2
11:19:55,279 INFO [TomcatDeployment] deploy, ctxPath=/
11:19:55,417 INFO [HornetQServerImpl] trying to deploy queue jms.queue.ExpiryQueue
11:19:55,462 INFO [HornetQServerImpl] trying to deploy queue jms.queue.DLQ
11:19:55,508 INFO [service] Removing bootstrap log handlers
11:19:55,616 INFO [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
11:19:55,624 INFO [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
11:19:55,625 INFO [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.1.0.Final "Neo"] Started in 31s:909ms
11:19:56,100 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/restejb
I am checking one of my projects using rest and in the annotation I use a slash / before the resource name both in #ApplicationPath("/rest") as in the rest service `#Path("/current"), so your EJB seems like must be something like:
#Stateless
#Path("/current")
public class ServiceImpl {
#GET
public Date getCurrentDate(){
return new Date();
}
}
And your activator class something like:
#ApplicationPath("/rest")
public class RestApplication extends Application {
}

Jetty slow startup... hibernate issue?

I'm running Jetty 8 with Eclipse. After a Java update this morning, JettyLauncher is now taking 6 minutes to start up, as opposed to 10 seconds before. Several of the delays seem to deal with Hibernate (I don't remember seeing too much about Hibernate when Jetty was running at a normal speed). Could anyone confirm or deny that hibernate is causing an issue with the JettyLauncher? Or otherwise pinpoint where this delay is coming from?
The Jetty launch delays the most during these lines in the console output:
5347 [main] INFO org.hibernate.validator.util.Version - Hibernate Validator 4.2.0.Final
...
74022 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
starting guide stats cache service
97089 [main] INFO org.springframework.beans.factory.config.PropertiesFactoryBean - Loading properties file from ServletContext resource [/WEB-INF/properties/build.properties]
118670 [main] INFO org.springframework.orm.hibernate3.HibernateTransactionManager - Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource#16bc6df1] of Hibernate SessionFactory for HibernateTransactionManager
CacheReportsJob.cacheGuideStats()
119649 [main] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 119133 ms
119661 [main] INFO org.eclipse.jetty.server.handler.ContextHandler - started o.e.j.w.WebAppContext{/,file:/C:/Users/MBeatty/Documents/Tortoise%20SVN/Beek%20Checkout%20v2/trunk/server/}
Oct 17, 2013 11:54:22 AM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.3 (FCS b02) for context ''
Oct 17, 2013 11:54:59 AM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Oct 17, 2013 11:55:43 AM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.2-SNAPSHOT
Oct 17, 2013 11:55:43 AM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.