文章目录
- Eclipse 一直提示 loading descriptor for 的解决方法
- 关于项目Import后总是需要重新导入jar包的问题
- Could not publish server configuration for Tomcat v7.0 Server at localhost.
- ECLIPSE中服务器发布时发现项目名后括号与项目名不一致的问题
- 配置Maven后遇到An internal error occurred during: "reload maven project".
- SpringBoot - 错误: 找不到或无法加载主类
- 自己建的JavaProject项目,不会初始化servlet
- 关于访问tomcat,对外可见的页面应该放在WebContent的目录下
- springboot启动出错:java.lang.IllegalArgumentException: Sources must not be empty。
- Dynamic Web Module 3.0 requires Java 1.6 or newer. captcha-web line 1 Maven Java EE Configuration Problem
- Project captcha-core already exists Add a version or custom suffix using "Name template" in "Advanced" settings
- 前端报错406
Eclipse 一直提示 loading descriptor for 的解决方法
关于项目Import后总是需要重新导入jar包的问题
首先呢,可以理解jar包为一个资源,没有这个资源我们的程序是不能运行的。
然后,import 这个jar包,是提供程序与这个jar包的一个接口,接口通了才能使用jar包的资源
最后,可以尝试不在目录下放jar包,那么在import的时候,是会报错的
- 所以说,先把jar包放在Lib下面,再去build path 这样对于项目以后如果别人要import或者自己要import,比较友好,直接去项目下面build path 或者不需要build path就可以了
Could not publish server configuration for Tomcat v7.0 Server at localhost.
- Multiple Contexts have a path of “/ssm_demo”.
- https://stackoverflow.com/questions/27411015/eclipse-luna-getting-error-could-not-publish-server-configuration-for-tomca?noredirect=1
- 找到workspace下面tomcat临时文件的server.xml
- 应该是由于有两个路径是重复的导致冲突了
- 我直接将上面冲突的删掉后重启sever他还是会自己部署
- 所以
- 先把重复的对应的项目去掉,即可:
- 但是配置的路径依旧是
- 为什么呢-我猜测。 由于是由ssm_demo直接复制过来的,所以导致
- 以及.project里面配置的路径都是ssm_demo:
- 全都改为ssm_restful_demo后还是不可以
ECLIPSE中服务器发布时发现项目名后括号与项目名不一致的问题
- 这个括号应该是直接访问ssm_demo的原因,那么:
- 把原来项目名称均改为当前项目名称
- 把tomcat里的项目重新add and remove即可;
配置Maven后遇到An internal error occurred during: “reload maven project”.
- 启动eclipse时候遇到:
- 去到workspace目录下找到
\.metadata\.plugins\org.eclipse.e4.workbench
下面的workbench.xml
,删除即可,但是有可能会删除相关字体的设置
SpringBoot - 错误: 找不到或无法加载主类
- 将这两项改为warnings后保存
- 清除项目缓存
- run as - java application:
- 成功:
自己建的JavaProject项目,不会初始化servlet
这样一个项目,用tomcat启,可以访问首页:但是
没有初始化servlet。。。不知哪里问题
后来改为了DnamicWebProject即可
关于访问tomcat,对外可见的页面应该放在WebContent的目录下
想直接以http://localhost:8080/priverify_demo1_dwp/code.jsp
访问,需要配置在web-inf并列的位置;
如果放到:
是需要配置映射的路径
springboot启动出错:java.lang.IllegalArgumentException: Sources must not be empty。
解决:选错主类:
成功启动
Dynamic Web Module 3.0 requires Java 1.6 or newer. captcha-web line 1 Maven Java EE Configuration Problem
- j2ee项目在eclipse中报错,
- 查看环境
- 已经都是1.8了,可能这是由于你的 Maven 编译级别是 jdk1.5 或以下,而你导入了 jdk1.6 以上的依赖包:查看项目目录下的 .classpath 文件:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
解决办法:
使用 maven-compiler-plugin 将 maven 编译级别改为 jdk1.6 以上:(注意以下plugins一定要放在Pom.xml文件里的build标签内)
<build>
<plugins>
<!-- define the project compile level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
ALT+F5,成功
Project captcha-core already exists Add a version or custom suffix using “Name template” in “Advanced” settings
- import项目的时候,之前import过遇到如下:
- 找到下面的advanced
前端报错406
后端报错::org.springframework.web.HttpMediaTypeNotAcceptableException: Could not findacceptable representation
采用SpringMVC+ajax发送请求
对应前端:
请求的json,返回的也没问题,原因:缺少jacksonjar包:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>