Re: error writing tuple to database the owning entity is not mapped geronimo 2.1.1

2008-07-06 Thread Mario Kofler

 If a person becomes a director, (s)he won't be able to
 resign and become a manager or just a developer?

that's right. for my application it is assumed that if a person is a
director this person is just a director and cannot be an actor in the
same time.


 On to your issue...

  so i want to write a Person first, to keep it simple. unfortunately i get an
  error when i try to perform a write:

 Could you show us how Person looks like? And your persistence.xml too.
 I assume you don't use orm.xml or alike, do you? If so, show it too.

so thanks, the persistence.xml we discussed a lot already if i
remember right ;):

persistence xmlns=http://java.sun.com/xml/ns/persistence;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 
xsi:schemaLocation=http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd;
 version=1.0
  persistence-unit name=valhalla transaction-type=JTA
descriptionvideothek/description
providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider
classvt.bean.entity.Person/class
classvt.bean.entity.Actor/class
classvt.bean.entity.Director/class
classvt.bean.entity.Movie/class
classvt.bean.entity.Dvd/class

properties

  property name=openjpa.jdbc.DBDictionary value=postgres/
  !--property name=openjpa.LockManager value=pessimistic/--   
/properties
jta-data-sourcejdbc/postgres/jta-data-source
non-jta-data-sourcejdbc/postgres/non-jta-data-source
  /persistence-unit
/persistence



 the Person entity:


/*Persistent Entity Person*/
@Entity
@Table(name=person)
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name=role, discriminatorType=DiscriminatorType.STRING)
@DiscriminatorValue(P)
public class Person implements java.io.Serializable
{
private int id;
private String name;
private Calendar birthdate;
private String origin;

@Id
@GeneratedValue
public int getId()
{
return id;
}

public void setId(int id)
{
this.id = id;
}

public String getName()
{
return name;
}

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

@Temporal(TemporalType.DATE)
public Calendar getBirthdate()
{
return birthdate;
}

public void setBirthdate(Calendar birthdate)
{
this.birthdate = birthdate;
}

public String getOrigin()
{
return origin;
}

public void setOrigin(String origin)
{
this.origin = origin;
}

}


and yes i do not use an orm.xml

thanks a lot for helping,

greetings,

mario.


 Jacek

 --
 Jacek Laskowski
 Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl


Re: error writing tuple to database the owning entity is not mapped geronimo 2.1.1

2008-07-06 Thread Jacek Laskowski
On Sun, Jul 6, 2008 at 11:34 AM, Mario Kofler [EMAIL PROTECTED] wrote:


Hi Mario,

Let's make it simpler by removing some unneeded, defaulted
configuration values in your sample.

 persistence xmlns=http://java.sun.com/xml/ns/persistence;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 
 xsi:schemaLocation=http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd;
 version=1.0
  persistence-unit name=valhalla transaction-type=JTA

Hint: you may remove transaction-type as it's JTA in managed
environment like Geronimo.

descriptionvideothek/description
providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider

Provider defaults to openjpa in Geronimo. You may remove it.

classvt.bean.entity.Person/class
classvt.bean.entity.Actor/class
classvt.bean.entity.Director/class
classvt.bean.entity.Movie/class
classvt.bean.entity.Dvd/class

Not needed in managed environment like Geronimo. It makes things run
faster - no need to look for annotated classes, but am not sure if we
don't do this even though the class elements are specified.

Also, you showed Person entity class, but what about the rest? Either
remove them and let's play with a single entity only and add more
later or show all of them as I think the issue might be in the others.

properties

  property name=openjpa.jdbc.DBDictionary value=postgres/
  !--property name=openjpa.LockManager value=pessimistic/--
/properties
jta-data-sourcejdbc/postgres/jta-data-source
non-jta-data-sourcejdbc/postgres/non-jta-data-source

I think *data-source should be before properties element. Geronimo
should really be more strict.

 @Entity
 @Table(name=person)
 @Inheritance(strategy=InheritanceType.JOINED)
 @DiscriminatorColumn(name=role, discriminatorType=DiscriminatorType.STRING)

discriminatorType is defaulted to STRING.

 @DiscriminatorValue(P)
 public class Person implements java.io.Serializable
 {
private int id;
private String name;
private Calendar birthdate;
private String origin;

@Id
@GeneratedValue
public int getId()
{
return id;
}

public void setId(int id)
{
this.id = id;
}

public String getName()
{
return name;
}

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

@Temporal(TemporalType.DATE)
public Calendar getBirthdate()
{
return birthdate;
}

I think that's the issue - @Temporal. According to the spec - JSR 220:
Enterprise JavaBeansTM,Version 3.0 Java Persistence API - page 234:

xsd:simpleType name=temporal-type
xsd:annotation
xsd:documentation
public enum TemporalType {
DATE, // java.sql.Date
TIME, // java.sql.Time
TIMESTAMP // java.sql.Timestamp
}
/xsd:documentation
/xsd:annotation
xsd:restriction base=xsd:token
xsd:enumeration value=DATE/
xsd:enumeration value=TIME/
xsd:enumeration value=TIMESTAMP/
/xsd:restriction
/xsd:simpleType

so Calendar seems to not be accepted for @Temporal annotation. Change
the return type of the getter.

I think the Person entity is not mapped correctly and when you run
your sample you are off the error messages which tell you the Person
entity could not be mapped.

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl


Re: Geronimo 2.1.2-SNAPSHOT Server Start-Up Failed

2008-07-06 Thread Jacek Laskowski
On Sun, Jul 6, 2008 at 7:22 AM, jklcom99 [EMAIL PROTECTED] wrote:

 I'm running 07/03 build

 [java] Booting Geronimo Kernel (in Java 1.6.0)...

Change the JVM version and let us know how it goes. AFAIR, the CORBA
stuff was exactly what made us stay at Java SE 5.0-level.

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl


Re: Geronimo 2.1.2-SNAPSHOT Server Start-Up Failed

2008-07-06 Thread jklcom99

I added  jvmarg value=-Djava.endorsed.dirs=${GeronimoHome}/lib/endorsed / 
and it was happy a little bit.

but now I'm getting this error:

I tried setting the port but still getting this error.
Here's what I have in geronimo-ra.xml

Thanks for your help.

resourceadapter
!-- connect to the JMS Server --
resourceadapter-instance
resourceadapter-nameConnectionFactory/resourceadapter-name
config-property-setting
name=ServerUrltcp://localhost:8989/config-property-setting
config-property-setting
name=UserName**/config-property-setting
config-property-setting
name=Password**/config-property-setting
workmanager
xmlns='http://geronimo.apache.org/xml/ns/naming-1.2'
gbean-linkDefaultWorkManager/gbean-link
/workmanager
/resourceadapter-instance
!-- defines a ConnectionFactory --
outbound-resourceadapter
connection-definition
   
connectionfactory-interfacejavax.jms.ConnectionFactory/connectionfactory-interface
connectiondefinition-instance
nameConnectionFactory/name
   
implemented-interfacejavax.jms.QueueConnectionFactory/implemented-interface
   
implemented-interfacejavax.jms.TopicConnectionFactory/implemented-interface
connectionmanager
xa-transaction
transaction-caching/
/xa-transaction
single-pool
max-size10/max-size
min-size0/min-size
match-one/
/single-pool
/connectionmanager
/connectiondefinition-instance
/connection-definition
/outbound-resourceadapter
/resourceadapter


 ERROR [MCFConnectionInterceptor] Error occurred creating
ManagedConnection for
[EMAIL PROTECTED]:
Could not create connection.
 [java] at
org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFactory.java:112)
 [java] at
org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionInterceptor.java:48)
 [java] at
org.apache.geronimo.connector.outbound.XAResourceInsertionInterceptor.getConnection(XAResourceInsertionInterceptor.java:41)
...


 [java] Caused by: javax.jms.JMSException: Could not connect to broker
URL: tcp://localhost:8989. Reason: java.net.ConnectException: Connection
refused: connect
 [java] at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:33)
 [java] at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:280)
 [java] at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:168)
 [java] at
org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(ActiveMQResourceAdapter.java:108)
 [java] at
org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(ActiveMQResourceAdapter.java:102)
 [java] at
org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFactory.java:109)
 [java] ... 42 more



Jacek Laskowski wrote:
 
 On Sun, Jul 6, 2008 at 7:22 AM, jklcom99 [EMAIL PROTECTED] wrote:

 I'm running 07/03 build

 [java] Booting Geronimo Kernel (in Java 1.6.0)...
 
 Change the JVM version and let us know how it goes. AFAIR, the CORBA
 stuff was exactly what made us stay at Java SE 5.0-level.
 
 Jacek
 
 -- 
 Jacek Laskowski
 Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
 
 

-- 
View this message in context: 
http://www.nabble.com/Geronimo-2.1.2-SNAPSHOT-Server-Start-Up-Failed-tp18298989s134p18307079.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: Geronimo 2.1.2-SNAPSHOT Server Start-Up Failed

2008-07-06 Thread Lin Sun
Hi,

Did you intend to use tcp://localhost:8989 instead of the default
value tcp://localhost:61616 for the ConnectionFactory's ServerUrl?
If you want to use a different port than the default port, you'll need
to update the geronimo_home/var/config/config_substitutions.properties
file accordingly.

HTH, Lin

On Sun, Jul 6, 2008 at 5:54 PM, jklcom99 [EMAIL PROTECTED] wrote:

 I added  jvmarg value=-Djava.endorsed.dirs=${GeronimoHome}/lib/endorsed /
 and it was happy a little bit.

 but now I'm getting this error:

 I tried setting the port but still getting this error.
 Here's what I have in geronimo-ra.xml

 Thanks for your help.

resourceadapter
!-- connect to the JMS Server --
resourceadapter-instance
resourceadapter-nameConnectionFactory/resourceadapter-name
config-property-setting
 name=ServerUrltcp://localhost:8989/config-property-setting
config-property-setting
 name=UserName**/config-property-setting
config-property-setting
 name=Password**/config-property-setting
workmanager
 xmlns='http://geronimo.apache.org/xml/ns/naming-1.2'
gbean-linkDefaultWorkManager/gbean-link
/workmanager
/resourceadapter-instance
!-- defines a ConnectionFactory --
outbound-resourceadapter
connection-definition

 connectionfactory-interfacejavax.jms.ConnectionFactory/connectionfactory-interface
connectiondefinition-instance
nameConnectionFactory/name

 implemented-interfacejavax.jms.QueueConnectionFactory/implemented-interface

 implemented-interfacejavax.jms.TopicConnectionFactory/implemented-interface
connectionmanager
xa-transaction
transaction-caching/
/xa-transaction
single-pool
max-size10/max-size
min-size0/min-size
match-one/
/single-pool
/connectionmanager
/connectiondefinition-instance
/connection-definition
/outbound-resourceadapter
/resourceadapter


 ERROR [MCFConnectionInterceptor] Error occurred creating
 ManagedConnection for
 [EMAIL PROTECTED]:
 Could not create connection.
 [java] at
 org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFactory.java:112)
 [java] at
 org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionInterceptor.java:48)
 [java] at
 org.apache.geronimo.connector.outbound.XAResourceInsertionInterceptor.getConnection(XAResourceInsertionInterceptor.java:41)
 ...


 [java] Caused by: javax.jms.JMSException: Could not connect to broker
 URL: tcp://localhost:8989. Reason: java.net.ConnectException: Connection
 refused: connect
 [java] at
 org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:33)
 [java] at
 org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:280)
 [java] at
 org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:168)
 [java] at
 org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(ActiveMQResourceAdapter.java:108)
 [java] at
 org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(ActiveMQResourceAdapter.java:102)
 [java] at
 org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFactory.java:109)
 [java] ... 42 more



 Jacek Laskowski wrote:

 On Sun, Jul 6, 2008 at 7:22 AM, jklcom99 [EMAIL PROTECTED] wrote:

 I'm running 07/03 build

 [java] Booting Geronimo Kernel (in Java 1.6.0)...

 Change the JVM version and let us know how it goes. AFAIR, the CORBA
 stuff was exactly what made us stay at Java SE 5.0-level.

 Jacek

 --
 Jacek Laskowski
 Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl



 --
 View this message in context: 
 http://www.nabble.com/Geronimo-2.1.2-SNAPSHOT-Server-Start-Up-Failed-tp18298989s134p18307079.html
 Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.