facebook

Problem with JPA tutorial

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #281455 Reply

    j_droberts
    Member

    Hi

    I’m running the JPA tutorial with no changes on myeclipse 6.0.1 GTA.

    And get the following error message:

    any ideas?

    Jonathan

    [TopLink Info]: 2008.02.05 03:56:04.562–ServerSession(10284430)–TopLink, version: Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))
    [TopLink Info]: 2008.02.05 03:56:06.093–ServerSession(10284430)–file:/C:/Documents%20and%20Settings/Jonathan%20Roberts/workspace/SampleJPAProject/bin/-SampleJPAProjectPU login successful
    [TopLink Warning]: 2008.02.05 03:56:06.609–ServerSession(10284430)–Exception [TOPLINK-4002] (Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Constraints ‘SQL080205035606501’ and ‘SQL080205035606500’ have the same set of columns, which is not allowed.
    Error Code: -1
    Call: CREATE TABLE CLASSICCARS.PRODUCTLINE (PRODUCTLINE VARCHAR(50) UNIQUE NOT NULL, TEXTDESCRIPTION VARCHAR(4000), IMAGE VARCHAR(255), HTMLDESCRIPTION VARCHAR(255), PRIMARY KEY (PRODUCTLINE))
    Query: DataModifyQuery()
    05-Feb-2008 15:56:06 uk.co.jtech.jpa.EntityManagerHelper log
    INFO: saving Productline instance
    05-Feb-2008 15:56:06 uk.co.jtech.jpa.EntityManagerHelper log
    INFO: save successful
    [TopLink Warning]: 2008.02.05 03:56:07.078–UnitOfWork(21565531)–Exception [TOPLINK-4002] (Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: An attempt was made to put a data value of type ‘java.lang.String’ into a data value of type ‘BLOB’.
    Error Code: -1
    Call: INSERT INTO CLASSICCARS.PRODUCTLINE (PRODUCTLINE, TEXTDESCRIPTION, IMAGE, HTMLDESCRIPTION) VALUES (?, ?, ?, ?)
    bind => [my Men’s Shoes, Shoes for men., http://www.genuitec.com/publicfiles/riyad/support/tutorials/men_shoe.jpg, <strong>Men’s Shoes</strong>]
    Query: InsertObjectQuery(uk.co.jtech.jpa.Productline@bf053f)
    Exception in thread “main” javax.persistence.RollbackException: Exception [TOPLINK-4002] (Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: An attempt was made to put a data value of type ‘java.lang.String’ into a data value of type ‘BLOB’.
    Error Code: -1
    Call: INSERT INTO CLASSICCARS.PRODUCTLINE (PRODUCTLINE, TEXTDESCRIPTION, IMAGE, HTMLDESCRIPTION) VALUES (?, ?, ?, ?)
    bind => [my Men’s Shoes, Shoes for men., http://www.genuitec.com/publicfiles/riyad/support/tutorials/men_shoe.jpg, <strong>Men’s Shoes</strong>]
    Query: InsertObjectQuery(uk.co.jtech.jpa.Productline@bf053f)
    at oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:105)
    at oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:45)
    at uk.co.jtech.jpa.EntityManagerHelper.commit(EntityManagerHelper.java:46)
    at uk.co.jtech.jpa.RunJPA.main(RunJPA.java:56)
    Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials – 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: An attempt was made to put a data value of type ‘java.lang.String’ into a data value of type ‘BLOB’.
    Error Code: -1[/b]

    #281468 Reply

    Loyal Water
    Member

    Can you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.

    #281470 Reply

    j_droberts
    Member

    Hi guys

    only seems to work if you use null for last 2 attributes

    Productline newProductline = new Productline(
    productLineID,
    “Shoes for men.”, null, null );

    Any ideas? Is this a new version which has an issue rflecting blobs.

    Cheers
    Jon

    #282590 Reply

    Riyad Kalla
    Member

    Jon,
    I’m so sorry this thread went un-replied to for so long. Actually the only thing you need to null is the String that was the URL to the image, the data type was changed to BLOB, so you could *literally* store the image byte[] data in the DB, instead the quick fix is just to null the value in the tutorial.

    I’ll fix this. Thanks for the heads up.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Problem with JPA tutorial

You must be logged in to post in the forum log in