Bug 231926 - EJB 3.0 Message Driven Beans need @MessageDriven.messageListenerInterface if not JMS
Summary: EJB 3.0 Message Driven Beans need @MessageDriven.messageListenerInterface if ...
Status: CLOSED FIXED
Alias: None
Product: WTP EJB Tools
Classification: WebTools
Component: jst.ejb (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: Yavor Boyadzhiev CLA
QA Contact: Kaloyan Raev CLA
URL:
Whiteboard: PMC_approved
Keywords: Documentation, PII
Depends on:
Blocks:
 
Reported: 2008-05-13 16:02 EDT by Carl Anderson CLA
Modified: 2008-11-06 14:20 EST (History)
3 users (show)

See Also:
katep: documentation+
david_williams: pmc_approved+
kaloyan: pmc_approved? (raghunathan.srinivasan)
kaloyan: pmc_approved? (naci.dai)
kaloyan: pmc_approved? (deboer)
kaloyan: pmc_approved? (neil.hauge)
kaloyan: review+
ccc: review+


Attachments
planned changes (21.49 KB, image/png)
2008-05-15 09:11 EDT, Kaloyan Raev CLA
no flags Details
patch (18.43 KB, patch)
2008-05-20 12:49 EDT, Yavor Boyadzhiev CLA
kaloyan: iplog+
Details | Diff
revised patch (25.22 KB, patch)
2008-05-21 07:08 EDT, Kaloyan Raev CLA
no flags Details | Diff
screenshot of UI changes done (16.67 KB, image/png)
2008-05-21 07:23 EDT, Kaloyan Raev CLA
no flags Details
update for the wizard infopop (4.03 KB, patch)
2008-05-22 09:41 EDT, Kaloyan Raev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Anderson CLA 2008-05-13 16:02:27 EDT
An adopter has reported the following:

Using the New->Message-Driven bean option to launch the new message bean wizard for a EJB 3 project.
On the first page of the wizard, if you only enter the java package and class name for the bean, and click Finish, the message bean is generated with error:
JSR 220: EJB 3.0 Simplified API, 10.1.3: @MessageDriven.messageListenerInterface must be specified if the bean class does not implement its message listener interface.	

The bean is only generated correctly if you select JMS and a destination type.  

If more info is needed to generate the bean, then the Finish button should be disabled until all required info are entered for the wizard to proceed.

I am marking this as major, since we are generating EJBs that don't follow the spec.
Comment 1 Kaloyan Raev CLA 2008-05-14 03:21:28 EDT
This is a major overlook of the EJB spec. 

We have to make a small UI change in the Interfaces list. There should be a special icon that marks the interfaces which is the message listener interface of the bean. A button and a context menu should be added to enable the user to select the message listener interface from the list. 

The wizard finish operation should be changed to generate the @MessageDriven.messageListenerInterface if needed. 

Validation should be added to disable finishing the wizard if the message listener interface cannot be determined. 
Comment 2 Kaloyan Raev CLA 2008-05-15 09:11:39 EDT
Created attachment 100432 [details]
planned changes

Here a picture of the planned UI changes: 
  - a special icon in the Interfaces list that marks the message listener interface
  - a button that enables the user to select the message listener interface from the interfaces in the list
  - a context-menu in the Interfaces views with "Remove" and "Set as Message Listener Interface" actions
  - new validation messages in the wizard page title-description area.
Comment 3 Kate Price CLA 2008-05-16 11:22:48 EDT
If you're changing the GUI this will require documentation updates. If this gets approved by the PMC we'll need at least 1-2 additional days to make doc changes to match.
Comment 4 Yavor Boyadzhiev CLA 2008-05-20 12:49:46 EDT
Created attachment 101094 [details]
patch
Comment 5 Kaloyan Raev CLA 2008-05-21 07:08:16 EDT
Created attachment 101221 [details]
revised patch
Comment 6 Kaloyan Raev CLA 2008-05-21 07:23:24 EDT
Created attachment 101224 [details]
screenshot of UI changes done

During the implementation of the patch we have realized that we can fix the issue with less UI changes. We have added a new hyperlink under the Interfaces list. We have borrowed the idea of using hyperlinks from the Web Services wizards. The new hyperlink has the following characteristics:
  - the value of the hyperlink determines the message listener interface. 
  - clicking on the hyperlink pops the Interface Selection dialog up. 
  - if the value is not set an error status is displayed and the wizard cannot be finished. 
  - if the Interfaces list is empty and an interface is added, then this interface is automatically set as value of the hyperlink. 
  - if the JMS checkbox (first page) is checked, then the value of the hyperlink is automatically set to javax.jms.MessageListener.
  - if the value of the hyperlink is set to something different than javax.jms.MessageListener, then the JMS checkbox is unchecked. 

This approach also covers the situation where the message listener interface can be set to an interface that is not implemented by the bean. This is allowed by the EJB specification and could not be achieved with the previously planned UI changes.
Comment 7 Kaloyan Raev CLA 2008-05-21 07:25:42 EDT
Carl, please check if the "revised patch" is the resolution that you have expected. 
Comment 8 Kaloyan Raev CLA 2008-05-21 07:39:55 EDT
Requesting PMC review for RC2. 

    * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

This is a late found overlook of the EJB specification that states that the message listener interface of the Message-Driven Bean should be explicitly specified with the @MessageDriven.messageListenerInterface attribute whenever it is not implemented by the bean, or the bean implements zero or more than one interfaces. The wizard does not enable the user to select the message listener interface. 

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 

The user can manually set the @MessageDriven.messageListenerInterface after finishing the wizard. However, this is quite bad from usability point of view. 

    * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

I have manually tested several scenarios of creating Message-Driven Beans. 

    * Give a brief technical overview. Who has reviewed this fix? 

The patch introduces new hyperlink widget for the message listener interface and synchronize it with a new data model property. There several dependencies introduced between the data model properties for the JMS type, Interfaces and Message Listener Interface. 

The patch was prepared by Yavor. I have reviewed and corrected the patch. Waiting for Carl (as he is the reporter) to check if this is the expected solution. 

    * What is the risk associated with this fix? 

This is a late UI change. There is a new widget (hyperlink) added under the Interfaces list on the second wizard page. The risk is that this can affect adopters who already extend the Message-Driven Bean wizard. However, I doubt we have such adopter yet, because this wizard was introduced in Ganymede M5. 

From technical point of view, this is a low-risk patch. 
Comment 9 David Williams CLA 2008-05-22 00:51:10 EDT
> The patch was prepared by Yavor. 
Please note that the correct process is for the contributor to attach the patch, for strictly correct tracking. 

I am ok with this, as it does seem a large omission, and relatively safe fix, but am marking as PII and Documentation in keywords, since will effect those teams to some extent. 

Kate, please let us know if you need more information, but would appreciate your support. 

Comment 10 Kaloyan Raev CLA 2008-05-22 03:09:17 EDT
(In reply to comment #9)
> > The patch was prepared by Yavor. 
> Please note that the correct process is for the contributor to attach the
> patch, for strictly correct tracking. 

And it was done exactly like this. Attachment "patch" is attached by Yavor, I have made some corrections and attached new "revised patch". 

Comment 11 Kaloyan Raev CLA 2008-05-22 09:41:42 EDT
Created attachment 101487 [details]
update for the wizard infopop

This is a suggested change to the infopop help information of the Message-Driven Bean wizard.
Comment 12 Carl Anderson CLA 2008-05-22 09:56:41 EDT
Patch will satisfy adopter's concerns.
Comment 13 Kaloyan Raev CLA 2008-05-22 11:12:49 EDT
"revised patch" committed and released
Comment 14 Kate Price CLA 2008-05-22 17:08:18 EDT
Thanks for the infopop patch Kaloyan. Updates committed and released to R2.
Comment 15 Kaloyan Raev CLA 2008-05-23 05:11:47 EDT
Verified with the S-3.0RC2-20080523002415 build.