【问题标题】:james not picking up mysql connector jar詹姆斯没有拿起 mysql 连接器 jar
【发布时间】:2012-06-06 13:51:01
【问题描述】:

我尝试在我的亚马逊实例上安装 james [1],并使用 MySQL 作为后端。我有 MySQL 连接器 mysql-connector-java-5.1.20.zip,解压缩并将其复制到 conf/lib 和 lib/ 但是当我启动 james 时: $ sudo bin/james start 它停止了。包装器日志显示: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

我的 james-database.properties 如下所示:

database.driverClassName=com.mysql.jdbc.Driverdatabase.url=jdbc:mysql://localhost:3306/jamesdatabase.username= ** user name **

database.password= ** secret **vendorAdapter.database=MYSQL openjpa.streaming=false

我没有改变任何其他东西。但詹姆斯不工作。

任何帮助,谢谢!

【问题讨论】:

    标签: apache configuration james


    【解决方案1】:

    我知道这个回复来得有点晚,但我刚刚遇到了这个问题。

    据 Eric Charles answer:

    在 beta4 中加载的 conf/lib/*.jar 有问题。

    您需要编辑 conf/wrapper.conf 并更改

    'wrapper.java.classpath...=../conf/lib' to 
    'wrapper.java.classpath...=../conf/lib/*' (add a /* after lib).
    

    您可以使用文本编辑器,或者如果您使用脚本或类似的东西(在我的例子中是 Dockerfile)来安装 James,您也​​可以通过转到 wrapper.conf 所在的目录并执行来编辑它:

    sed -i "s/wrapper\.java\.classpath\.2=\.\.\/conf/wrapper\.java\.classpath\.2=\.\.\/conf\/lib\/\*/g" wrapper.conf
    

    在此之后,conf/lib 中的所有 jars 都应该在下次启动 James 时加载到类路径中。

    【讨论】:

      【解决方案2】:

      我已经设法让我的 apache-james-3.0-beta4 工作设置database.url=jdbc:mysql://127.0.0.1/james?create=true

      【讨论】:

        【解决方案3】:

        wiki 说:

        Using MySQL instead of Derby
        
        Download the MySQL driver JAR from http://dev.mysql.com/downloads/connector/j/3.1.html, and put the JAR file into your ./conf/lib folder. Change the database settings in ./conf/database.properties to the following values:
        
        # MySQL JDBC database properties
        database.driverClassName=com.mysql.jdbc.Driver
        database.url=jdbc:mysql://localhost/james
        database.username=jamesuser
        database.password=password_for_jamesuser
        vendorAdapter.database=MYSQL
        openjpa.streaming=false
        
        To add the JAR to the classpath, edit ./bin/setenv.sh as shown here:
        
        # Add every needed extra jar to this
        CLASSPATH_PREFIX=../conf/lib/mysql-connector-java-5.1.13-bin.jar
        

        但是,他们的版本控制似乎不正确,而且,诚然,这些指示don't work for me

        【讨论】:

          猜你喜欢
          • 2019-02-24
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2022-01-18
          • 2013-08-12
          相关资源
          最近更新 更多