Re: [JBoss-user] Jboss warning whenever i deploy.

2001-10-04 Thread Peter Wone

Sacha, sorry for sending this twice - I accidentally sent a private reply
the first time.

 Currently, the verifier checks for exact exception signature. Pseudo-code:
 source.getClass() == destination.getClass()

Guys, is there any reason we can't change this expression to

destination.getClass().isAssignableFrom(source.getClass())

which is both very readable and semantically closer to the intention of this
code?




___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-04 Thread Sacha Labourey

me too... :(

 Hello Peter,
 
 IMHO, the EJB spec states that both exceptions should be 
 identical hence the current code. But I agree that it could be 
 more code-friendly and it would not hurt the spec that much.
 
 Anyone against it?
 
 Cheers,
 
 
 
Sacha

___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread John LYC

Hi all,
when ever i deploy my ejb.jar files...

i get the following warning from jboss.. for every entity beans in my jar
file.
the entity beans are still working properly, i can call them and manipulate
the database.

here's the error msg
snip
[Verifier] ejb/entity/Contact: Verified.
[Verifier]
Bean   : ejb/entity/Country
Method : public abstract Country findByPrimaryKey(String) throws
RemoteException, FinderException
Section: 9.2.8
Warning: All the exceptions defined in the throws clause of an ejbFind
method of the entity bean class must be included in the throws clause of the
matching find method of the home interface.
--snip-

here's my home intereface
--snip--
public interface ContactHome extends EJBHome {
public Contact create(String contactOid, String name, String company,
String address1, String address2, String city, String state, String country,
String postal, String email, String phone, String fax, String id, String
accountNo) throws RemoteException, CreateException;
public Contact create(String contactOid) throws RemoteException,
CreateException;
public Contact findByPrimaryKey(String primaryKey) throws
RemoteException, FinderException;
public Collection findAll() throws RemoteException, FinderException;
}
-snip

here's my finder method...
---snip ---
public String ejbFindByPrimaryKey(String key) throws ObjectNotFoundException
{
Connection connection = null;
PreparedStatement statement = null;
try {
connection = dataSource.getConnection();
statement = connection.prepareStatement(SELECT CONTACT_OID FROM
dbo.CONTACT WHERE CONTACT_OID = ?);
statement.setString(1, key);
ResultSet resultSet = statement.executeQuery();
if (!resultSet.next()) {
throw new ObjectNotFoundException(Primary key does not
exist);
}
statement.close();
statement = null;
connection.close();

...
...
-snip--

please help me...
thank you all..
john


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Sacha Labourey

John,

I guess the message is quite clear...

 Section: 9.2.8
 Warning: All the exceptions defined in the throws clause of an ejbFind
 method of the entity bean class must be included in the throws
 clause of the
 matching find method of the home interface.

Look at section 9.2.8 of the EJB 1.1 spec.

in short: exception on finder methods of the bean must be present on finder
declaration of the home.

Your bean finder declaration:
 public String ejbFindByPrimaryKey(String key) throws
 ObjectNotFoundException

= ObjectNotFoundException may be thrown

Your home declaration for this finder:
 public Contact findByPrimaryKey(String primaryKey) throws
 RemoteException, FinderException;

Where is the ObjectNotFoundException declaration on this method declaration
of the home?




Sacha


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Dmitri Colebatch

ObjectNotFoundException is a subclass of FinderException...

On Wed, 3 Oct 2001, Sacha Labourey wrote:

 John,
 
 I guess the message is quite clear...
 
  Section: 9.2.8
  Warning: All the exceptions defined in the throws clause of an ejbFind
  method of the entity bean class must be included in the throws
  clause of the
  matching find method of the home interface.
 
 Look at section 9.2.8 of the EJB 1.1 spec.
 
 in short: exception on finder methods of the bean must be present on finder
 declaration of the home.
 
 Your bean finder declaration:
public String ejbFindByPrimaryKey(String key) throws
ObjectNotFoundException
 
 = ObjectNotFoundException may be thrown
 
 Your home declaration for this finder:
public Contact findByPrimaryKey(String primaryKey) throws
RemoteException, FinderException;
 
 Where is the ObjectNotFoundException declaration on this method declaration
 of the home?
 
 
 
 
   Sacha
 
 
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/jboss-user
 


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Sacha Labourey

Oups... :( I missed it... Thank's Dimitri!

John, simply change the declaration of you bean method to:

public String ejbFindByPrimaryKey(String key) throws FinderException

You will still be allowed to throw ObjectNotFoundException, but the verifier
will no more complain.

The verifier verfies the exact class exception equality, not if they are
compatible through inheritance.

Cheers,



Sacha




 -Message d'origine-
 De : Dmitri Colebatch [mailto:[EMAIL PROTECTED]]
 Envoye : mercredi, 3 octobre 2001 14:09
 A : Sacha Labourey
 Cc : John LYC; Jboss Mailing List
 Objet : RE: [JBoss-user] Jboss warning whenever i deploy.


 ObjectNotFoundException is a subclass of FinderException...

 On Wed, 3 Oct 2001, Sacha Labourey wrote:

  John,
 
  I guess the message is quite clear...
 
   Section: 9.2.8
   Warning: All the exceptions defined in the throws clause of an ejbFind
   method of the entity bean class must be included in the throws
   clause of the
   matching find method of the home interface.
 
  Look at section 9.2.8 of the EJB 1.1 spec.
 
  in short: exception on finder methods of the bean must be
 present on finder
  declaration of the home.
 
  Your bean finder declaration:
   public String ejbFindByPrimaryKey(String key) throws
   ObjectNotFoundException
 
  = ObjectNotFoundException may be thrown
 
  Your home declaration for this finder:
   public Contact findByPrimaryKey(String primaryKey) throws
   RemoteException, FinderException;
 
  Where is the ObjectNotFoundException declaration on this method
 declaration
  of the home?
 
 
 
 
  Sacha
 
 
  ___
  JBoss-user mailing list
  [EMAIL PROTECTED]
  https://lists.sourceforge.net/lists/listinfo/jboss-user
 




___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Dmitri Colebatch

I know its splitting hairs and all.. but shouldn't ejbFindByPK be allowed
to only declare the ObjectNotFoundException?  I would think thats legal,
as it is in normal inheritence (which is effectively what the verifier is
trying to verify isn't it?)...

cheers
dim

On Wed, 3 Oct 2001, Sacha Labourey wrote:

 Oups... :( I missed it... Thank's Dimitri!
 
 John, simply change the declaration of you bean method to:
 
   public String ejbFindByPrimaryKey(String key) throws FinderException
 
 You will still be allowed to throw ObjectNotFoundException, but the verifier
 will no more complain.
 
 The verifier verfies the exact class exception equality, not if they are
 compatible through inheritance.
 
 Cheers,
 
 
 
   Sacha
 
 
 
 
  -Message d'origine-
  De : Dmitri Colebatch [mailto:[EMAIL PROTECTED]]
  Envoye : mercredi, 3 octobre 2001 14:09
  A : Sacha Labourey
  Cc : John LYC; Jboss Mailing List
  Objet : RE: [JBoss-user] Jboss warning whenever i deploy.
 
 
  ObjectNotFoundException is a subclass of FinderException...
 
  On Wed, 3 Oct 2001, Sacha Labourey wrote:
 
   John,
  
   I guess the message is quite clear...
  
Section: 9.2.8
Warning: All the exceptions defined in the throws clause of an ejbFind
method of the entity bean class must be included in the throws
clause of the
matching find method of the home interface.
  
   Look at section 9.2.8 of the EJB 1.1 spec.
  
   in short: exception on finder methods of the bean must be
  present on finder
   declaration of the home.
  
   Your bean finder declaration:
  public String ejbFindByPrimaryKey(String key) throws
  ObjectNotFoundException
  
   = ObjectNotFoundException may be thrown
  
   Your home declaration for this finder:
  public Contact findByPrimaryKey(String primaryKey) throws
  RemoteException, FinderException;
  
   Where is the ObjectNotFoundException declaration on this method
  declaration
   of the home?
  
  
  
  
 Sacha
  
  
   ___
   JBoss-user mailing list
   [EMAIL PROTECTED]
   https://lists.sourceforge.net/lists/listinfo/jboss-user
  
 
 
 
 


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Sacha Labourey

Hello Dimitri,

 I know its splitting hairs and all.. but shouldn't ejbFindByPK be allowed
 to only declare the ObjectNotFoundException?  I would think thats legal,
 as it is in normal inheritence (which is effectively what the verifier is
 trying to verify isn't it?)...

The spec says : All the exceptions defined in the throws clause of an
ejbFind method of the entity bean class must be
included in the throws clause of the matching find method of the home
interface.

Thus, the spec does not seem to allow much place for smooth checking IMHO.
But, IMHO again, I cannot see why this shouldn't be allowed.

Currently, the verifier checks for exact exception signature. Pseudo-code:
source.getClass() == destination.getClass()

Cheers,



Sacha


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread Erin Mulder

Looks like he could easily avoid the warning by having his
ejbFindByPrimaryKey() throw FinderException instead of the
more specific ObjectNotFoundException.

Putting that aside, however, it seems that no warning should be
necessary when the home interface's throws clause contains a
superset of the implementation's.  Certainly, that is a very
reasonable interpretation of 9.2.8 based on the way Java
interfaces/implementations work.

(i.e. no compiler error/warning is issued when implementing
an interface with methods which throw more specific exceptions
than the interface requires, so long as the interface's throws
clause contains a superset)

Erin


- Original Message -
From: Sacha Labourey [EMAIL PROTECTED]
To: John LYC [EMAIL PROTECTED]; Jboss Mailing List
[EMAIL PROTECTED]
Sent: Wednesday, October 03, 2001 7:26 AM
Subject: RE: [JBoss-user] Jboss warning whenever i deploy.


 John,

 I guess the message is quite clear...

  Section: 9.2.8
  Warning: All the exceptions defined in the throws clause of an ejbFind
  method of the entity bean class must be included in the throws
  clause of the
  matching find method of the home interface.

 Look at section 9.2.8 of the EJB 1.1 spec.

 in short: exception on finder methods of the bean must be present on
finder
 declaration of the home.

 Your bean finder declaration:
  public String ejbFindByPrimaryKey(String key) throws
  ObjectNotFoundException

 = ObjectNotFoundException may be thrown

 Your home declaration for this finder:
  public Contact findByPrimaryKey(String primaryKey) throws
  RemoteException, FinderException;

 Where is the ObjectNotFoundException declaration on this method
declaration
 of the home?




 Sacha


 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/jboss-user


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Jboss warning whenever i deploy.

2001-10-03 Thread John LYC

Thank everyone,
i will change my method signature to throws finderException...

But i agree with you guys..
it should be legal thru inheritence.

anyway, for now, i'll just do as above.
regards,
John



- Original Message -
From: Dmitri Colebatch [EMAIL PROTECTED]
To: Sacha Labourey [EMAIL PROTECTED]
Cc: John LYC [EMAIL PROTECTED]; Jboss Mailing List
[EMAIL PROTECTED]
Sent: Wednesday, October 03, 2001 8:09 PM
Subject: RE: [JBoss-user] Jboss warning whenever i deploy.


 ObjectNotFoundException is a subclass of FinderException...

 On Wed, 3 Oct 2001, Sacha Labourey wrote:

  John,
 
  I guess the message is quite clear...
 
   Section: 9.2.8
   Warning: All the exceptions defined in the throws clause of an ejbFind
   method of the entity bean class must be included in the throws
   clause of the
   matching find method of the home interface.
 
  Look at section 9.2.8 of the EJB 1.1 spec.
 
  in short: exception on finder methods of the bean must be present on
finder
  declaration of the home.
 
  Your bean finder declaration:
   public String ejbFindByPrimaryKey(String key) throws
   ObjectNotFoundException
 
  = ObjectNotFoundException may be thrown
 
  Your home declaration for this finder:
   public Contact findByPrimaryKey(String primaryKey) throws
   RemoteException, FinderException;
 
  Where is the ObjectNotFoundException declaration on this method
declaration
  of the home?
 
 
 
 
  Sacha
 
 
  ___
  JBoss-user mailing list
  [EMAIL PROTECTED]
  https://lists.sourceforge.net/lists/listinfo/jboss-user
 


 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/jboss-user


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user