2 Replies Latest reply on Dec 30, 2005 8:39 PM by Emmanuel Bernard

    @OneToOne problem ...

    Michael Small Newbie

      I have two entities that I'm trying to associate using one to one. Below is the code snippet for each:

      In Relationship.java (an Entity)

      private TascForce tascForce;
      
      @OneToOne(cascade=Cascade.ALL, fetch=FetchType.EAGER)
      @JoinColumn(name="fk_tasc_tascforce")
      public TascForce getTascForce()
      {
       return(this.tascForce);
      }
      
      public void setTascForce(TascForce tascForce)
      {
       this.tascForce = tascForce;
      }
      


      In TascForce.java (an Entity):
      private Relationship relationship;
      
      @OneToOne(mappedBy="tascForce", fetch=FetchType.EAGER)
      public Relationship getRelationship()
      {
       return(this.relationship);
      }
      
      public void setRelationship(Relationship relationship)
      {
       this.relationship = relationship;
      }
      


      Database schemas (in MySQL 5.0):
      CREATE TABLE tasc_relationship (
      internalKey BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
      created DATETIME,
      createdBy BINARY(15),
      lastUpdated DATETIME,
      lastUpdatedBy BINARY(15),
      version BIGINT,
      relationshipId BINARY(15),
      loginId VARCHAR(150),
      pin BINARY(6),
      authenticationType ENUM('NATIVE', 'ACTIVE_DIRECTORY'),
      lockedOut TINYINT(1),
      fk_tasc_tascforce BIGINT
      ) TYPE = Innodb;
      
      CREATE TABLE tasc_tascforce (
      internalKey BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
      created DATETIME,
      createdBy BINARY(15),
      lastUpdated DATETIME,
      lastUpdatedBy BINARY(15),
      version BIGINT,
      address1 VARCHAR(100),
      address2 VARCHAR(100),
      city VARCHAR(40),
      state CHAR(2),
      deliveryArea CHAR(5),
      plusFour CHAR(4),
      fk_tasc_contact BIGINT
      ) TYPE = InnoDB;
      


      I can successfully create a TascForce instance and search for a TascForce instance (i.e. no EJB errors and the database records look good), but when I attempt a EntityManager.merge on the TascForce object I get the following error:

      09:10:25,868 INFO [LongType] could not bind value 'com.tasconline.tascforce.TascForce@1f8f72f[contact=com.tasconline.util.BasicContact@1c02db5[internalKey=1,created=2005-12-14 08:47:02.0,createdBy=com.tasconline.relationship.RelationshipId@1e8f789[id=0000000-0000001],lastUpdated=Wed Dec 14 09:10:25 CST 2005,lastUpdatedBy=com.tasconline.relationship.RelationshipId@1a9b92e[id=4260000-0000262],version=1,name=com.tasconline.util.PersonName@1b01412[lastName=Small,firstName=Michael,middleName=<null>],homeNumber=com.tasconline.util.PhoneNumber@553ddb[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],businessNumber=com.tasconline.util.PhoneNumber@1c51342[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],faxNumber=com.tasconline.util.PhoneNumber@1ecc08c[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],mobileNumber=com.tasconline.util.PhoneNumber@5017e9[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],emailAddress=com.tasconline.util.EmailAddress@573206[address=MichaelS@tasconline.com]],address=<null>]' to parameter: 1
      09:10:26,054 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: S1009
      09:10:26,054 ERROR [JDBCExceptionReporter] Statement parameter 1 not set.
      09:10:26,056 ERROR [AjaxPhaseListener] AJAX request failed: null; CausedByException is:
       could not load an entity: [com.tasconline.relationship.Relationship#com.tasconline.tascforce.TascForce@1f8f72f[contact=com.tasconline.util.BasicContact@1c02db5[internalKey=1,created=2005-12-14 08:47:02.0,createdBy=com.tasconline.relationship.RelationshipId@1e8f789[id=0000000-0000001],lastUpdated=Wed Dec 14 09:10:25 CST 2005,lastUpdatedBy=com.tasconline.relationship.RelationshipId@1a9b92e[id=4260000-0000262],version=1,name=com.tasconline.util.PersonName@1b01412[lastName=Small,firstName=Michael,middleName=<null>],homeNumber=com.tasconline.util.PhoneNumber@553ddb[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],businessNumber=com.tasconline.util.PhoneNumber@1c51342[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],faxNumber=com.tasconline.util.PhoneNumber@1ecc08c[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],mobileNumber=com.tasconline.util.PhoneNumber@5017e9[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],emailAddress=com.tasconline.util.EmailAddress@573206[address=MichaelS@tasconline.com]],address=<null>]]
      javax.ejb.EJBException: null; CausedByException is:
       could not load an entity: [com.tasconline.relationship.Relationship#com.tasconline.tascforce.TascForce@1f8f72f[contact=com.tasconline.util.BasicContact@1c02db5[internalKey=1,created=2005-12-14 08:47:02.0,createdBy=com.tasconline.relationship.RelationshipId@1e8f789[id=0000000-0000001],lastUpdated=Wed Dec 14 09:10:25 CST 2005,lastUpdatedBy=com.tasconline.relationship.RelationshipId@1a9b92e[id=4260000-0000262],version=1,name=com.tasconline.util.PersonName@1b01412[lastName=Small,firstName=Michael,middleName=<null>],homeNumber=com.tasconline.util.PhoneNumber@553ddb[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],businessNumber=com.tasconline.util.PhoneNumber@1c51342[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],faxNumber=com.tasconline.util.PhoneNumber@1ecc08c[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],mobileNumber=com.tasconline.util.PhoneNumber@5017e9[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],emailAddress=com.tasconline.util.EmailAddress@573206[address=MichaelS@tasconline.com]],address=<null>]]
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:46)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:70)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:151)
       at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:85)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:204)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:37)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:88)
       at $Proxy257.changeDemographics(Unknown Source)
       at com.tasconline.tascforce.web.ui.event.AjaxTascForcePhaseListener$SaveMyDemographicsAjaxAction.performAction(AjaxTascForcePhaseListener.java:296)
       at com.tasconline.web.ui.ajax.AjaxPhaseListener.handleRequest(AjaxPhaseListener.java:96)
       at com.tasconline.web.ui.ajax.AjaxPhaseListener.afterPhase(AjaxPhaseListener.java:77)
       at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
       at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.tasconline.security.web.ui.filter.SecurityFilter.doFilter(SecurityFilter.java:102)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.tasconline.web.ui.filter.InitializeFilter.doFilter(InitializeFilter.java:67)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      org.hibernate.exception.GenericJDBCException: could not load an entity: [com.tasconline.relationship.Relationship#com.tasconline.tascforce.TascForce@1f8f72f[contact=com.tasconline.util.BasicContact@1c02db5[internalKey=1,created=2005-12-14 08:47:02.0,createdBy=com.tasconline.relationship.RelationshipId@1e8f789[id=0000000-0000001],lastUpdated=Wed Dec 14 09:10:25 CST 2005,lastUpdatedBy=com.tasconline.relationship.RelationshipId@1a9b92e[id=4260000-0000262],version=1,name=com.tasconline.util.PersonName@1b01412[lastName=Small,firstName=Michael,middleName=<null>],homeNumber=com.tasconline.util.PhoneNumber@553ddb[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],businessNumber=com.tasconline.util.PhoneNumber@1c51342[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],faxNumber=com.tasconline.util.PhoneNumber@1ecc08c[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],mobileNumber=com.tasconline.util.PhoneNumber@5017e9[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],emailAddress=com.tasconline.util.EmailAddress@573206[address=MichaelS@tasconline.com]],address=<null>]]
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.loader.Loader.loadEntity(Loader.java:1796)
       at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
       at org.hibernate.loader.entity.EntityLoader.loadByUniqueKey(EntityLoader.java:85)
       at org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:1521)
       at org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:365)
       at org.hibernate.type.EntityType.resolve(EntityType.java:306)
       at org.hibernate.type.EntityType.replace(EntityType.java:207)
       at org.hibernate.type.TypeFactory.replace(TypeFactory.java:431)
       at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:279)
       at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:245)
       at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:102)
       at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
       at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:608)
       at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:594)
       at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:147)
       at org.jboss.ejb3.entity.InjectedEntityManager.merge(InjectedEntityManager.java:102)
       at com.tasconline.tascforce.service.bean.TascForceServiceBean.changeAddress(TascForceServiceBean.java:188)
       at com.tasconline.tascforce.service.bean.TascForceServiceBean.changeDemographics(TascForceServiceBean.java:82)
       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)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:32)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:66)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:151)
       at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:85)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:204)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:37)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:88)
       at $Proxy257.changeDemographics(Unknown Source)
       at com.tasconline.tascforce.web.ui.event.AjaxTascForcePhaseListener$SaveMyDemographicsAjaxAction.performAction(AjaxTascForcePhaseListener.java:296)
       at com.tasconline.web.ui.ajax.AjaxPhaseListener.handleRequest(AjaxPhaseListener.java:96)
       at com.tasconline.web.ui.ajax.AjaxPhaseListener.afterPhase(AjaxPhaseListener.java:77)
       at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
       at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.tasconline.security.web.ui.filter.SecurityFilter.doFilter(SecurityFilter.java:102)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.tasconline.web.ui.filter.InitializeFilter.doFilter(InitializeFilter.java:67)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.SQLException: Statement parameter 1 not set.
       at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:992)
       at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:670)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211)
       at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1676)
       at org.hibernate.loader.Loader.doQuery(Loader.java:662)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
       at org.hibernate.loader.Loader.loadEntity(Loader.java:1782)
       ... 81 more
      09:10:26,056 ERROR [AjaxPhaseListener] AJAX request failed: null; CausedByException is:
       could not load an entity: [com.tasconline.relationship.Relationship#com.tasconline.tascforce.TascForce@1f8f72f[contact=com.tasconline.util.BasicContact@1c02db5[internalKey=1,created=2005-12-14 08:47:02.0,createdBy=com.tasconline.relationship.RelationshipId@1e8f789[id=0000000-0000001],lastUpdated=Wed Dec 14 09:10:25 CST 2005,lastUpdatedBy=com.tasconline.relationship.RelationshipId@1a9b92e[id=4260000-0000262],version=1,name=com.tasconline.util.PersonName@1b01412[lastName=Small,firstName=Michael,middleName=<null>],homeNumber=com.tasconline.util.PhoneNumber@553ddb[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],businessNumber=com.tasconline.util.PhoneNumber@1c51342[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],faxNumber=com.tasconline.util.PhoneNumber@1ecc08c[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],mobileNumber=com.tasconline.util.PhoneNumber@5017e9[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],emailAddress=com.tasconline.util.EmailAddress@573206[address=MichaelS@tasconline.com]],address=<null>]]
      javax.ejb.EJBException: null; CausedByException is:
       could not load an entity: [com.tasconline.relationship.Relationship#com.tasconline.tascforce.TascForce@1f8f72f[contact=com.tasconline.util.BasicContact@1c02db5[internalKey=1,created=2005-12-14 08:47:02.0,createdBy=com.tasconline.relationship.RelationshipId@1e8f789[id=0000000-0000001],lastUpdated=Wed Dec 14 09:10:25 CST 2005,lastUpdatedBy=com.tasconline.relationship.RelationshipId@1a9b92e[id=4260000-0000262],version=1,name=com.tasconline.util.PersonName@1b01412[lastName=Small,firstName=Michael,middleName=<null>],homeNumber=com.tasconline.util.PhoneNumber@553ddb[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],businessNumber=com.tasconline.util.PhoneNumber@1c51342[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],faxNumber=com.tasconline.util.PhoneNumber@1ecc08c[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],mobileNumber=com.tasconline.util.PhoneNumber@5017e9[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],emailAddress=com.tasconline.util.EmailAddress@573206[address=MichaelS@tasconline.com]],address=<null>]]
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:46)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:70)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:151)
       at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:85)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:204)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:37)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:88)
       at $Proxy257.changeDemographics(Unknown Source)
       at com.tasconline.tascforce.web.ui.event.AjaxTascForcePhaseListener$SaveMyDemographicsAjaxAction.performAction(AjaxTascForcePhaseListener.java:296)
       at com.tasconline.web.ui.ajax.AjaxPhaseListener.handleRequest(AjaxPhaseListener.java:96)
       at com.tasconline.web.ui.ajax.AjaxPhaseListener.afterPhase(AjaxPhaseListener.java:77)
       at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
       at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.tasconline.security.web.ui.filter.SecurityFilter.doFilter(SecurityFilter.java:102)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.tasconline.web.ui.filter.InitializeFilter.doFilter(InitializeFilter.java:67)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      org.hibernate.exception.GenericJDBCException: could not load an entity: [com.tasconline.relationship.Relationship#com.tasconline.tascforce.TascForce@1f8f72f[contact=com.tasconline.util.BasicContact@1c02db5[internalKey=1,created=2005-12-14 08:47:02.0,createdBy=com.tasconline.relationship.RelationshipId@1e8f789[id=0000000-0000001],lastUpdated=Wed Dec 14 09:10:25 CST 2005,lastUpdatedBy=com.tasconline.relationship.RelationshipId@1a9b92e[id=4260000-0000262],version=1,name=com.tasconline.util.PersonName@1b01412[lastName=Small,firstName=Michael,middleName=<null>],homeNumber=com.tasconline.util.PhoneNumber@553ddb[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],businessNumber=com.tasconline.util.PhoneNumber@1c51342[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],faxNumber=com.tasconline.util.PhoneNumber@1ecc08c[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],mobileNumber=com.tasconline.util.PhoneNumber@5017e9[areaCode=<null>,trunk=<null>,number=<null>,extension=<null>],emailAddress=com.tasconline.util.EmailAddress@573206[address=MichaelS@tasconline.com]],address=<null>]]
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.loader.Loader.loadEntity(Loader.java:1796)
       at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
       at org.hibernate.loader.entity.EntityLoader.loadByUniqueKey(EntityLoader.java:85)
       at org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:1521)
       at org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:365)
       at org.hibernate.type.EntityType.resolve(EntityType.java:306)
       at org.hibernate.type.EntityType.replace(EntityType.java:207)
       at org.hibernate.type.TypeFactory.replace(TypeFactory.java:431)
       at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:279)
       at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:245)
       at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:102)
       at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
       at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:608)
       at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:594)
       at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:147)
       at org.jboss.ejb3.entity.InjectedEntityManager.merge(InjectedEntityManager.java:102)
       at com.tasconline.tascforce.service.bean.TascForceServiceBean.changeAddress(TascForceServiceBean.java:188)
       at com.tasconline.tascforce.service.bean.TascForceServiceBean.changeDemographics(TascForceServiceBean.java:82)
       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)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:32)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:66)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:151)
       at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:85)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:204)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:37)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:88)
       at $Proxy257.changeDemographics(Unknown Source)
       at com.tasconline.tascforce.web.ui.event.AjaxTascForcePhaseListener$SaveMyDemographicsAjaxAction.performAction(AjaxTascForcePhaseListener.java:296)
       at com.tasconline.web.ui.ajax.AjaxPhaseListener.handleRequest(AjaxPhaseListener.java:96)
       at com.tasconline.web.ui.ajax.AjaxPhaseListener.afterPhase(AjaxPhaseListener.java:77)
       at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
       at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.tasconline.security.web.ui.filter.SecurityFilter.doFilter(SecurityFilter.java:102)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at com.tasconline.web.ui.filter.InitializeFilter.doFilter(InitializeFilter.java:67)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.SQLException: Statement parameter 1 not set.
       at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:992)
       at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:670)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211)
       at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1676)
       at org.hibernate.loader.Loader.doQuery(Loader.java:662)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
       at org.hibernate.loader.Loader.loadEntity(Loader.java:1782)
       ... 81 more
      


      It's like EJB3 is trying to set the fk_tasc_tascforce database value to the entire toString value of the TascForce object versus is primary key.