Hi all!


I got a small project (BPM4Struts and Spring) with two entities: IntranetUser 
and IntranetGroup - IntranetUser has a one-to-many relation to IntranetGroup.

The instantiation of the IntranetGroup works fine, but when I to create a 
IntranetUser I get the following exception.



All values of the new IntranetUser entity are filled with valid objects (of 
type String or IntranetGroup-Entity).



Would be very nice, if somebody could help me...



Kind regards,



Alex



P.S.: The related code:



    protected void 
handleAddUser(sample.intranet.security.AddUserData addUserData)

        throws java.lang.Exception

    {

       IntranetUser userEntity = 
IntranetUser.Factory.newInstance();

       Collection groups = new HashSet(1);

      
 groups.add(getIntranetGroupDao().findGroupByName(addUserData.getGroup()));

       userEntity.setIntranetGroup(groups);

       System.out.println("Username: " + 
addUserData.getUsername());

      
 userEntity.setUsername(addUserData.getUsername());

       System.out.println("Password: " + 
addUserData.getPassword());

      
 userEntity.setPassword(addUserData.getPassword());

       System.out.println("Firstname: " + 
addUserData.getFirstName());

      
 userEntity.setFirstname(addUserData.getFirstName());

       System.out.println("Lastname: " + 
addUserData.getLastName());

      
 userEntity.setLastname(userEntity.getLastname());

       System.out.println("Gender: " + 
addUserData.getGender());

      
 userEntity.setGender(addUserData.getGender());

       

      
 getIntranetUserDao().create(userEntity);

    }





15:29:24,217 INFO  [STDOUT] Hibernate: select intranetgr0_.NAME as NAME from 
INTRANET_GROUP intranetgr0_ where (intranetgr0_.NAME=? )

15:29:24,227 INFO  [STDOUT] Username: ExampleUser

15:29:24,227 INFO  [STDOUT] Password: hallowelt

15:29:24,227 INFO  [STDOUT] Firstname: myFirstname

15:29:24,227 INFO  [STDOUT] Lastname: myLastname

15:29:24,227 INFO  [STDOUT] Gender: male

15:29:24,267 INFO  [ClassPathXmlApplicationContext] Closing application context 
[org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=26955360]

15:29:24,267 INFO  [DefaultListableBeanFactory] Destroying singletons in 
factory {org.springframework.beans.factory.support.DefaultListableBeanFactory 
defining beans [beanRefFactory]; root of BeanFactory hierarchy}

15:29:24,267 ERROR [LogInterceptor] RuntimeException in method: public abstract 
void 
sample.intranet.security.AuthentificationService.addUser(sample.intranet.security.AddUserData):

sample.intranet.security.AuthentificationServiceException: Error performing 
'sample.intranet.security.AuthentificationService.addUser(sample.intranet.security.AddUserData
 addUserData)' --> org.springframework.orm.hibernate.HibernateSystemException: 
not-null property references a null or transient value: 
sample.intranet.security.users.IntranetUserImpl.lastname; nested exception is 
net.sf.hibernate.PropertyValueException: not-null property references a null or 
transient value: sample.intranet.security.users.IntranetUserImpl.lastname

        at 
sample.intranet.security.AuthentificationServiceBase.addUser(AuthentificationServiceBase.java:100)

        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:284)

        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)

        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)

        at 
org.springframework.orm.hibernate.HibernateInterceptor.invoke(HibernateInterceptor.java:163)

        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=1011#1011
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to