java.lang.NoClassDefFoundError error running J2EE Server Setup or SCInstaller

java.lang.NoClassDefFoundError error running J2EE Server Setup or SCInstaller

  
Symptoms

When running the Configuration Tool (serversetup.sh) or the Service Center Installer (scinstall.sh) and you have the following error:

[outsystems@ServerMachine /opt/outystems/platform]$ ./serversetup.sh
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at outsystems.hubedition.ServerSetup.<clinit>(Unknown Source)


Cause

The problem may be related to lack of ‘outsystems’ user permissions to access the necessary libraries. In this particular case user ‘outsystems’ can’t access Log4J library, under $JBOSS_HOME/server/outsystems/lib/ directory.


Trouble Shooting

In this case you need to check which libraries are not accessible to the user.
Here is a list of directories and required privileges for the ‘outsystems’ user:
  • $JBOSS_HOME/client/, Directory and Files, READ;
  • $JBOSS_HOME/server/, Directory and Files, READ;
  • $JBOSS_HOME/server/outsystems/, Directory and Files, READ;
  • $JBOSS_HOME/server/outsystems/lib/, Directory and Files, READ;
  • $JBOSS_HOME/server/outsystems/log/ ,Directory and Files, READ/WRITE;
  • $JBOSS_HOME/server/outsystems/deploy/, Directory and Files, READ/WRITE;
  • /opt/outystems/platform/, Directory and Files, READ/EXECUTE;
  • /opt/outsystems/platform/logs/ , Directory and Files, READ/WRITE;
  • /etc/init.d/outsystems/, Directory and Files, READ/WRITE/EXECUTE;
  • $ANT_HOME/bin/ant , File, READ/EXECUTE;
  • $JBOSS_HOME/bin/run.sh, File, READ/EXECUTE;
  • /etc/init.d/jboss.sh,, File, READ/EXECUTE;

You need to use chmod linux command, as root user, to grant these privileges.

Here how to solve example problem:
root# chmod a+r /opt/jboss-4.0.3SP1/server/outsystems/lib/*


Regards,

João Portela