RE: [JBoss-user] Bug in 3.2.1?

2003-06-06 Thread Danny . Yates
ObjectNotFoundException is a subclass of FinderException. You can
catch either:

  try {
find(...)
  } catch (FinderException fe) {
// something went wrong
  }

or

  try {
find(...)
  } catch (ObjectNotFoundException onfe) {
// could not find object - do something clever, like create it
  } catch (FinderException fe) {
// something else went wrong - perhaps a wrapped SQLException?
  }

-- 
Danny Yates
 


-Original Message-
From: Jon Haugsand [mailto:[EMAIL PROTECTED] 
Sent: 06 June 2003 15:42
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Bug in 3.2.1?


Look at this fragment.  The call 'findAktivtByIsin' is a finder in
another bean and it fails (just check the stacktrace).  However, it
fails with ObjectNotFoundException: No such entity.  Why is that?
If it does not exist, shouldn't it fail with FinderException?




public void checkConsistency() throws InconsistentDataException
...
try
{
vp =
EjbHomeFactory.getFactory().lookUpVerdipapir().findAktivtByIsin(
this.getIsin() );
} catch( final FinderException e )
{
cat.warn( Konsistenssjekk feilet. );
throw new InconsistentDataException( e );
}
  



Detail exception is:
javax.ejb.ObjectNotFoundException: No such entity!
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityC
omm
and.java:46)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.
jav
a:591)
at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager
.ja
va:312)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(
Cac
hedConnectionInterceptor.java:301)
at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:627)
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.ja
va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
r.j
ava:998)
at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
a:8
8)
at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
hro
nizationInterceptor.java:188)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(
Cac
hedConnectionInterceptor.java:215)
at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
a:8
8)
at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
erc
eptor.java:91)
at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor
.ja
va:61)
at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInt
erc
eptor.java:28)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.ja
va:88)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
jav
a:243)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74)
at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav
a:9
2)
at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryF
ind
erInterceptor.java:93)
at
org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:477)
at org.jboss.ejb.Container.invoke(Container.java:694)
at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyF
act
ory.java:272)
at
org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
at $Proxy59.findAktivtByIsin(Unknown Source)
at
norgesbank.bank.sil.entiteter.pant.PantBean.checkConsistency(PantBean.java:2
167
)

-- 
 Jon Haugsand, [EMAIL PROTECTED]
 http://www.norges-bank.no



---
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


_ 
Notice to recipient: 
The information in this internet e-mail and any attachments is confidential
and may be privileged. It is intended solely for the addressee. If you are
not the intended addressee please notify the sender immediately by
telephone. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. 

When addressed to external clients 

RE: [JBoss-user] Bug in 3.2.1?

2003-06-06 Thread Danny . Yates
I should just add, that the exception handler you show below should
work OK.

-- 
Danny Yates
 


-Original Message-
From: Jon Haugsand [mailto:[EMAIL PROTECTED] 
Sent: 06 June 2003 15:42
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Bug in 3.2.1?


Look at this fragment.  The call 'findAktivtByIsin' is a finder in
another bean and it fails (just check the stacktrace).  However, it
fails with ObjectNotFoundException: No such entity.  Why is that?
If it does not exist, shouldn't it fail with FinderException?




public void checkConsistency() throws InconsistentDataException
...
try
{
vp =
EjbHomeFactory.getFactory().lookUpVerdipapir().findAktivtByIsin(
this.getIsin() );
} catch( final FinderException e )
{
cat.warn( Konsistenssjekk feilet. );
throw new InconsistentDataException( e );
}
  



Detail exception is:
javax.ejb.ObjectNotFoundException: No such entity!
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityC
omm
and.java:46)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.
jav
a:591)
at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager
.ja
va:312)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(
Cac
hedConnectionInterceptor.java:301)
at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:627)
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.ja
va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
r.j
ava:998)
at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
a:8
8)
at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
hro
nizationInterceptor.java:188)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(
Cac
hedConnectionInterceptor.java:215)
at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
a:8
8)
at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
erc
eptor.java:91)
at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor
.ja
va:61)
at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInt
erc
eptor.java:28)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.ja
va:88)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
jav
a:243)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74)
at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav
a:9
2)
at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryF
ind
erInterceptor.java:93)
at
org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:477)
at org.jboss.ejb.Container.invoke(Container.java:694)
at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyF
act
ory.java:272)
at
org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
at $Proxy59.findAktivtByIsin(Unknown Source)
at
norgesbank.bank.sil.entiteter.pant.PantBean.checkConsistency(PantBean.java:2
167
)

-- 
 Jon Haugsand, [EMAIL PROTECTED]
 http://www.norges-bank.no



---
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


_ 
Notice to recipient: 
The information in this internet e-mail and any attachments is confidential
and may be privileged. It is intended solely for the addressee. If you are
not the intended addressee please notify the sender immediately by
telephone. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. 

When addressed to external clients any opinions or advice contained in this
internet e-mail are subject to the terms and conditions expressed in any
applicable governing terms of business or client engagement letter issued by
the pertinent Bank of America group entity. 

If this email originates from the U.K. please note that Bank of America,
N.A., London Branch, 

RE: [JBoss-user] Bug in 3.2.1?

2003-06-06 Thread Rupp,Heiko
Hi,

 Look at this fragment.  The call 'findAktivtByIsin' is a finder in
 another bean and it fails (just check the stacktrace).  However, it
 fails with ObjectNotFoundException: No such entity.  Why is that?
 If it does not exist, shouldn't it fail with FinderException?

ObjectNotFoundException is iic derived from FinderException and
is supposed to be thrown if a finder, that is supposed to return
a unique object (as opposed to a collection), doesn't find an
entry in the db.

  Heiko
-- 
Bancotec GmbH  EMail: [EMAIL PROTECTED]
Calwer Str. 33 Telefon: +49 711 222 992 900
D-70173 Stuttgart  Telefax: +49 711 222 992 999
Ein Unternehmen der Cellent AG http://www.cellent.de/


---
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] Bug in 3.2.1?

2003-06-06 Thread DavidNeuer

ObjectNotFoundException is a subclass
of FinderException.

NoSuchObjectExsists is what gets throw
if you reference an actual bean interface method on an Entity that's beed
removed.

Dave







Jon Haugsand [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
06/06/2003 10:41 AM
Please respond to jboss-user

To:
   [EMAIL PROTECTED]
cc:
   
Subject:
   [JBoss-user] Bug in 3.2.1?


Look at this fragment. The call 'findAktivtByIsin'
is a finder in
another bean and it fails (just check the stacktrace). However, it
fails with ObjectNotFoundException: No such entity. Why
is that?
If it does not exist, shouldn't it fail with FinderException?




  public void checkConsistency() throws InconsistentDataException
...
  try
  {
vp = EjbHomeFactory.getFactory().lookUpVerdipapir().findAktivtByIsin(
this.getIsin() );
  } catch( final FinderException
e )
  {
cat.warn( Konsistenssjekk
feilet. );
throw new InconsistentDataException(
e );
  }
 



Detail exception is:
javax.ejb.ObjectNotFoundException: No such entity!
at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityComm
and.java:46)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.jav
a:591)
at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.ja
va:312)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(Cac
hedConnectionInterceptor.java:301)
at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:627)
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja
va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.j
ava:998)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:8
8)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchro
nizationInterceptor.java:188)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(Cac
hedConnectionInterceptor.java:215)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:8
8)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterc
eptor.java:91)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.ja
va:61)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterc
eptor.java:28)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.ja
va:88)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.jav
a:243)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:9
2)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFind
erInterceptor.java:93)
at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:477)
at org.jboss.ejb.Container.invoke(Container.java:694)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFact
ory.java:272)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
at $Proxy59.findAktivtByIsin(Unknown Source)
at norgesbank.bank.sil.entiteter.pant.PantBean.checkConsistency(PantBean.java:2167
)

-- 
 Jon Haugsand, [EMAIL PROTECTED]
 http://www.norges-bank.no



---
This SF.net email is sponsored by: Etnus, makers of TotalView, The
best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user