Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Deployment issues #1521

Closed
mastiles opened this issue Mar 10, 2017 · 11 comments
Closed

Deployment issues #1521

mastiles opened this issue Mar 10, 2017 · 11 comments

Comments

@mastiles
Copy link

Hi there,

I’m trying to install Web Apollo onto a lab’s server as part of my undergraduate project, but due to my lack of background in installation using Linux (or using Linux at all in fact) am having some issues.
For background, I’m installing it on a Linux Mint 17.3 OS using Web Apollo 2.0.6, Java 8 and Tomcat 7

At the moment I am having issues with two aspects.

Firstly, I don’t have a setenv.sh file, even when restarting Tomcat, or a catalina.sh file. I do have a file /etc/default/tomcat7 where I have pasted in the export CATALINA_OPTS=“…”; however there were no CATALINA_OPTS variables in there to begin with, and therefore I’m not sure if this will be picked up.

Additionally, I have run ./apollo deploy and produced a WAR file. I then moved it to ~/Apollo-2.0.6/web-app and renamed it to apollo.war; however when I then try to navigate to http://localhost:8080/apollo, I am getting an error from Tomcat: “HTTP Status 404 - /apollo/ the requested resource is not available.” I assume the war file must be in the wrong place, however I have moved it to multiple other places, such as ~/Apollo-2.0.6/target/work/webapps /var/lib/tomcat7/webapps and var/lib/tomcat7/webapps/apollo and the same error persists. I have also tried renaming it to Apollo.war, in case case matters. Where am I going wrong?

Finally, I’m trying to use Web Apollo as a database where members of a lab can annotate genomes of ~200 bacteria relevant to the lab, and export annotations and full genomes from this. Will the suggested memory settings be sufficient for this?

Thank you very much, and sorry for the barrage of questions - Web Apollo looks like a really exciting tool and I’m really keen to begin to use it properly!

Morgaine

@nathandunn
Copy link
Contributor

The apollo.war should go in:

/var/lib/tomcat7/webapps/apollo.war

Question: Did you configure an apollo-config.groovy file in your ~/Apollo-2.0.6 directory? If not, you'll need to do that so that it talks to a database. More info here. You can use the sample-postgres-apollo-config.groovy in the same directory as an example.

What I would do:

  1. turn of tomcat and verify that it is off (ps -ef | grep catalina)
    1.a confirm that nothing else is on the 8080 port (netstat -tan | grep LISTEN)
  2. rm -rf /var/lib/tomcat7/webapps/apollo*
  3. rm -rf ~/Apollo-2.0.6/web-app/apollo*
  4. ./apollo deploy
  5. cp ~/Apollo-2.0.6/target/apollo-2.0.6.war /var/lib/tomcat7/webapps/apollo.war
  6. turn on tomcat again
  7. if you get the same 404 error, post the log file here (/var/log/tomcat7/catalina.out)

Tomcat (if running) will open the .war file into a directory named apollo and it should work.

Nathan

@mastiles
Copy link
Author

mastiles commented Mar 10, 2017 via email

@mastiles
Copy link
Author

It still isn't working. I had set up a mysql server and changed username "" and password "" to "myusername" and "mypassword"; and then copied the sample-mysql-apollo-config.groovy to apollo-config.groovy.

This is the catalina.out file...

Mar 13, 2017 9:47:08 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 9:47:08 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 9:47:08 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 9:47:08 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 9:47:08 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 9:47:08 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 9:47:08 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 13, 2017 9:47:08 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 348 ms
Mar 13, 2017 9:47:08 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 13, 2017 9:47:08 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Mar 13, 2017 9:47:08 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Mar 13, 2017 9:47:09 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 13, 2017 9:47:09 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 638 ms
Mar 13, 2017 10:21:12 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Mar 13, 2017 10:21:12 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Mar 13, 2017 10:21:12 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Mar 13, 2017 10:21:12 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future
Mar 13, 2017 10:36:43 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 10:36:43 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 10:36:43 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 10:36:43 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 10:36:43 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 10:36:43 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Mar 13, 2017 10:36:44 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 13, 2017 10:36:44 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 280 ms
Mar 13, 2017 10:36:44 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 13, 2017 10:36:44 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Mar 13, 2017 10:36:44 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/apollo.war
Mar 13, 2017 10:36:51 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
Mar 13, 2017 10:36:51 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags/form is already defined
log4j:WARN No appenders could be found for logger (org.codehaus.groovy.grails.commons.cfg.ConfigurationHelper).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2017-03-13 10:36:53,903 [localhost-startStop-1] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedClassVersionError: org/grails/plugin/config/AbstractConfigHelper : Unsupported major.minor version 52.0 (unable to load class org.grails.plugin.config.AbstractConfigHelper) (unable to load class org.grails.plugin.config.DefaultConfigHelper)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsupportedClassVersionError: org/grails/plugin/config/AbstractConfigHelper : Unsupported major.minor version 52.0 (unable to load class org.grails.plugin.config.AbstractConfigHelper) (unable to load class org.grails.plugin.config.DefaultConfigHelper)
at java.lang.Class.privateGetDeclaredFields(Class.java:2509)
at java.lang.Class.getDeclaredFields(Class.java:1819)
... 5 more
2017-03-13 10:36:53,904 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedClassVersionError: org/grails/plugin/config/AbstractConfigHelper : Unsupported major.minor version 52.0 (unable to load class org.grails.plugin.config.AbstractConfigHelper) (unable to load class org.grails.plugin.config.DefaultConfigHelper)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedClassVersionError: org/grails/plugin/config/AbstractConfigHelper : Unsupported major.minor version 52.0 (unable to load class org.grails.plugin.config.AbstractConfigHelper) (unable to load class org.grails.plugin.config.DefaultConfigHelper)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsupportedClassVersionError: org/grails/plugin/config/AbstractConfigHelper : Unsupported major.minor version 52.0 (unable to load class org.grails.plugin.config.AbstractConfigHelper) (unable to load class org.grails.plugin.config.DefaultConfigHelper)
at java.lang.Class.privateGetDeclaredFields(Class.java:2509)
at java.lang.Class.getDeclaredFields(Class.java:1819)
... 5 more
2017-03-13 10:36:53,905 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing Grails: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedClassVersionError: org/grails/plugin/config/AbstractConfigHelper : Unsupported major.minor version 52.0 (unable to load class org.grails.plugin.config.AbstractConfigHelper) (unable to load class org.grails.plugin.config.DefaultConfigHelper)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.UnsupportedClassVersionError: org/grails/plugin/config/AbstractConfigHelper : Unsupported major.minor version 52.0 (unable to load class org.grails.plugin.config.AbstractConfigHelper) (unable to load class org.grails.plugin.config.DefaultConfigHelper)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsupportedClassVersionError: org/grails/plugin/config/AbstractConfigHelper : Unsupported major.minor version 52.0 (unable to load class org.grails.plugin.config.AbstractConfigHelper) (unable to load class org.grails.plugin.config.DefaultConfigHelper)
at java.lang.Class.privateGetDeclaredFields(Class.java:2509)
at java.lang.Class.getDeclaredFields(Class.java:1819)
... 5 more
Mar 13, 2017 10:36:53 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Mar 13, 2017 10:36:53 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/apollo] startup failed due to previous errors
Mar 13, 2017 10:36:53 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Mar 13, 2017 10:36:54 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 13, 2017 10:36:54 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 9831 ms

@nathandunn
Copy link
Contributor

nathandunn commented Mar 13, 2017 via email

@mastiles
Copy link
Author

mastiles commented Mar 13, 2017

I think I already have done this... my /etc/default/tomcat7 file reads:

# Run Tomcat as this user ID. Not setting this or leaving it blank will use the
# default of tomcat7.
TOMCAT7_USER=tomcat7

# Run Tomcat as this group ID. Not setting this or leaving it blank will use
# the default of tomcat7.
TOMCAT7_GROUP=tomcat7

# The home directory of the Java development kit (JDK). You need at least
# JDK version 1.5. If JAVA_HOME is not set, some common directories for 
# OpenJDK, the Sun JDK, and various J2SE 1.5 versions are tried.
#JAVA_HOME=/usr/lib/jvm/java-8-oracle

# You may pass JVM startup parameters to Java here. If unset, the default
# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
#
# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
# response time). If you use that option and you run Tomcat on a machine with
# exactly one CPU chip that contains one or two cores, you should also add
# the "-XX:+CMSIncrementalMode" option.
JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"

# To enable remote debugging uncomment the following line.
# You will then be able to use a java debugger on port 8000.
#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

# Java compiler to use for translating JavaServer Pages (JSPs). You can use all
# compilers that are accepted by Ant's build.compiler property.
#JSP_COMPILER=javac

# Use the Java security manager? (yes/no, default: no)
#TOMCAT7_SECURITY=no

# Number of days to keep logfiles in /var/log/tomcat7. Default is 14 days.
#LOGFILE_DAYS=14
# Whether to compress logfiles older than today's
#LOGFILE_COMPRESS=1

# Location of the JVM temporary directory
# WARNING: This directory will be destroyed and recreated at every startup !
#JVM_TMP=/tmp/tomcat7-temp

# If you run Tomcat on port numbers that are all higher than 1023, then you
# do not need authbind.  It is used for binding Tomcat to lower port numbers.
# NOTE: authbind works only with IPv4.  Do not enable it when using IPv6.
# (yes/no, default: no)
#AUTHBIND=no

export CATALINA_OPTS="-Xms512m -Xmx1g \
        -XX:+CMSClassUnloadingEnabled \
        -XX:+CMSPermGenSweepingEnabled \
        -XX:+UseConcMarkSweepGC \
        -XX:MaxPermSize=256m"

@nathandunn
Copy link
Contributor

I would try to remove jdk 7 / java 7 and that will likely fix your problem (it is deprecated anyway) and you won't have to set anything (I think), such that only jdk8 is available.

If it doesn't fix it, then add this either to the tomcat above (whatever directory your JDK is in) or in your .bashrc / .project file.

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/  # or set in .bashrc / .project

@mastiles
Copy link
Author

mastiles commented Mar 13, 2017

I removed java 7, and turned off tomcat. When I attempted to restart tomcat it stated that java path needed to be set, so I added JAVA_HOME=/usr/lib/jvm/java-8-oracle to my /etc/default/tomcat7 file. Tomcat then started again, and I navigated to http://localhost:8080/apollo, but it still did not work. Navigating to http://localhost:8080 took me to the "If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!" page, however.

I then deleted the war file and redeployed but still to no avail.

I don't know if it's relevant, but I had to do all of the deleting of files and copying the war file in sudo. (maybe not relevant because Tomcat has a separate user?)

I couldn't find a .bashrc or .project file...

@nathandunn
Copy link
Contributor

@mastiles Sorry, a bit of a trial by fire with Linux.

I think that if you used sudo, the permissions might be wrong, but we'll see.

if you type (to wherever your webapps directory is:

ls -ltrca /var/lib/tomcat7/webapps/

webapps should be owned by the user tomcat or tomcat7. If not you need to use chown to set it to that user/group.

If it was set correctly then:

  • what is in the webapps directory? (you should see an apollo.war file and an apollo directory)
  • what is in the logs now on restart?
  • what is on the screen?

It also wouldn't hurt to have JAVA_HOME point to the JDK (something with the words JDK in it in the same directory JAVA_HOME=/usr/lib/jvm/java-8-jdk-oracle) instead of the JRE.

@mastiles
Copy link
Author

mastiles commented Mar 13, 2017

It looks like tomcat7 does own it...

ls -ltrca /var/lib/tomcat7/webapps/
total 139712
drwxr-xr-x 3 root root 4096 Mar 13 09:47 ROOT
-rw-r--r-- 1 root root 143045830 Mar 13 16:53 apollo.war
drwxr-xr-x 7 root root 4096 Mar 13 16:54 ..
drwxrwxr-x 4 tomcat7 tomcat7 4096 Mar 13 16:54 .
drwxr-xr-x 12 tomcat7 tomcat7 4096 Mar 13 16:54 apollo

Is this the case (indicated by the tomcat7 tomcat7 next to the . ?

If not, what do I need to change (and how?!)

In /var/lib/tomcat7/webapps is: apollo apollo.war ROOT

I've attached the log file
catalina_out.txt

I've screenshotted what is on the screen

screenshot at 2017-03-13 17 50 06

There doesn't seem to be anything in the jre folder with jdk in it (although there is java-6-openjdk-amd64 and java-7-openjdk-amd64, which is odd because these do not show up when I input sudo update-alternatives --config java) - I downloaded java via the ppa:webupd8team/java then install oracle-java8-installer if that makes a difference?

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

I really appreciate all your help, thank you

@nathandunn
Copy link
Contributor

@mastiles You're close! Its having issuing connecting to the datasource:

2017-03-13 16:28:28,591 [localhost-startStop-1] ERROR pool.ConnectionPool  - Unable to create initial connections of pool.
java.sql.SQLException: Access denied for user 'beebylab'@'localhost' (using password: YES)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)

Did you look at this?

http://genomearchitect.readthedocs.io/en/stable/ExampleBuild.html

Your apollo-config.groovy should contain the proper password. Make sure you can connect with that.

@mastiles
Copy link
Author

Sorted!

I followed the link and created a user for the mysql database and granted permissions (and stored the config file outside of the source tree) and it's up and running!

Thank you so much for all of your help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants