RE: [JBoss-user] Jboss warning whenever i deploy.
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
Re: [JBoss-user] Jboss warning whenever i deploy.
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.
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
Re: [JBoss-user] Jboss warning whenever i deploy.
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.
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.
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.
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.
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.
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