spring4 hibernate5 struts2 整合时出现异常该怎么解决,求各位大神帮帮忙 1C

org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path resource
[applicationContext.xml]: Instantiation of bean failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.springframework.orm.hibernate5.LocalSessionFactoryBean]:
No default constructor found; nested exception is
java.lang.UnsupportedClassVersionError: org/hibernate/cfg/Configuration
: Unsupported major.minor version 52.0 (unable to load class
org.hibernate.cfg.Configuration)

5个回答

你的SQL驱动用的mysql的,你看下你的db配置是不是有问题。我之前遇到的问题就是因为用的SQL配置与驱动JAR包不一直导致的

u013749444
近了 没有吧,之前都是用这个数据库配置,可以连接上,配置都是在spring配置文件中的,就是上面的图片,你看看有什么问题吗?
2 年多之前 回复

别人说是jdk版本不对,我都换过了,还是没有用,是不是jar包的问题呢?

图片说明

<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

 <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
    <property name="driverClass" value="com.mysql.jdbc.Driver"></property>
    <property name="jdbcUrl" value="jdbc:mysql:///ssh_crm"></property>
    <property name="user" value="root"></property>
    <property name="password" value="root"></property>
 </bean>

 <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource"></property>
    <property name="configLocations" value="classpath:hibernate.cfg.xml"></property>
 </bean>

 <!-- 事务管理 -->
 <bean id="transactionManager" 
    class="org.springframework.orm.hibernate5.HibernateTransactionManager"></bean>
 <tx:annotation-driven transaction-manager="transactionManager"/>


 <bean id="userAction" class="action.UserAction" scope="prototype">
    <property name="userService" ref="userService"></property>
 </bean>

 <bean id="userService" class="service.UserService">
    <property name="userDao" ref="userDaoImpl"></property>
 </bean>

 <bean id="userDaoImpl" class="dao.UserDaoImpl">
    <property name="hibernateTemplate" ref="hibernateTemplate"></property>
 </bean>

 <bean id="hibernateTemplate" class="org.springframework.orm.hibernate5.HibernateTemplate">
    <property name="sessionFactory" ref="sessionFactory"></property>
 </bean>

代码的编译版本不对,不是jdk版本

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
spring4与jackson整合时报错
[size=24px]springmvc.xml配置文件[/size]rn[img=https://img-bbs.csdn.net/upload/201604/13/1460550390_98892.png][/img]rnjakson和spring4的jar包rn[img=https://img-bbs.csdn.net/upload/201604/13/1460550860_448989.png][/img]rn报错rn[img=https://img-bbs.csdn.net/upload/201604/13/1460551109_335724.png][/img]rn还有一个问题为什么找不到包中的org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
Struts2、Spring4与Hibernate5三大框架整合
一、新建一个web项目,以 Struts2 为基础 载入一些jsp提示类库(在tomcat中jsp-api,servlet-api,tomcat-api) 在src源文件目录下新建一个struts.xml,内容如下: <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuratio
获取网络图片出现异常,该如何解决,求大神
path = "http://www.baidu.com/img/baidu_sylogo1.gif";rn PrintUtil.log("=====", "======" + path);rn viewHolder.tuijian_imageView.setImageBitmap(addImage());rnrnrnrnrnprivate Bitmap addImage() rn Bitmap bitmap = null;rnrn try rn byte[] data = getImage(path);rn bitmap = BitmapFactory.decodeByteArray(data, 0,rnrn data.length);rnrn // tuijian_imageView.setImageBitmap(bitmap);rnrn catch (Exception e) rnrn // Toast.makeText(getActivity(), R.string.error, 1).show();rnrn Log.e(TAG + "加载图片异常", e.toString());rnrn rn return bitmap;rn rnrn public static byte[] getImage(String path) throws Exception rnrn URL url = new URL(path);rnrn HttpURLConnection conn = (HttpURLConnection) url.openConnection();rnrn conn.setRequestMethod("GET");rnrn conn.setConnectTimeout(5 * 1000);rnrn InputStream inStream = conn.getInputStream();rnrn return readFromInput(inStream);rnrn rnrn public static byte[] readFromInput(InputStream inStream) throws Exception rnrn ByteArrayOutputStream outStream = new ByteArrayOutputStream();rnrn byte[] buffer = new byte[1024];rnrn int len = 0;rnrn while ((len = inStream.read(buffer)) != -1) rnrn outStream.write(buffer, 0, len);rnrn rnrn inStream.close();rnrn return outStream.toByteArray();rnrn rnrn总是报错,谁知道什么原因啊啊rnrn07-03 02:12:59.567: D/=====(2399): ======http://www.baidu.com/img/baidu_sylogo1.gifrn07-03 02:12:59.567: E/MainActivity加载图片异常(2399): android.os.NetworkOnMainThreadExceptionrnlog打印的信息
求各位大神,这是该怎么解决
[img=https://img-bbs.csdn.net/upload/201506/14/1434291631_148065.png][/img]rn求各位指点,不胜感激
Spring4与Hibernate4整合时出现的问题
[b]错误信息:[/b]rn[color=#FF0000]ERROR: Access denied for user 'sa'@'localhost' (using password: NO)[/color]rn[b]beans.xml配置:[/b]rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.SQLServerDialectrn truern updatern org.springframework.orm.hibernate4.SpringSessionContextrn rn rn rn rn rn classpath:com/lengyu/abt/modelrn rn rn rn rn rn rn rn rnrn rnrn[b]解决方案:[/b]rn原因在于我在classpath下加入了hibernate.properties配置文件,Spring会自动读取这个文件中的用户名,把hibernate.properties重命名一下就可以了。rn
SSH(Struts2、Spring4、Hibernate5)整合jar包
SSH较新整合包: Struts-2.3.34 Spring-4.3.9 Hibernate-5.2.11 本jar包集合主要使用c3p0,如需common-dbcp.jar,common-pool.jar请另行下载
ssh项目整合时出现异常:org.springframework.beans.factory.BeanCreationException:
我在启动tomcat时 出现了一下异常信息:rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginDao' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is requiredrnCaused by: rnjava.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is requiredrn at org.springframework.orm.hibernate3.support.HibernateDaoSupport.checkDaoConfig(HibernateDaoSupport.java:112)rn at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:420)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)rn at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:578)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rn2010-5-31 23:31:45 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginDao' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is requiredrnCaused by: java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is requiredrn at org.springframework.orm.hibernate3.support.HibernateDaoSupport.checkDaoConfig(HibernateDaoSupport.java:112)rn at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:420)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)rn at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:578)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnrn而我的Applicationcontext.xml是这样配置的:rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn classpath:hibernate.cfg.xmlrn rn rn rn rn rn rn rn rn rn rn请问高手 到底是哪里出问题了啊 我是新手 这是我第一次整合spring 所以很多都是依样画葫芦 出错了连问题在哪里都不清楚 谢谢了先~rn
spring4整合hibernate5报错解决
2015-09-19 21:50:34,525 WARN org.springframework.web.context.support.XmlWebApplicationContext.refresh:544 - Exception encountered during context initialization - cancelling refresh attempt org.springf
求各位大神帮帮忙。
gridview 种checked怎么默认选择rnrnrn 有三列rnrn编号 省份 checkedrnrnrn在数据库中,怎么确认有省份的默认true 没有的False呢
求各位大神帮帮忙
老师让我们配置写汇编程序的环境,按照他给的步骤,中间有部分始终不行rn/*安装完DOSBox后,我们就能运行汇编后的程序了。rn打开DOSBox后,我们可以看到Z : \ >,这是DOSBox里的虚拟盘,我们可以采用mount命令将其转变到自己的D盘: mount d d:\masm。*/rn就是这部分里面,我输入mount d d:\masm 的时候里面显示的是rn[img=https://img-bbs.csdn.net/upload/201510/19/1445255151_443760.png][/img]rn求各位指导指导。。。。不胜感激rn
Spring4整合Hibernate4抛出异常,求各位大神帮帮忙
系统启动抛错,Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ClassLoadingException,但是系统里明明有这个jar包,哪位大神知道会是什么情况吗?![图片说明](https://img-ask.csdn.net/upload/201704/18/1492512426_576429.png)
struts2与spring2整合时出现Error filterStart
我在整合struts2和spring2的时候,想实现用spring2的bean代替struts2的actionrn但后台却报Error filterStart错误rnrn以下几种情况都会出现该错误:rnrn1.导入struts2-spring-plugin-2.0.8.jarrn2.在struts.xml中加入rn3.在struts.xml中的class使用了beanid,代码如下:rnrn login.jsp rnrnrn但是,不做上操作就无法整合struts2和spring2,不知如何解决,请高手们多多指教了,不胜感谢!rnrn我引用的jar包如下:rnspring-beans-2.0.5.jarrnspring-context-2.0.5.jarrnspring-core-2.0.5.jarrnspring-web-2.0.5.jarrnstruts2-core-2.0.8.jarrnstruts-core-1.3.5.jarrnxwork-2.0.3.jarrn
struts2、spring和hibernate整合时遇到的一些问题
1.Action对象的产生问题(struts2本身产生好呢?还是让spring代替struts2产生好呢?) 答:这个问题是关于struts2和spring的整合问题,需要用到struts2的struts2-spring-plugin.jar包 如果让struts2本身产生action,action中的set方法struts2会根据这个jar包自动注入(不需要通过@Resource手动注入...
请问struts1与struts2整合时的问题
严重: Exception starting filter struts2rnClass: org.apache.xml.utils.DOMBuilderrnFile: DOMBuilder.javarnMethod: startElementrnLine: 322 - org/apache/xml/utils/DOMBuilder.java:322:-1rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)rn at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:205)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3696)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: Parameter or operation isn't supported by this node. - Class: org.apache.xml.utils.DOMBuilderrnFile: DOMBuilder.javarnMethod: startElementrnLine: 322 - org/apache/xml/utils/DOMBuilder.java:322:-1rn at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)rn ... 34 morernCaused by: gnu.xml.dom.DomEx: Parameter or operation isn't supported by this node.rn at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:322)rn at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1020)rn at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.startElement(DomHelper.java:245)rn at com.opensymphony.xwork2.util.location.LocationAttributes$Pipe.startElement(LocationAttributes.java:317)rn at com.opensymphony.xwork2.util.DomHelper$StartHandler.startElement(DomHelper.java:304)rn at gnu.xml.pipeline.EventFilter.startElement(EventFilter.java:570)rn at gnu.xml.pipeline.ValidationConsumer.startElement(ValidationConsumer.java:1177)rn at gnu.xml.aelfred2.SAXDriver.startElement(SAXDriver.java:834)rn at gnu.xml.aelfred2.XmlParser.parseElement(XmlParser.java:1042)rn at gnu.xml.aelfred2.XmlParser.parseContent(XmlParser.java:1207)rn at gnu.xml.aelfred2.XmlParser.parseElement(XmlParser.java:1038)rn at gnu.xml.aelfred2.XmlParser.parseDocument(XmlParser.java:416)rn at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:167)rn at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320)rn at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294)rn at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)rn at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:121)rn ... 35 morern2010-10-21 22:56:51 org.apache.catalina.core.StandardContext startrn严重: Error filterStart
Spring4 hibernate5整合 事务管理问题
[code=java]rn收藏(0)rnapplicationContext.xml:rnrnrnrnrn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rn rnrn rn[code=java]rnDaoImpl:rnrnpackage com.company.SH.dao.Impl;rnrnimport org.hibernate.Session;rnimport org.hibernate.SessionFactory;rnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.stereotype.Repository;rnimport org.springframework.transaction.annotation.Transactional;rnrnimport com.company.SH.dao.BookDao;rnimport com.company.SH.entity.Book;rnimport com.company.SH.exception.BookStockException;rnimport com.company.SH.exception.CustomerException;rnrn@Repository(value="bookDao")rnrnpublic class BookDaoImpl implements BookDao rn rn @Autowiredrn private SessionFactory sessionFactory;rnrn public Session getSession() rn return sessionFactory.getCurrentSession();rn rn @Override rn public float getBookPriceByBookId(String bookid) rn String hql = "SELECT b.price FROM Book b WHERE b.bookId = ?";rn float price = (float) getSession().createQuery(hql).setParameter(0, bookid).uniqueResult();rn return price;rn rn @Override rn public void updateBookStock(String bookid) rn //验证库存是否为充足rn String hql2 = "SELECT b.stock FROM Book b WHERE b.bookId = ?";rn int stock = (int) getSession().createQuery(hql2).setParameter(0, bookid).uniqueResult();rn if(stock == 0)rn System.out.println(123);rn throw new BookStockException("书的库存不足!");rn rn rn String hql = "UPDATE Book b SET b.stock = b.stock -1 WHERE b.bookId = ?";rn getSession().createQuery(hql).setParameter(0, bookid).executeUpdate();rn rn @Override rn public void updateCostomerBalance(float price, String username) rn //验证余额是否充足rn String hql2 = "SELECT c.balance FROM Customer c WHERE userName=?";rn float balance = (float) getSession().createQuery(hql2).setParameter(0, username).uniqueResult();rn rn if(price>balance)rn System.out.println(456);rn throw new CustomerException("余额不足!");rn rn rn String hql = "UPDATE Customer c SET c.balance = c.balance - ? WHERE userName=?";rn getSession().createQuery(hql).setParameter(0, price).setParameter(1, username).executeUpdate();rnrn rnrnrn[/code]rn rnrn rnrn rn[code=java]rnserviceImpl:rnrnpackage com.company.SH.service.Impl;rnrnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.stereotype.Service;rnimport org.springframework.transaction.annotation.Transactional;rnrnimport com.company.SH.dao.BookDao;rnimport com.company.SH.service.BookService;rnrn@Service(value="bookService")rnpublic class BookServiceImpl implements BookService rnrn @Autowiredrn private BookDao bookDao;rn rn @Overridern public void borrow(String bookid, String username) rn float price = bookDao.getBookPriceByBookId(bookid);rn bookDao.updateBookStock(bookid);rn bookDao.updateCostomerBalance(price, username);rn rnrnrn rn[/code]rn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn
spring4整合hibernate5时报错
WARN [localhost-startStop-1] -Exception encountered during context initialization - cancelling refresh attemptrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [F:\soft\apache-tomcat-8.0.52-windows-x64\apache-tomcat-8.0.52\webapps\test\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.XMLContext.(Lorg/hibernate/boot/spi/ClassLoaderAccess;)Vrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:706)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4900)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5363)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:731)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1868)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)rn at java.util.concurrent.FutureTask.run(FutureTask.java:266)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)rn at java.lang.Thread.run(Thread.java:748)rnCaused by: java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.XMLContext.(Lorg/hibernate/boot/spi/ClassLoaderAccess;)Vrn at org.hibernate.cfg.annotations.reflection.JPAMetadataProvider.(JPAMetadataProvider.java:66)rn at org.hibernate.boot.internal.MetadataBuilderImpl$MetadataBuildingOptionsImpl.generateDefaultReflectionManager(MetadataBuilderImpl.java:742)rn at org.hibernate.boot.internal.MetadataBuilderImpl$MetadataBuildingOptionsImpl.(MetadataBuilderImpl.java:715)rn at org.hibernate.boot.internal.MetadataBuilderImpl.(MetadataBuilderImpl.java:127)rn at org.hibernate.boot.MetadataSources.getMetadataBuilder(MetadataSources.java:135)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:654)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726)rn at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:511)rn at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:495)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564)rn ... 25 more
ssm整合时Spring单元测试报错,求大神解救
java.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)rn at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)rn at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:363)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\Eclipse\MyProject\ssm-crud\target\classes\mapper\EmployeeMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cn.ccsu.crud.bean.Employee.department'. Cause: java.lang.ClassNotFoundException: Cannot find class: cn.ccsu.crud.bean.Employee.departmentrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:251)rn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)rn at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)rn ... 25 morernCaused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\Eclipse\MyProject\ssm-crud\target\classes\mapper\EmployeeMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cn.ccsu.crud.bean.Employee.department'. Cause: java.lang.ClassNotFoundException: Cannot find class: cn.ccsu.crud.bean.Employee.departmentrn at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:523)rn at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:380)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)rn ... 40 morernCaused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cn.ccsu.crud.bean.Employee.department'. Cause: java.lang.ClassNotFoundException: Cannot find class: cn.ccsu.crud.bean.Employee.departmentrn at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120)rn at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92)rn at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:521)rn ... 43 morernCaused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cn.ccsu.crud.bean.Employee.department'. Cause: java.lang.ClassNotFoundException: Cannot find class: cn.ccsu.crud.bean.Employee.departmentrn at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:118)rn at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:265)rn at org.apache.ibatis.builder.xml.XMLMapperBuilder.processNestedResultMappings(XMLMapperBuilder.java:386)rn at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildResultMappingFromContext(XMLMapperBuilder.java:367)rn at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:280)rn at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:252)rn at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:244)rn at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116)rn ... 45 morernCaused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cn.ccsu.crud.bean.Employee.department'. Cause: java.lang.ClassNotFoundException: Cannot find class: cn.ccsu.crud.bean.Employee.departmentrn at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:120)rn at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:149)rn at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:116)rn ... 52 morernCaused by: java.lang.ClassNotFoundException: Cannot find class: cn.ccsu.crud.bean.Employee.departmentrn at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:200)rn at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:89)rn at org.apache.ibatis.io.Resources.classForName(Resources.java:261)rn at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:116)rn ... 54 morernrn
SSH整合时struts报了一个错误,求大神指点。
Struts Problem ReportrnrnStruts has detected an unhandled exception: rnrnrnMessages: •There is no Action mapped for namespace [/] and action name [] associated with context path [/ssh-1].rn rnrnStacktracesrnrnThere is no Action mapped for namespace [/] and action name [] associated with context path [/ssh-1]. - [unknown location] rn com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)rn org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)rn org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)rn org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)rn org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)rn org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)rn org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)rn org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)rn java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn java.lang.Thread.run(Thread.java:745)rn rnrnrnrnYou are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set: rn struts.devMode=falsernrnin your WEB-INF/classes/struts.properties file.
这个该怎么解决,求大神
![图片](https://img-ask.csdn.net/upload/201603/14/1457885765_747448.jpg)
java 、Spring出现异常,求大神解决
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/maxingbo/entities/Employee.hbm.xmlrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/maxingbo/entities/Employee.hbm.xmlrn at org.hibernate.cfg.Configuration.addResource(Configuration.java:588)rn at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1606)rn at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1574)rn at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1553)rn at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1527)rn at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:601)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1367)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)rn ... 39 morernCaused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input streamrn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:527)rn at org.hibernate.cfg.Configuration.addResource(Configuration.java:585)rn ... 48 morernCaused by: org.dom4j.DocumentException: http://hibernate.org/dtd/hibernate-mapping-3.2.dtd Nested exception: http://hibernate.org/dtd/hibernate-mapping-3.2.dtdrn at org.dom4j.io.SAXReader.read(SAXReader.java:484)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:518)rn ... 49 morern2014-12-6 14:57:44 org.apache.catalina.core.StandardContext startrn严重: Error listenerStartrn2014-12-6 14:57:44 org.apache.catalina.core.StandardContext startrn严重: Context [/ssh] startup failed due to previous errorsrn2014-12-6 14:57:44 org.apache.catalina.core.ApplicationContext logrn信息: Closing Spring root WebApplicationContextrn2014-12-6 14:57:44 org.apache.coyote.http11.Http11Protocol startrn信息: Starting Coyote HTTP/1.1 on http-8090rn2014-12-6 14:57:44 org.apache.jk.common.ChannelSocket initrn信息: JK: ajp13 listening on /0.0.0.0:8009rn2014-12-6 14:57:44 org.apache.jk.server.JkMain startrn信息: Jk running ID=0 time=0/33 config=nullrn2014-12-6 14:57:44 org.apache.catalina.startup.Catalina startrn信息: Server startup in 7066 msrn
求正则:各位大神帮帮忙
'"base":"http://www.baidu.com","test":"123"'rn这里需要匹配的是base后面的"http://www.baidu.com",别说先转成JSON唉,因为特殊的原因,所以只能用正则了。
JAVA编程,求各位大神帮帮忙.......
JAVA编程:两int数组A,B。A长度为100并且有值无重复,B长度为99无值。 把A数组中的数随机添加到B数组中去,求出没有在B数组中那个数。
spring_hibernate整合时遇到的问题,新手真不知怎么解决,求大神指点,在线等
新手学习ssh,在网上找的视频学习,学到spring_hibernate时遇到的问题[img=https://img-bbs.csdn.net/upload/201312/08/1386516569_450987.jpg][/img]rn求大神看看
KMP程序出现异常,求各位大神帮忙解决一下,谢谢
运行程序出现异常,调试的时候说异常出现在红色行,代码如下:rn#include rn#include rnrnusing namespace std;rn#define MAX_STRING_SIZE 1024rnrnclass CmyStringrnrnpublic:rn CmyString(char *s);rn ~CmyString();rn //int Find(CmyString *CS,CmyString *s);rn int getLength();rn char* getString();rn void operator=(CmyString *s);rnprivate:rn int length;rn char *str[MAX_STRING_SIZE + 1];rnrnrn;rnrnCmyString::CmyString(char *s)rnrn [color=#FF0000]strcpy_s(*str,strlen(s),s);[/color]rnrn length = strlen(s);rnrnrnCmyString ::~CmyString()rnrnrnrnint CmyString::getLength()rnrn return length;rnrnrnchar* CmyString::getString()rnrn return str[MAX_STRING_SIZE + 1];rnrnrnvoid CmyString::operator=(CmyString *s)rnrn strcpy_s(*str,strlen(s->getString()), s->getString());rn length = s->getLength();rnrnrnvoid GenKMPNext(int *next, CmyString *s)rnrn int i = 0, j = -1;rn next[0] = -1;rn char *str = s->getString();rn while (i < (s->getLength()- 1))rn rn while (j >= 0 && str[i] != str[j])rn j = next[j];rn i++;rn j++;rn if (str[i] == str[j])rn next[i] = next[j];rn else next[i] = j;rn rnrnint Find(CmyString *CS, CmyString *s)rnrn int i, j;rn CmyString *ss;rn ss = s;rn char *str1 = ss->getString();rn char *str2 = CS->getString();rn int *next=(int *)malloc(sizeof(int)*s->getLength());rn GenKMPNext(next,ss);rn for (i = 0, j = 0; i < ss->getLength() && j < CS->getLength();)rn rn if (str1[i] == str2[j])rn rn i++; j++;rn rn else if (next[i] >= 0)rn i = next[i];rn elsern rn i = 0; j++;rn rn rn if (i >= ss->getLength())rn return j - ss->getLength();rn elsern return -1;rnrnrnint main()rnrn char p[MAX_STRING_SIZE];rn char target[MAX_STRING_SIZE];rn cin >> p;rn //char *m = (char *)p;rn cin >> target;rn CmyString s(p);rn CmyString cs(target);rn int result;rn result = Find(&cs,&s);rn if (result == -1)rn cout << "False" << endl;rn elsern cout << "True" << endl;rn return 0;rnrn我使用的是VS2015。请各位大神帮忙看一下。目的是要实现KMP算法
求各位大神 帮帮忙 assembly.CreateInstance()
Assembly assembly = Assembly.GetExecutingAssembly();nn var form = assembly.CreateInstance("HumanResources.成本报表.发货成本明细") as Form;n form.MdiParent = ComClass.MainForm;n form.Show();n n 报调用目标发生了异常nn 求各位大神帮帮忙
S2SH整合时报错多谢各位
hibernate配置文件rnrn  rn spring配置文件rn  rn  rnrn  userdaoImpl内容为rn  rn  rn  rnrn  rn 报错内容为rn  rnrn  rn 请问一下这是什么原因,我看网络上好多人都是利用myeclipse自动生成的配置文件搞的,我这个为什么就不行呢?rn 多谢各位大侠
【各位大神帮帮忙】关于Struts2文件上传
在action中只要有private String contextType字段在增加的时候Struts2不是会自动增加到数据库嘛我试了很久都没有成功,为什么呢??
ssi整合时之web.xml
ssi整合时之web.xml
ssi整合时之beans.xml
ssi整合时spring的总配置文件·
Spring+Mybatis整合时报错
刚接触,跑junit test 的时候报错了,注入的时候参数错了?求大神帮忙看看怎么解决,还需要贴什么我再传,谢啦rnrn[code=java]十一月 20, 2014 4:47:22 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from class path resource [spring.xml]rn十一月 20, 2014 4:47:22 下午 org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider registerDefaultFiltersrn信息: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanningrn十一月 20, 2014 4:47:22 下午 org.springframework.test.context.TestContextManager prepareTestInstancern严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@131276c2] to prepare test instance [sy.test.TestTAdd@26aa12dd]rnjava.lang.IllegalStateException: Failed to load ApplicationContextrn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)rn at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:103)rn at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:73)rn at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:313)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnCaused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\MM_System\workspace\MM_System\target\classes\sy\service\UserServiceImpl.class]; nested exception is java.lang.IllegalArgumentExceptionrn at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:261)rn at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)rn at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)rn at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)rn at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1435)rn at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1425)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadBeanDefinitions(AbstractGenericContextLoader.java:219)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103)rn at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:57)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)rn at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)rn at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)rn at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)rn ... 24 morernCaused by: java.lang.IllegalArgumentExceptionrn at org.springframework.asm.ClassReader.(Unknown Source)rn at org.springframework.asm.ClassReader.(Unknown Source)rn at org.springframework.asm.ClassReader.(Unknown Source)rn at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:52)rn at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)rn at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)rn at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:237)rn ... 47 morernrn[/code]rnrn[img=https://img-bbs.csdn.net/upload/201411/20/1416473872_164056.jpg][/img][img=https://img-bbs.csdn.net/upload/201411/20/1416473892_316418.jpg][/img]
ssh整合时报错!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMostSpecificMethod(Ljava/lang/reflect/Method;Ljava/lang/Class;)Ljava/lang/reflect/Method;rnCaused by: java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMostSpecificMethod(Ljava/lang/reflect/Method;Ljava/lang/Class;)Ljava/lang/reflect/Method;rn在我的application.xml文件里有:rnrn rn rn rn rn如果我把这段注释掉,就不报错了.我把asm2.2.3.jar删了,还是不行,往高手指点!rnrnapplication.xml文件开头部分:rnrn
ssh 整合时的问题
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/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;)Vrnrnrn 在网上搜了一下 ,说是一个asm-2.2.3.jar的包问题 可是我把移调还是这样子.......rnweb.xmlrn rn contextConfigLocationrn /WEB-INF/classes/applicationContext.xmlrn rn rn org.springframework.web.context.ContextLoaderListenerrn rnrnapplicationContext.xmlrnrn rn rnrn rnrnrnrnrnrnrnrnrnrnrn 初学者.....
dwr 整合时报错
java.lang.NumberFormatException: null  at java.lang.Integer.parseInt(Unknown Source)  at java.lang.Integer.parseInt(Unknown Source)  at org.directwebremoting.util.VersionUtil.loadProperties(Version
帮忙解决下SSH2整合时出现的问题
[code=text]rn17:33:37,152 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'VipService' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'advice': Cannot resolve reference to bean 'trManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'trManager' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.getJDBCMajorVersion()Irn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:448)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'advice': Cannot resolve reference to bean 'trManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'trManager' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.getJDBCMajorVersion()Irn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor.getAdvice(AbstractBeanFactoryPointcutAdvisor.java:85)rn at org.springframework.aop.aspectj.AspectJProxyUtils.isAspectJAdvice(AspectJProxyUtils.java:67)rn at org.springframework.aop.aspectj.AspectJProxyUtils.makeAdvisorChainAspectJCapableIfNecessary(AspectJProxyUtils.java:49)rn at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.extendAdvisors(AspectJAwareAdvisorAutoProxyCreator.java:101)rn at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:88)rn at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)rn at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn ... 35 morern[/code]rn在网上查到的解决方案是jar包太旧,但是换了classes12.jar、ojdbc5.jar、ojdbc6.jar、ojdbc14.jar、oracle.jar都没有作用rnapplicationContext.xml中sessionfactory的配置如下:rn[code=text]rn rn rn rn rnrn rn rn org.hibernate.dialect.Oracle10gDialectrn updatern truern falsern falsern rn rnrn[/code]
SpringMVC+Spring+JPA整合时出现问题
错误信息:rnrnrn七月 15, 2014 12:27:28 下午 org.apache.catalina.core.StandardContext listenerStartrnSEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [file:/D:/apache-tomcat-7.0.54/webapps/SMHJ/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerErrorrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: java.lang.ExceptionInInitializerErrorrn at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:130)rn at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:286)rn at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)rn ... 26 morernCaused by: java.lang.ClassCastException: org.hibernate.annotations.common.reflection.java.JavaReflectionManager cannot be cast to org.hibernate.annotations.common.reflection.MetadataProviderInjectorrn at org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2939)rn at org.hibernate.cfg.Configuration.createReflectionManager(Configuration.java:2934)rn at org.hibernate.cfg.Configuration.reset(Configuration.java:305)rn at org.hibernate.cfg.AnnotationConfiguration.reset(AnnotationConfiguration.java:233)rn at org.hibernate.cfg.Configuration.(Configuration.java:296)rn at org.hibernate.cfg.Configuration.(Configuration.java:300)rn at org.hibernate.cfg.AnnotationConfiguration.(AnnotationConfiguration.java:108)rn at org.hibernate.ejb.Ejb3Configuration.(Ejb3Configuration.java:107)rn ... 31 morern七月 15, 2014 12:27:28 下午 org.apache.catalina.core.StandardContext startInternalrnSEVERE: Error listenerStartrn七月 15, 2014 12:27:28 下午 org.apache.catalina.core.StandardContext startInternalrnSEVERE: Context [/SMHJ] startup failed due to previous errorsrnrn看上去好像是不能把JavaReflectionManager类转换成MetadataProviderInjector 具体什么原因我也搞不懂...rnrn配置文件:rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn $hibernate.dialectrn org.hibernate.cache.ehcache.EhCacheRegionFactoryrn /ehcache/ehcache.xmlrn org.hibernate.cfg.ImprovedNamingStrategyrn truern truern truern 3rn updatern rn rn rn rnrnrn求助啊各位大神 整了3 个小时了 整不出来啊 哭晕在厕所!!!rn
ssh整合时出现问题~
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [ApplicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/AbstractExecutorServicern at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)rn at com.dazy.test.Test.main(Test.java:19)rnCaused by: java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/AbstractExecutorServicern at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:418)rn at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:334)rn at net.sf.ehcache.CacheManager.configure(CacheManager.java:306)rn at net.sf.ehcache.CacheManager.init(CacheManager.java:226)rn at net.sf.ehcache.CacheManager.(CacheManager.java:213)rn at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:131)rn at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72)rn at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:236)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)rn ... 15 morernCaused by: java.lang.ClassNotFoundException: edu.emory.mathcs.backport.java.util.concurrent.AbstractExecutorServicern at java.net.URLClassLoader$1.run(URLClassLoader.java:366)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:355)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:354)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:423)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:356)rn ... 29 morernrnrnssh整理时,当我把struts加进来后,再倒回去运行测试类的时候,出现了这个bug,搜索了好多答案都没有解决,求各位大神看看,给点意见~
apache与tomcat整合时
apache运行时提示LoadModule jk_module modules/mod_jk-2.0.42.dll找不到指定模块,why?rn
SSH整合时,
[img=https://img-bbs.csdn.net/upload/201409/21/1411307967_510059.jpg][/img]rn从网上下的马士兵Spring视频,都看了,然后把视频中源码部分,最后一个项目Spring_3300_Registration_11部署到自己的MyEclipse7.5下,除了使用mysql5的数据库之外,其他都一样啊,总是出现这样的错误,而且,每个测试方法都通不过…rn本人水平有限,这个SSH整合的项目,怎么也解决不了这个异常啊,所以,跪求解决啊~
SSH 整合时的jar包
四十几个SSH整合时必须的不冲突的jar包,直接粘贴就可以
SSH整合时知识点
本文采用struts2.3.16+hibernate3.6+spring3.2.8进行整合 [b]jar包列表[/b] [list] [*]antlr-2.7.6.jar [*]aopalliance-1.0.jar [*]asm-3.3.jar [*]asm-commons-3.3.jar [*]aspectjweaver.jar [*]commons-collections...
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池