报错是"Missing classpath entry C:/jboss-5.0.0.GA/server/default/lib/mail.jar"
这个问题在eclipse的bug中心可以找到 https://bugs.eclipse.org/bugs/show_bug.cgi?id=257823
原因是JBoss 5.0 GA release的目录结构和之前不一样了,而eclipse的对应插件没有相应的更改
解决办法:
到下面的目录中修改jboss5.serverdef
C:\ejb3\eclipse-jee-ganymede-SR1-win32\plugins\org.eclipse.jst.server.generic.jboss_1.5.205.v200805140145\servers\jboss5.serverdef
找到下面这一段并且做相应的修改
<classpath id="jboss.project" > <fileset dir="${serverRootDirectory}"> <include name="client/*.jar" /> <include name="server/default/lib/*.jar" /> <include name="server/default/deployers/jbossweb.deployer/jsf-libs/*.jar" /> <!-- This will be ignored if EJB3 is not there 5.0 --> <include name="lib/*.jar" /> <include name="server/default/deployers/jbossweb.deployer/*.jar" /> <include name="server/default/deployers/jboss-aop-jboss5.deployer/*.jar" /> <include name="server/default/deployers/ejb3.deployer/jboss-annotations-ejb3.jar" /> <!-- for validation to work this library is defined as an archive --> <exclude name="common/lib/mail.jar" /> </fileset> <!-- leave one generic jar as an archive so that validation works --> <archive path="${serverRootDirectory}/common/lib/mail.jar" /> </classpath>