
SSH
Olizee
这个作者很懒,什么都没留下…
展开
-
使用Spring的AOP后,Struts2的@InputConfig注解不起作用
简单解决,使用struts2的通配符,例: /WEB-INF/page/xxx{1}原创 2013-04-07 11:16:33 · 1029 阅读 · 0 评论 -
org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
使用原生的SQL查询时,如果你用了text数据类型,Hibernate根本就不认识这种数据类型,所以会返回No Dialect mapping for JDBC type:-1,这样的话,就需要自定义方言。另:如果mysql数据库类型是char,在使用原生SQL查询时,发现结果只取一位字符。解决方法继承MYSQL的dialect,在Hibernate中将CHAR(N)都注册为String类型转载 2013-09-24 17:56:47 · 1384 阅读 · 0 评论 -
query specified join fetching, but the owner of the fetched association was not present in the selec
java.lang.IllegalArgumentException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list可能的原因:fetch 与 count 一起使用原创 2013-10-16 09:52:31 · 1807 阅读 · 0 评论 -
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
可能原因:Hibernate的OpenSessionInViewFilter放在了Struts的StrutsPrepareAndExecuteFilter后面解决方法:挪到前面即可。 openSessionInViewFilter org.springframework.orm.hibernate3.support.OpenSessionInViewFilter原创 2013-10-16 09:58:30 · 857 阅读 · 0 评论 -
Spring获取WebApplicationcontext,ApplicationContext几种方法详解
方法一:在初始化时保存ApplicationContext对象代码:ApplicationContext ac = new FileSystemXmlApplicationContext("applicationContext.xml");ac.getBean("bean1");说明:这种方式适用于采用Spring框架的独立应用程序,需要程序通过配置文件手工初始化Spring的情况。转载 2014-02-21 11:58:50 · 627 阅读 · 0 评论