0

我已经按照wiki配置了Apache James

thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ tail bin/setenv.sh 
# limitations under the License.
# ----------------------------------------------------------------------------
#
# Add every needed extra jar to this
CLASSPATH_PREFIX=../conf/lib/*
export CLASSPATH_PREFIX



CLASSPATH_PREFIX=../conf/lib/mysql-connector-java-5.1.21-bin.jar
thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ ll conf/lib/
total 824
drwxr-xr-x 2 thufir thufir   4096 Aug 16 19:40 ./
drwxr-xr-x 4 thufir thufir   4096 Aug 16 18:56 ../
-rw-r--r-- 1 thufir thufir 827942 Jun 21 06:41 mysql-connector-java-5.1.21-bin.jar
-rw------- 1 thufir thufir     66 Mar 21 03:33 README.txt
thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ cat conf/james-database.properties 
# MySQL JDBC database properties
database.driverClassName=com.mysql.jdbc.Driver
database.url=jdbc:mysql://localhost/james
database.username=james
database.password=password
vendorAdapter.database=MYSQL
openjpa.streaming=false

thufir@dur:~/apache-james-3.0-beta4$ 

但我得到:

jvm 1    |  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
jvm 1    |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
jvm 1    |  at java.lang.reflect.Method.invoke(Method.java:616)
jvm 1    |  at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1    |  at java.lang.Thread.run(Thread.java:679)
jvm 1    | Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
jvm 1    |  at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429)
jvm 1    |  at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
jvm 1    |  at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
jvm 1    |  at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:137)
jvm 1    |  at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112)
jvm 1    |  at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239)
jvm 1    |  ... 98 more
jvm 1    | Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
jvm 1    |  at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
jvm 1    |  at java.security.AccessController.doPrivileged(Native Method)
jvm 1    |  at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
jvm 1    |  at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
jvm 1    |  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
jvm 1    |  at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
jvm 1    |  at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
jvm 1    |  ... 103 more
jvm 1    | 
jvm 1    |  at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:309)
jvm 1    |  at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1652)
jvm 1    |  at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:645)
jvm 1    |  at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:204)
jvm 1    |  ... 80 more
wrapper  | <-- Wrapper Stopped
thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ 
thufir@dur:~/apache-james-3.0-beta4$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu2)
OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
thufir@dur:~/apache-james-3.0-beta4$ 

完整的控制台输出太大,无法粘贴到此处。

我究竟做错了什么?JDBC JAR 在那里,它在脚本中,并且配置了 MySql。

哦,我使用 OpenJDK 6 是因为JDK 7 和 James 存在问题,尽管我希望这仅适用于您使用 JDK 而不仅仅是像我这样的 JRE 的情况。

我可以看到这可能不是第一次讨论这个问题。

4

2 回答 2

1

埃里克查尔斯提供:

From: Eric Charles <eric <at> apache.org>
Subject: Re: mysql driver
Newsgroups: gmane.comp.jakarta.james.user
Date: 2012-08-17 10:48:28 GMT (13 minutes ago)

The conf/lib/*.jar loading in beta4 is buggy.

Can you edit the conf/wrapper.conf and change 
'wrapper.java.classpath...=../conf/lib' to 
'wrapper.java.classpath...=../conf/lib/*' (add a /* after lib).

Thx, Eric

虽然我需要测试一下。

于 2012-08-17T11:05:47.827 回答
-1

我通过添加行“ wrapper.java.classpath.133=%REPO_DIR%/mysql-connector-java-5.1.36.jar”解决了这个问题wrapper.conf

于 2015-10-17T14:27:27.130 回答