logicahealth / InfoButtons

Infobuttons are context-sensitive links embedded in the electronic health record (EHR). They use clinical context information from the EHR, such as patient demographics, medications, diagnoses, user role, and clinical setting to help find answers to clinicians' and patients' questions using online health information resources.
28 stars 29 forks source link

ERROR during final startup. #26

Open jxfish2 opened 5 years ago

jxfish2 commented 5 years ago

I finally managed to work through all of the errors, up to the very last section, where I need to deploy the WAR file.

I installed Tomcat, and configured it to run as a service.

I copied the WAR file to the /opt/tomcat/webapps directory.

I can start Tomcat just fine at this point, but when I attempt to access the URL, it times out.

Note that I can get to the base Tomcat directory just fine... It works... :

http://:8080

But, when I attempt to add any other URL identification, the request times out:

http://:8080/infobutton-service/app/index.html

http://:8080/infobutton-service/OpenInfobuttonDemo.html

I then decided to try your alternative method, by invoking with the "mvn clean" command, from within the /opt/InfoButtons/oib-request directory structure, because this is where one of the "pom.xml" files is located:


mvn -e -X clean tomcat:run-war -Ddatasource1.password=mypass -Ddatasource2.password=mypass -DskipTests 2>&1 > Maven_Start_Errors.log

With this start method, I am getting errors again, but they are slightly different, and fewer.

Here are the "ERROR" excerpts from the log file:

Jan 31, 2019 4:21:17 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart Jan 31, 2019 4:21:17 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/oib-request-service] startup failed due to previous errors Jan 31, 2019 4:21:17 PM org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext Jan 31, 2019 4:21:17 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/oib-request-service] registered the JBDC driver [com.mysql.fabric.jdbc.FabricMySQLDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Jan 31, 2019 4:21:17 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/oib-request-service] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Jan 31, 2019 4:21:17 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/oib-request-service] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for oib-request 2.3-SNAPSHOT: [INFO] [INFO] oib-request ........................................ SUCCESS [ 0.404 s] [INFO] oib-profile-schema ................................. SUCCESS [ 4.739 s] [INFO] oib-service-test ................................... SUCCESS [ 0.415 s] [INFO] oib-request-schema ................................. SUCCESS [ 0.974 s] [INFO] OIB Core Utility Module ............................ SUCCESS [ 0.456 s] [INFO] oib-valueset-matcher ............................... SUCCESS [ 0.507 s] [INFO] oib-request-db ..................................... SUCCESS [ 0.883 s] [INFO] oib-request-inference-rxnorm ....................... SUCCESS [ 0.343 s] [INFO] oib-ext-resources .................................. SUCCESS [ 0.646 s] [INFO] oib-request-service ................................ FAILURE [ 10.380 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20.204 s [INFO] Finished at: 2019-01-31T16:21:17-05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run-war (default-cli) on project oib-request-service: Could not start Tomcat: Protocol handler initialization failed: java.net.BindException: Address already in use (Bind failed) :8080 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run-war (default-cli) on project oib-request-service: Could not start Tomcat

at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

[ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :oib-request-service Exception in thread "pool-1-thread-1" java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/ParameterizedMessage

Note that I am running this

aniskand commented 5 years ago

So the error you linked is because Tomcat is already running as a service on that server, so port 8080 won't be available to start up a second instance. What we need to figure out is why you can't access the infobutton-service URLs on the first Tomcat instance. It's usually due to the database credentials set in the POM not being correct. but you'll have to look at the Tomcat catalina.out log to know for sure.

jxfish2 commented 5 years ago

Is there a default database login ID and password?

Or, do I simply create my own database login ID and password, then plug them into the pom.xml?

aniskand commented 5 years ago

It really depends on how you installed MySQL/mariadb. Normally, it will ask you to set a default administrator/root account and a password during installation.

jxfish2 commented 5 years ago

But, should I use the administrator account inside of the pom.xml file, or some other userID, at a different level of authentication?

aniskand commented 5 years ago

Well, ideally you would create a "service user" that only has read/write access to the OIB databases and tables. That's really just a convention for security purposes though, technically, the administrator account will work.

jxfish2 commented 5 years ago

Thanks

jxfish2 commented 5 years ago

Ok, a few more MySQL questions now:

1) For this application, we can create a generic user such as 'genusr'@'localhost', or we can create a generic user, using a FQDN (Fully Qualified Domain Name). For purposes of this InfoButtons installation, which one is better?

2) You mentioned in a previous post that this user only needed read/write access to the OIB databases. Does this mean I need to create this user, and associate the user to each of the existing databases? Screen capture from a current listing of available databases:

mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | resource_profile | | sys | | valueset_and_log | +--------------------+ 6 rows in set (0.03 sec)

3) Since the MySQL grant command does not use "read/write", which options should I assign to this functional user?

SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, or something else ???

And, do I need to run the GRANT command against every database listed above?

jxfish2 commented 5 years ago

Please note that I asked the above questions, because I am NOT a DBA, or by any means a MySQL expert.

Since we will be communicating with this database, from a remote server, and since this server will be redirecting to external document sites, I would prefer to set it up as you did.

With the exception of actual account names, I want this server to be as close to what you have in place, as possible.

I've already gone through the MySQL reference materials, but there are a lot of different things that "can" be done.

I just want to know what you recommend, so that we can get this up and running today.

I really need to get this finished today.

Thanks for any assistance and recommendations you can give me.

aniskand commented 5 years ago

So when you do the GRANT command, I would use the wildcard rather than a specific domain name, that would allow administration using that user from a separate server. It would look something like 'user'@'%'. You could also just use GRANT ALL , rather than individual commands. It only needs to be done for the 'resource_profile' and 'valueset_and_log' databases. The rest are used by mysql itself and aren't part of OIB.

jxfish2 commented 5 years ago

Thanks Andrew. That helps.

I do have another question... Sorry...

In your documentation, you note 2 different ways to startup services, but I did not see any specific way to stop services.

Is it as simple as stopping the MySQL server and Tomcat?

Or is there a "Maven" command that needs to be run also?

Thanks in advance, and have a great weekend.

jxfish2 commented 5 years ago

I am a systems engineer, so if I know the sequence of steps that need to be followed to both startup and shutdown the application, I can create a service for it, to start and stop everything programatically.

I am just not a DBA...

Just an FYI...

I was able to start everything successfully, after creating the user ID, and after populating the pom.xml file.

But, for some reason, I still can not get to the webpages.

aniskand commented 5 years ago

Actually, since I changed the service layer to use Spring's DispatcherServlet, I'm no longer loading those web pages as part of the main OIB service. They have been integrated into LITE instead.

As for starting/stopping Tomcat, you can use Linux's service manager or call startup.sh/shudown.sh directly. If it's installed as service, the former is better. You don't need to do anything with maven at that point, it's just used to build the deployment artifact.

jxfish2 commented 5 years ago

Hi Andrew,

I can now get to the base Tomcat GUI, and to the base .../app/index.html webpage.

Here is a screenshot of where I am currently.

Does this look correct to you?

I can not seem to get to the OpenInfobuttonDemo.html webpage though.

image

aniskand commented 5 years ago

I think you started up the wrong project. LITE is under the oib-site-lite-ui folder in the repository.

jxfish2 commented 5 years ago

Good morning Andrew.

To be honest, I'm not sure what I need.

I need the full function application, where we tie in our backend health system, press the little blue icon from within our application, which sends the request to the InfoButtons server, and then to the 3rd party, external document repositories.

In the past, I only used the LITE GUI to configure the 3rd party document repositories, and to test connectivity.

But, if that is all I need for my backend systems to connect, I'm happy with that.

So, from where I'm at right now, can you tell me what I need to do next?

Help!!! Ahhh...

I will be SOOOO happy, when you finally port this application to a Docker container.

aniskand commented 5 years ago

Well you definitely need LITE to be able to configure which knowledge resources you're using. Right now you've got the manager running with a blank resource profile database, so any requests will just return a blank response.

After you get LITE up and running, you can install the resource profiles and configure your organization's OID. The guide for that is here,

http://www.openinfobutton.org/documentation/lite-users-guide

jxfish2 commented 5 years ago

I'm still getting the same exact URL screen, and I followed all of the instructions in the above guide, and in the inline buildguide.

I can hit the URL, but I don't see any tabs or dropdown menu's.

What could I be missing, that the LITE GUI is not populating these tabs and dropdowns.

Once I get the tabs and dropdowns to show, I am quite familiar with how to configure providers and OUR OIB.

For now, I need help to figure out why the LITE GUI is not populating correctly, and why there are no menu's or dropdowns.

aniskand commented 5 years ago

It doesn't look like you're actually running LITE. I'm not even sure where that /app/index.html is coming from, it's not part of the OIB manager server. LITE is this project in the repository,

https://github.com/VHAINNOVATIONS/InfoButtons/tree/2.3-SNAPSHOT/oib-site-lite-ui