转java后台遇到的问题及解决办法(持续更新ing)

2018-09-29  本文已影响60人  你在心上_b28f

1.web.xml is missing and <failOnmissingwebxml> is set to true

这个报错是说web.xml,也就是部署描述符找不到。很简单的思路,就是右键项目属性,找到 Deployment Assembly,这里面会制定了一系列的路径:

      1)/src/main/webapp,没有的话add 一下新文件夹,Deploy Path 就是 /

      2)下面  Advanced  这个里面,选择  Folder for deployment dexcriptor所在的文件夹即可了。

2.Cannot change version of project facet Dynamic Web Module to 3.0

eg:eclipse maven Cannot change version of project facet Dynamic web module to 3.0 - Marydon - 博客园

3.Dynamic Web Module 3.0 requires Java 1.6 or newer.

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>2.3.2</version>

<configuration>

<source>1.7</source>

<target>1.7</target>

</configuration>

</plugin>

4.The builder launch configuration could not be found.

弹出的 Properties 对话框中,点击 Builders

将缺失的 builder 移除掉 -> 点击 OK 按钮

5.taglib definition not consistent with specification version

<jsp-config>

<taglib>

<taglib-uri>http://www.showhan.com/web/functions</taglib-uri>

<taglib-location>/WEB-INF/showhanFunctions.tld</taglib-location>

</taglib>

</jsp-config>

添加<jsp-config> 规范

6The method init(FilterConfig) of type WeixinFilter must override a superclass method

项目 buid path  jre 要大于等于1.6  ,1.5会报错

7.org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration)

1点击help->install new software

2.https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.2/N/LATEST/

8.java.lang.OutOfMemoryError: PermGen space

Exception in thread "http-bio-8080-exec-7"

1.调整eclipse的 eclipse.ini的参数-Xms512m  -Xmx1024m

2.添加tomcat的配置,open  launch configuration-->arguments-->添加 -Xms128m -Xmx1024m -XX:MaxPermSize=512m

9.Could not obtain transaction-synchronized Session for current thread(hibernate) eg:Could not obtain transaction-synchronized Session for current thread原因及解决方案 - zeng1994 - 博客园

原因配置文件没有配置事务切面,也没有用注解事务

(1)必须要将使用了sessionFactory.getCurrentSession()获取session的代码所在的方法加入到事务管理器中;否则获取不到session了。

(2)sessionFactory.getCurrentSession()是要基于事务的,才能实现session生命周期的管理。所以我们查询方法上用个只读事务就ok了。

解决办法,加上相应配置,可参考链接

10.getSession().createQuery("from tblstudent where stuId=?").setParameter(0, stuId).uniqueResult();  报 tblstudent is not mapped

tblstudent 一定要写成表的实体类名,而不是表名

11.工作空间--->项目名称--->.settings--->org.eclipse.wst.common.project.facet.core  修改这个文件中:

将 <runtime name="Apache Tomcat v7.0"/> 删除掉保存文件即可

上一篇 下一篇

猜你喜欢

热点阅读