English 中文(简体)
Java-EE6: 获取型態。 LAZY 带有静态编织, 丢弃了奇怪的例外 。
原标题:Java-EE6: FetchType.LAZY with static weaving throws strange exception

我的解决方案包括三个不同的项目:

  • EJB项目与Netbeans自动产生的法卡德公司合作管理实体类和持久性。xml

  • 持有所有@Entity 附加说明和静态编织数据库分类和外表ejb s 远程界面(由 EJB 和独立客户共享) 的分类 Library

  • 独立客户客户,主要由Swing GUI类构成

我使用玻璃鱼3.1.2, Eclipselink 2.3作为JPA提供者、Netbeans 7.1.1 和 MySQL 数据库。 我配置了一个Ant-task, 以持久性.xml为基础静态编织实体类别。

我有几个@OneToone、@ManyToone和 @manyTomany 附加说明,

现在我有以下错误:

Exception in thread "Mainframe Loader" Local Exception Stack: 
Exception [EclipseLink-7242] (Eclipse Persistence Services - 2.3.2.v20111125-r10461):     org.eclipse.persistence.exceptions.ValidationException
Exception Description: An attempt was made to traverse a relationship using indirection that had a null Session.  This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization.  To avoid this issue, instantiate the LAZY relationship prior to serialization.
 at org.eclipse.persistence.exceptions.ValidationException.instantiatingValueholderWithNullSession(ValidationException.java:998)
 at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:220)
 at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:88)
 at org.eclipse.persistence.indirection.IndirectList.buildDelegate(IndirectList.java:244)
 at org.eclipse.persistence.indirection.IndirectList.getDelegate(IndirectList.java:414)
 at org.eclipse.persistence.indirection.IndirectList.size(IndirectList.java:752)
 at ch.lawsuite.gui.mail.PosteingangUI.updateDokumentTable(PosteingangUI.java:47)
 at ch.lawsuite.gui.mail.MailboxUI.updateDokumentTables(MailboxUI.java:81)
 at ch.lawsuite.gui.mail.MailboxUI.initMailboxes(MailboxUI.java:37)
 at ch.lawsuite.gui.mail.MailboxUI.<init>(MailboxUI.java:23)
 at ch.lawsuite.gui.MainframeUI.initModules(MainframeUI.java:191)
 at ch.lawsuite.gui.login.LoginUI$MainframeLoader.run(LoginUI.java:131)

任何帮助都十分感激。

事先多谢!

最佳回答

一旦该实体被传送到远程客户端 - 您无法装入无载懒惰属性。 您需要确认它们被装入( 触摸它们或其它东西) 远程传递它们。 静态编织与此无关 。 ( 自动程序与静态/ 动态/ 不编织不同, 但对于我们作为开发者来说, 概念上没有区别 ) 。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签