[JBoss-user] [EJB 3.0] - @ManyToOne or @OneToOne using @JoinTable and @Inheritance ca

2006-05-23 Thread ariggz
I have experence a problem while mapping a legacy database when I am attempt to 
use @ManyToOne using @JoinTable and the parent class is declaired with 
@Inheritance(strategy=InheritanceType.JOINED). Here is a simplified version of 
what I am attempting:
@Entity
  | @Inheritance(strategy=InheritanceType.JOINED)
  | @Table(name = baseclass)
  | public abstract class Baseclass implements java.io.Serializable {
  | 
  | private String internalid;
  | 
  | @Id
  | @Column(name = INTERNALID, unique = true, nullable = false, 
insertable = true, updatable = true, length = 34)
  | public String getInternalid() {
  | return this.internalid;
  | }
  | public void setInternalid(String internalid) {
  | this.internalid = internalid;
  | }
  | }   
@Entity
  | @Table(name = parent)
  | public class Parent extends Baseclass
  | {
  | 
  | private String name;
  | 
  | public String getName(){
  | return this.name;
  | }
  | public void setName(String name){
  | this.name = name;
  | }
  | }
@Entity
  | @Table(name = child)
  | public class Child implements java.io.Serializable {
  | 
  | private String internalid;
  | private String name;
  | private Parent parent;
  | 
  | @Id
  | @Column(name = INTERNALID, unique = true, nullable = false, 
insertable = true, updatable = true, length = 34)
  | public String getInternalid() {
  | return this.internalid;
  | }
  | public void setInternalid(String internalid) {
  | this.internalid = internalid;
  | }
  | 
  | public String getName(){
  | return this.name;
  | }
  | public void setName(String name){
  | this.name = name;
  | }
  | 
  | @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
  | @JoinTable(name=hierarchy,
  | joinColumns = @JoinColumn( name=childinternalid),
  | inverseJoinColumns = @JoinColumn( name=parentinternalid)) 
  | public Parent getParent(){
  | return this.parent;
  | }
  | public void setParent(Parent parent){
  | this.parent = parent;
  | }
  | }

When I try this in JBOSSAS4.0.4GA I receive the following error:

14:24:09,268 ERROR [AssertionFailure] an assertion failure occured (this may 
indicate a bug in Hiber
  | nate, but is more likely due to unsafe use of the session)
  | org.hibernate.AssertionFailure: Table hierarchy not found
  | at 
org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPers
  | ister.java:444)
  | at 
org.hibernate.persister.entity.JoinedSubclassEntityPersister.init(JoinedSubclassEntityPersister.java:225)
  | at 
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
  | at 
org.hibernate.impl.SessionFactoryImpl.init(SessionFactoryImpl.java:223)
  | at 
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
  | at 
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
  | at 
org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
  | at 
org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:3
  | 50)
  | at 
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.
  | java:119)
  | at 
org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | 
  | ... 
  | 


If I switch the association to @OneToMany on the parent side there is no error.

I have also experenced this same error using bidirectional @OneToOne with an 
association table where either end is using 
@Inheritance(strategy=InheritanceType.JOINED), and if I make it unidirectional 
on the end without @Inheritance(strategy=InheritanceType.JOINED) it does not 
throw the error.

I'm not sure what I am doing incorrectly.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3945694#3945694

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3945694


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list

[JBoss-user] [EJB/JBoss] - Re: @OneToMany using @JoinTable with Joined Inheritance

2006-05-23 Thread ariggz
Sorry I posted in the wrong forum.  I moved post to: 
http://www.jboss.com/index.html?module=bbop=viewtopict=83530[/url]

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3945696#3945696

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3945696


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB/JBoss] - @OneToMany using @JoinTable with Joined Inheritance

2006-05-22 Thread ariggz
I have experence a problem while mapping a legacy database when I am attempt to 
use @ManyToOne using @JoinTable and the parent class is declaired with 
@Inheritance(strategy=InheritanceType.JOINED).  Here is a simplified version of 
what I am attempting:
@Entity
  | @Inheritance(strategy=InheritanceType.JOINED)
  | @Table(name = baseclass)
  | public abstract class Baseclass implements java.io.Serializable {
  | 
  | private String internalid;
  | 
  | @Id
  | @Column(name = INTERNALID, unique = true, nullable = false, 
insertable = true, updatable = true, length = 34)
  | public String getInternalid() {
  | return this.internalid;
  | }
  | public void setInternalid(String internalid) {
  | this.internalid = internalid;
  | }
  | }

@Entity
  | @Table(name = parent)
  | public class Parent extends Baseclass
  | {
  | 
  | private String name;
  | 
  | public String getName(){
  | return this.name;
  | }
  | public void setName(String name){
  | this.name = name;
  | }
  | }

@Entity
  | @Table(name = child)
  | public class Child implements java.io.Serializable {
  | 
  | private String internalid;
  | private String name;
  | private Parent parent;
  | 
  | @Id
  | @Column(name = INTERNALID, unique = true, nullable = false, 
insertable = true, updatable = true, length = 34)
  | public String getInternalid() {
  | return this.internalid;
  | }
  | public void setInternalid(String internalid) {
  | this.internalid = internalid;
  | }
  | 
  | public String getName(){
  | return this.name;
  | }
  | public void setName(String name){
  | this.name = name;
  | }
  | 
  | @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
  | @JoinTable(name=hierarchy,
  | joinColumns = @JoinColumn( name=childinternalid),
  | inverseJoinColumns = @JoinColumn( name=parentinternalid)) 
  | public Parent getParent(){
  | return this.parent;
  | }
  | public void setParent(Parent parent){
  | this.parent = parent;
  | }
  | }

When I try this in JBOSSAS4.0.4GA I receive the following error:
14:24:09,268 ERROR [AssertionFailure] an assertion failure occured (this may 
indicate a bug in Hibernate, but is more likely due to unsafe use of the 
session)
  | org.hibernate.AssertionFailure: Table hierarchy not found
  | at 
org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:444)
  | at 
org.hibernate.persister.entity.JoinedSubclassEntityPersister.init(JoinedSubclassEntityPersister.java:225)
  | at 
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
  | at 
org.hibernate.impl.SessionFactoryImpl.init(SessionFactoryImpl.java:223)
  | at 
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
  | at 
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
  | at 
org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
  | at 
org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:350)
  | at 
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:119)
  | at 
org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | 
  | ...

If I switch the association to @OneToMany on the parent side there is no error.

I have also experenced this same error using bidirectional @OneToOne with an 
association table where either end is using 
@Inheritance(strategy=InheritanceType.JOINED), and if I make it unidirectional 
on the end without @Inheritance(strategy=InheritanceType.JOINED) it does not 
throw the error.

I'm not sure what I am doing wrong, and thanks for all the help this forum 
gives me.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3945463#3945463

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3945463


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list

[JBoss-user] [JBoss Seam] - Re: Portal example errors with 4.0.4CR2 and Portal 2.4

2006-04-30 Thread ariggz
I was able to get the portlet example to work using JBossAS 4.0.4CR2, JBoss 
Portal 2.2.1, and jboss-seam-1.0.0.CR2 by with following:

Install JBossAS 4.0.4CR2 with the installer, selecting EJB
Copy jboss-portal.sar and portal-hsqldb-ds.xml from the binary download of 
JBoss Portal 2.2.1 into jboss-4.0.4.CR2\server\default

Modify the jboss-service.xml per:

DViper01 wrote : I just had the same problem with 4.0.4RC2 and found a fix:
  | 
  | Open the xml-file 
'JBOSS_HOME/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml' 
in an editor.
  | 
  | Search for ...
  | name=portal:service=TreeCache,type=transient
  | 
  | ... and add the line ...
  | dependsjboss:service=TransactionManager/depends
  | ... to the contents of the TreeCache mbean.

I never could get it to work using jboss-portal-2.4 from CVS.  Are the 
instructions in the readme.txt wrong, or am I just to green to read them 
correctly?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3940417#3940417

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940417


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: Entity bean helper functions possible?

2006-04-28 Thread ariggz
I believe they will work with #{member.age} and #{member.genderString}.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3940160#3940160

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3940160


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Portal example errors with 4.0.4CR2 and Portal 2.4

2006-04-27 Thread ariggz
I am having trouble with the portal example.  I am installing the the latestest 
CVS seam with portal 2.4 and jboss AS 4.0.4CR2.

I am experiencing the following error:

anonymous wrote : 
  | 00:00:44,917 INFO  [MyFacesGenericPortlet] PortletContext 'C:\Program 
Files\jboss-4.0.4.CR2\server\default\.\tmp\deploy\tmp39083jboss-seam-hibernate-exp.war\'
 initialized.
  | 00:00:45,047 ERROR [MainDeployer] Could not start deployment: 
file:/C:/Program 
Files/jboss-4.0.4.CR2/server/default/tmp/deploy/tmp39083jboss-seam-hibernate-exp.war/WEB-INF/
  | org.jboss.deployment.DeploymentException: - nested throwable: 
(java.lang.NullPointerException)
  | at 
org.jboss.portal.core.deployment.jboss.ObjectDeployment.start(ObjectDeployment.java:279)
  | at 
org.jboss.portal.server.deployment.jboss.PortalDeploymentInfo$DeploymentContext.start(PortalDeploymentInfo.java:211)
  | at 
org.jboss.portal.server.deployment.jboss.ServerDeployer.start(ServerDeployer.java:244)
  | at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
  | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
  | at sun.reflect.GeneratedMethodAccessor262.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at 
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | at 
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | at 
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | at 
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
  | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
  | at $Proxy106.deploy(Unknown Source)
  | at 
org.jboss.portal.server.deployment.jboss.ServerDeployer.deploy(ServerDeployer.java:298)
  | at sun.reflect.GeneratedMethodAccessor269.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at 
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | at 
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
  | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
  | at $Proxy72.deploy(Unknown Source)
  | at 
org.jboss.portal.server.deployment.WebAppAdapter.deploy(WebAppAdapter.java:54)
  | at 
org.jboss.portal.server.deployment.WebAppIntercepter.handleNotification(WebAppIntercepter.java:145)
  | at sun.reflect.GeneratedMethodAccessor182.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at 
org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
  | at $Proxy107.handleNotification(Unknown Source)
  | at 
org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotification(JBossNotificationBroadcasterSupport.java:127)
  | at 
org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotification(JBossNotificationBroadcasterSupport.java:108)
  | at 
org.jboss.deployment.SubDeployerSupport.emitNotification(SubDeployerSupport.java:340)
  | at 
org.jboss.deployment.SubDeployerSupport.start(SubDeployerSupport.java:308)
  | at 
org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:482)
  | at sun.reflect.GeneratedMethodAccessor235.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at 
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | at 
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | at 
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | at 
org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
  | at