Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Business method names must not start with "ejb".

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please take time and respond this question.
 
Chandrashekhar Raiphale
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried it for method in Stateless session bean. There is no problem if method name starts with ejb like "ejbSomeMethod()". It works perfectly.
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i conclude the book needs errata for the point it described.
 
Piotr Uryga
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See section 4.6.5 of JSR 220: Enterprise JavaBeansTM,Version 3.0
EJB Core Contracts and Requirements.
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So can i conclude that even if Specs says "MUST NOT" its application vendor specific.
 
Piotr Uryga
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic