James启动报错

打算搭建一个邮件服务器,但是下载了 james-2.3.2.1 之后发先直接启动是会报错的。
INFO    2017-03-05 20:05:16.755 [Phoenix.] (): 20 Blocks to process for phase "startup". Order of processing = [dnsserver, database-connections, mailstore, users-store, localusersrepository, spoolrepository, sockets, thread-manager, scheduler, James, mailetpackages, matcherpackages, spoolmanager, connections, remotemanager, pop3server, smtpserver, nntp-repository, nntpserver, fetchmail].
ERROR   2017-03-05 20:05:16.821 [Phoenix.] (): Component named "users-store" failed to pass through the Starting stage. (Reason: org.apache.avalon.framework.configuration.ConfigurationException: destination>>URL).
ERROR   2017-03-05 20:05:16.821 [Phoenix.] (): There was an error running phase "startup" for Block named "users-store". (Reason: Component named "users-store" failed to pass through the Starting stage. (Reason: org.apache.avalon.framework.configuration.ConfigurationException: destination>>URL).).
org.apache.avalon.phoenix.containerkit.lifecycle.LifecycleException: Component named "users-store" failed to pass through the Starting stage. (Reason: org.apache.avalon.framework.configuration.ConfigurationException: destination>>URL).
	at org.apache.avalon.phoenix.containerkit.lifecycle.LifecycleHelper.fail(LifecycleHelper.java:354)
	at org.apache.avalon.phoenix.containerkit.lifecycle.LifecycleHelper.startup(LifecycleHelper.java:226)
	at org.apache.avalon.phoenix.components.application.DefaultApplication.startup(DefaultApplication.java:530)
	at org.apache.avalon.phoenix.components.application.DefaultApplication.doRunPhase(DefaultApplication.java:478)
	at org.apache.avalon.phoenix.components.application.DefaultApplication.runPhase(DefaultApplication.java:409)
	at org.apache.avalon.phoenix.components.application.DefaultApplication.start(DefaultApplication.java:180)
	at org.apache.avalon.framework.container.ContainerUtil.start(ContainerUtil.java:260)
rethrown from
org.apache.avalon.framework.configuration.ConfigurationException: destination>>URL
	at org.apache.james.userrepository.UsersFileRepository.configure(UsersFileRepository.java:134)
	at org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.java:201)
	at org.apache.james.core.AvalonUsersStore.initialize(AvalonUsersStore.java:130)
	at org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:244)
	at org.apache.avalon.phoenix.containerkit.lifecycle.LifecycleHelper.startup(LifecycleHelper.java:200)
	at org.apache.avalon.phoenix.components.application.DefaultApplication.startup(DefaultApplication.java:530)
	at org.apache.avalon.phoenix.components.application.DefaultApplication.doRunPhase(DefaultApplication.java:478)
rethrown from
java.io.IOException: 文件名、目录名或卷标语法不正确。
	at java.io.WinNTFileSystem.canonicalize0(Native Method)
	at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428)
	at java.io.File.getCanonicalPath(File.java:618)
	at java.io.File.getCanonicalFile(File.java:643)
	at org.apache.james.userrepository.UsersFileRepository.configure(UsersFileRepository.java:132)
	at org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.java:201)
	at org.apache.james.core.AvalonUsersStore.initialize(AvalonUsersStore.java:130)
INFO    2017-03-05 20:05:16.824 [Phoenix.] (): exception while starting:Component named "users-store" failed to pass through the Starting stage. (Reason: org.apache.avalon.framework.configuration.ConfigurationException: destination>>URL).


下载源码看了下,找到对应的报错地方,发现是在

james\apps\james\SAR-INF 下的config.xml文件报错,找到对应的  destination>>URL 


         

发现是不能生成文件,把这个注释掉,在下方可以找一个一个被注释的配置


       

去掉注释。

采取使用数据库方式就行了

数据库配置加在: 标签下

需要将 mysql-connector-java-5.1.7-bin.jar 导入在 james\lib 下;

同时修改config.xml配置:


         com.mysql.jdbc.Driver
         jdbc:mysql://127.0.0.1/mail?autoReconnect=true
         root
         123456
         true
         20
当然要在mysql数据库中穿件 mail 数据库,不然还算会报错的


最后启动成功

你可能感兴趣的:(james,James,邮件服务器,users-store)