| Author |
Business method names must not start with "ejb".
|
Deepak Jain
Ranch Hand
Joined: Aug 05, 2006
Posts: 637
|
|
EJB In Action page 78. Business method names must not start with "ejb". Result: 17:47:17,953 INFO [STDOUT] Start: PlaceBidBean.initializeBean() 17:47:17,953 INFO [STDOUT] Inside init: PostConstruct, PostActivate 17:47:17,953 INFO [STDOUT] End: PlaceBidBean.initializeBean() 17:47:17,968 INFO [STDOUT] Start: PlaceBidBean.addBid(com.ejb3inaction.actionbazaar.buslogic.Bid@17dbeaf) 17:47:17,968 INFO [STDOUT] Adding bid. bidder ID=20091297,item id=22 , bid amount=200.0 17:47:17,968 INFO [STDOUT] End: PlaceBidBean.addBid(com.ejb3inaction.actionbazaar.buslogic.Bid@17dbeaf) 17:47:17,984 INFO [STDOUT] Start: PlaceBidBean.ejbAddBid(com.ejb3inaction.actionbazaar.buslogic.Bid@13c339f) 17:47:17,984 INFO [STDOUT] Adding bid. bidder ID=20091297,item id=22 , bid amount=200.0 17:47:17,984 INFO [STDOUT] End: PlaceBidBean.addBid(com.ejb3inaction.actionbazaar.buslogic.Bid@13c339f) PlaceBidRemote interface has a business method ejbAddBid() and it worked perfectly? Is something wrong with the book or am i going wrong, i see lot of such issues.
|
SCJP, SCWCD, SCBCD
|
 |
Deepak Jain
Ranch Hand
Joined: Aug 05, 2006
Posts: 637
|
|
|
Can someone please take time and respond this question.
|
 |
Chandrashekhar Raiphale
Greenhorn
Joined: Aug 26, 2006
Posts: 14
|
|
|
I tried it for method in Stateless session bean. There is no problem if method name starts with ejb like "ejbSomeMethod()". It works perfectly.
|
Cheers,<br />Chandrashekhar <br />SCJP
|
 |
Deepak Jain
Ranch Hand
Joined: Aug 05, 2006
Posts: 637
|
|
|
Can i conclude the book needs errata for the point it described.
|
 |
Piotr Uryga
Ranch Hand
Joined: May 25, 2006
Posts: 68
|
|
See section 4.6.5 of JSR 220: Enterprise JavaBeansTM,Version 3.0 EJB Core Contracts and Requirements.
|
SCJP 1.4, SCWCD 1.4, SCBCD 5, SCEA
|
 |
Amandeep Singh
Ranch Hand
Joined: Jul 17, 2008
Posts: 839
|
|
|
the ejb speci. says it must not start with ejb, to avoid naming conflicts javax.ejb.Enterprise Beans method's. It does not prohibit to do so. Again it's vendor implentation how to behave.
|
SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
|
 |
Deepak Jain
Ranch Hand
Joined: Aug 05, 2006
Posts: 637
|
|
|
So can i conclude that even if Specs says "MUST NOT" its application vendor specific.
|
 |
Piotr Uryga
Ranch Hand
Joined: May 25, 2006
Posts: 68
|
|
Your goal is to pass the exam. Stick to the spec. I don't see a point in proving that some vendor implementation allows some things which are prohibited by spec. BTW: Relying on such things in real commercial projects is not the smartest thing to do.
|
 |
Reza Rahman
author
Ranch Hand
Joined: Feb 01, 2005
Posts: 559
|
|
Deepak,
Sorry for the delay in responding...I just came back from vacation...
The implementation you are using appears to be in violation of the spec.
Best regards,
Reza
|
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
|
 |
Deepak Jain
Ranch Hand
Joined: Aug 05, 2006
Posts: 637
|
|
One more....
Hi Rahman,
Yes it cleary violates the specification. The code was deployed with jboss-4.2.3.GA application server.
Looks like one must not use jboss-4.2.3.GA.
Please suggest a better application server which is completely compliant with ejb 3.0 specification
I think we need to put these similar cases in SCBCD FAQ, if its not there already.
|
 |
Reza Rahman
author
Ranch Hand
Joined: Feb 01, 2005
Posts: 559
|
|
Deepak,
The reality is that no application server is *100%* spec compliant. That being said, I don't think this is really a critical issue, as long as your code is spec compliant. All Java EE 5 certified application servers must pass the Sun compatibility test kit, but the set of tests in the test kit is not necessarily perfect (I think that would be an almost impossible job).
I would say try JBoss 5, which is Java EE 5 certified. GlassFish, Geronimo, WebLogic and WebSphere are good choices too. In particular, I know that Geronimo and WebLogic tries hard to be spec compliant, even beyond the certification test kit.
Hope this helps,
Reza
|
 |
 |
|
|
subject: Business method names must not start with "ejb".
|
|
|