2014-01-23 69 views
2

當試圖部署到tomcat7我得到一個空白網頁,並在.IntelliJIdea12 \ system文件夾日誌文件顯示下面的錯誤 -Intellij12.1.4和Tomcat的context.xml 7問題

com.intellij.execution.ExecutionException: Cannot load C:\Users\XXX\GitRepo\project1\webapp\target\webapp-3.1.0-SNAPSHOT\META-INF\context.xml 
    at org.jetbrains.idea.tomcat.TomcatUtil.loadXMLFile(TomcatUtil.java:151) 
    at org.jetbrains.idea.tomcat.TomcatUtil.findContextInContextXml(TomcatUtil.java:103) 
    at org.jetbrains.idea.tomcat.TomcatUtil.findContextElement(TomcatUtil.java:338) 
    at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl.addApplicationContext(TomcatAdminLocalServerImpl.java:192) 
    at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl$4.doPerform(TomcatAdminLocalServerImpl.java:123) 
    at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl$DeployStep.perform(TomcatAdminLocalServerImpl.java:271) 
    at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl.doDeploy(TomcatAdminLocalServerImpl.java:118) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$4.doPerform(JavaeeJmxAdminServerBase.java:115) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$JmxOperation.perform(JavaeeJmxAdminServerBase.java:234) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase.doStartDeploy(JavaeeJmxAdminServerBase.java:106) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase.access$100(JavaeeJmxAdminServerBase.java:22) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$2.setDeploymentStatus(JavaeeJmxAdminServerBase.java:85) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$DeploymentModelOperation.doSetDeploymentStatus(JavaeeJmxAdminServerBase.java:272) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$3.doPerform(JavaeeJmxAdminServerBase.java:95) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase$JmxOperation.perform(JavaeeJmxAdminServerBase.java:234) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase.doStartDeployWithUndeploy(JavaeeJmxAdminServerBase.java:90) 
    at com.intellij.javaee.oss.admin.jmx.JavaeeJmxAdminServerBase.startDeploy(JavaeeJmxAdminServerBase.java:69) 
    at org.jetbrains.idea.tomcat.admin.TomcatAdminServerBase.startDeploy(TomcatAdminServerBase.java:122) 
    at org.jetbrains.idea.tomcat.admin.TomcatAdminLocalServerImpl.startDeploy(TomcatAdminLocalServerImpl.java:101) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at com.intellij.javaee.oss.admin.AdminClientBase$InvocationHandlerImpl$1.call(AdminClientBase.java:55) 
    at com.intellij.javaee.oss.admin.AdminClientBase$InvocationHandlerImpl$2.run(AdminClientBase.java:74) 
    at com.intellij.javaee.util.SequentialTaskExecutor$1.run(SequentialTaskExecutor.java:32) 
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:454) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
    at java.lang.Thread.run(Thread.java:722) 
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:152) 
Caused by: java.io.FileNotFoundException: C:\Users\XXX\GitRepo\project1\webapp\target\webapp-3.1.0-SNAPSHOT\META-INF\context.xml (The system cannot find the file specified) 
    at java.io.FileInputStream.open(Native Method) 
    at java.io.FileInputStream.<init>(FileInputStream.java:138) 
    at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:350) 
    at org.jetbrains.idea.tomcat.TomcatUtil.loadXMLFile(TomcatUtil.java:145) 

任何想法上如何解決這個問題?

回答

0

當我從運行/調試配置對話框的部署選項卡中刪除爆炸戰爭文件並在其位置添加了非爆炸戰爭文件時,IntelliJ Idea v12中出現類似錯誤 - 但忘記設置應用程序上下文返回到我之前設置的內容。

例如,如果我將應用程序上下文設置爲/coolapp,那麼當我移除分解的war文件時,上下文將重置爲/。我添加了未爆炸的戰爭文件,並且上下文仍然設置爲/,但我繼續嘗試在我的瀏覽器中訪問/coolapp。在尋找.../META-INF/context.xml時,這產生了FileNotFoundException,它與您在堆棧跟蹤底部看到的異常匹配。

希望這可以幫助未來的人!