今天在修改项目的时候,犯了一个很低级的错误, 错误很小 ,但一旦出现异常找起来就忙了半天.
首先我阐述一下我犯的错误, 我的项目中使用到了hibernate 3.0框架, 在进行ORM映射的时候我改动了一些属性及引用路径 而在我*.java Pojo对象原文件中我并没有对应的去改动此属性名称, 这直接导致了hbm.xml映射文件中的属性与Pojo对象中的属性不匹配,所以启动tomcat加载hibernate hbm.xml文件时找不到setter getter 访问器提供不了访问该属性的访问方法.
tomcat 启动加载异常问题如下: (注:红色字体表示异常所在)
2011-04-07 15:01:10,812 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:/D:/Tomcat/tomcat6.0/webapps/iet/WEB- INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:323)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:433)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:231)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1313)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)
... 36 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:107)
... 49 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for goodFiles in class com.jhsoft.entity.User
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.mapping.Property.getGetter(Property.java:272)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:300)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:118)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:78)
... 53 more
原因如图所示:
解决问题的办法 : 把实体对象中的属性名称与hbm映射文件中 的set name属性名称要一致
分享到:
相关推荐
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient 通过控制台的...
在Android系统中,BroadcastReceiver(广播接收者)是一种重要的组件,用于监听系统或应用程序发出的各种广播事件,并在接收到广播时执行相应的操作。标题提到的“BroadcasReceivert的两种注册模式”指的是...
stdin, stdout, stderr = ssh.exec_command('command_to_execute') output = stdout.read().decode() error = stderr.read().decode() ssh.close() ``` 在这个例子中,我们创建了一个`SSHClient`实例,但只...
在编写完业务逻辑代码后,只需要将.class文件放入Web容器,例如Tomcat的相应目录下,即可完成WebService的发布。 Axis2提供了多种编写客户端程序的方式。最简单的方式是使用wsdl2java工具来简化客户端代码的编写,...
<constructor-arg value="file:/path/to/axis2.xml"/> ``` 3. **定义Web服务**: 在Spring配置文件中,使用`ServiceDeployer` bean部署Axis2服务。这通常涉及到将服务的aar文件添加到Axis2的Repository目录,并...
很好用的OPC模拟服务器,配置简单,支持.Net,Java的开发环境。
3. **Java源码中的XML引用**:当XML文件引用了Java类或方法时,插件能提供跳转功能,直接定位到相应的Java源代码。 4. **XML编译时检查**:在Java项目构建过程中,插件会检查XML配置文件的正确性,确保其与Java代码...
4. **性能优化**:jMimeMagic设计时考虑了性能,尽可能减少对磁盘I/O和CPU的消耗,以适应大规模文件处理的需求。 5. **跨平台兼容性**:作为Java库,jMimeMagic可以在任何支持Java的平台上运行,包括Windows、Linux...
在使用 Prefabs 和 Instantiate 时,需要注意以下几点: 1. Prefabs 只能被实例化在场景中,而不能在 Prefabs 本身中被实例化。 2. Prefabs 的实例可以被单独编辑,但是 Prefabs 本身不能被编辑。 3. Prefabs 的...
在Unity3D游戏开发中,Prefabs(预设)和Instantiate(实例化)是两个非常重要的概念,它们是构建游戏对象和动态管理游戏世界的基石。本文将深入探讨这两个概念,帮助初学者理解并掌握它们在实际项目中的应用。 ...
dpoll ... 最初创建于 安装 $ python3 -m venv dpoll-env $ tmp source dpoll-env/bin/activate ...$ cd dpoll.xyz $ pip install -r requirements.txt $ touch dpoll/base/settings.py dpoll/base/local_settings.py ...
{“success”:false,“message”:“Failed to instantiate the chaincode. cause:instantiate proposal resulted in an error :: Error: 2 UNKNOWN: chaincode error (status: 500, message: is not a valid ...
用SpringBoot + Spring Data JPA操作数据库 项目启动的时候 报了一个错 SpringBoot的版本是2.2.6.RELEASE org.springframework.beans.factory.BeanCreationException: Error creating bean with name '...
当在执行多次Instantiate实例化物体时,会卡顿严重甚至在移动端会导致程序崩溃 因为Instantiate会产生大量的GC,使CPU过高,导致崩溃 下面是一段测试代码:当我们按下按键时实例化100000个预制体 using UnityEngine...
- 错误处理:处理可能出现的异常,如文件I/O错误、格式不支持等。 通过MediaExtractor和MediaMuxer的配合,开发者可以实现自定义的多媒体文件处理逻辑,比如裁剪视频、合并音视频、转码等。这两个组件为Android提供...
稳定的兔子 stablerabbit是一个用于Rabbitmq的库 ... log.Fatalf("unable to instantiate publisher: %s", err) } queueName := "shahin" if err = p.Publish(context.Background(), queueName
1. **GUI模式不可用**:文档中提到“Unable to instantiate GUI”,这是因为没有图形界面支持。在没有GUI的Linux环境下,WebLogic安装程序会自动进入文本模式安装。 2. **权限问题**:在安装过程中可能会遇到权限...
名称 WebService :: Pushover-Pushover ...) or die( "Unable to instantiate WebService::Pushover.\n" ); my %params = ( message => 'test test test', priority => 0, ); my $status = $push->message( %params
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.amqp.core.Queue]: Factory method 'clientQueue' threw exception; nested exception is org....
Android 基础知识点总结 Android 操作系统是 Google 公司研发的一种基于 Linux 的操作系统,用于手机和...11. E/AndroidRuntime(1099): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{...