-->
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.  [ 9 posts ] 
Author Message
 Post subject: Versioning: "could not set a field value by reflection&
PostPosted: Thu Mar 01, 2007 8:19 pm 
Newbie

Joined: Mon Oct 23, 2006 11:03 pm
Posts: 17
Scenario:

This code is a web service that receives an xml-serialized version of
an object that was previously fetched from the database in another
app. Based on reading "Java Persistence with Hibernate" page 413,
paragraph 3, I assumed that I could update an existing database object
by creating a transient copy and then executing a merge(). According
to the book, "If there is no equal persitent instance in the persistence
context, Hibernate loads it from the database". Based on the log, it
looks like

1) Hibernate is trying to insert a new row

2) It's failing when trying to set the version number


Hibernate version: 3.2.2

Log Excerpt:
Code:
DEBUG [03-01-2007 17:56:17] (SessionFactoryImpl.java:<init>:308) - instantiated session factory
DEBUG [03-01-2007 17:56:17] (SessionFactoryImpl.java:<init>:324) - obtaining JTA TransactionManager
INFO [03-01-2007 17:56:17] (NamingHelper.java:getInitialContext:26) - JNDI InitialContext properties:{}
DEBUG [03-01-2007 17:56:17] (SessionFactoryImpl.java:checkNamedQueries:392) - Checking 0 named HQL queries
DEBUG [03-01-2007 17:56:17] (SessionFactoryImpl.java:checkNamedQueries:412) - Checking 0 named SQL queries
DEBUG [03-01-2007 17:56:17] (SessionImpl.java:<init>:220) - opened session at timestamp: 11727933778
DEBUG [03-01-2007 17:56:17] (UpdateTeam.java:update:26) - got session
INFO [03-01-2007 17:56:17] (HibernateUtil.java:getUserTransaction:39) - Getting User Transaction
DEBUG [03-01-2007 17:56:17] (UpdateTeam.java:update:29) - got transaction
DEBUG [03-01-2007 17:56:17] (UpdateTeam.java:update:32) - starting merge
DEBUG [03-01-2007 17:56:17] (JDBCContext.java:registerSynchronizationIfPossible:172) - successfully registered Synchronization
DEBUG [03-01-2007 17:56:17] (VersionValue.java:isUnsaved:28) - version unsaved-value strategy NULL
DEBUG [03-01-2007 17:56:17] (AbstractSaveEventListener.java:getEntityState:514) - transient instance of: com.wholefoods.ittoolkit.ws.admin.Team
DEBUG [03-01-2007 17:56:17] (DefaultMergeEventListener.java:entityIsTransient:160) - merging transient instance
DEBUG [03-01-2007 17:56:17] (AbstractBatcher.java:logOpenPreparedStatement:358) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [03-01-2007 17:56:17] (ConnectionManager.java:openConnection:419) - opening JDBC connection
DEBUG [03-01-2007 17:56:18] (AbstractBatcher.java:log:393) - select ittoolkit.CR_TEAM_ID.nextval from dual
DEBUG [03-01-2007 17:56:18] (AbstractBatcher.java:getPreparedStatement:476) - preparing statement
DEBUG [03-01-2007 17:56:18] (SequenceGenerator.java:generate:82) - Sequence identifier generated: 3
DEBUG [03-01-2007 17:56:18] (AbstractBatcher.java:logClosePreparedStatement:366) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [03-01-2007 17:56:18] (AbstractBatcher.java:closePreparedStatement:525) - closing statement
DEBUG [03-01-2007 17:56:18] (ConnectionManager.java:aggressiveRelease:402) - aggressively releasing JDBC connection
DEBUG [03-01-2007 17:56:18] (ConnectionManager.java:closeConnection:439) - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
DEBUG [03-01-2007 17:56:18] (AbstractSaveEventListener.java:saveWithGeneratedId:112) - generated identifier: 3, using strategy: org.hibernate.id.SequenceGenerator
DEBUG [03-01-2007 17:56:18] (AbstractSaveEventListener.java:performSave:153) - saving [com.wholefoods.ittoolkit.ws.admin.Team#3]
DEBUG [03-01-2007 17:56:18] (Versioning.java:seed:56) - Seeding: 0
ERROR [03-01-2007 17:56:18] (UpdateTeam.java:update:41) - Exception



Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.wholefoods.ittoolkit.ws.admin">
  <class name="Team" table="CR_TEAM">
     <id name="id" column="TEAM_ID">
        <generator class="sequence">
           <param name="sequence">CR_TEAM_ID</param>
        </generator>
     </id>
     <version name="version" access="field" column="VERSION" unsaved-value="null"/>
     <property name="name" column="NAME"/>
     <property name="email" column="EMAIL"/>
     <property name="remedyGroupId" column="RMDY_GROUP_ID"/>
     
     <set name="members" table="CR_TEAM_MEMBER">
        <key column="TEAM_ID"/>
        <composite-element class="TeamMember">
           <property name="name"   column="NAME"    not-null="true"/>
           <property name="email"  column="EMAIL"   not-null="true"/>
           <property name="userId" column="USER_ID" not-null="true"/>
           <property name="roleId" column="ROLE_IE" not-null="true"/>
        </composite-element>
     </set>

     <idbag name="projects" table="CR_PROJECT" order-by="PROJECT_NAME asc">
        <collection-id type="long" column="PROJECT_ID">
           <generator class="sequence">
              <param name="sequence">CR_PROJECT_ID</param>
         </generator>
      </collection-id>
      
        <key column="TEAM_ID"/>
        
        <composite-element class="TeamProject">
           <property name="name"   column="NAME"    not-null="true"/>
        </composite-element>
     </idbag>
     
  </class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
Code:
            Team t = new TeamParser().parse(new StringReader(xml));
            log.debug(t);
           
            Session session = HibernateUtil.getSessionFactory().openSession();
            log.debug("got session");
           
            tx = HibernateUtil.getUserTransaction();
            log.debug("got transaction");
            tx.begin();

            log.debug("starting merge");
            session.merge(t);
            log.debug("merge successful");

            tx.commit();
            session.close();



Full stack trace of any exception that occurs:
Code:
org.hibernate.PropertyAccessException: could not set a field value by reflection setter of com.wholefoods.ittoolkit.ws.admin.Team.version
        at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:82)
        at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
        at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
        at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3560)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:277)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
        at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:186)
        at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:123)
        at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
        at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677)
        at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
        at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
        at com.wholefoods.ittoolkit.ws.admin.UpdateTeam.update(UpdateTeam.java:33)
        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:324)
        at weblogic.webservice.component.javaclass.JavaClassInvocationHandler.invoke(JavaClassInvocationHandler.java:133)
        at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:104)
        at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
        at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:549)
        at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204)
        at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:176)
        at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:96)
        at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java:100)
        at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebServiceServlet.java:297)
        at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:498)
        at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServlet.java:267)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Caused by: java.lang.IllegalArgumentException
        at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
        at java.lang.reflect.Field.set(Field.java:519)
        at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:79)
        ... 40 more



Name and version of the database you are using: Oracle9


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 8:22 pm 
Newbie

Joined: Thu Mar 01, 2007 6:58 pm
Posts: 9
I can't tell from your information, but Hibernate uses the ID field to determine if there there is an insert or update on the merge (one of the two has to happen). Does your object that you are trying to merge have the correct ID?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 12:00 am 
Newbie

Joined: Mon Oct 23, 2006 11:03 pm
Posts: 17
Yes, the id is set correctly and matches an existing row in the database.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 1:11 am 
Newbie

Joined: Thu Mar 01, 2007 11:16 am
Posts: 6
Can you paste the code of your JavaBean - Team ?

Check the Getters and Setters of the JavaBean to make sure they follow the JavaBean notation.

Also the bean should have a default , empty, public constructor.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 2:07 am 
Newbie

Joined: Mon Oct 23, 2006 11:03 pm
Posts: 17
Code:
package com.wholefoods.ittoolkit.ws.admin;

import java.util.*;

public class Team
{
    private Long            id              = null;
    private Long            version         = null;
    private String          name            = null;
    private String          email           = null;
    private Long            remedyGroupId   = null;
    private Set             members         = new HashSet();
    private Collection      projects        = new ArrayList();

    public Team() { }

    public Team(String name, String email, long remedyGroupId)
    {
        this.name           = name;
        this.email          = email;
        this.remedyGroupId  = (remedyGroupId==0) ? null : new Long(remedyGroupId);
    }
   
    public String toString()
    {
        StringBuffer buf = new StringBuffer(500);
        buf.append("Team ID=").append(id)
           .append(" ").append(name)
           .append(" ").append(email)
           .append(" ").append(remedyGroupId)
           .append("\n");
        for (Iterator i=members.iterator(); i.hasNext(); )
            buf.append(i.next().toString());
        for (Iterator i=projects.iterator(); i.hasNext(); )
            buf.append(i.next().toString());
        return buf.toString();
    }
   
    public void addMember(TeamMember tm)
    {
        this.members.add(tm);
    }

    public void addProject(TeamProject tp)
    {
        this.projects.add(tp);
    }
   
    public Collection getProjects()
    {
        return projects;
    }

    public void setProjects(Collection projects)
    {
        this.projects = projects;
    }

    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public Set getMembers()
    {
        return members;
    }

    public void setMembers(Set members)
    {
        this.members = members;
    }

    public String getName()
    {
        return name;
    }

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

    public Long getId()
    {
        return id;
    }

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

    public Long getRemedyGroupId()
    {
        return remedyGroupId;
    }

    public void setRemedyGroupId(Long remedyGroupId)
    {
        this.remedyGroupId = remedyGroupId;
    }
   
    public Iterator teamMemberIterator()
    {
        return members.iterator();
    }

    public boolean equals(Object x)
    {
        if (this == x) return true;
        if (x == null) return false;
        if (! (x instanceof Team)) return false;
        return ((Team)x).getId().equals(this.id);
    }
   
    public int hashCode()
    {
        return (id == null) ? System.identityHashCode(this) : id.hashCode();
    }

    public Long getVersion()
    {
        return version;
    }
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 2:41 am 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
Hi jhg

This could be by wrong data in data base.Like in HBM integer ,In Class in int is there but in DB null is there so when hibernate try to set value it would get same Exception (internally null pointer Exception).

In your case (ws.admin.Team.version) version might be null

_________________
Dharmendra Pandey


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 11:16 am 
Newbie

Joined: Mon Oct 23, 2006 11:03 pm
Posts: 17
Hmm... the VERSION column is NOT NULL, and all rows currently
have the value 0 (zero), so I don't think that's it.

Can someone explain the conditions that give rise to the
org.hibernate.PropertyAccessException on the version column?

Is this happening when Hibernate is trying to load the row? From the
log excerpt it appears that Hibernate is trying to set up a new row:
Code:
DEBUG [03-01-2007 17:56:18] (AbstractSaveEventListener.java:saveWithGeneratedId:112) - generated identifier: 3, using strategy: org.hibernate.id.SequenceGenerator
DEBUG [03-01-2007 17:56:18] (AbstractSaveEventListener.java:performSave:153) - saving [com.wholefoods.ittoolkit.ws.admin.Team#3]
DEBUG [03-01-2007 17:56:18] (Versioning.java:seed:56) - Seeding: 0
ERROR [03-01-2007 17:56:18] (UpdateTeam.java:update:41) - Exception


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 11:41 am 
Newbie

Joined: Mon Oct 23, 2006 11:03 pm
Posts: 17
I added an explicit load of the same object from the database, and now
it fails with the same error during the load. I'm obviously missing
something quite simple:
Code:
DEBUG [03-02-2007 09:35:07] (DefaultLoadEventListener.java:proxyOrLoad:171) - loading entity: [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (DefaultLoadEventListener.java:createProxyIfNecessary:255) - creating new proxy for entity
DEBUG [03-02-2007 09:35:07] (UpdateTeam.java:update:34) - Team loaded
DEBUG [03-02-2007 09:35:07] (SessionImpl.java:immediateLoad:832) - initializing proxy: [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (DefaultLoadEventListener.java:doLoad:332) - attempting to resolve: [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (DefaultLoadEventListener.java:doLoad:369) - object not resolved in any cache: [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (AbstractEntityPersister.java:load:3031) - Fetching entity: [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (Loader.java:loadEntity:1843) - loading entity: [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (AbstractBatcher.java:logOpenPreparedStatement:358) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG [03-02-2007 09:35:07] (ConnectionManager.java:openConnection:419) - opening JDBC connection
DEBUG [03-02-2007 09:35:07] (AbstractBatcher.java:log:393) - select team0_.TEAM_ID as TEAM1_0_0_, team0_.VERSION as VERSION0_0_, team0_.NAME as NAME0_0_, team0_.EMAIL as EMAIL0_0_, team0_.RMDY_GROUP_ID as RMDY5_0_0_ from ittoolkit.CR_TEAM team0_ where team0_.TEAM_ID=?
DEBUG [03-02-2007 09:35:07] (AbstractBatcher.java:getPreparedStatement:476) - preparing statement
DEBUG [03-02-2007 09:35:07] (NullableType.java:nullSafeSet:133) - binding '1' to parameter: 1
DEBUG [03-02-2007 09:35:07] (AbstractBatcher.java:logOpenResults:374) - about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [03-02-2007 09:35:07] (Loader.java:doQuery:682) - processing result set
DEBUG [03-02-2007 09:35:07] (Loader.java:doQuery:687) - result set row: 0
DEBUG [03-02-2007 09:35:07] (Loader.java:getRow:1164) - result row: EntityKey[com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (Loader.java:loadFromResultSet:1346) - Initializing object from ResultSet: [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (AbstractEntityPersister.java:hydrate:2027) - Hydrating entity: [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (NullableType.java:nullSafeGet:172) - returning '0' as column: VERSION0_0_
DEBUG [03-02-2007 09:35:07] (NullableType.java:nullSafeGet:172) - returning 'NPS Systems' as column: NAME0_0_
DEBUG [03-02-2007 09:35:07] (NullableType.java:nullSafeGet:172) - returning 'npss-team@wholefoods.com' as column: EMAIL0_0_
DEBUG [03-02-2007 09:35:07] (NullableType.java:nullSafeGet:172) - returning '1087' as column: RMDY5_0_0_
DEBUG [03-02-2007 09:35:07] (TwoPhaseLoad.java:postHydrate:75) - Version: 0
DEBUG [03-02-2007 09:35:07] (Loader.java:doQuery:709) - done processing result set (1 rows)
DEBUG [03-02-2007 09:35:07] (AbstractBatcher.java:logCloseResults:381) - about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [03-02-2007 09:35:07] (AbstractBatcher.java:logClosePreparedStatement:366) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [03-02-2007 09:35:07] (AbstractBatcher.java:closePreparedStatement:525) - closing statement
DEBUG [03-02-2007 09:35:07] (ConnectionManager.java:aggressiveRelease:402) - aggressively releasing JDBC connection
DEBUG [03-02-2007 09:35:07] (ConnectionManager.java:closeConnection:439) - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
DEBUG [03-02-2007 09:35:07] (Loader.java:initializeEntitiesAndCollections:839) - total objects hydrated: 1
DEBUG [03-02-2007 09:35:07] (TwoPhaseLoad.java:initializeEntity:107) - resolving associations for [com.wholefoods.ittoolkit.ws.admin.Team#1]
DEBUG [03-02-2007 09:35:07] (CollectionLoadContext.java:getLoadingCollection:141) - creating collection wrapper:[com.wholefoods.ittoolkit.ws.admin.Team.members#1]
DEBUG [03-02-2007 09:35:07] (CollectionLoadContext.java:getLoadingCollection:141) - creating collection wrapper:[com.wholefoods.ittoolkit.ws.admin.Team.projects#1]
INFO [03-02-2007 09:35:07] (DefaultLoadEventListener.java:onLoad:111) - Error performing load command
org.hibernate.PropertyAccessException: could not set a field value by reflection setter of com.wholefoods.ittoolkit.ws.admin.Team.version
        at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:82)
        at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
        at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
        at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3560)
        at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)
        at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
        at org.hibernate.loader.Loader.doQuery(Loader.java:717)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:1851)
        at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
        at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
        at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3038)
        at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
        at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
        at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
        at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:98)
        at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
        at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:836)
        at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:66)
        at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:140)
        at com.wholefoods.ittoolkit.ws.admin.Team$$EnhancerByCGLIB$$3f47b99c.toString(<generated>)
        at org.apache.log4j.or.DefaultRenderer.doRender(DefaultRenderer.java:35)
        at org.apache.log4j.or.RendererMap.findAndRender(RendererMap.java:79)
        at org.apache.log4j.spi.LoggingEvent.getRenderedMessage(LoggingEvent.java:297)
        at org.apache.log4j.helpers.PatternParser$BasicPatternConverter.convert(PatternParser.java:403)
        at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:64)
        at org.apache.log4j.PatternLayout.format(PatternLayout.java:503)
        at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301)
        at org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:234)
        at org.apache.log4j.WriterAppender.append(WriterAppender.java:159)
        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
        at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
        at org.apache.log4j.Category.callAppenders(Category.java:203)
        at org.apache.log4j.Category.forcedLog(Category.java:388)
        at org.apache.log4j.Category.debug(Category.java:257)
        at com.wholefoods.ittoolkit.ws.admin.UpdateTeam.update(UpdateTeam.java:35)
        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:324)
        at weblogic.webservice.component.javaclass.JavaClassInvocationHandler.invoke(JavaClassInvocationHandler.java:133)
        at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:104)
        at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
        at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:549)
        at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204)
        at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:176)
        at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:96)
        at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java:100)
        at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebServiceServlet.java:297)
        at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:498)
        at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServlet.java:267)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
        at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Caused by: java.lang.IllegalArgumentException
        at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
        at java.lang.reflect.Field.set(Field.java:519)
        at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:79)
        ... 63 more


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 3:12 pm 
Newbie

Joined: Thu Mar 01, 2007 6:58 pm
Posts: 9
Not sure if this is it, but since version is defined as not-null, can you try switching it to a long instead of Long. (Boxing of null to long with throw a null pointer exception).

Also, to check if the value is being set, can you add a protected/private setVersion(long) and changed your access to property from field and log/print when the value gets set.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.