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

CLASSPATH broken on RHEL6 #143

Open
joshuabaird opened this issue Jul 14, 2015 · 3 comments
Open

CLASSPATH broken on RHEL6 #143

joshuabaird opened this issue Jul 14, 2015 · 3 comments

Comments

@joshuabaird
Copy link

$CLASSPATH is omitting $CATALINA_BASE/lib on RHEL(6). JARs that get put in $CATALINA_BASE/lib are not loaded, only JARs in $CATALINA_HOME/lib.

@pmauduit
Copy link
Member

It might be a regression, I just tested on centos7 / tomcat7, and it works fine ; step to reproduce:

  • Spawn a vagrant with the following provisionning commands:
  config.vm.provision "shell", inline: "rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm"
  config.vm.provision "shell", inline: "yum install -y puppet"
  config.vm.provision :puppet do |puppet|
    puppet.module_path    = "modules"
  end

  • manifests/default.pp:
include tomcat
tomcat::instance {'test':
  ensure    => present,
    http_port => '8080',
}
  • Get a random jar (mysql-connector.jar for example):
$ wget -O /srv/tomcat/test/lib/mysql.jar http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.36/mysql-connector-java-5.1.36.jar
  • Get a test webapp
wget -O /srv/tomcat/test/webapps/java-info.war http://sdi.georchestra.org/~pmauduit/java-info.war
  • Relaunch tomcat
service tomcat-test restart
  • Test if the Mysql jdbc driver is resolved:
curl 'http://localhost:8080/java-info/isClassAvailable.json?class=com.mysql.jdbc.Driver'

Returns:

{
    "class": "com.mysql.jdbc.Driver",
    "status": "available"
}

@pmauduit
Copy link
Member

I can reproduce the bug with centos 6 / tomcat 6 / openjdk7 (same workflow as in previous comment):

{
    "reason": "com.mysql.jdbc.Driver",
    "status": "unavailable",
    "class": "com.mysql.jdbc.Driver"
}

@joshuabaird joshuabaird changed the title CLASSPATH broken on RHEL CLASSPATH broken on RHEL6 Jul 15, 2015
@joshuabaird
Copy link
Author

OK - so the problem is that the /etc/tomcat6/catalina.properties file is not getting invoked for the CATALINA_BASE instance. After copying /etc/tomcat6/catalina.properties to $CATALINA_BASE/conf/catalina.properties, the libraries are getting loaded correctly, and common.loader includes $CATALINA_BASE:

common.loader: ${catalina.base}/lib,${catalina.base}/lib/.jar,${catalina.home}/lib,${catalina.home}/lib/.jar

How should we account for this in the module? Drop a catalina.properties file in $CATALINA_BASE RHEL6 is being used? Or, should this be handled outside of the module?

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