我在 Eclipse 中有 2 个针对 Tomcat 7 的 m2e 管理项目。每个项目都有相同的配置,除了 POM 中的 artifactId 和 web.xml 中的显示名称(其中一个的大部分配置是从另一个中剪切/粘贴的)。
在第一个上,当我“在服务器上运行”时,所有 Resteasy 类都被注册,@Providers 被扫描并注册。
另一方面,Web 服务器已注册,但没有证据表明正在扫描。有没有人遇到过这样的情况?我很想知道这两个项目有什么不同。
工作日志:
INFO: Reloading Context with name [/itworks] has started
Feb 12, 2013 12:48:57 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned @Provider: xxx.BadRequestHandler
Feb 12, 2013 12:48:57 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned @Provider: org.codehaus.jackson.jaxrs.JsonMappingExceptionMapper
Feb 12, 2013 12:48:57 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned @Provider: org.codehaus.jackson.jaxrs.JsonParseExceptionMapper
Feb 12, 2013 12:48:57 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned @Provider: org.codehaus.jackson.jaxrs.JacksonJsonProvider
Feb 12, 2013 12:48:57 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned @Provider: org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider
Feb 12, 2013 12:48:57 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned resource: xxx.Hashmask
Feb 12, 2013 12:48:57 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned resource: xxx.HelloWorld
Feb 12, 2013 12:48:57 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/itworks] is completed
非工作日志:
INFO: Reloading Context with name [/noworkie] has started
Feb 12, 2013 12:56:30 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned resource: yyy.HelloWorld
Feb 12, 2013 12:56:30 PM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap
INFO: Adding scanned resource: yyy.MongoTest
Feb 12, 2013 12:56:30 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/noworkie] is completed