Topic
  • 2 replies
  • Latest Post - ‏2014-01-14T11:28:30Z by ptrinchi
ptrinchi
ptrinchi
3 Posts

Pinned topic Warning about XML mappings in Liberty profile

‏2013-12-18T07:48:34Z |

Hi All,

I have an @Entity class with a field mapped to a DB2 XML datatype using the annotations (JobData is a JAXB generated class):

@Persistent(fetch = FetchType.LAZY)
@Strategy("org.apache.openjpa.jdbc.meta.strats.XMLValueHandler")
@Column(name = "DATA")
private JobData jobData;

When I deploy the application on Liberty profile (8.5.5.1) I receive this warning in the trace:

CWWJP9991W: openjpa.MetaData: Warn: OpenJPA cannot map field "Job.jobData" efficiently.  It is of an unsupported type. The field value will be serialized to a BLOB by default.

Any idea about the possible cause of this warning and its effect at runtime ?

The datasource is defined as follow:

<variable name="DB2_JCC_DRIVER_PATH" value="/home/db2inst1/sqllib/java/"/>

<library id="db2-jcc-lib" name="DB2 JCC Database Drivers">
    <fileset dir="${DB2_JCC_DRIVER_PATH}" includes="db2jcc4.jar db2jcc_license_cu.jar"/>
</library>

<jdbcDriver id="db2-jcc-driver" libraryRef="db2-jcc-lib"/>
    
<dataSource connectionSharing="MatchOriginalRequest" jdbcDriverRef="db2-jcc-driver" jndiName="jdbc/WG" type="javax.sql.XADataSource">
    <properties.db2.jcc currentSchema="TST" databaseName="TSTDB" password="{xor}KT4zOm1obm5tb29rLTYw" portNumber="50000" serverName="localhost" user="db2inst1"/>
</dataSource>

Thanks for your help

Regards,

Patrizio

  • AlexMulholland
    AlexMulholland
    32 Posts

    Re: Warning about XML mappings in Liberty profile

    ‏2013-12-19T14:24:35Z  

    Hello Patrizio,

    There are a couple of suggestions for this message on stack overflow: http://stackoverflow.com/questions/4583180/problem-with-open-jpa

    - make sure the entity is in the persistence.xml

    - check for relationships to another class that isn't annotated with @ManyToOne, @OneToMany or similar

    There's a similar posting here: http://stackoverflow.com/questions/2465327/problem-with-bidirection-manytoone

    I hope this helps.

    Regards, Alex.

     

  • ptrinchi
    ptrinchi
    3 Posts

    Re: Warning about XML mappings in Liberty profile

    ‏2014-01-14T11:28:30Z  

    Hello Patrizio,

    There are a couple of suggestions for this message on stack overflow: http://stackoverflow.com/questions/4583180/problem-with-open-jpa

    - make sure the entity is in the persistence.xml

    - check for relationships to another class that isn't annotated with @ManyToOne, @OneToMany or similar

    There's a similar posting here: http://stackoverflow.com/questions/2465327/problem-with-bidirection-manytoone

    I hope this helps.

    Regards, Alex.

     

    Hi Alex,

    thanks for the hints, but I my scenario is slightly different. When I'd like to implement is a mapping with an XML database column.
    I already have all the entity classes enlisted in persistence.xml and no relations with other entities, but I still receive that warning from WebSphere Liberty Profile. The same EAR deployed to a full profile doesn't give any problem. Is is a known limitation of the JPA implementation provided by Liberty? or there is some other way to manage the XML column mapping an that platform?

    Thanks again for your help

    Patrizio