简体   繁体   English

Intellij 13无法在调试时保存/编译

[英]Intellij 13 not saving/compiling on debug

I had been using Intellij 13 for awhile and it was amazing. 我使用Intellij 13已有一段时间了,这真是太神奇了。 I got a new hard drive 500 ssd and had to install it. 我有一个新的500 ss硬盘驱动器,必须安装它。 I got my project back on my hard drive, (which I had to redo everything because Intellij did not like importing my project). 我将项目重新放在硬盘上(由于Intellij不喜欢导入我的项目,所以我不得不重做所有事情)。 But now everything works perfect except the compiler. 但是现在,除了编译器之外,其他所有东西都可以正常工作。 I hit debug and nothing seems to work correctly. 我点击调试,似乎没有任何正常工作。 Come to find out none of the code is being saved/compiled unless I do a clean install with maven. 除非我使用maven进行全新安装,否则请找出没有保存/编译的代码。 I am not even sure where to start looking. 我什至不知道从哪里开始寻找。 I went into the settings and enabled some of the java compiler settings but to no avail. 我进入设置并启用了一些Java编译器设置,但无济于事。 Any suggestions or ideas of where to start looking? 关于从哪里开始寻找任何建议或想法?

I am running JSF with Apache Tomcat. 我正在使用Apache Tomcat运行JSF。

The Pom 绒球

    <project xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
  http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mkyong.common</groupId>
  <artifactId>JavaServerFaces</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>JavaServerFaces Maven Webapp</name>
  <url>http://maven.apache.org</url>

  <repositories>
    <repository>
       <id>java.net.m2</id>
       <name>java.net m2 repo</name>
       <url>http://download.java.net/maven/2</url>
     </repository>
  </repositories>

  <dependencies>

    <!-- MySQL database driver -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.9</version>
    </dependency>

    <!-- Spring framework --> 
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>2.5.6</version>
    </dependency>

    <!-- For Java EE Application Server, uncomment this library 
    and comment the rest of the libraries
    <dependency>
      <groupId>javax.faces</groupId>
      <artifactId>jsf-api</artifactId>
      <version>2.0</version>
      <scope>provided</scope>
    </dependency>
    -->

    <!-- For Servlet Container like Tomcat -->
    <!-- http://download.java.net/maven/2 -->
    <dependency>
      <groupId>com.sun.faces</groupId>
      <artifactId>jsf-api</artifactId>
      <version>2.1.0-b03</version>
    </dependency>

    <dependency>
      <groupId>com.sun.faces</groupId>
      <artifactId>jsf-impl</artifactId>
      <version>2.1.0-b03</version>
    </dependency>

    <!-- EL 2.2 to support method parameter in EL -->
    <dependency>
      <groupId>org.glassfish.web</groupId>
      <artifactId>el-impl</artifactId>
      <version>2.2</version>
    </dependency>


    <!-- http://repo1.maven.org/maven2/ -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
    </dependency>

    <!-- too old
    <dependency>
      <groupId>com.sun.el</groupId>
      <artifactId>el-ri</artifactId>
      <version>1.0</version>
    </dependency>
   -->

   <!-- Commons Validator 
   <dependency>
        <groupId>commons-validator</groupId>
        <artifactId>commons-validator</artifactId>
        <version>1.3.1</version>
   </dependency>

   <dependency>
        <groupId>oro</groupId>
        <artifactId>oro</artifactId>
        <version>2.0.8</version>
   </dependency>
    -->

  </dependencies>

  <build>
    <finalName>JavaServerFaces</finalName>

    <plugins>
       <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>2.3.1</version>
           <configuration>
               <source>1.6</source>
               <target>1.6</target>
           </configuration>
       </plugin>
    </plugins>
  </build>
</project>

web.xml web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
    id="WebApp_ID" version="2.5">

  <display-name>JavaServerFaces</display-name>

  <resource-ref>
    <description>MySQL Datasource example</description>
    <res-ref-name>jdbc/mkyongdb</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>


  <!-- Change to "Production" when you are ready to deploy -->
  <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
  </context-param>

  <!-- Welcome page -->
  <welcome-file-list>
    <welcome-file>faces/default.xhtml</welcome-file>
  </welcome-file-list>

  <!-- JSF mapping -->
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <!-- Map these files with JSF -->
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
  </servlet-mapping>

    <filter>
        <filter-name>LoginFilter</filter-name>
        <filter-class>com.mkyong.LoginFilter</filter-class>
    </filter>
    <!-- Set the login filter to secure all the pages in the /secured/* path of the application  -->
    <filter-mapping>
        <filter-name>LoginFilter</filter-name>
        <url-pattern>/secured/*</url-pattern>
    </filter-mapping>

    <!-- By default go to secured welcome page -->
    <welcome-file-list>
        <welcome-file>secured/welcome.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

Two things I can think of doing as a quick fix, either 'Invalidate Caches/Restart' by going to File > Invalidate Caches/Restart. 我可以考虑做为快速修复的两件事,要么通过转到“文件”>“使缓存无效/重新启动”来“使缓存无效/重新启动”。 Or try importing the project again as a maven project. 或者尝试再次将项目导入为Maven项目。

Do you have any errors in the 'Event Log'? 您在“事件日志”中是否有任何错误?

Intellij opens a project in two ways (depending on your needs). Intellij以两种方式(取决于您的需求)打开一个项目。 If you opened a project it will debug normally. 如果您打开一个项目,它将正常调试。 In your case, your project lost it's debug configurations. 就您而言,您的项目丢失了调试配置。 Please open Run/Debug Configurations, reconfigurate (like a new project) and click Apply and click OK. 请打开“运行/调试配置”,重新配置(如新项目),然后单击“应用”,然后单击“确定”。 Then try debugging again. 然后尝试再次调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM