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 81331

Summary: Cannot run application client with EJB
Product: javaee Reporter: Jiri Skrivanek <jskrivanek>
Component: App ClientAssignee: Lukas Jungmann <jungi>
Status: VERIFIED FIXED    
Severity: blocker CC: mkrauskopf, nnmarques
Priority: P3    
Version: 5.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: Stack trace

Description Jiri Skrivanek 2006-07-28 13:13:15 UTC
It is not possible to run or debug application client project which calls EJB.
It is thrown NullPointerException because bean is not instantionized. If you run
it from Java Web Start it works fine. To reproduce:

- open new Enterprise project wizard
- check the flag Create Application Client Module and finish the wizard
- create a session bean in the EJB Module
- add a bussines method in it
- edit the Main class in the Application Client Module (call action 'Enterprise
Resources|Call Enterprise Bean' in editor and add
'newSessionBean.businessMethod();' to the main method)
- deploy the Enterprise Application
- call Run Project action on the Application Client project node but it fails
with NPE.

Build 20060728-1106, JDK1.5.0_06, WindowsXP.
Comment 1 Jiri Skrivanek 2006-07-28 13:13:56 UTC
Created attachment 32293 [details]
Stack trace
Comment 2 Petr Blaha 2006-07-28 13:27:20 UTC
What's about run J2EE application. This should work.
Comment 3 Lukas Jungmann 2006-07-28 21:11:05 UTC
If called bean does not have remote interface then described behaviour is
correct (in sync with EJB specification), because you are trying to run
appclient as a standalone module and it tries to find remote interface of
referenced bean which seems to not exist.
If you want run appclient within enterprise application (in this case EJB with
local interface is enough) then you have to invoke "Run project" on enterprise
application project (which its sub-module should be run can be configured in ear
project's properties).

This is the same behaviour as in case of ear with web module thus this part is
invalid.
Comment 4 Lukas Jungmann 2006-08-17 18:15:49 UTC
debugging was not planned (=> p3), but will try look at it...
Comment 5 Lukas Jungmann 2006-08-18 11:19:18 UTC
Fixed for standalone appclient. Jirko, can I ask you (or anyone else) to check
whether it works as expected, so we can apply similar changes to ear project?

IDE:-------------------------------------------------
IDE: [8/18/06 12:07 PM] Committing Files started
Checking in AppClientActionProvider.java;
/cvs/j2ee/clientproject/src/org/netbeans/modules/j2ee/clientproject/Attic/AppClientActionProvider.java,v
 <--  AppClientActionProvider.java
new revision: 1.1.4.8; previous revision: 1.1.4.7
done
Checking in resources/build-impl.xsl;
/cvs/j2ee/clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/Attic/build-impl.xsl,v
 <--  build-impl.xsl
new revision: 1.1.4.21; previous revision: 1.1.4.20
done
IDE: [8/18/06 12:07 PM] Committing Files finished
Comment 6 Lukas Jungmann 2006-08-20 02:12:57 UTC
Debugging hopefully finally fixed also in ear project, some minor corrections
were made in appclient part.

 Just few notes:
- if there will be something wrong, file new issue for it

- server must not be running in debug mode otherwise debugger will connect to
the server instead of to the appclient (see issue 83055 and issue 83056) and
debug session must be closed manually; currently dialog is shown to the user
before debugging starts

- simultaneous debugging of client side and server side components is not
correctly supported yet - see issue 83057


IDE:-------------------------------------------------
IDE: [8/20/06 1:33 AM] Committing 2 Projects started
Checking in
clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientActionProvider.java;
/cvs/j2ee/clientproject/src/org/netbeans/modules/j2ee/clientproject/Attic/AppClientActionProvider.java,v
 <--  AppClientActionProvider.java
new revision: 1.1.4.9; previous revision: 1.1.4.8
done
Checking in
clientproject/src/org/netbeans/modules/j2ee/clientproject/Bundle.properties;
/cvs/j2ee/clientproject/src/org/netbeans/modules/j2ee/clientproject/Attic/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.1.4.7; previous revision: 1.1.4.6
done
Checking in
earproject/src/org/netbeans/modules/j2ee/earproject/resources/build-impl.xsl;
/cvs/j2ee/earproject/src/org/netbeans/modules/j2ee/earproject/resources/build-impl.xsl,v
 <--  build-impl.xsl
new revision: 1.19.36.21; previous revision: 1.19.36.20
done
Checking in
earproject/src/org/netbeans/modules/j2ee/earproject/EarActionProvider.java;
/cvs/j2ee/earproject/src/org/netbeans/modules/j2ee/earproject/EarActionProvider.java,v
 <--  EarActionProvider.java
new revision: 1.8.2.1.2.10; previous revision: 1.8.2.1.2.9
done
Checking in earproject/src/org/netbeans/modules/j2ee/earproject/Bundle.properties;
/cvs/j2ee/earproject/src/org/netbeans/modules/j2ee/earproject/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.7.24.5; previous revision: 1.7.24.4
done
Checking in
clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/build-impl.xsl;
/cvs/j2ee/clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/Attic/build-impl.xsl,v
 <--  build-impl.xsl
new revision: 1.1.4.23; previous revision: 1.1.4.22
done
IDE: [8/20/06 1:33 AM] Committing 2 Projects finished
Comment 7 Jiri Skrivanek 2006-08-24 11:10:51 UTC
As said Run Project action works only on Enterprise Application project. Debug
Project action works both for standalone and embedded application client.