|
From: <jue...@we...> - 2003-11-14 17:45:01
|
There's a bug entry on SourceForge for this: = http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D823990&group= _id=3D73357&atid=3D537539 =20 Juergen ________________________________ Von: spr...@li... im Auftrag = von Colin Sampaleanu Gesendet: Fr 14.11.2003 18:41 An: spr...@li... Betreff: [Springframework-developer] AbstractMessageDrivenBean's = ejbCreate method is not spec compliant, I am going to change it AbstractMessageDrivenBean currently has the following ejbCreate method: /** * Lifecycle method required by the EJB specification but not * the MessageDrivenBean interface. * <p>This implementation loads the BeanFactory. Don't override it * (although it can't be made final): code your initialization in * onEjbCreate(), which is called when the BeanFactory is available. * <p>Unfortunately we can't load the BeanFactory in setSessionContext(), * as ResourceManager access isn't permitted and the BeanFactory may require it. */ public void ejbCreate() throws CreateException { loadBeanFactory(); onEjbCreate(); } This is actually not spec compliant. If you look at the spec, section 15.7.3, it states that MessageDrivenBeans must not throw application exceptions. CreateException is an application exception, and in fact JBoss, for example, will not allow an MDB with this create method to = load. So I am going to change this to remove the exception, after I get back from lunch. If anybody disagrees with me, before or after that, please let me know. (lucky me, still putzin' around with legacy EJB code...) Regards, Colin ------------------------------------------------------- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=3Dmm/g22lp.tmp= l _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Rod J. <rod...@in...> - 2003-11-14 17:51:52
|
Yes, as the bug entries say I took the decision that it is incorrect according to the spec, but the WebLogic examples do throw CreateException. And the user reported that it _did_ still work in JBoss, so I figured that I didn't want to have to go test it in all EJB containers. (Ie I didn't have time to retest it in WLS.) However, you probably should change it. Regards, Rod ----- Original Message ----- From: "jürgen höller [werk3AT]" <jue...@we...> To: <spr...@li...> Sent: Friday, November 14, 2003 5:40 PM Subject: Re: [Springframework-developer] AbstractMessageDrivenBean's ejbCreate method is not spec compliant, I am going to change it There's a bug entry on SourceForge for this: http://sourceforge.net/tracker/index.php?func=detail&aid=823990&group_id=73357&atid=537539 Juergen ________________________________ Von: spr...@li... im Auftrag von Colin Sampaleanu Gesendet: Fr 14.11.2003 18:41 An: spr...@li... Betreff: [Springframework-developer] AbstractMessageDrivenBean's ejbCreate method is not spec compliant, I am going to change it AbstractMessageDrivenBean currently has the following ejbCreate method: /** * Lifecycle method required by the EJB specification but not * the MessageDrivenBean interface. * <p>This implementation loads the BeanFactory. Don't override it * (although it can't be made final): code your initialization in * onEjbCreate(), which is called when the BeanFactory is available. * <p>Unfortunately we can't load the BeanFactory in setSessionContext(), * as ResourceManager access isn't permitted and the BeanFactory may require it. */ public void ejbCreate() throws CreateException { loadBeanFactory(); onEjbCreate(); } This is actually not spec compliant. If you look at the spec, section 15.7.3, it states that MessageDrivenBeans must not throw application exceptions. CreateException is an application exception, and in fact JBoss, for example, will not allow an MDB with this create method to load. So I am going to change this to remove the exception, after I get back from lunch. If anybody disagrees with me, before or after that, please let me know. (lucky me, still putzin' around with legacy EJB code...) Regards, Colin ------------------------------------------------------- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF. Net email is sponsored by: GoToMyPC GoToMyPC is the fast, easy and secure way to access your computer from any Web browser or wireless device. Click here to Try it Free! https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=/g22lp.tmpl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <tri...@tr...> - 2003-11-14 18:31:17
|
+1 for removing it.
It looks like you are all correct - WebLogic seems to think that CreateException
should be thrown from the ejbCreate method - but from my experience it works
without this throws clause. I don't remember where I copied my generic
messagebean implementation from, but I did not have this throws clause and
WebLogic has never complained.
This is from
/bea/weblogic700/samples/server/src/examples/ejb20/message/MessageTraderBean.java
/**
* This method corresponds to the create method in the home interface
* "TraderHome.java".
* The parameter sets of the two methods are identical. When the client calls
* <code>TraderHome.create()</code>, the container allocates an instance of
* the EJBean and calls <code>ejbCreate()</code>.
*
* @exception javax.ejb.CreateException if there is
* a communications or systems failure
* @see examples.ejb11.basic.statelessMessageDriven.Trader
*/
public void ejbCreate () throws CreateException {
}
Also see:
http://edocs.bea.com/wls/docs81/javadocs/weblogic/ejb/GenericMessageDrivenBean.html
My take on this is that the messagebean should throw an EJBException if there is
a communications or system failure.
Thomas
Quoting Rod Johnson <rod...@in...>:
> Yes, as the bug entries say I took the decision that it is incorrect
> according to the spec, but the WebLogic examples do throw CreateException.
> And the user reported that it _did_ still work in JBoss, so I figured that I
> didn't want to have to go test it in all EJB containers. (Ie I didn't have
> time to retest it in WLS.)
>
> However, you probably should change it.
>
> Regards,
> Rod
>
> ----- Original Message -----
> From: "jürgen höller [werk3AT]" <jue...@we...>
> To: <spr...@li...>
> Sent: Friday, November 14, 2003 5:40 PM
> Subject: Re: [Springframework-developer] AbstractMessageDrivenBean's
> ejbCreate method is not spec compliant, I am going to change it
>
>
> There's a bug entry on SourceForge for this:
>
http://sourceforge.net/tracker/index.php?func=detail&aid=823990&group_id=73357&atid=537539
>
> Juergen
>
> ________________________________
>
> Von: spr...@li... im Auftrag von
> Colin Sampaleanu
> Gesendet: Fr 14.11.2003 18:41
> An: spr...@li...
> Betreff: [Springframework-developer] AbstractMessageDrivenBean's ejbCreate
> method is not spec compliant, I am going to change it
>
>
>
> AbstractMessageDrivenBean currently has the following ejbCreate method:
>
> /**
> * Lifecycle method required by the EJB specification but not
> * the MessageDrivenBean interface.
> * <p>This implementation loads the BeanFactory. Don't override it
> * (although it can't be made final): code your initialization in
> * onEjbCreate(), which is called when the BeanFactory is available.
> * <p>Unfortunately we can't load the BeanFactory in
> setSessionContext(),
> * as ResourceManager access isn't permitted and the BeanFactory may
> require it.
> */
> public void ejbCreate() throws CreateException {
> loadBeanFactory();
> onEjbCreate();
> }
>
> This is actually not spec compliant. If you look at the spec, section
> 15.7.3, it states that MessageDrivenBeans must not throw application
> exceptions. CreateException is an application exception, and in fact
> JBoss, for example, will not allow an MDB with this create method to load.
>
> So I am going to change this to remove the exception, after I get back
> from lunch. If anybody disagrees with me, before or after that, please
> let me know.
>
> (lucky me, still putzin' around with legacy EJB code...)
>
> Regards,
> Colin
>
>
>
>
>
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=/g22lp.tmpl
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: Colin S. <col...@ex...> - 2003-11-14 19:25:24
|
The spec is actually quite clear (i.e. look at 7.10.3 for a Session
Bean's ejbCreate contract, where they say explicitely that application
exceptions _may_ be thrown, including CreateException). So I think the
people who created those examples don't know the correct spec. Probably
those appserver which allow the throw are doing it either because the
authors (of the appserver) didn't realize the behaviour was different,
and just carried over their validation to be the same as for other bean
types, or they made them allow non-compliant code in order to work with
more user code, since this is likely to be a common error.
tri...@tr... wrote:
>+1 for removing it.
>
>It looks like you are all correct - WebLogic seems to think that CreateException
>should be thrown from the ejbCreate method - but from my experience it works
>without this throws clause. I don't remember where I copied my generic
>messagebean implementation from, but I did not have this throws clause and
>WebLogic has never complained.
>
>
>This is from
>/bea/weblogic700/samples/server/src/examples/ejb20/message/MessageTraderBean.java
>
> /**
> * This method corresponds to the create method in the home interface
> * "TraderHome.java".
> * The parameter sets of the two methods are identical. When the client calls
> * <code>TraderHome.create()</code>, the container allocates an instance of
> * the EJBean and calls <code>ejbCreate()</code>.
> *
> * @exception javax.ejb.CreateException if there is
> * a communications or systems failure
> * @see examples.ejb11.basic.statelessMessageDriven.Trader
> */
> public void ejbCreate () throws CreateException {
>
> }
>
>Also see:
>http://edocs.bea.com/wls/docs81/javadocs/weblogic/ejb/GenericMessageDrivenBean.html
>
>My take on this is that the messagebean should throw an EJBException if there is
>a communications or system failure.
>
>Thomas
>
>
>Quoting Rod Johnson <rod...@in...>:
>
>
>
>>Yes, as the bug entries say I took the decision that it is incorrect
>>according to the spec, but the WebLogic examples do throw CreateException.
>>And the user reported that it _did_ still work in JBoss, so I figured that I
>>didn't want to have to go test it in all EJB containers. (Ie I didn't have
>>time to retest it in WLS.)
>>
>>However, you probably should change it.
>>
>>Regards,
>>Rod
>>
>>----- Original Message -----
>>From: "jürgen höller [werk3AT]" <jue...@we...>
>>To: <spr...@li...>
>>Sent: Friday, November 14, 2003 5:40 PM
>>Subject: Re: [Springframework-developer] AbstractMessageDrivenBean's
>>ejbCreate method is not spec compliant, I am going to change it
>>
>>
>>There's a bug entry on SourceForge for this:
>>
>>
>>
>http://sourceforge.net/tracker/index.php?func=detail&aid=823990&group_id=73357&atid=537539
>
>
>>Juergen
>>
>>________________________________
>>
>>Von: spr...@li... im Auftrag von
>>Colin Sampaleanu
>>Gesendet: Fr 14.11.2003 18:41
>>An: spr...@li...
>>Betreff: [Springframework-developer] AbstractMessageDrivenBean's ejbCreate
>>method is not spec compliant, I am going to change it
>>
>>
>>
>>AbstractMessageDrivenBean currently has the following ejbCreate method:
>>
>> /**
>> * Lifecycle method required by the EJB specification but not
>> * the MessageDrivenBean interface.
>> * <p>This implementation loads the BeanFactory. Don't override it
>> * (although it can't be made final): code your initialization in
>> * onEjbCreate(), which is called when the BeanFactory is available.
>> * <p>Unfortunately we can't load the BeanFactory in
>>setSessionContext(),
>> * as ResourceManager access isn't permitted and the BeanFactory may
>>require it.
>> */
>> public void ejbCreate() throws CreateException {
>> loadBeanFactory();
>> onEjbCreate();
>> }
>>
>>This is actually not spec compliant. If you look at the spec, section
>>15.7.3, it states that MessageDrivenBeans must not throw application
>>exceptions. CreateException is an application exception, and in fact
>>JBoss, for example, will not allow an MDB with this create method to load.
>>
>>So I am going to change this to remove the exception, after I get back
>>from lunch. If anybody disagrees with me, before or after that, please
>>let me know.
>>
>>(lucky me, still putzin' around with legacy EJB code...)
>>
>>Regards,
>>Colin
>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF. Net email is sponsored by: GoToMyPC
>>GoToMyPC is the fast, easy and secure way to access your computer from
>>any Web browser or wireless device. Click here to Try it Free!
>>https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
>>_______________________________________________
>>Springframework-developer mailing list
>>Spr...@li...
>>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF. Net email is sponsored by: GoToMyPC
>>GoToMyPC is the fast, easy and secure way to access your computer from
>>any Web browser or wireless device. Click here to Try it Free!
>>https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=/g22lp.tmpl
>>_______________________________________________
>>Springframework-developer mailing list
>>Spr...@li...
>>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF. Net email is sponsored by: GoToMyPC
>>GoToMyPC is the fast, easy and secure way to access your computer from
>>any Web browser or wireless device. Click here to Try it Free!
>>https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
>>_______________________________________________
>>Springframework-developer mailing list
>>Spr...@li...
>>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>>
>
>
>
>
>
>-------------------------------------------------------
>This SF. Net email is sponsored by: GoToMyPC
>GoToMyPC is the fast, easy and secure way to access your computer from
>any Web browser or wireless device. Click here to Try it Free!
>https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|
|
From: Colin S. <col...@ex...> - 2003-11-14 19:08:44
|
It may work in some versions of JBoss. JBoss 3.2.2 doesn't deploy the
bean at all though:
----
12:22:35,853 ERROR [MainDeployer] could not create deployment:
file:/C:/dev/jbos
s-3.2.2/server/default/deploy/core-app.ear
org.jboss.deployment.DeploymentException: Verification of Enterprise
Beans faile
d, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:778)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
...
12:22:36,118 ERROR [URLDeploymentScanner] MBeanException: Exception in
MBean ope
ration 'checkIncompleteDeployments()'
Cause: Incomplete Deployment listing:
Packages waiting for a deployer:
<none>
Incompletely deployed packages:
[org.jboss.deployment.DeploymentInfo@47111691 {
url=file:/C:/dev/jboss-3.2.2/ser
ver/default/deploy/core-app.ear }
deployer: org.jboss.deployment.EARDeployer@4977e2
status: Deployment FAILED reason: Verification of Enterprise Beans
failed, see
above for error messages.
state: FAILED
watch: file:/C:/dev/jboss-3.2.2/server/default/deploy/core-app.ear
lastDeployed: 1068830549227
----
So I don't see much choice but to change it. That is, I think it makes
more sense that it's compliant and works in JBoss, and works with
compliant code in other app servers, and breaks some non-compliant code
in other app servers, than the current situation where we force
non-compliant code, which can't run on JBoss at all.
Regardless of Spring, the real question is if there is an app-server out
there that breaks without the CreateException. If that's the case, it
would kill cross-server compatibility...
Rod Johnson wrote:
>Yes, as the bug entries say I took the decision that it is incorrect
>according to the spec, but the WebLogic examples do throw CreateException.
>And the user reported that it _did_ still work in JBoss, so I figured that I
>didn't want to have to go test it in all EJB containers. (Ie I didn't have
>time to retest it in WLS.)
>
>However, you probably should change it.
>
>Regards,
>Rod
>
>----- Original Message -----
>From: "jürgen höller [werk3AT]" <jue...@we...>
>To: <spr...@li...>
>Sent: Friday, November 14, 2003 5:40 PM
>Subject: Re: [Springframework-developer] AbstractMessageDrivenBean's
>ejbCreate method is not spec compliant, I am going to change it
>
>
>There's a bug entry on SourceForge for this:
>http://sourceforge.net/tracker/index.php?func=detail&aid=823990&group_id=73357&atid=537539
>
>Juergen
>
>________________________________
>
>Von: spr...@li... im Auftrag von
>Colin Sampaleanu
>Gesendet: Fr 14.11.2003 18:41
>An: spr...@li...
>Betreff: [Springframework-developer] AbstractMessageDrivenBean's ejbCreate
>method is not spec compliant, I am going to change it
>
>
>
>AbstractMessageDrivenBean currently has the following ejbCreate method:
>
> /**
> * Lifecycle method required by the EJB specification but not
> * the MessageDrivenBean interface.
> * <p>This implementation loads the BeanFactory. Don't override it
> * (although it can't be made final): code your initialization in
> * onEjbCreate(), which is called when the BeanFactory is available.
> * <p>Unfortunately we can't load the BeanFactory in
>setSessionContext(),
> * as ResourceManager access isn't permitted and the BeanFactory may
>require it.
> */
> public void ejbCreate() throws CreateException {
> loadBeanFactory();
> onEjbCreate();
> }
>
>This is actually not spec compliant. If you look at the spec, section
>15.7.3, it states that MessageDrivenBeans must not throw application
>exceptions. CreateException is an application exception, and in fact
>JBoss, for example, will not allow an MDB with this create method to load.
>
>So I am going to change this to remove the exception, after I get back
>from lunch. If anybody disagrees with me, before or after that, please
>let me know.
>
>(lucky me, still putzin' around with legacy EJB code...)
>
>Regards,
>Colin
>
>
>
|
|
From: Rod J. <rod...@in...> - 2003-11-14 19:17:59
|
OK, we need to change it then.
----- Original Message -----
From: "Colin Sampaleanu" <col...@ex...>
To: <spr...@li...>
Sent: Friday, November 14, 2003 6:49 PM
Subject: Re: [Springframework-developer] AbstractMessageDrivenBean's
ejbCreate method is not spec compliant, I am going to change it
> It may work in some versions of JBoss. JBoss 3.2.2 doesn't deploy the
> bean at all though:
> ----
> 12:22:35,853 ERROR [MainDeployer] could not create deployment:
> file:/C:/dev/jbos
> s-3.2.2/server/default/deploy/core-app.ear
> org.jboss.deployment.DeploymentException: Verification of Enterprise
> Beans faile
> d, see above for error messages.
> at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
> at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
> at org.jboss.deployment.MainDeployer.create(MainDeployer.java:778)
> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
> ...
> 12:22:36,118 ERROR [URLDeploymentScanner] MBeanException: Exception in
> MBean ope
> ration 'checkIncompleteDeployments()'
> Cause: Incomplete Deployment listing:
> Packages waiting for a deployer:
> <none>
> Incompletely deployed packages:
> [org.jboss.deployment.DeploymentInfo@47111691 {
> url=file:/C:/dev/jboss-3.2.2/ser
> ver/default/deploy/core-app.ear }
> deployer: org.jboss.deployment.EARDeployer@4977e2
> status: Deployment FAILED reason: Verification of Enterprise Beans
> failed, see
> above for error messages.
> state: FAILED
> watch: file:/C:/dev/jboss-3.2.2/server/default/deploy/core-app.ear
> lastDeployed: 1068830549227
> ----
>
> So I don't see much choice but to change it. That is, I think it makes
> more sense that it's compliant and works in JBoss, and works with
> compliant code in other app servers, and breaks some non-compliant code
> in other app servers, than the current situation where we force
> non-compliant code, which can't run on JBoss at all.
>
> Regardless of Spring, the real question is if there is an app-server out
> there that breaks without the CreateException. If that's the case, it
> would kill cross-server compatibility...
>
>
>
> Rod Johnson wrote:
>
> >Yes, as the bug entries say I took the decision that it is incorrect
> >according to the spec, but the WebLogic examples do throw
CreateException.
> >And the user reported that it _did_ still work in JBoss, so I figured
that I
> >didn't want to have to go test it in all EJB containers. (Ie I didn't
have
> >time to retest it in WLS.)
> >
> >However, you probably should change it.
> >
> >Regards,
> >Rod
> >
> >----- Original Message -----
> >From: "jürgen höller [werk3AT]" <jue...@we...>
> >To: <spr...@li...>
> >Sent: Friday, November 14, 2003 5:40 PM
> >Subject: Re: [Springframework-developer] AbstractMessageDrivenBean's
> >ejbCreate method is not spec compliant, I am going to change it
> >
> >
> >There's a bug entry on SourceForge for this:
>
>http://sourceforge.net/tracker/index.php?func=detail&aid=823990&group_id=73
357&atid=537539
> >
> >Juergen
> >
> >________________________________
> >
> >Von: spr...@li... im Auftrag von
> >Colin Sampaleanu
> >Gesendet: Fr 14.11.2003 18:41
> >An: spr...@li...
> >Betreff: [Springframework-developer] AbstractMessageDrivenBean's
ejbCreate
> >method is not spec compliant, I am going to change it
> >
> >
> >
> >AbstractMessageDrivenBean currently has the following ejbCreate method:
> >
> > /**
> > * Lifecycle method required by the EJB specification but not
> > * the MessageDrivenBean interface.
> > * <p>This implementation loads the BeanFactory. Don't override it
> > * (although it can't be made final): code your initialization in
> > * onEjbCreate(), which is called when the BeanFactory is available.
> > * <p>Unfortunately we can't load the BeanFactory in
> >setSessionContext(),
> > * as ResourceManager access isn't permitted and the BeanFactory may
> >require it.
> > */
> > public void ejbCreate() throws CreateException {
> > loadBeanFactory();
> > onEjbCreate();
> > }
> >
> >This is actually not spec compliant. If you look at the spec, section
> >15.7.3, it states that MessageDrivenBeans must not throw application
> >exceptions. CreateException is an application exception, and in fact
> >JBoss, for example, will not allow an MDB with this create method to
load.
> >
> >So I am going to change this to remove the exception, after I get back
> >from lunch. If anybody disagrees with me, before or after that, please
> >let me know.
> >
> >(lucky me, still putzin' around with legacy EJB code...)
> >
> >Regards,
> >Colin
> >
> >
> >
>
>
>
>
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: Colin S. <col...@ex...> - 2003-11-14 19:42:04
|
Now the only question is what to do with loadBeanFactory in
AbstractEnterpriseBean, which throws CreateException. It could either be
left that way, and AbstractMessageDrivenBean could rewrap it is
something derived from RuntimeException or alternately just pull out the
BootstrapException and throw that. However, I think it is cleaner for
loadBeanFactory to just throw BootstrapException directly, and
AbstractSessionBean will itself wrap it with a CreateException, while
AbstractMessageDrivenBean just lets it flow through.
Colin Sampaleanu wrote:
> It may work in some versions of JBoss. JBoss 3.2.2 doesn't deploy the
> bean at all though:
> ----
> 12:22:35,853 ERROR [MainDeployer] could not create deployment:
> file:/C:/dev/jbos
> s-3.2.2/server/default/deploy/core-app.ear
> org.jboss.deployment.DeploymentException: Verification of Enterprise
> Beans faile
> d, see above for error messages.
> at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
> at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
> at org.jboss.deployment.MainDeployer.create(MainDeployer.java:778)
> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
> ...
> 12:22:36,118 ERROR [URLDeploymentScanner] MBeanException: Exception in
> MBean ope
> ration 'checkIncompleteDeployments()'
> Cause: Incomplete Deployment listing:
> Packages waiting for a deployer:
> <none>
> Incompletely deployed packages:
> [org.jboss.deployment.DeploymentInfo@47111691 {
> url=file:/C:/dev/jboss-3.2.2/ser
> ver/default/deploy/core-app.ear }
> deployer: org.jboss.deployment.EARDeployer@4977e2
> status: Deployment FAILED reason: Verification of Enterprise Beans
> failed, see
> above for error messages.
> state: FAILED
> watch: file:/C:/dev/jboss-3.2.2/server/default/deploy/core-app.ear
> lastDeployed: 1068830549227
> ----
>
> So I don't see much choice but to change it. That is, I think it makes
> more sense that it's compliant and works in JBoss, and works with
> compliant code in other app servers, and breaks some non-compliant
> code in other app servers, than the current situation where we force
> non-compliant code, which can't run on JBoss at all.
>
> Regardless of Spring, the real question is if there is an app-server
> out there that breaks without the CreateException. If that's the case,
> it would kill cross-server compatibility...
>
>
>
> Rod Johnson wrote:
>
>> Yes, as the bug entries say I took the decision that it is incorrect
>> according to the spec, but the WebLogic examples do throw
>> CreateException.
>> And the user reported that it _did_ still work in JBoss, so I figured
>> that I
>> didn't want to have to go test it in all EJB containers. (Ie I didn't
>> have
>> time to retest it in WLS.)
>>
>> However, you probably should change it.
>>
>> Regards,
>> Rod
>>
>> ----- Original Message ----- From: "jürgen höller [werk3AT]"
>> <jue...@we...>
>> To: <spr...@li...>
>> Sent: Friday, November 14, 2003 5:40 PM
>> Subject: Re: [Springframework-developer] AbstractMessageDrivenBean's
>> ejbCreate method is not spec compliant, I am going to change it
>>
>>
>> There's a bug entry on SourceForge for this:
>> http://sourceforge.net/tracker/index.php?func=detail&aid=823990&group_id=73357&atid=537539
>>
>>
>> Juergen
>>
>> ________________________________
>>
>> Von: spr...@li... im Auftrag
>> von
>> Colin Sampaleanu
>> Gesendet: Fr 14.11.2003 18:41
>> An: spr...@li...
>> Betreff: [Springframework-developer] AbstractMessageDrivenBean's
>> ejbCreate
>> method is not spec compliant, I am going to change it
>>
>>
>>
>> AbstractMessageDrivenBean currently has the following ejbCreate method:
>>
>> /**
>> * Lifecycle method required by the EJB specification but not
>> * the MessageDrivenBean interface.
>> * <p>This implementation loads the BeanFactory. Don't override it
>> * (although it can't be made final): code your initialization in
>> * onEjbCreate(), which is called when the BeanFactory is available.
>> * <p>Unfortunately we can't load the BeanFactory in
>> setSessionContext(),
>> * as ResourceManager access isn't permitted and the BeanFactory may
>> require it.
>> */
>> public void ejbCreate() throws CreateException {
>> loadBeanFactory();
>> onEjbCreate();
>> }
>>
>> This is actually not spec compliant. If you look at the spec, section
>> 15.7.3, it states that MessageDrivenBeans must not throw application
>> exceptions. CreateException is an application exception, and in fact
>> JBoss, for example, will not allow an MDB with this create method to
>> load.
>>
>> So I am going to change this to remove the exception, after I get back
>> from lunch. If anybody disagrees with me, before or after that, please
>> let me know.
>>
>> (lucky me, still putzin' around with legacy EJB code...)
>>
>> Regards,
>> Colin
>>
>>
>>
>
>
|
|
From: <tri...@tr...> - 2003-11-14 20:12:56
|
I like the last suggestion -- "for loadBeanFactory to just throw
BootstrapException directly, and AbstractSessionBean will itself wrap it with a
CreateException, while AbstractMessageDrivenBean just lets it flow through."
Thomas
Quoting Colin Sampaleanu <col...@ex...>:
> Now the only question is what to do with loadBeanFactory in
> AbstractEnterpriseBean, which throws CreateException. It could either be
> left that way, and AbstractMessageDrivenBean could rewrap it is
> something derived from RuntimeException or alternately just pull out the
> BootstrapException and throw that. However, I think it is cleaner for
> loadBeanFactory to just throw BootstrapException directly, and
> AbstractSessionBean will itself wrap it with a CreateException, while
> AbstractMessageDrivenBean just lets it flow through.
>
>
> Colin Sampaleanu wrote:
>
> > It may work in some versions of JBoss. JBoss 3.2.2 doesn't deploy the
> > bean at all though:
> > ----
> > 12:22:35,853 ERROR [MainDeployer] could not create deployment:
> > file:/C:/dev/jbos
> > s-3.2.2/server/default/deploy/core-app.ear
> > org.jboss.deployment.DeploymentException: Verification of Enterprise
> > Beans faile
> > d, see above for error messages.
> > at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
> > at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
> > at org.jboss.deployment.MainDeployer.create(MainDeployer.java:778)
> > at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
> > ...
> > 12:22:36,118 ERROR [URLDeploymentScanner] MBeanException: Exception in
> > MBean ope
> > ration 'checkIncompleteDeployments()'
> > Cause: Incomplete Deployment listing:
> > Packages waiting for a deployer:
> > <none>
> > Incompletely deployed packages:
> > [org.jboss.deployment.DeploymentInfo@47111691 {
> > url=file:/C:/dev/jboss-3.2.2/ser
> > ver/default/deploy/core-app.ear }
> > deployer: org.jboss.deployment.EARDeployer@4977e2
> > status: Deployment FAILED reason: Verification of Enterprise Beans
> > failed, see
> > above for error messages.
> > state: FAILED
> > watch: file:/C:/dev/jboss-3.2.2/server/default/deploy/core-app.ear
> > lastDeployed: 1068830549227
> > ----
> >
> > So I don't see much choice but to change it. That is, I think it makes
> > more sense that it's compliant and works in JBoss, and works with
> > compliant code in other app servers, and breaks some non-compliant
> > code in other app servers, than the current situation where we force
> > non-compliant code, which can't run on JBoss at all.
> >
> > Regardless of Spring, the real question is if there is an app-server
> > out there that breaks without the CreateException. If that's the case,
> > it would kill cross-server compatibility...
> >
> >
> >
> > Rod Johnson wrote:
> >
> >> Yes, as the bug entries say I took the decision that it is incorrect
> >> according to the spec, but the WebLogic examples do throw
> >> CreateException.
> >> And the user reported that it _did_ still work in JBoss, so I figured
> >> that I
> >> didn't want to have to go test it in all EJB containers. (Ie I didn't
> >> have
> >> time to retest it in WLS.)
> >>
> >> However, you probably should change it.
> >>
> >> Regards,
> >> Rod
> >>
> >> ----- Original Message ----- From: "jürgen höller [werk3AT]"
> >> <jue...@we...>
> >> To: <spr...@li...>
> >> Sent: Friday, November 14, 2003 5:40 PM
> >> Subject: Re: [Springframework-developer] AbstractMessageDrivenBean's
> >> ejbCreate method is not spec compliant, I am going to change it
> >>
> >>
> >> There's a bug entry on SourceForge for this:
> >>
>
http://sourceforge.net/tracker/index.php?func=detail&aid=823990&group_id=73357&atid=537539
>
> >>
> >>
> >> Juergen
> >>
> >> ________________________________
> >>
> >> Von: spr...@li... im Auftrag
> >> von
> >> Colin Sampaleanu
> >> Gesendet: Fr 14.11.2003 18:41
> >> An: spr...@li...
> >> Betreff: [Springframework-developer] AbstractMessageDrivenBean's
> >> ejbCreate
> >> method is not spec compliant, I am going to change it
> >>
> >>
> >>
> >> AbstractMessageDrivenBean currently has the following ejbCreate method:
> >>
> >> /**
> >> * Lifecycle method required by the EJB specification but not
> >> * the MessageDrivenBean interface.
> >> * <p>This implementation loads the BeanFactory. Don't override it
> >> * (although it can't be made final): code your initialization in
> >> * onEjbCreate(), which is called when the BeanFactory is available.
> >> * <p>Unfortunately we can't load the BeanFactory in
> >> setSessionContext(),
> >> * as ResourceManager access isn't permitted and the BeanFactory may
> >> require it.
> >> */
> >> public void ejbCreate() throws CreateException {
> >> loadBeanFactory();
> >> onEjbCreate();
> >> }
> >>
> >> This is actually not spec compliant. If you look at the spec, section
> >> 15.7.3, it states that MessageDrivenBeans must not throw application
> >> exceptions. CreateException is an application exception, and in fact
> >> JBoss, for example, will not allow an MDB with this create method to
> >> load.
> >>
> >> So I am going to change this to remove the exception, after I get back
> >> from lunch. If anybody disagrees with me, before or after that, please
> >> let me know.
> >>
> >> (lucky me, still putzin' around with legacy EJB code...)
> >>
> >> Regards,
> >> Colin
> >>
> >>
> >>
> >
> >
>
>
>
>
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|