customerCode seems to be null. Btw a nullable pk field is a bad thing, even a compound one.
Ara. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:xdoclet-user- > [EMAIL PROTECTED]] On Behalf Of L. Yeung > Sent: Saturday, July 06, 2002 9:18 PM > To: [EMAIL PROTECTED] > Subject: [Xdoclet-user] Newbie: HashCode Problem > > I deployed a simple bean written with xdoclet-1.1.2. > Jboss 2.4.6 dumped this stack exception. Any help is > greatly appreciated. > > [23:12:06,840,CacheKey] failed to initialize, > id=[.null.] > java.lang.NullPointerException > at test.interfaces.CustomerPK.hashCode(Unknown > Source) > at org.jboss.ejb.CacheKey.<init>(CacheKey.java:87) > at > org.jboss.ejb.plugins.EntityInstanceCache.createCacheKey(EntityInstanceC ac > he.java:48) > at > org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceM an > ager.java:245) > at > org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:640) > 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 > org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityCont ai > ner.java:867) > at > org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(Entity Sy > nchronizationInterceptor.java:234) > at > org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanc eI > nterceptor.java:147) > at > org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterce pt > or.java:97) > at > org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java: 14 > 2) > at > org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptor CM > T.java:347) > at > org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java: 86 > ) > at > org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor .j > ava:102) > at > org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:103) > at > org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:429) > at > org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPCo nt > ainerInvoker.java:458) > at > org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.jav a: > 237) > at > org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:18 2) > at $Proxy4.create(Unknown Source) > at test.ejb.CustomerImplBean.createCustomer(Unknown > Source) > 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 > org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stat el > essSessionContainer.java:542) > at > org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Statele ss > SessionInstanceInterceptor.java:82) > at > org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java: 13 > 8) > at > org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptor CM > T.java:347) > at > org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100) > at > org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.jav a: > 127) > at > org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170) > at > org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer .j > ava:286) > at > org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContai ne > rInvoker.java:412) > 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 sun.rmi.server.UnicastServerRef.dispatch(Unknown > Source) > at sun.rmi.transport.Transport$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native > Method) > at sun.rmi.transport.Transport.serviceCall(Unknown > Source) > at > sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown > Source) > at > sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown > Source) > at java.lang.Thread.run(Unknown Source) > > > /* > * Generated file - Do not edit! > */ > package test.interfaces; > > import java.lang.*; > import javax.ejb.*; > import test.interfaces.*; > import java.util.Collection; > import java.util.Date; > > /** > * Primary key for oro/Customer. > * @xdoclet-generated at Jul 5, 2002 11:09:03 PM > */ > public class CustomerPK > extends java.lang.Object > implements java.io.Serializable > { > static final long serialVersionUID = > -5190502349533170368L; > transient private int _hashCode = > Integer.MIN_VALUE; > transient private String value = null; > > public java.lang.String customerCode; > > public CustomerPK() > { > } > > public CustomerPK( java.lang.String customerCode ) > { > this.customerCode = customerCode; > } > > public java.lang.String getCustomerCode() > { > return customerCode; > } > > public void setCustomerCode(java.lang.String > customerCode) > { > this.customerCode = customerCode; > } > > public int hashCode() > { > if( _hashCode == Integer.MIN_VALUE ) > { > _hashCode += this.customerCode.hashCode(); > } > > return _hashCode; > } > > public boolean equals(Object obj) > { > if( !(obj instanceof test.interfaces.CustomerPK) > ) > return false; > > test.interfaces.CustomerPK pk = > (test.interfaces.CustomerPK)obj; > boolean eq = true; > > if( obj == null ) > { > eq = false; > } > else > { > if( this.customerCode == null && > ((test.interfaces.CustomerPK)obj).getCustomerCode() == > null ) > { > eq = true; > } > else > { > if( this.customerCode == null || > ((test.interfaces.CustomerPK)obj).getCustomerCode() == > null ) > { > eq = false; > } > else > { > eq = eq && this.customerCode.equals( > pk.customerCode ); > } > } > } > > return eq; > } > > public String toString() > { > if( value == null ) > { > value = "[."; > value += this.customerCode+"."; > value += "]"; > } > > return value; > } > } > > > > __________________________________________________ > Do You Yahoo!? > Sign up for SBC Yahoo! Dial - First Month Free > http://sbc.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Got root? We do. > http://thinkgeek.com/sf > _______________________________________________ > Xdoclet-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Got root? We do. http://thinkgeek.com/sf _______________________________________________ Xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
