Bug 784535 - jboss-as fails to start when environment-modules installed and MODULEPATH set
Summary: jboss-as fails to start when environment-modules installed and MODULEPATH set
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: unspecified
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Juan Hernández
QA Contact:
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-25 10:09 UTC by Juan Hernández
Modified: 2012-06-14 12:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-14 12:22:33 UTC
oVirt Team: ---


Attachments (Terms of Use)

Description Juan Hernández 2012-01-25 10:09:47 UTC
Description of problem:
When the "environment-modules" package is installed it adds the "MODULEPATH" environment variable, also used by JBoss 7, as a result the application server can't locate its modules.

Version-Release number of selected component (if applicable):
ovirt-engine-jbossas-1.2-2.fc16.x86_64.rpm

How reproducible:
Always.

Steps to Reproduce:
1. Install the "environment-modules" package.
2. Log out and log in again.
3. Try to start the application server.
  
Actual results:
# /usr/share/jboss-as/bin/standalone.sh -c standalone.xml
=========================================================================
 
JBoss Bootstrap Environment
 
JBOSS_HOME: /usr/share/jboss-as
 
JAVA: java
 
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
 
=========================================================================
 
Exception in thread "main" org.jboss.modules.ModuleNotFoundException: Module org.jboss.logmanager:main is not found in local module loader @4be03c55 (roots: /usr/share/Modules/modulefiles,/etc/modulefiles)
at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126)
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:265)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:212)
at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:194)
at org.jboss.modules.Main.main(Main.java:264)

Expected results:
The application server should start correctly.


Additional info:
Adding "unset MODULEPATH" at the beginning of "/etc/init.d/jboss-as" solves the problem.

Comment 1 Alon Levy 2012-01-25 10:22:06 UTC
The suggestion in "Additional info:" doesn't work, because standalone is run via daemon / su. What does work is adding it to the list of parameters to the two invocation options, i.e. before standalone:

x86_64 garlic:~ alon$ cat /etc/init.d/jboss-as | grep MODULE
    daemon --user $JBOSS_USER LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=$JBOSS_PIDFILE MODULEPATH= $JBOSS_SCRIPT -c $JBOSS_CONFIG 2>&1 > $JBOSS_CONSOLE_LOG &
    su - $JBOSS_USER -c "LAUNCH_JBOSS_IN_BACKGROUND=1 JBOSS_PIDFILE=$JBOSS_PIDFILE MODULEPATH= $JBOSS_SCRIPT -c $JBOSS_CONFIG" 2>&1 > $JBOSS_CONSOLE_LOG &

Comment 2 Juan Hernández 2012-06-14 10:22:35 UTC
This will be solved when we release 3.1, as it the script that starts the service doesn't use the MODULEPATH environment variable, and in addition it is started by systemctl which cleans the environment before starting the service.


Note You need to log in before you can comment on or make changes to this bug.