tomcat的错误及解决方式

1.Error Infomation:
A configuration error occurred during startup.please verify the preference field with the prompt:Tomcat JDK name
没有配置Tomcat的JDK。通过windows.perferences.myEclipse.Application Server.Tomcat.JDK.选择相应的JDK即可。


2.Error Infomation:
to launch an application server,a full jdk(not just a jre) must be specified.
if the selected jre is actually part of a full jdk,please update its configuration to point to the jdk installation root directory,not to its included jre subdirectory.
选择Tomcat的JDK时,不要选择JRE的根目录,选择Java根目录即可。注:JRE根目录需要作为JDK的子目录。

3.Struts Error infomation:
java.lang.NoClassDefFoundError: org/apache/commons/beanutils/Converter
1).在web.xml文件中加上ActionServlet的配置信息
2).确定没有少引用Struts包,特别是common-beanutils.jar
3).可以将struts作为一个完整的包路径进行重新的引用

4.import org.hibernate.cfg.AnnotationConfiguration; //报错
lib . import -> hibernate.annotation.jar.

5.sessionFactory.getCurrentSession().getTransaction().commit();
The method getTransaction() is undefined for the type Session 
产生此问题的情况可能是Hibernate的版本有问题,更替新版本后即可。(默认用MyEclipse带的Hibernate包可能会产生此问题。具体可参考)

getTransaction() - Method in interface org.hibernate. Session
Get the Transaction instance associated with this session.
getTransaction() - Method in interface org.hibernate. StatelessSession
Get the current Hibernate transaction.
getTransaction() - Method in class org.hibernate.impl. SessionImpl
getTransaction() - Method in class org.hibernate.impl. StatelessSessionImpl
getTransaction() - Method in class org.hibernate.jdbc. JDBCContext
getTransaction() - Method in class org.hibernate.transaction. WebSphereExtendedJTATransactionLookup.TransactionManagerAdapter
getTransactionCount() - Method in class org.hibernate.jmx. StatisticsService

你可能感兴趣的:(tomcat的错误及解决方式)