Problems with first connection

Installation Forum (Inactive)
Problems with first connection alpha87  2014-05-22 09:13
Status: Closed
 
Dear all,

just installed LabKey on a Ubuntu Server (precise), but got stuck with an error that I really don't know where's coming from.

Trying to access domain-name:8080/labkey returns the following 500 error:

org/apache/AnnotationProcessor

java.lang.NoClassDefFoundError: org/apache/AnnotationProcessor
       at org.labkey.jsp.compiled.org.labkey.core.login.setPassword_jsp._jspInit(setPassword_jsp.java:29)
       at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
       at org.labkey.api.jsp.JspLoader.createPage(JspLoader.java:64)
       at org.labkey.api.view.JspView.<init>(JspView.java:77)
       at org.labkey.api.view.JspView.<init>(JspView.java:85)
       at org.labkey.core.login.LoginController$AbstractSetPasswordAction.getView(LoginController.java:844)
       at org.labkey.core.login.LoginController$InitialUserAction.getView(LoginController.java:1086)
       at org.labkey.core.login.LoginController$InitialUserAction.getView(LoginController.java:1028)
       at org.labkey.api.action.FormViewAction.handleRequest(FormViewAction.java:104)
       at org.labkey.api.action.FormViewAction.handleRequest(FormViewAction.java:75)
       at org.labkey.api.action.BaseViewAction.handleRequestInternal(BaseViewAction.java:178)
       at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
       at org.labkey.api.action.SpringActionController.handleRequest(SpringActionController.java:370)
       at org.labkey.api.module.DefaultModule.dispatch(DefaultModule.java:1007)
       at org.labkey.api.view.ViewServlet._service(ViewServlet.java:188)
       at org.labkey.api.view.ViewServlet.service(ViewServlet.java:122)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.labkey.api.data.TransactionFilter.doFilter(TransactionFilter.java:36)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.labkey.core.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:118)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.labkey.api.module.ModuleLoader.doFilter(ModuleLoader.java:1010)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.labkey.api.security.AuthFilter.doFilter(AuthFilter.java:182)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
       at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
       at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
       at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
       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:744)
Caused by: java.lang.ClassNotFoundException: org.apache.AnnotationProcessor
       at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
       ... 45 more

request attributes
LABKEY.StartTime = 1400774918893
LABKEY.container =
LABKEY.action = initialUser
org.springframework.web.servlet.DispatcherServlet.CONTEXT = org.springframework.web.context.support.XmlWebApplicationContext@785e7845: display name [Root WebApplicationContext]; startup date [Thu May 22 18:08:16 CEST 2014]; parent: org.springframework.web.context.support.XmlWebApplicationContext@be5214b
LABKEY.RequestURL = /labkey/login/initialUser.view?
LABKEY.OriginalURLHelper = /labkey/login/initialUser.view?
LABKEY.controller = login
X-LABKEY-CSRF = 22d6b89848aaaae9511e619b23fcbf55
LABKEY.Counter = 0
LABKEY.OriginalURL = http://domain-name:8080/labkey/login/initialUser.view?

core schema database configuration
Server URL    jdbc:postgresql://localhost:5432/labkey
Product Name    PostgreSQL
Product Version    9.1.13
Driver Name    PostgreSQL Native Driver
Driver Version    PostgreSQL 9.3 JDBC4.1 (build 1100).


Tomcat logs report a successful deployment:
May 22, 2014 6:08:13 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
May 22, 2014 6:08:13 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 875 ms
May 22, 2014 6:08:13 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 22, 2014 6:08:13 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat
May 22, 2014 6:08:13 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /etc/tomcat7/Catalina/localhost/labkey.xml
May 22, 2014 6:08:13 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug' to '0' did not find a matching property.
May 22, 2014 6:08:13 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Context/Loader} Setting property 'useSystemClassLoaderAsParent' to 'false' did not find a matching property.
May 22, 2014 6:08:13 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Deploying resources from exploded modules to web app directory...
May 22, 2014 6:08:14 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Module extraction and deployment complete.
May 22, 2014 6:08:14 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Cleaning up web app directory...
May 22, 2014 6:08:14 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Deleting unused file in web app directory: /usr/local/labkey/labkeywebapp/WEB-INF/attachments
May 22, 2014 6:08:14 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Web app directory cleanup complete.
May 22, 2014 6:08:14 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags/form is already defined
May 22, 2014 6:08:14 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
May 22, 2014 6:08:21 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 22, 2014 6:08:23 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 22, 2014 6:08:23 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 9676 ms



Any idea?
 
 
jeckels responded:  2014-05-22 09:20
The missing resource is usually in jasper.jar, which from the log information you posted would most likely be in the /var/lib/tomcat7/lib directory.

Can you check if that directory exists, and if so, what files it contains?

Also, how did you install Tomcat? Through the Ubuntu package manager, or via a direct download?

Thanks,
Josh
 
adam responded:  2014-05-22 09:30
This looks like a Tomcat 6 vs. Tomcat 7 issue. What version of LabKey Server did you deploy? Did you build from source or install from a pre-built distribution? What version of Tomcat are you running?

Adam
 
alpha87 responded:  2014-05-22 09:30
Dear jeckels,

thank you for your prompt response.

Tomcat was installed via aptitude.

The directory you refer to exists, and contains the following files:
common
conf -> /etc/tomcat7
logs -> ../../log/tomcat7
server
shared
temp -> /tmp/
webapps
work -> ../../cache/tomcat7


The jasper.jar file is not in that folder, but I've traced it in /usr/share/tomcat7/lib/jasper.jar.

Folder /usr/share/tomcat7/lib/ contains the following files/dirs:
annotations-api.jar -> ../../java/tomcat-annotations-api-7.0.26.jar
ant.jar
catalina-ant.jar -> ../../java/catalina-ant-7.0.26.jar
catalina-ha.jar -> ../../java/tomcat-catalina-ha-7.0.26.jar
catalina.jar
catalina-tribes.jar -> ../../java/catalina-tribes-7.0.26.jar
commons-dbcp.jar -> ../../java/commons-dbcp.jar
commons-pool.jar -> ../../java/commons-pool.jar
el-api.jar -> ../../java/tomcat-el-api-2.2.jar
jasper-el.jar -> ../../java/tomcat-jasper-el-7.0.26.jar
 jasper.jar -> ../../java/tomcat-jasper-7.0.26.jar
jsp-api.jar -> ../../java/tomcat-jsp-api-2.2.jar
-rw-r--r-- 1 tomcat7 tomcat7 317816 May 22 17:26 jtds.jar [COMING FROM LABKEY]
-rw-r--r-- 1 tomcat7 tomcat7 37306 May 22 17:26 labkeyBootstrap.jar [COMING FROM LABKEY]
-rw-r--r-- 1 tomcat7 tomcat7 507849 May 22 17:26 mail.jar [COMING FROM LABKEY]
-rw-r--r-- 1 tomcat7 tomcat7 802721 May 22 17:26 mysql.jar [COMING FROM LABKEY]
-rw-r--r-- 1 tomcat7 tomcat7 587064 May 22 17:26 postgresql.jar [COMING FROM LABKEY]
servlet-api.jar -> ../../java/tomcat-servlet-api-3.0.jar
tomcat-api.jar -> ../../java/tomcat-api-7.0.26.jar
tomcat-coyote.jar -> ../../java/tomcat-coyote-7.0.26.jar
tomcat-i18n-es.jar -> ../../java/tomcat-i18n-es-7.0.26.jar
tomcat-i18n-fr.jar -> ../../java/tomcat-i18n-fr-7.0.26.jar
tomcat-i18n-ja.jar -> ../../java/tomcat-i18n-ja-7.0.26.jar
tomcat-util.jar -> ../../java/tomcat-util-7.0.26.jar
 
alpha87 responded:  2014-05-22 09:33
adam,

LabKey 14.1, pre-build binaries. Tomcat Version: 7.0.26-1ubuntu1.2
 
alpha87 responded:  2014-05-22 10:23
Don't know if it's useful, but I found a discussion about a similar problem at the link http://markmail.org/thread/dy2zliylp7suw622#query:+page:1+mid:wtpjt6qe5fcgs3py+state:results

Seems old, but maybe helpful to sort out this thing!

Thank you!
 
adam responded:  2014-05-22 11:03
I see the problem... key is this line in the log fragment you posted:

  INFO: Starting Servlet Engine: Apache Tomcat

We expect Tomcat to report a version number; in my deployment, for example, this line is:

  INFO: Starting Servlet Engine: Apache Tomcat/7.0.52

The Tomcat version information is important, especially in LabKey Server 14.1 where we jumped through hoops to get our distribution supporting pre-compiled JSPs that run on both Tomcat 6 and Tomcat 7. The code is assuming you're running on Tomcat 6 and therefore expecting Tomcat to include AnnotationProcessor. (When we detect Tomcat 7 we substitute our own version of that interface.)

In short, 7.0.26 is a rather old version of Tomcat; if you upgrade to something more current (e.g., 7.0.53) then this problem should go away.

Adam
 
alpha87 responded:  2014-05-22 12:41
Hi again Adam,

the version number was proactively hidden by our IT staff securing the Tomcat sever, so this behavior does not depend on the tomcat version. Even if we update the server, we will likely end up with the same problem.

Is there a way to "convince" labkey that it's running on Tomcat 7 or we should seriously think of re-enabling the version number? In this case, which is the minimum string we should put? Something containing a 7 is enough?
 
adam responded:  2014-05-22 13:41
Interesting...

We try to avoid looking at the Tomcat version, but this was a case where we couldn't avoid it. Fortunately, I've removed this code for our next release. (14.2, scheduled for mid July, supports Tomcat 7 only.)

A quick test shows that "Apache Tomcat/7" should be sufficient. That seems like the best near-term solution.

You could probably revert to "Apache Tomcat" once you upgrade to 14.2.

Adam
 
alpha87 responded:  2014-05-22 14:21
Just set the string back, the systems work normally.

Thank you! Look forward to upgrade to 14.2!