这个异常为啥提示在user里面少东西

问题描述

org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinclasspathresource[applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.PropertyNotFoundException:Couldnotfindagetterforidinclasscom.wee.s2sh.entity.Useratorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:681)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)atorg.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)atorg.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)atjava.util.concurrent.FutureTask.run(FutureTask.java:262)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)atjava.lang.Thread.run(Thread.java:744)Causedby:org.hibernate.PropertyNotFoundException:Couldnotfindagetterforidinclasscom.wee.s2sh.entity.Useratorg.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:310)atorg.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:304)atorg.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:497)atorg.hibernate.tuple.PropertyFactory.buildIdentifierAttribute(PropertyFactory.java:87)atorg.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:163)atorg.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:520)atorg.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:148)atsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)atjava.lang.reflect.Constructor.newInstance(Constructor.java:526)atorg.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:163)atorg.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135)atorg.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:401)atorg.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)atorg.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)atorg.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:343)atorg.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:431)atorg.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:416)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)...25morespring配置xml:<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:p="http://www.springframework.org/schema/p"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:context="http://www.springframework.org/schema/context"xmlns:jee="http://www.springframework.org/schema/jee"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-4.0.xsdhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-4.0.xsdhttp://www.springframework.org/schema/jeehttp://www.springframework.org/schema/jee/spring-jee-4.0.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-4.0.xsd"><!--加载数据库属性配置文件--><context:property-placeholderlocation="classpath:db.properties"/><!--数据库连接池c3p0配置--><beanid="dataSource"class="com.mchange.v2.c3p0.ComboPooledDataSource"destroy-method="close"><propertyname="jdbcUrl"value="${db.url}"></property><propertyname="driverClass"value="${db.driverClassName}"></property><propertyname="user"value="${db.username}"></property><propertyname="password"value="${db.password}"></property><propertyname="maxPoolSize"value="40"></property><propertyname="minPoolSize"value="1"></property><propertyname="initialPoolSize"value="1"></property><propertyname="maxIdleTime"value="20"></property></bean><!--session工厂--><beanid="sessionFactory"class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"><propertyname="dataSource"><refbean="dataSource"/></property><propertyname="hibernateProperties"><props><propkey="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop><propkey="hibernate.show_sql">true</prop></props></property><propertyname="mappingResources"><value>com/wee/s2sh/entity/User.hbm.xml</value></property></bean><!--配置事务管理器--><beanid="transactionManager"class="org.springframework.orm.hibernate4.HibernateTransactionManager"><propertyname="sessionFactory"ref="sessionFactory"/></bean><beanid="baseDao"class="com.wee.s2sh.dao.impl.BaseDaoImpl"><propertyname="sessionFactory"ref="sessionFactory"></property></bean><beanid="userService"class="com.wee.s2sh.service.user.impl.UserServiceImpl"><propertyname="baseDao"ref="baseDao"></property></bean><beanid="Login"class="com.wee.s2sh.action.Login"><propertyname="userService"ref="userService"></property></bean><!--配置事务通知属性--><tx:adviceid="txAdvice"transaction-manager="transactionManager"><!--定义事务传播属性--><tx:attributes><tx:methodname="insert*"propagation="REQUIRED"/><tx:methodname="update*"propagation="REQUIRED"/><tx:methodname="edit*"propagation="REQUIRED"/><tx:methodname="save*"propagation="REQUIRED"/><tx:methodname="add*"propagation="REQUIRED"/><tx:methodname="new*"propagation="REQUIRED"/><tx:methodname="set*"propagation="REQUIRED"/><tx:methodname="remove*"propagation="REQUIRED"/><tx:methodname="delete*"propagation="REQUIRED"/><tx:methodname="change*"propagation="REQUIRED"/><tx:methodname="get*"propagation="REQUIRED"read-only="true"/><tx:methodname="find*"propagation="REQUIRED"read-only="true"/><tx:methodname="load*"propagation="REQUIRED"read-only="true"/><tx:methodname="*"propagation="REQUIRED"read-only="true"/></tx:attributes></tx:advice><!--应用普通类获取bean<beanid="appContext"class="com.soanl.util.tool.ApplicationUtil"/>--><!--配置事务切面--><aop:config><aop:pointcutid="serviceOperation"expression="execution(*com.wee.s2sh.service..*.*(..))"/><aop:advisoradvice-ref="txAdvice"pointcut-ref="serviceOperation"/></aop:config><!--自动加载构建bean--><!--<context:component-scanbase-package="com.wee.s2sh.entity"/>--></beans>

解决方案

解决方案二:
User对象的id有没有get方法?

时间: 2025-01-20 22:07:47

这个异常为啥提示在user里面少东西的相关文章

图片处理-Android 进入剪切图片界面异常,提示无法加载图片,然后退出

问题描述 Android 进入剪切图片界面异常,提示无法加载图片,然后退出 这是我的代码,大神门错在哪,求教~ 拍照功能正常,进入剪切界面就闪退. public class informationActivity extends Activity { public static final int TAKE_PHOTO = 1; public static final int CROP_PHOTO = 2; private Button takephoto; private ImageView

请求-mysql访问异常,提示设置max_allowed_packet

问题描述 mysql访问异常,提示设置max_allowed_packet com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1168 > 1024). You can change this value on the server by setting the max_allowed_packet' variable. max_allowed_packet已经为16m修改且生效,但是还是报这个异常.重启后恢

云路由器宽带拨号提示“网络异常”的解决办法

设置路由器上网时,路由器WAN口宽带拨号不成功,在路由器管理界面 网络状态 页面出现"网络异常"的提示,如下图: 请按照以下方法排查: 可能原因:线路接错或者网线接口接触不良. 解决办法:请根据您的入户宽带线路类型,确认线路连接正确,如下:   如果线路连接正常,但WAN口指示灯不亮,检查是否网线接口接触不良,请换一条网线尝试. 确保电脑直接连接宽带可以正常上网,排除宽带线路问题. 可能原因:宽带线路的上网方式不是PPPoE拨号上网. 解决办法:PPPoE是指通过运营商指定的宽带账号密

userinit.exe异常怎么解决

userinit.exe是什么进程? Userinit.exe是Windows操作系统一个关键进程.用于管理不同的启动顺序,一般情况下,该进程不是什么病毒程序.所以可以不要去管它.当系统刚启动时,如果你调出任务管理器就会看到userinit.exe ,但过一段时间,系统各项加载完毕后,userinit.exe就会自动消失的. Userinit.exe出现异常的现象: 故障分析:Userinit.exe出现故障其主要原始Userinit.exe是一些黑客改名伪装为木马病毒程序,这样电脑就会出现很卡

使用JNative调用C# DLL文件 提示未找到方法

问题描述 最近项目需要使用一个C#的DLL文件的方法,用JNative去实现的,JNativeCpp.dll和需要调用的dll文件都放到windows/system32下了,然后newJNative("ABC.Portal.Common.dll","Token");提示这个Token方法找不到.org.xvolks.jnative.exceptions.NativeException:FunctionTokennotfoundatorg.xvolks.jnative

如何处理GCHandle.Alloc()的参数异常?

问题描述 各位大侠,关于以下问题,强烈请求帮助!想获取当前自定义控件对象的地址,原VB6.0中用ret=objPtr(Me),程序转到VB.NET环境中,将自定义控件编写定义为类,而上述语句则改写为:ImportsSystem.Runtime.InteropServicesDimsfHandleAsGCHandleDimretAsIntegersfHandle=GCHandle.Alloc(Me,GCHandleType.Pinned)ret=sfHandle.AddrOfPinnedObjec

C#运行程序后,触摸屏设备上弹出IO异常,打开串口失败

问题描述 上位机C#编写的智能设备应用程序,用USB线连接触摸屏设备,WinCE6.0,在Class1.cs的串口初始化函数中尝试打开串口,若捕获到异常,则显示异常,代码如下所示.串口就只在串口初始化函数中打开一次,串口关闭和自定义三个线程Abort都写在了Form1的Closing事件中,这样应该没问题吧?但部署运行后,有时会在屏幕上出现IO异常的提示框,见下图,重启VS2008软件不能解决问题,只有设备重启后,才不出现,请问是怎么回事呢,该如何解决?感谢高手相助~try{comport.Op

Hibernate4.3在开发中的一些异常总结(持续更新)

版权声明:尊重博主原创文章,转载请注明出处哦~http://blog.csdn.net/eson_15/article/details/51273804 目录(?)[+]         当被错误折磨半天后,突然找到解决办法了,那种快感--不是东京热可以给的了的--好来,不闲扯了,这篇文章主要是记录hibernate在开发中所出现的异常,方便以后查看~ 1.java.lang.NoSuchMethodError: 1.1 javax.persistence.Table.indexes()[Lja

环信消息在flyme4.5系统上提醒异常

问题描述 使用魅族mx4集成环信sdk, 在flyme4.5系统上. 当有接受到新消息时,并且当前应用正在运行, 通知栏会闪一下消息 然后立马消失. 其他系统miui.cm测试没有问题. 不知道是不是flyme自身机制问题. 有谁遇到一样的问题? 望提供解决办法或思路? 解决方案 在flyme4.5系统上程序运行在后台,也是闪一下吗? 我们demo的默认实现时在后台时来消息会在通知栏显示通知,在前台会闪一下提示,在当前聊天页面不提示,这些都是demo层面处理的,可以自定义.不知道你所说的闪一下是