在学习SSH中遇到的一些问题与大家共享
2009-02-11 15:58
483 查看
问题一:今天在配置SSH时,却遇到了问题,如下:
15:20:54,093 ERROR ContextLoader:203 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'SessionFact
ory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested
exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)
找了很久,才找到问题,解决方法如下: 去掉asm-2.2.3.jar包就可以了.
网上找到的原文如下: from:http://blog.chinaunix.net/u1/36006/showart_390459.html
第一种:
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
第二种:
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
第三种:
用struts-config.xml的
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
</plug-in>
致命异常:
15:20:54,093 ERROR ContextLoader:203 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Session
Factory' defined in class path resource [applicationContext.xml]: Invocation of init
method failed; nested exception is java.lang.NoSuchMethodError:
org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;L
java/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
(IILjava/lang/String;Ljava/lang/Stri
ng;[Ljava/lang/String;Ljava/lang/String;)
网友的解决方法:
从出错的字面看,肯定与org.objectweb.asm包有关,于是我就检查lib下面关于asm的包,分别有如下几个JAR包:
asm-2.2.3.jar
asm.jar
asm-attrs.jar
asm-commons-2.2.3.jar
asm-util-2.2.3.jar
然后怀疑是asm-2.2.3.jar与asm.jar可能有嫌疑,于是分别去掉他们,最后,去掉asm-2.2.3.jar成功启动.
呵呵,其实,这些微不足道的小错误需要一个细心的心来发现,我在google上找了半天也没有成型的结果 ,反而让我觉得这是一个很新的问题.其实,关键是自己要细心,不要太依赖网络带给你的答案.
通过多次的测试,在使用myeclise5.5.GA时,如果你选用spring1.2,hibernate3.2和JSF1.1时,一般会顺利的配置成功.如果项目不要求指定版本的框架时,请使用如上组合,能够快速的解决你很多意想不到的错误和版本冲突.
我的途径:
去掉asm-2.2.3.jar,果然成功。
问题二:在使用hibernate 链接access数据库的时候,首先是出现:
问题三:在执行HQL语句的时候提示“java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]列名 'uname ' 无效。 ”
导致此问题的原因很可能是:HQL语句出错了检查HQL语句就行。
Hibernate链接access的方法:
连接access用很多种,今天说一种我的连接方法,是用的hxtt(http://www.hxtt.com/)的东东,这个网站上有很多驱动和方言,还可以连接excel呢,呵呵....好了下面是连接方法:
需要两个包的支持,1、jdbc连接access的驱动程序 (Access_JDBC30.jar)地址:http://www.hxtt.com/access.zip 2、access的方言包(hibernate.jar)地址:http://www.hxtt.com/test/hibernate.zip
下面是hibernate配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username"></property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.dialect">com.hxtt.support.hibernate.HxttAccessDialect</property>
<!-- <property name="hibernate.connection.url">jdbc:access:///f:/mdbfiles/aaa.mdb</property> -->
<property name="hibernate.connection.driver_class">com.hxtt.sql.access.AccessDriver</property>
<property name="hiberante.show_sql">true</property>
<mapping resource="Person.hbm.xml" />
</session-factory>
</hibernate-configuration>
连接access就是这样啦,很简单吧,o(∩_∩)o...哈哈
15:20:54,093 ERROR ContextLoader:203 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'SessionFact
ory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested
exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)
找了很久,才找到问题,解决方法如下: 去掉asm-2.2.3.jar包就可以了.
网上找到的原文如下: from:http://blog.chinaunix.net/u1/36006/showart_390459.html
第一种:
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
第二种:
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
第三种:
用struts-config.xml的
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
</plug-in>
致命异常:
15:20:54,093 ERROR ContextLoader:203 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Session
Factory' defined in class path resource [applicationContext.xml]: Invocation of init
method failed; nested exception is java.lang.NoSuchMethodError:
org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;L
java/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
(IILjava/lang/String;Ljava/lang/Stri
ng;[Ljava/lang/String;Ljava/lang/String;)
网友的解决方法:
从出错的字面看,肯定与org.objectweb.asm包有关,于是我就检查lib下面关于asm的包,分别有如下几个JAR包:
asm-2.2.3.jar
asm.jar
asm-attrs.jar
asm-commons-2.2.3.jar
asm-util-2.2.3.jar
然后怀疑是asm-2.2.3.jar与asm.jar可能有嫌疑,于是分别去掉他们,最后,去掉asm-2.2.3.jar成功启动.
呵呵,其实,这些微不足道的小错误需要一个细心的心来发现,我在google上找了半天也没有成型的结果 ,反而让我觉得这是一个很新的问题.其实,关键是自己要细心,不要太依赖网络带给你的答案.
通过多次的测试,在使用myeclise5.5.GA时,如果你选用spring1.2,hibernate3.2和JSF1.1时,一般会顺利的配置成功.如果项目不要求指定版本的框架时,请使用如上组合,能够快速的解决你很多意想不到的错误和版本冲突.
我的途径:
去掉asm-2.2.3.jar,果然成功。
问题二:在使用hibernate 链接access数据库的时候,首先是出现:
“Dialect找不到 ”
然后加入:“<property name="dialect">org.hibernate.dialect.SQLServerDialect</property> ”
再发布,没有问题了但是在页面,点击提交后,执行HQL时候弹出“[Microsoft][ODBC Microsoft Access Driver] 找不到文件 'E:/Program Files/MyEclipse6.0/myeclipse/eclipse/plugins/com.genuitec.eclipse.easie.tomcat.myeclipse_6.0.1.zmyeclipse601200710/tomcat/bin/yuan.dbo'”。
在改为SQLservice2000使用桥链接时候加入<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>是不会出错的。
问题三:在执行HQL语句的时候提示“java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]列名 'uname ' 无效。 ”
导致此问题的原因很可能是:HQL语句出错了检查HQL语句就行。
Hibernate链接access的方法:
连接access用很多种,今天说一种我的连接方法,是用的hxtt(http://www.hxtt.com/)的东东,这个网站上有很多驱动和方言,还可以连接excel呢,呵呵....好了下面是连接方法:
需要两个包的支持,1、jdbc连接access的驱动程序 (Access_JDBC30.jar)地址:http://www.hxtt.com/access.zip 2、access的方言包(hibernate.jar)地址:http://www.hxtt.com/test/hibernate.zip
下面是hibernate配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username"></property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.dialect">com.hxtt.support.hibernate.HxttAccessDialect</property>
<!-- <property name="hibernate.connection.url">jdbc:access:///f:/mdbfiles/aaa.mdb</property> -->
<property name="hibernate.connection.driver_class">com.hxtt.sql.access.AccessDriver</property>
<property name="hiberante.show_sql">true</property>
<mapping resource="Person.hbm.xml" />
</session-factory>
</hibernate-configuration>
连接access就是这样啦,很简单吧,o(∩_∩)o...哈哈
相关文章推荐
- 搭建ssh 遇到的一些奇怪的问题。分享给大家
- 近期网友遇到的一些问题,整理出来 大家可以学习 交流 MySQL问题及解答
- Cocos2dx:cocos2d-x-3.2版本学习过程中所遇到的一些问题(每一次都是一次作死的感觉)
- kotlin的一些学习和使用时遇到的问题
- 通过plsql 测试存储过程遇到的问题和学习到的一些基础知识整理
- 经常写VC工程的人都会遇到升级到VS2005时出现的各种各样的问题,下面写一些自己遇到的问题,还有什么不全的请大家补充。希望能给朋友们一些帮助。
- 刚开始学习Android遇到的一些问题---主要安卓环境安装Androidstudio以及模拟器测试真机测试
- 学习队列遇到的一些问题
- 学习c语言遇到的一些问题(1)(Linux)(调用库函数)
- 关于if (i%2==0) 的一些问题,大家都遇到吗
- Mysql学习中遇到的一些问题
- 学习JS中遇到的一些问题(读书笔记)
- 打印机共享遇到的一些问题
- 学习钩子(Hook)过程中遇到的一些问题
- 黑马程序员 + 在学习中遇到的一些问题1
- 在学习autotools遇到一个问题:make没有按照VPATH给的目录进行搜索,请大家指导一下。
- 近期学习javascript和jquery遇到一些问题的技巧知识总结
- 近期学习javascript和jquery遇到一些问题的技巧知识总结
- 易语言学习中遇到的一些问题
- Java学习中,所遇到的一些问题及解决方案