0 Replies Latest reply on Jun 27, 2010 6:25 AM by PHANTOMIASA

    Can not set int field to flex.messaging.io.amf.ASObject

    PHANTOMIASA

      Hello!

       

      I am in the dark: I get an error and I have no idea what's going wong.

      I use Hibernate, Spring and have a Flex, BlazeDS, J2EE application.

       

      I get this error:

      Hibernate: update Project set creationDate=?, description=?, name=? where id=?
      Hibernate: delete from Project_Person where project_id=?
      Hibernate: update Sprint set project_id=null where project_id=?
      Hibernate: insert into Project_Person (project_id, person_id) values (?, ?)
      Hibernate: update Sprint set project_id=? where id=?
      27.06.2010 15:15:56 org.slf4j.impl.JCLLoggerAdapter error
      SCHWERWIEGEND: Could not synchronize database state with session
      org.hibernate.PropertyAccessException: could not get a field value by reflection getter of com.domain.myproject.data.domain.Sprint.id
          at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:62)
          at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:230)
          at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3852)
          at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:3560)
          at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:204)
          at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:243)
          at org.hibernate.type.EntityType.getIdentifier(EntityType.java:449)
          at org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:132)
          at org.hibernate.persister.collection.AbstractCollectionPersister.writeElement(AbstractCollectionPersister.java:816)
          at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1204)
          at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:58)
          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:268)
          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:260)
          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:183)
          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
          at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
          at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
          at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)
          at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
          at com.domain.myproject.data.dao.ProjectDaoImplHibernate.updateProject(ProjectDaoImplHibernate.java:31)
          at com.domain.myproject.data.services.ProjectServiceImpl.updateProject(ProjectServiceImpl.java:34)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:418)
          at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
          at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
          at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
          at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
          at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
          at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
          at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
          at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
          at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
          at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
          at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.IllegalArgumentException: Can not set int field com.domain.myproject.data.domain.Sprint.id to flex.messaging.io.amf.ASObject
          at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
          at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
          at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
          at sun.reflect.UnsafeIntegerFieldAccessorImpl.getInt(Unknown Source)
          at sun.reflect.UnsafeIntegerFieldAccessorImpl.get(Unknown Source)
          at java.lang.reflect.Field.get(Unknown Source)
          at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:59)
          ... 48 more

       

       

       

      So I have a Project<->Sprint 1:n relation. And I do an update of the project. Why does ist fail with:

      Caused by: java.lang.IllegalArgumentException: Can not set int field com.domain.myproject.data.domain.Sprint.id to flex.messaging.io.amf.ASObject

       

      What's the problem?

       

      Thanks a lot in advance & Best Regards