ModuleLoader init NullPointerException

Installation Forum (Inactive)
ModuleLoader init NullPointerException ymei  2011-11-14 06:26
Status: Closed
 
Hello there,

I tried to install labkey server in both OpenSuse and UBUNTU. However, for both systems, after I restarted the tomcat server, I got "The requested resource () is not available." from the browser when accessing http://...:8080/labkey. I saw the following errors from log files.

in labkey.log

ERROR ModuleLoader 2011-11-14 11:24:36,677 main : Failure occurred during ModuleLoader init.
java.lang.NullPointerException
        at org.labkey.api.module.ModuleLoader.doInit(ModuleLoader.java:294)
        at org.labkey.api.module.ModuleLoader.init(ModuleLoader.java:215)
        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
        at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
        at org.apache.catalina.core.StandardService.start(StandardService.java:525)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)


in catalina.out:

Nov 14, 2011 11:24:35 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor labkey.xml
Nov 14, 2011 11:24:36 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Nov 14, 2011 11:24:36 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/labkey] startup failed due to previous errors

in localhost.2011-11-14.log

Nov 14, 2011 11:24:36 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter Set Character Encoding
java.lang.ClassNotFoundException: org.labkey.core.filters.SetCharacterEncodingFilter
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
        at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
        at org.apache.catalina.core.StandardService.start(StandardService.java:519)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Nov 14, 2011 11:24:36 AM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext

What are the possible causes? Your timely help will be appreciated!

Thanks,
Yongguo
 
 
Brian Connolly responded:  2011-11-14 10:08
Yongguo,

There are a few possible causes. It could be:

1) you are running the incorrect version of JAVA. You must use SUN/ORACLE JAVA 1.6.x. If your server has SUN/ORACLE JAVA and openJAVA installed, you must make sure that the tomcat server is being started by the correct JVM.

2) The permissions on LABKEY_HOME directory are incorrect. The user running the tomcat server needs read/write access to all files in the LABKEY_HOME directory. The LABKEY_HOME directory is the directory where you installed the modules, labkeywebapp, etc directory.

In order to assist you in troubleshooting this problem, can you send me the additional information

1) What versions of OpenSUSE and UBUNTU did you attempt to install LabKey on.

2) How did you install the LabKey server. Did you follow the installation instructions on http://www.labkey.org or did you use a different method.

2) Can you please attach a copy of the catalina.out, labkey.log and localhost.2011* log files. These may contain further information about these errors.

-Brian
 
ymei responded:  2011-11-14 11:21
Hi Brian,

Thanks for your help. Indeed I only installed OpenJAVA. I installed a while ago Sun/JAVA 1.6.0_29 and them set "export JAVA_HOME=/usr/local/jdk1.6.0_29". I then restarted the tomcat, but still got the same error.

The system has OpenSUSE 11.4 32bit and Tomcat6. I mostly followed the instructions from the labkey website except that not all the binaries for $LABKEY_HOME/bin are compiled. I have set the $labkey_Home to 777. But it does not help.

The logs are attached. Please advise whatelse we can do make the labkey server running.

Thanks,
Yongguo
 
jeckels responded:  2011-11-14 11:45
Hi Yongguo,

I assume that you're running version 11.2.

These error messages indicate that the server is having trouble extracting resources from the Core module. Other modules may have similar issues.

First, please verify that your labkey.xml file includes the line:

    <Loader loaderClass="org.labkey.bootstrap.LabkeyServerBootstrapClassLoader" useSystemClassLoaderAsParent="false" />

and that you have copied labkeyBootstrap.jar to <TOMCAT_HOME>/lib.

Second, it sounds like you've already configured permissions, but the user that is starting up Tomcat will need to be able to create directories and write files into them under the <LABKEY_HOME>/modules directory.

Thanks,
Josh
 
ymei responded:  2011-11-14 12:52
Hi Josh,

I have checked the two places you pointed out but do not see any obvious issue. I restarted the machine and still saw the same error. The OpenSUSE is 11.4 from /etc/SuSE-release

What else could I check?

Thanks a lot,
Yongguo



/usr/share/tomcat6/conf/Catalina/localhost/labkey.xml

<Loader loaderClass="org.labkey.bootstrap.LabkeyServerBootstrapClassLoader" useSystemClassLoaderAsParent="false" />


/usr/local> ls -l
total 44
drwxr-xr-x 2 root root 4096 Nov 13 23:34 bin
drwxr-xr-x 2 root root 4096 Feb 18 2011 games
drwxr-xr-x 3 root root 4096 Nov 13 18:53 include
drwxr-xr-x 10 root root 4096 Nov 14 13:36 jdk1.6.0_29
drwxrwxrwx 8 root root 4096 Nov 13 16:49 labkey
drwxr-xr-x 4 root root 4096 Nov 13 23:34 lib
drwxr-xr-x 12 root root 4096 Nov 7 13:26 man
drwxr-xr-x 13 root root 4096 Nov 14 13:37 netbeans-7.0.1
drwxr-xr-x 2 root root 4096 Feb 18 2011 sbin
drwxr-xr-x 4 root root 4096 Nov 13 18:53 share
drwxr-xr-x 2 root root 4096 Feb 18 2011 src

/usr/local> ls -l labkey
total 44
drwxr-xr-x 2 root root 4096 Nov 13 23:50 bin
drwxr-xr-x 2 root root 4096 Nov 13 16:49 common-lib
drwxrwxrwx 15 root root 4096 Nov 14 15:31 labkeywebapp
-rw-r--r-- 1 root root 2800 Nov 13 16:49 labkey.xml
drwxrwxrwx 26 root root 4096 Nov 14 01:06 modules
drwxr-xr-x 2 root root 4096 Nov 13 16:49 pipeline-lib
-rw-r--r-- 1 root root 539 Nov 13 16:49 README.txt
drwxr-xr-x 2 root root 4096 Nov 13 16:49 server-lib
-rwxr--r-- 1 root root 10397 Nov 13 16:49 upgrade.sh

/usr/share/tomcat6/lib> ls -l
total 8120
-rw-r--r-- 1 root root 15237 Sep 16 10:11 annotations-api-6.0.32.jar
lrwxrwxrwx 1 root root 26 Nov 13 16:27 annotations-api.jar -> annotations-api-6.0.32.jar
-rwxrwxrwx 1 root root 1289806 Nov 13 16:50 ant.jar
-rw-r--r-- 1 root root 1216868 Sep 16 10:11 catalina-6.0.32.jar
-rw-r--r-- 1 root root 53756 Sep 16 10:11 catalina-ant-6.0.32.jar
lrwxrwxrwx 1 root root 23 Nov 13 16:27 catalina-ant.jar -> catalina-ant-6.0.32.jar
-rw-r--r-- 1 root root 129895 Sep 16 10:11 catalina-ha-6.0.32.jar
lrwxrwxrwx 1 root root 22 Nov 13 16:27 catalina-ha.jar -> catalina-ha-6.0.32.jar
lrwxrwxrwx 1 root root 19 Nov 13 16:27 catalina.jar -> catalina-6.0.32.jar
-rw-r--r-- 1 root root 237318 Sep 16 10:11 catalina-tribes-6.0.32.jar
lrwxrwxrwx 1 root root 26 Nov 13 16:27 catalina-tribes.jar -> catalina-tribes-6.0.32.jar
lrwxrwxrwx 1 root root 47 Nov 13 16:27 [commons-collections-tomcat5].jar -> /usr/share/java/commons-collections-tomcat5.jar
-rw-r--r-- 1 root root 24575 Sep 16 10:12 commons-collections-tomcat5.jar
lrwxrwxrwx 1 root root 40 Nov 13 16:27 [commons-dbcp-tomcat5].jar -> /usr/share/java/commons-dbcp-tomcat5.jar
-rw-r--r-- 1 root root 122680 Sep 16 10:12 commons-dbcp-tomcat5.jar
lrwxrwxrwx 1 root root 40 Nov 13 16:27 [commons-pool-tomcat5].jar -> /usr/share/java/commons-pool-tomcat5.jar
-rw-r--r-- 1 root root 48438 Sep 16 10:12 commons-pool-tomcat5.jar
lrwxrwxrwx 1 root root 23 Nov 13 16:27 [ecj].jar -> /usr/share/java/ecj.jar
-rw-r--r-- 1 root root 1375858 Sep 16 10:12 ecj.jar
-rw-r--r-- 1 root root 546588 Sep 16 10:11 jasper-6.0.32.jar
-rw-r--r-- 1 root root 112538 Sep 16 10:11 jasper-el-6.0.32.jar
lrwxrwxrwx 1 root root 20 Nov 13 16:27 jasper-el.jar -> jasper-el-6.0.32.jar
lrwxrwxrwx 1 root root 17 Nov 13 16:27 jasper.jar -> jasper-6.0.32.jar
-rwxrwxrwx 1 root root 302284 Nov 13 16:50 jtds.jar
-rwxrwxrwx 1 root root 35849 Nov 13 16:51 labkeyBootstrap.jar
-rwxrwxrwx 1 root root 494975 Nov 13 16:50 mail.jar
-rwxrwxrwx 1 root root 787920 Nov 13 16:50 mysql.jar
-rwxrwxrwx 1 root root 547769 Nov 13 16:50 postgresql.jar
lrwxrwxrwx 1 root root 32 Nov 13 16:27 tomcat6-el-1.0-api-6.0.32.jar -> ../tomcat6-el-1.0-api-6.0.32.jar
lrwxrwxrwx 1 root root 33 Nov 13 16:27 tomcat6-jsp-2.1-api-6.0.32.jar -> ../tomcat6-jsp-2.1-api-6.0.32.jar
lrwxrwxrwx 1 root root 37 Nov 13 16:27 tomcat6-servlet-2.5-api-6.0.32.jar -> ../tomcat6-servlet-2.5-api-6.0.32.jar
-rw-r--r-- 1 root root 765004 Sep 16 10:11 tomcat-coyote-6.0.32.jar
lrwxrwxrwx 1 root root 24 Nov 13 16:27 tomcat-coyote.jar -> tomcat-coyote-6.0.32.jar
-rw-r--r-- 1 root root 70034 Sep 16 10:11 tomcat-i18n-es-6.0.32.jar
lrwxrwxrwx 1 root root 25 Nov 13 16:27 tomcat-i18n-es.jar -> tomcat-i18n-es-6.0.32.jar
-rw-r--r-- 1 root root 51971 Sep 16 10:11 tomcat-i18n-fr-6.0.32.jar
lrwxrwxrwx 1 root root 25 Nov 13 16:27 tomcat-i18n-fr.jar -> tomcat-i18n-fr-6.0.32.jar
-rw-r--r-- 1 root root 55036 Sep 16 10:11 tomcat-i18n-ja-6.0.32.jar
lrwxrwxrwx 1 root root 25 Nov 13 16:27 tomcat-i18n-ja.jar -> tomcat-i18n-ja-6.0.32.jar
 
Brian Connolly responded:  2011-11-14 13:29
Yongguo,

It looks like you have installed Tomcat using the package manager is that correct?

LabKey Server 11.2 has not been tested with Tomcat installed via the package manager, only from source. So debugging this problem may take a little bit longer.

How are you starting the tomcat server? Are you running /etc/init.d/tomcat6 start? Or a different method? If you are using the start script, I recommend changing ownership of all files and subdirectories in /usr/local/labkey to be owned by the user tomcat6. (you can do this by running "chown -R tomcat6 /usr/local/labkey")

Can you post your labkey.xml file that is located in /var/lib/tomcat6/conf/Catalina/localhost

-Brian
 
ymei responded:  2011-11-14 13:55
Hi Brian and Josh,

You are right. I installed Tomcat from YaST, the package manager of SUSE. I use "/etc/init.d/tomcat6 restart".

The labkey.xml is attached. In this OpenSuse, the file is at "/usr/share/tomcat6/conf/Catalina/localhost". There is no "/var/lib/tomcat6".


----- Update -----

I just did "chown -R tomcat:tomcat /usr/local/labkey" as you suggested and restarted the tomcat. Now, at least I can get to the registration page. WOW, our walk with labkey starts here!

Thanks a lot, men!
Yongguo
 
Brian Connolly responded:  2011-11-14 14:12
Yongguo,

This is great news. It looks like it was a permissions problem.

If you have any other problems, do not hesitate to post another message to the support forum.

-Brian