- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在研究 hibernate 映射,除了我在 hibernate 尝试将我的对象持久化到系统时遇到的 PropertyAccessException 之外,其他一切都运行良好。
下面是堆栈跟踪
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.raisonne.tr.model.destination.Destination.uuid
org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:195)
org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:199)
org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3605)
org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:3321)
org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:204)
org.hibernate.engine.ForeignKeys$Nullifier.isNullifiable(ForeignKeys.java:160)
org.hibernate.engine.ForeignKeys$Nullifier.nullifyTransientReferences(ForeignKeys.java:92)
org.hibernate.engine.ForeignKeys$Nullifier.nullifyTransientReferences(ForeignKeys.java:70)
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:311)
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535)
org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527)
org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:241)
org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:240)
org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:193)
org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:320)
org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:266)
org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:243)
org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:193)
org.hibernate.engine.Cascade.cascade(Cascade.java:154)
org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:479)
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:357)
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535)
org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527)
org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:523)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342)
$Proxy17.saveOrUpdate(Unknown Source)
com.raisonne.tr.dao.impl.GenericDAOImpl.makePersistance(GenericDAOImpl.java:170)
com.raisonne.tr.service.impex.impl.DestinationImportServiceImpl.startDestinationImport(DestinationImportServiceImpl.java:130)
com.raisonne.tr.backoffice.actions.impex.DestinationImportAction.destinationImport(DestinationImportAction.java:118)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)
java.lang.IllegalArgumentException: object is not an instance of declaring class
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:169)
org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:199)
org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3605)
org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:3321)
org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:204)
org.hibernate.engine.ForeignKeys$Nullifier.isNullifiable(ForeignKeys.java:160)
org.hibernate.engine.ForeignKeys$Nullifier.nullifyTransientReferences(ForeignKeys.java:92)
org.hibernate.engine.ForeignKeys$Nullifier.nullifyTransientReferences(ForeignKeys.java:70)
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:311)
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535)
org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527)
org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:241)
org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:240)
org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:193)
org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:320)
org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:266)
org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:243)
org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:193)
org.hibernate.engine.Cascade.cascade(Cascade.java:154)
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
<id name="uuid" type="java.lang.String">
<column name="UUID" />
<generator class="uuid"/>
</id>
private Set<PlaceToVisit> placesToVisit=new HashSet<PlaceToVisit>();
public Set<PlaceToVisit> getPlacesToVisit() {
return placesToVisit;
}
public void setPlacesToVisit(Set<PlaceToVisit> placesToVisit) {
this.placesToVisit = placesToVisit;
}
public void addPlaceToVisit(PlaceToVisit placeToVisit){
placeToVisit.setDestination(this);
this.placesToVisit.add(placeToVisit);
}
<set name="placesToVisit" table="PLACETOVISIT" inverse="false" lazy="true" cascade="save-update">
<key>
<column name="DESTINATIONID" />
</key>
<one-to-many class="PlaceToVisit" />
</set>
<id name="uuid" type="java.lang.String">
<column name="UUID" />
<generator class="uuid"/>
</id>
<property name="name" type="java.lang.String">
<column name="NAME" />
</property>
<many-to-one name="destination" class="Destination" fetch="join">
<column name="DESTINATION" />
</many-to-one>
最佳答案
此错误可能是由于在类型 Destination
的对象中找到了某种其他类型的对象而引起的。预料之中。
例如,如果某个其他类被意外添加到 Collection<Destination>
通过未经检查的 Actor 。
关于hibernate - org.hibernate.PropertyAccessException : IllegalArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4616141/
我在尝试保持多对多关系时遇到了以下异常。任何线索将不胜感激。我正在使用 hibernate 的 @ManyToMany 注释,如下所示。 如果我从建筑实体中移除房屋然后坚持下去,它就可以正常工作。只有
当 HashMap 中的顶级键可能存在也可能不存在时,如何解决 PropertyAccessExceptions? 在下面的示例中,如果属性存在,它就可以正常工作,但如果变量映射中不存在该属性,则会抛
我有四个实体 RoomNight、BookingCorporateDetails、BookingDiscountDetails 和 BookingDetails,其中 BookingCorporate
我正在研究 hibernate 映射,除了我在 hibernate 尝试将我的对象持久化到系统时遇到的 PropertyAccessException 之外,其他一切都运行良好。 下面是堆栈跟踪 or
这是一个异常(exception): org.hibernate.PropertyAccessException:空值被分配给 com.FOO.hibernate.Tccl.MIN 的原始类型 set
尝试运行以下程序时: public class Runner { public static void main(String args[]) { Configuration
我有一个父表(MHS_USER)和关联的子表(GROUP),与ManyToMany关系映射如下(相关代码如下) @Entity @Table(name = "mhs_user") public cla
我收到以下错误: org.hibernate.PropertyAccessException: IllegalArgumentException 调用 Part.part_id 的 getter 时发
我想配置 Spring-ws 连接管理器以使用 PoolingHttpClientConnectionManager。这是我的配置 camel-context.xml
我已经做了一个在 hibernate 中使用数据库登录的示例。我的 Xml 和实体类是用户.java: import java.util.Date; import javax.persistence.
当我运行下面的代码以显示属于 JTable 中特定类别的项目时,我收到此异常: private void categoryComboBoxActionPerformed(java.awt.event.
我正在开发一个 Spring-boot 2 项目,该项目用于添加 MCQ 问题、选项和答案。每个问题的选项可能有 2 到 6 个选项。 我创建了 3 个表格:一张用于问题,一张用于选项,一张用于答案。
我最近开始 hibernate ,在我的第一个项目中,我在使用 @ManyToMany 时给出了 PropertyAccessException: Error accessing field 我不知道
我使用 spring-boot-1.5.3 和 spring-data-jpa,有两个实体,它们在 cloumn tags 和 nicknames 上都有 JPA Annoatation Elemen
我正在构建一个使用 java reSTLet 和 Hibernate 的应用程序。 我有用户实体类,每当我调用 http get 时。我收到错误。 { "error": "20000:Hibe
将 Spring Boot 与 Hibernate JPA 结合使用 我无法访问 @Entity 的 DAO,它有一个复合键,其中一列是外键。它给了我org.hibernate.PropertyAcc
这段执行 Hibernate 查询的代码作为 Java 程序运行正常,但如果我将它作为 Spring Boot 运行,它就会失败我在某处读到它可能是因为 Hibernate 5.1 中的错误。可能是吗
这是我的 hibernate POJO 类。 StockModel.java import java.util.Date; public class StockModel implements jav
是什么导致了这个异常,我无法找出。 Request processing failed; nested exception is javax.persistence.PersistenceExcept
我环顾四周寻找答案,看起来它与反射有关,但由于我没有处理过它们,所以我不确定如何进行。我正在尝试构建一个 HQL 查询,该查询仅返回表中与作为 FK 的列匹配的行到另一个表中的 PK。 这是我的代码:
我是一名优秀的程序员,十分优秀!