2011-12-30 49 views
4

我目前在Tomcat 7.0.21,JDK1.6.29和WTP 3.3.1(在Eclipse Indigo上運行)。我不確定我運行的是哪個版本的M2E。當我在Eclipse之外進行mvn安裝並運行Tomcat時,我的項目可以構建和部署,或者可以通過WTP將「未發佈服務模塊」選中,從而將其部署到服務器。WTP部署沒有發佈失敗

然而,當我通過WTP啓動服務器與無權發佈選中複選框,Tomcat將無法啓動成功,以失敗:

 
Dec 29, 2011 4:09:39 PM org.apache.catalina.startup.ContextConfig processAnnotationsJndi 
SEVERE: Unable to process JNDI URL [jndi:/localhost/plutom-ws/WEB-INF/classes] for annotations 
java.io.FileNotFoundException: jndi:/localhost/plutom-ws/WEB-INF/classes 
    at 
org.apache.naming.resources.DirContextURLConnection.list(DirContextURLConnection.java:463) 
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1901) 
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1905) 
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1828) 
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1295) 

如果我手動創建類目錄,它則抱怨classes/com似乎在類加載器和文件路徑之間有衝突解決某處?

+0

你爲什麼要用no-publish?我的意思是不是那會導致你的類被髮布到服務器的東西? – 2011-12-30 01:16:48

+1

這只是意味着它會從/ target目錄中獲取我的類文件和部署,而不是將實際的戰爭複製到某處。複製戰爭意味着我所做的任何更改都需要停止並重新啓動。不發佈意味着我可以在不重新啓動的情況下處理修改html/js /某些類文件。 – 2012-01-01 19:22:08

回答

3

這是很不幸的Bugzilla的相關條目的Eclipse WTP和Tomcat 7這裏有一間已知的bug:

Tomcat 7 + Serve Modules without publishing fails to find classpath resources

Really fix "Serve modules without publishing" with tomcat 7 by using the new VirtualDirContext of tomcat >=7.0.24

顯然,修復是已知的,只是一直沒有尚未應用。我想這不是一個普通的用例,因爲否則會有更多的人請求修復它。它太糟糕了,它是一個非常有用的功能。