Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » virtual mapping for byte[]
virtual mapping for byte[] [message #1234398] Tue, 21 January 2014 22:18
jason zhang is currently offline jason zhang
Messages: 30
Registered: July 2009
Member
Hi, I am trying to create a virtual mapping for byte[]. The eclipselink-orm.xml is like this

<?xml version="1.0" encoding="UTF-8"?>
<orm:entity-mappings xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <orm:persistence-unit-metadata>
      <orm:xml-mapping-metadata-complete>true</orm:xml-mapping-metadata-complete>
      <orm:exclude-default-mappings>true</orm:exclude-default-mappings>
      <orm:persistence-unit-defaults>
         <orm:access>VIRTUAL</orm:access>
         <orm:access-methods get-method="get" set-method="set"/>
      </orm:persistence-unit-defaults>
   </orm:persistence-unit-metadata>
   <orm:package>com.flexdms.flexims.dynamic.model.generated</orm:package>
   <orm:table-generator name="Testseq" table="seqs" pk-column-name="name" value-column-name="seq" pk-column-value="Test" initial-value="10000" allocation-size="50"/>
   <orm:entity name="Test" class="Test">
      <orm:property name="System" value="true"/>
      <orm:attributes>
         <orm:id name="id" attribute-type="Long">
            <orm:generated-value strategy="TABLE" generator="Testseq"/>
         </orm:id>
         <orm:basic name="lobvalue" attribute-type="byte[]">
            <orm:column/>
            <orm:lob/>
         </orm:basic>
         <orm:version name="_version" mutable="true" attribute-type="Integer"/>
      </orm:attributes>
   </orm:entity>
</orm:entity-mappings>

But, at the bootstrap time, I got this exception
javax.persistence.PersistenceException: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [test] failed. Close all factories for this PersistenceUnit.
Internal Exception: java.lang.VerifyError: (class: com/flexdms/flexims/dynamic/model/generated/Test, method: getLobvalue signature: ()L[B;) Wrong return type in function
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createDeployFailedPersistenceException(EntityManagerSetupImpl.java:820)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:760)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:304)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:336)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:302)
	at com.flexdms.flexims.unit.jpa.eclipselink.TestORMGenerator.testLobTypes(TestORMGenerator.java:135)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [test] failed. Close all factories for this PersistenceUnit.
Internal Exception: java.lang.VerifyError: (class: com/flexdms/flexims/dynamic/model/generated/Test, method: getLobvalue signature: ()L[B;) Wrong return type in function
	at org.eclipse.persistence.exceptions.EntityManagerSetupException.deployFailed(EntityManagerSetupException.java:238)
	... 32 more
Caused by: java.lang.VerifyError: (class: com/flexdms/flexims/dynamic/model/generated/Test, method: getLobvalue signature: ()L[B;) Wrong return type in function
	at java.lang.Class.getDeclaredFields0(Native Method)
	at java.lang.Class.privateGetDeclaredFields(Class.java:2387)
	at java.lang.Class.getField0(Class.java:2712)
	at java.lang.Class.getField(Class.java:1567)
	at org.eclipse.persistence.dynamic.DynamicTypeBuilder.<init>(DynamicTypeBuilder.java:141)
	at org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder.<init>(JPADynamicTypeBuilder.java:39)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.createDynamicType(MetadataProject.java:935)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.createDynamicClasses(MetadataProject.java:904)
	at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.createDynamicClasses(MetadataProcessor.java:157)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:586)
	... 30 more


I tested other basic types such as int, double,string. All of them works except this one.

Any suggestion?

thanks
Previous Topic:Custom Byte Code Transformer
Next Topic:postponed database writes
Goto Forum:
  


Current Time: Thu Oct 23 06:50:14 GMT 2014

Powered by FUDForum. Page generated in 0.02887 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software