-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Wrong data type: BYTEA ? I want to use UUID
PostPosted: Sat Sep 06, 2008 9:54 am 
Beginner
Beginner

Joined: Wed Apr 23, 2008 12:07 pm
Posts: 22
Hi there.

I am having trouble with generating my tables through Hibernate while Starting JBoss out of Eclipse. I am using Postgres as database. My Entity looks like:

Code:
@MappedSuperclass
@Inheritance(strategy = InheritanceType.JOINED)
public class AbstractEntity implements Serializable, Cloneable {

   private static final long serialVersionUID = -5448868888497677224L;

   @Id
   @GeneratedValue
   private UUID id;



Code:
@Entity
public class Person extends AbstractEntity {

   private String name;

   public String getName() {
      return name;
   }

   public void setName(final String name) {
      this.name = name;
   }

}


The error message is:


ERROR [SchemaExport] Unsuccessful: create table Person (id bytea not null, name varchar(255), primary key (id))

ERROR [SchemaExport] Wrong data type: BYTEA in statement [create table Person (id bytea]


Does anyone know what this means?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 06, 2008 10:46 am 
Beginner
Beginner

Joined: Wed Apr 23, 2008 12:07 pm
Posts: 22
Solved this error, but got the next one.

You have to use
<jta-data-source>java:/PostgresDS</jta-data-source>
inside your persistence.xml

and put the postgres-ds.xml file from the jboss\docs\example directory into the jboss\server\default\conf directory and edit it with correct values.

now comes another new error message:

Quote:
16:43:00,531 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:unitName=xyEJBPU
State: NOTYETINSTALLED
I Depend On:
jboss.jca:name=PostgresDS,service=DataSourceBinding

--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.jca:name=PostgresDS,service=DataSourceBinding
State: NOTYETINSTALLED
Depends On Me:
persistence.units:unitName=xyEJBPU


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 06, 2008 11:15 am 
Beginner
Beginner

Joined: Wed Apr 23, 2008 12:07 pm
Posts: 22
2nd problem solved, it works ;) my tables are generated...

you have to move the file postgres-ds.xml into the server\deploy folder.

Quote:
<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->

<!-- $Id: postgres-ds.xml 71535 2008-04-01 07:05:03Z adrian@jboss.org $ -->
<!-- ==================================================================== -->
<!-- Datasource config for Postgres -->
<!-- ==================================================================== -->


<datasources>

<local-tx-datasource>

<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc:postgresql://localhost:5432/xyproduct</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password>postgres</password>

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>PostgreSQL</type-mapping>
</metadata>

</local-tx-datasource>

</datasources>



Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.