服务模块,不发布在Helios不工作 [英] Serve Modules without publishing not working in Helios

查看:161
本文介绍了服务模块,不发布在Helios不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近把我一直在开发的webapp移植到运行64位Eclipse Helios(Service Release 2)的新机器上,而且我使用的是Maven插件M2Eclipse。



I已经通过Eclipse部署在本地tomcat安装上,一切都可以(或多或少),但是我想选择不发布服务器选项,但是当我选择此选项时,我会收到错误:

  log4j:ERROR无法从URL中读取配置文件[file:/ C:/ butterfly / svn / trunk / micro / src / main / webapp / INF /类/ log4j.properties]。 
java.io.FileNotFoundException:C:\butterfly\svn\trunk\micro\src\main\webapp\WEB-INF\classes\log4j.properties(系统不能找到指定的文件)

log4j.properties文件不在,就像我的生活中的源目录在src / main / resources - 在构建它然后被复制到目标/ WEB-INF / classes /..



Eclipse似乎将预期的目标目录与src目录,所以找不到它。



我不知道这是仅仅是属性文件发生,或者如果同样的问题会发现寻找所有内置的资源。 p>

我看到这些问题:



https://bugs.eclipse.org/bugs/show_bug.cgi?id=318449

=nofollow> http://www.eclipse.org/forums/index.php?t=msg&goto=661045&S=25bafd85b11e042c169ecf1752bfa479



但是他们似乎略有不同或已经修复(我的Helios是上个周末的新下载)



任何人都会体验到这个或者知道如何解决?

解决方案

这里:没有发布选项的服务器模块就这样说了。 Web内容将直接从Dynamic Web Project的WebContent文件夹中提供。使用自定义的上下文来使项目的依赖关系在Web应用程序的类加载器中可用,我希望eclipse可以在构建项目之后模拟从WEB-INF / classes提供的每个类/资源文件(包括log4j.properties)。解决方法,如何在WebContent中创建classes文件夹,然后在此处复制log4j.properties文件,看看classloader是否能够快乐?


I have recently moved a webapp I have been developing to a new machine running 64bit Eclipse Helios (Service Release 2) and I am using Maven plugin M2Eclipse.

I have deployed on a local tomcat install through Eclipse and everything is ok (more or less), but I want to select the option "Serve Modules without publishing", but when I select this option I get errors:

log4j:ERROR Could not read configuration file from URL [file:/C:/butterfly/svn/trunk/micro/src/main/webapp/WEB-INF/classes/log4j.properties].
java.io.FileNotFoundException: C:\butterfly\svn\trunk\micro\src\main\webapp\WEB-INF\classes\log4j.properties (The system cannot find the file specified)

The log4j.properties file is not there, as in my source directories in lives in src/main/resources - at build it then gets copied over to target/WEB-INF/classes/..

Eclipse seems to be mixing the expected target directory with the src directory so not finding it.

Im not sure if this is happening for just the properties file or if the same problem will occur looking for all built resources.

I have seen these issues:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=318449

http://www.eclipse.org/forums/index.php?t=msg&goto=661045&S=25bafd85b11e042c169ecf1752bfa479

but they seem to be slightly different or already fixed (My Helios is a new download from last weekend)

Anyone experience this or know how to resolve?

解决方案

From here: "The Serve modules without publishing option does what it says. Web content will be served directly from the "WebContent" folder of the Dynamic Web Project. A customized context is used to make the project's dependencies available in the Web application's classloader". I would expect eclipse to emulate serving every class / resource file (including log4j.properties) from WEB-INF/classes after you build the project. As a workaround, what about creating a "classes" folder inside WebContent, copy log4j.properties file here and see if the classloader gets happy?

这篇关于服务模块,不发布在Helios不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆