OHDSI Home | Forums | Wiki | Github

WebApi: versions 2.8.1 \ 2.8.2 not starting

Hello everyone.
I’ve managed to build a war file for WebApi 2.8.2 without any error but, unfortunately, they are not starting properly on tomcat.
Server structure is: Windows Server 2019, SQL Server, Tomcat 10, everything installed and configured as described here:

SQL Server user is properly configured and connection tested

war file seems to deploy properly but not starting. The only log file info are the following:

27-Apr-2021 09:11:34.844 INFO [http-nio-8080-exec-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [E:\Apps\Tomcat 10.0\webapps\WebAPI.war]
27-Apr-2021 09:11:34.851 WARNING [http-nio-8080-exec-1] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Context] failed to set property [antiJARLocking] to [true]
27-Apr-2021 09:12:15.311 INFO [http-nio-8080-exec-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [E:\Apps\Tomcat 10.0\webapps\WebAPI.war] has finished in [40,467] ms

I already tried using webapi 2.8.1 but nothing changes.

Thanks in advance for any help

That’s just a warning, are you sure that the application does not start? If you open a browser and navivate to host:port/WebAPI/info do you get a response?

Thanks for your reply Chris. Yeah I’m quite sure …

HTTP Status 404 – Not Found
Type Status Report

Message The requested resource [/WebAPI/info] is not available

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/10.0.5

I found this information about that property: it’s something that existed in Tomcat 7.0, but removed in 8.0 (replaced with a different property):

You could edit the context.xml file found in src/main/webapp/META-INF to remove that attribute (antiJarLocking) and replace it with (antiResourceLocking)…the reason for this property is that we ran into problems where trying to redeploy the WAR after an update would fail due to some sort of resource lock on the filesystem, and we found this setting in Tomcat 7.0 fixed that problem.

Note, if you edit the file in /src/main…, you will need to rebuild the war and deploy again.

As far as your 404: I’m not sure. Are you sure you’re going to the right port? There are Tomcat logs you can go through to see if there’s any other failure to start the application…from your log message

27-Apr-2021 09:12:15.311 INFO [http-nio-8080-exec-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [E:\Apps\Tomcat 10.0\webapps\WebAPI.war] has finished in [40,467]

That means tomcat did deploy the WAR, but there may have been other failures when starting up the application that leads to the service to fail.

Thanks for your suggestion Chris and my apologies for my late reply.
Unfortunately, that didn’t solve the issue.
I’ve rebuild as suggested, undeployed and re-deployed WebApi

Log file:

06-May-2021 08:18:20.330 INFO [http-nio-8080-exec-19] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [E:\Apps\Tomcat 10.0\webapps\WebAPI.war]
06-May-2021 08:19:34.194 INFO [http-nio-8080-exec-19] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [E:\Apps\Tomcat 10.0\webapps\WebAPI.war] has finished in [73,863] ms

I’ve done Tomcat restart as well, still getting 404 not found.
Is there anything I can do to get some more detailed logging maybe?
Using a different Tomcat version might help? 10.0.5 installed on server at the moment.

Thanks in advance

I’m not sure which file you are getting the above log output, but in my enviornment, my log files are located here:

D:\Program Files\Apache Software Foundation\Tomcat 8.5\logs

And the file which has the stdout (which also reports errors) is tomcat8-stdout.{datestamp}.log. That should have output in it that has something like this:

2021-04-26 08:54:01 Commons Daemon procrun stdout initialized

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 :: Spring Boot ::       (v1.5.20.RELEASE)

2021-04-26 08:54:41.734 INFO localhost-startStop-1 org.ohdsi.webapi.WebApi -  - Starting WebApi on HOSTNAME with PID 3180 (started by HOSTNAME$ in D:\Program Files\Apache Software Foundation\Tomcat 8.5)

So, while you may be looking at a tomcat log that logs application deployment logging, there may be another log file which captures the output of the WAR. It might make sense for you to stop your tomcat service, delete all files in the /log folder so that it’s easier to find the right log file.

Hello Chris,
I’ve done a cleanup and those are my log files:

Also, I’ve tried to re-deploy but I haven’t got any error message so far

I think you should look in tomcat10-stdout… and see if you see anything related to WebAPI failing to start up (you should at least see the ‘Spring Boot’ banner appear…

I’ve checked every single log file but no messages so far.
Also, Sprint boot banner is not present in any file

How are you deploying this? Are you using the tomcat admin tool (it’s a URL something like {server}:{port}/host-manager/html: Details on this app is here.

On that page, it should show the WebAPI application, and it should have start/stop buttons. Does the application look started (ie: a started message or the start button is disabled)?

Hello Chris, I’m deploying using the admin tool @ http://localhost:8080/manager/html
Section: “WAR file to deploy”

WeApp looks like this:

Very confusing to me then: the manager app says the application is started (the start is disabled, the stop is enabled) so I am really at a loss as to why you see no output in your logs, and you do not get a response from /WebAPI/info. There are fa few other peple who have asked questions on the forums and in git about problems setting up WebAPI, and they have had issues with their local config, but they did eventually get the service responding, perhaps they can speak up here in this thread about troubleshooting this.

Hi @stefanou

Below are some ways I can think of to check if your webapi has been deployed properly.

After deploying WebAPI, do you see some tables newly created in the WebAPI schema of the OHDSI database? When it is first created by you, it is an empty schema. After deploying WebAPI, there will be some tables appear inside.

Also, you may try and check if WebAPI giving you response by clicking on the circled portion below and then adding ‘/info’ to the address of the page that pops up, e.g. if it brings you to http://localhost:8080/WebAPI, then add ‘/info’ will give ‘http://localhost:8080/WebAPI/info’ do you still get a 404 response?

Am not sure if its the Tomcat version 10, Tomcat 9 seems to work fine although Tomcat 8 is the recommended.

Best regards,
Hui Xing

1 Like

Hello Hui and thanks for posting.
Nope, I don’t see any table in the schema. I’ve also checked the activity using sql server profiler but it doesn’t even try to connect. The connection string is correct, I’ve already checked that several times.
Also, I’m still getting 404 at the info request.

I should try to move back to tomcat 8 as you pointed out, I’ll let you know

updating this issue: I’ve uninstalled Tomcat 10 and moved back to Tomcat 8 (8.5.66) and got it working properly using the same .war file.
Everything is up and running, tables have been created and /WebAPI/info reply as expected.
Definitely, a Tomcat10 issue which looks like to be not compatible at all.

Once again, thanks to Chris and Hui for helping