This puts the JOnAS code in a strange non-spec place: partly EJB 1.1,
partlly EJB 2.0. The Enhydra use of JOnAS is to be EJB 1.1 compliant; I
don't really worry very much about completely add-on behavior (like the
message driven beans) but changes that impact existing beans (such as
Walt's) could be a problem. So, would it be hard for you to put in a
build-time switch that restores EJB 1.1 strict behavior?

Wayne Stidolph

-----Original Message-----
From: Philippe Coq
Sent: Tuesday, March 06, 2001 12:25 AM
To: Skidmore, Walt
Cc: '[EMAIL PROTECTED]'
Subject: Re: New error...


> "Skidmore, Walt" wrote:
>
> I just went from version 2.2.6 to 2.2.7, and these are the errors I'm
> now getting when I run GenIC:
>
> --------------------------------------------------------------------------
----------------
>
> ./medinex/server/entitybean/JOnASMDXAccountingCodeBean.java:61:
> unreported exception javax.ejb.DuplicateKeyException; must be caught
> or declared to be thrown
>
>         throw new javax.ejb.DuplicateKeyException(pk.toString());
>         ^
>
> ./medinex/server/entitybean/JOnASMDXAccountingCodeBean.java:85:
> unreported exception javax.ejb.CreateException; must be caught or
> declared to be thrown
>
>         throw new javax.ejb.CreateException(e.toString());
>         ^
>
> ./medinex/server/entitybean/JOnASMDXAccountingCodeBean.java:323:
> unreported exception javax.ejb.RemoveException; must be caught or
> declared to be thrown
>
>         throw new javax.ejb.RemoveException(e.toString());
>         ^
> --------------------------------------------------------------------------
-----------------
>
> Do I need to change my methods in the bean? (e.g. from "public
> MDXAccountingCodeKey ejbCreate(...)" to "public MDXAccountingCodeKey
> ejbCreate(...) throws {exception}")  This hasn't been an issue in the
> past...  The thing that baffles me is that it's generated code that
> javac is taking issue with...
>
> Any help would be greatly appreciated.
>
>

Hi,
in JOnAS 2.2.7 we have made modofoication in order to catch correctly
CreateException,
DuplicateKeyException, RemoveException
the generated code by GenIc has changed and now as I said in a previous
Mail
Fri, 09 Feb 2001
Re: CreateException in ejbCreate does not get through to the client

"The only problem I see (I hope it is a minor one) : as the generated
code CMP throw CreateException and RemoveException it is mandatory for
the bean
provider to define javax.ejb.CreateException in the throws clause of
ejbCreate<METHOD> methods
and to define javax.ejb.RemoveException in the throws clause ejbRemove
method.
It was not mandatory in the current version of JOnAS (2.2.6) so some
existing
beans may not compile anymore as it.

Note that the EJB2.0 specification says:
§9.7.5 ejbCreate<METHOD>methods:
The throws clause MUST define javax.ejb.CreateException. The throws
clause may define arbitrary application specific exceptions.
The EJB1.1 Specification was saying:
§9.2.3 ejbCreate methods:
The throws clause MAY define arbitrary application specific exceptions,
including the javax.ejb.CreateException"

So you must add the correct throws clause to your ejbCreate, ejbRemove
method
according to the Specification 2.0

Best regards,



--
        Philippe

----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to