This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 137886 - [65cat] appclient functionality not available from within NetBeans
Summary: [65cat] appclient functionality not available from within NetBeans
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: App Client (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-21 15:54 UTC by wobster
Modified: 2010-03-23 23:04 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wobster 2008-06-21 15:54:05 UTC
I've been recently developing MDBs within NetBeans and wanted to test the remotely deployed MDB using a JMS producer
client running within the IDE. It appears that NetBeans doesn't support the notion of running it within an "appclient"
type environment automatically. You have to do this type of stuff:

http://www.netbeans.org/kb/61/javaee/entappclient.html

or edit an XML file:

https://glassfish.dev.java.net/javaee5/docs/DG/beakt.html#beaky

NetBeans has all of the info in the project to run the client via the server configurations that it uses to remotely
deploy the beans, which is very nice by the way. If is not a way to run a J2EE client within NetBeans without having to
perform the setup discussed above automatically, please add the capability to run a J2EE client from within NetBeans in
an "appclient" type environment that automatically injects the annotated resources into the client.
Comment 1 wobster 2009-12-01 19:52:28 UTC
Has this been addressed in 6.8?
Comment 2 David Konecny 2009-12-01 20:28:16 UTC
No, sorry it was not.

I cannot say I'm absolutely clear on what you are requesting. You have an MDB deployed to a server and you want to test it. I would create an AppClient project and in its main method declared your EJB as variable with @Ejb annotation. When you run the project your EJB will be injected and you can do with it whatever you want. Or what am I missing?

Adding Vince to CC list - he might know more.
Comment 3 wobster 2010-03-23 02:58:48 UTC
(In reply to comment #2)
> No, sorry it was not.
> 
> I cannot say I'm absolutely clear on what you are requesting. You have an MDB
> deployed to a server and you want to test it. I would create an AppClient
> project and in its main method declared your EJB as variable with @Ejb
> annotation. When you run the project your EJB will be injected and you can do
> with it whatever you want. Or what am I missing?
> 
> Adding Vince to CC list - he might know more.

David,

I'm looking for the ability to specify the JMS channel parameters in the annotations of the client code and then have NetBeans inject the references in the same way that the application server would inject the references. Right now, I have to do all my own lookups and such if I want to run the JMS client code outside of the application server.


Thanks,

Rob
Comment 4 David Konecny 2010-03-23 23:04:03 UTC
Rob, thanks, I think I understand what you are after now. You have a MDB which you deployed and you would like to test it. At the moment the only way is to create a separate AppClient project, inject MDB into its main method and test it. Let's call this option #1. What you are after is (#2) to be able to just write main class with "@Inject MyMDB myMdbInstance;" and some code testing myMdbInstance and be able to press Run on it. NB should in this case run file within application server context and inject the MDB. There is also option #3 (does this option make sense?): enhance server node in Services panel to not only list JMS queues but let test them; or similarly as for Web Services list MDBs in project under a special node in project logical structure and allow user to test them by sending messages etc.

Looking once again at #2 - one thing which I do not like is that you end up mixing Java classes for testing of your MDB with real project sources. I would probably prefer to either move testing files to separate dedicated project (ie. option #1) or write plain unit tests for my MDB which would use JNDI lookup to retrieve the instance and perform whatever testing is desirable (I do not think it would be easy to convince app server to execute junit test and inject MDB into it; though there might be a framework doing that).

Did I get it right?