Alex,

In a web-tier I lookup the entitybean and invoke the
findByProfileOnKey(minId, maxId) on the remote interface of the bean. This
returns a collection. I iterate over the collection and per Object in the
collection I call a function upon that entity bean object that gets the data
from this bean. Inside this function that gets the data, the abstract
getters of this bean are invoked, one of which is getF1().

It's this function getF1() that causes the problem. The EJB container
implements this method. The field is a double (java primitive type) and the
container tries to retrieve the double value from the database which has
value NULL. Note that the row in the database was not written by this Bean
because EJB2.0 will store the value 0.0. The value NULL was stored manually
or by a third party application that uses the same database. JBoss throws a
NullPointerException but WebLogic returns the value 0.0.

Hope this is clear enough.

Raymond Brandon




> -----Original Message-----
> From: Alex Loubyansky [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 21, 2003 14:19
> To: Brandon, Raymond
> Subject: Re: [JBoss-user] EJB2.0 JBoss 3.0.4 NullPointerException on
> invocation of abstract getter
> 
> 
> Raymond,
> 
> could you provide more info about the bean and the way you are trying
> to load it?
> 
> alex
> 
> Tuesday, January 21, 2003, 2:29:32 PM, you wrote:
> 
> Hi all,
>  
> I have an entity bean that retreives data from the 
> following table:
>  
> CREATE TABLE testnullvalues.DomainClass (
>     id                             INTEGER                
>         NOT NULL,
>      f1                             DOUBLE PRECISION      NULL,
>      f2                             VARCHAR (40)           
>      NULL,
>      PRIMARY KEY (id)
>  );
>  
>  According to the DBMS table definition, only the primary 
> key is required. I
>  have a row of data in this table of which only the 
> primary key has a value
>  and the other fields are NULL.
>  
>  When invoking the abstract getter of field "f1" I get the 
> stack-trace below.
>  Why is this happening? This code works perfectly on WebLogic 7.
>  
>  Regards,
>  
>  Raymond Brandon
>  
>  ---- stack-trace ----
>  
>  TRACE  EjbTier     (DomainClassBean.java:100) - DomainClassBean()
>  constructor called.
>  TRACE  EjbTier     (DomainClassBean.java:100) - DomainClassBean()
>  constructor called.
>  TRACE  EjbTier     (DomainClassBean.java:100) - DomainClassBean()
>  constructor called.
>  TRACE  EjbTier     (DomainClassBean.java:100) - DomainClassBean()
>  constructor called.
>  INFO   org.jboss.ejb.EjbModule (Logger.java:149) - Started
>  INFO   org.jboss.system.server.Server (Logger.java:149) - 
> JBoss (MX
>  MicroKernel) [3.0.4 Date:200211021607] Started in 0m:16s:141ms
>  INFO   OptimalJ    (LoggingSocketServer.java:106) - 
> Connected to client at
>  /127.0.0.1
>  INFO   WebTier     (DomainClassBrowseAction.java:163) - 
> Starting the
>  retrieve action...
>  INFO   WebTier     (DomainClassBrowseAction.java:170) - 
> Doing a full
>  retrieve.
>  INFO   WebTier     (DomainClassBrowseAction.java:289) - 
> Retrieving with
>  filter ByProfileOnKey from bfDomainClass.
>  INFO   WebTier     
> (DomainClassDomainClassBusinessFacade.java:439) -
>  retrieving DomainClassUpdateObject objects...
>  TRACE  EjbTier     (DomainClassBean.java:100) - DomainClassBean()
>  constructor called.
>  TRACE  EjbTier     (DomainClassBean.java:100) - DomainClassBean()
>  constructor called.
>  TRACE  EjbTier     (DomainClassBean.java:288) -
>  DomainClassBean.setEntityContext(EntityContext context)
>  TRACE  EjbTier     (DomainClassBean.java:288) -
>  DomainClassBean.setEntityContext(EntityContext context)
>  TRACE  EjbTier     (DomainClassBean.java:100) - DomainClassBean()
>  constructor called.
>  TRACE  EjbTier     (DomainClassBean.java:100) - DomainClassBean()
>  constructor called.
>  TRACE  EjbTier     (DomainClassBean.java:288) -
>  DomainClassBean.setEntityContext(EntityContext context)
>  TRACE  EjbTier     (DomainClassBean.java:288) -
>  DomainClassBean.setEntityContext(EntityContext context)
>  TRACE  EjbTier     (DomainClassBean.java:326) -
>  DomainClassBean.ejbActivate()
>  TRACE  EjbTier     (DomainClassBean.java:326) -
>  DomainClassBean.ejbActivate()
>  TRACE  EjbTier     (DomainClassBean.java:382) - 
> DomainClassBean.ejbLoad():
>  key=id(1)
>  TRACE  EjbTier     (DomainClassBean.java:382) - 
> DomainClassBean.ejbLoad():
>  key=id(1)
>  TRACE  EjbTier     (DomainClassBean.java:529) - 
> SADomainClass.getData()
>  TRACE  EjbTier     (DomainClassBean.java:529) - 
> SADomainClass.getData()
>  ERROR  org.jboss.ejb.plugins.LogInterceptor (Logger.java:194) -
>  EJBException, causedBy:
>  java.lang.NullPointerException
>          at
>  
> testnullvalues.application.ejb.DomainClassBean$Proxy.getF1(<ge
> nerated>)
>          at
>  
> testnullvalues.application.ejb.DomainClassBean$SADomainClass.g
> etData(DomainC
>  lassBean.java:538)
>          at
>  
> testnullvalues.application.ejb.DomainClassBean.initCRC(DomainC
> lassBean.java:
>  267)
>          at
>  
> testnullvalues.application.ejb.DomainClassBean.ejbLoad(DomainC
> lassBean.java:
>  384)
>          at 
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at
>  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39
>  )
>          at
>  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl
>  .java:25)
>          at java.lang.reflect.Method.invoke(Method.java:324)
>          at
>  
> org.jboss.ejb.plugins.CMPPersistenceManager.invokeLoad(CMPPers
> istenceManager
>  .java:551)
>          at
>  
> org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPers
> istenceManager
>  .java:413)
>          at
>  
> org.jboss.resource.connectionmanager.CachedConnectionIntercept
> or.loadEntity(
>  CachedConnectionInterceptor.java:353)
>          at
>  
> org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(
> EntitySynchron
>  izationInterceptor.java:251)
>          at
>  
> org.jboss.resource.connectionmanager.CachedConnectionIntercept
> or.invoke(Cach
>  edConnectionInterceptor.java:186)
>          at
>  
> org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(Entit
> yReentranceInt
>  erceptor.java:90)
>          at
>  
> org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityI
> nstanceInterce
>  ptor.java:163)
>          at
>  
> org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockI
> nterceptor.jav
>  a:107)
>          at
>  
> org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityC
> reationInterce
>  ptor.java:69)
>          at
>  
> org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(Abstrac
> tTxInterceptor
>  .java:107)
>          at
>  
> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxI
> nterceptorCMT.
>  java:178)
>          at
>  
> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT
> .java:60)
>          at
>  
> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInter
> ceptor.java:13
>  0)
>          at
>  
> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
>          at 
> org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
>          at org.jboss.ejb.Container.invoke(Container.java:712)
>          at 
> org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
>          at
>  
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
>          at
>  
> org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoke
> r.java:382)
>          at 
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at
>  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39
>  )
>          at
>  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl
>  .java:25)
>          at java.lang.reflect.Method.invoke(Method.java:324)
>          at
>  
> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
>          at sun.rmi.transport.Transport$1.run(Transport.java:148)
>          at 
> java.security.AccessController.doPrivileged(Native Method)
>          at 
> sun.rmi.transport.Transport.serviceCall(Transport.java:144)
>          at
>  
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport
> .java:460)
>          at
>  
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTr
> ansport.java:7
>  01)
>          at java.lang.Thread.run(Thread.java:536)
>  ERROR  WebTier     
> (DomainClassDomainClassBusinessFacade.java:1019) - caught
>  RemoteException while finding on the DomainClassBean!
>  ERROR  WebTier     
> (DomainClassDomainClassBusinessFacade.java:1021) -
>  rethrowing as AlturaRuntimeException
> 
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 


-- 
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it. 



-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to