当archiva在本地设置时出错500

时间:2012-09-07 11:03:15

标签: maven archiva

我正在尝试在Windows机器上设置Archiva。以下是我在尝试创建管理员用户时遇到的错误。

访问/archiva/security/register.action时出现问题。原因是:

Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;

嵌套异常是:     java.net.ConnectException:连接被拒绝:连接 引起:

org.springframework.mail.MailSendException:邮件服务器连接失败;嵌套异常是javax.mail.MessagingException:无法连接到SMTP主机:localhost,port:25;   嵌套异常是:     java.net.ConnectException:连接被拒绝:连接     在org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:419)     在org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:342)     在org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:338)     在org.codehaus.redback.integration.mail.MailerImpl.sendMessage(MailerImpl.java:131)     在org.codehaus.redback.integration.mail.MailerImpl.sendAccountValidationEmail(MailerImpl.java:73)     在org.codehaus.plexus.redback.struts2.action.RegisterAction.register(RegisterAction.java:154)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     在com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)     在com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)     在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)     at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88)     在com.opensymphony.xwork2.DefaultActionInvocation $ 2.doProfiling(DefaultActionInvocation.java:224)     在com.opensymphony.xwork2.DefaultActionInvocation $ 2.doProfiling(DefaultActionInvocation.java:223)     在com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)     在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)

有人遇到过这个问题吗?

1 个答案:

答案 0 :(得分:1)

一个解决方案 - 定义smtp服务器:

在jetty.xml中:

 <Resource name="mail/Session"  type="javax.mail.Session" auth="Container" 
   mail.smtp.host="localhost" 
   mail.smtp.auth="true" 
   mail.user="USERNAME" 
   mail.password="PASSWORD" 
   mail.port="25" 
   mail.transport.protocol="smtp" 
   mail.debug="true"/>

或者在Windows上安装smtp服务器。现在我不知道你是否可以禁用邮件配置。