eclipse配合maven导入项目遇到的问题

文章链接:http://www.liuschen.com

错误一:

Multiple annotations found at this line:
	- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'.
	- schema_reference.4: Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd', because 1) could not 
 find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

解决办法:

http://blog.csdn.net/tech4j/article/details/46754751

错误二:

jsp文件报错:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

解决办法:

将jre system library改为本机存在的正确的版本,添加serverRuntime

错误三:

Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution:
default-testCompile, phase: test-compile)

maven->Lifecycle Mapping载入如下文件:

<lifecycleMappingMetadata>
  <pluginExecutions>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <goals>
          <goal>compile</goal>
          <goal>testCompile</goal>
        </goals>
        <versionRange>[3.1,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore/>
      </action>
    </pluginExecution>
  </pluginExecutions>
</lifecycleMappingMetadata>

其中artifactId的值maven-compiler-plugin,versionRange的值和goal的值根据报的错误不同,做不同改动

错误四:

Cannot change version of project facet Dynamic Web Module to 2.3

解决方法

http://www.cnblogs.com/yezhenhan/archive/2011/10/17/2215279.html

错误五:

One or more constraints have not been satisfied.

错误六:

安装完tomcat插件后,点击启动tomcat的小猫图标,没有启动tomcat,反而在没有断点的情况下进入了调试。

解决方法:

重新建立工作区,重新导入,重新设置,这个情况出现是由于工作区配置在导入tomcat插件后出现混乱了。

错误七:

重新建立工作区,重新配置,git,maven,tomcat插件都设置好了,项目重新导入没有异常,但启动tomcat时报异常

java.lang.ClassNotFoundException: org.apache.catalina.loader.DevLoader
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

解决方法:

1、在eclipse目录下,找到DevLoader包,位于\eclipse\plugins\com.sysdeo.eclipse.tomcat(tomcat插件) 的DevLoader.zip

2、复制到apache-tomcat-6.0.x 里的lib里, 并改为DevLoader.jar

3、重启tomcat.

错误八:

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1698)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1544)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4219)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4779)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:803)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:780)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:676)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:602)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:503)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:325)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1069)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:761)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

解决方法:

错误九:

XX cannot be resolved

解决方法:

将编码格式改为UTF-8

错误十:

web.xml is missing and is set to true、

解决方法:

如果你的项目在 /src/main/webapp/WEB-INF 下有web.xml,但是仍然还是报这个错误,需要两步操作

1)右击项目,打开Properties对话框,点击Deployment Assembly选项,在右边添加一个文件夹,并且保存设置

2)在eclispe上方点击Project ->Clean 清理一下这个项目

错误十一

编译项目时,编译到一半,eclipse卡死

解决办法

每次卡死的地方找到是一个js文件,所以,取消掉js的校验

Window->Preferences->Valiation

取消表中关于javascript Client校验的勾选

删除.project中校验js的配置项

	<buildCommand>
		<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
		<arguments>
		</arguments>
	</buildCommand>


org.eclipse.wst.jsdt.core.jsNature

删除项目中的js文件,重新添加

Loading Disqus comments...
Table of Contents