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 198933 - Cannot call a callable EJB in a servlet with 'Insert Code...
Summary: Cannot call a callable EJB in a servlet with 'Insert Code...
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 7.0.1
Hardware: PC Solaris
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-26 20:33 UTC by Vince Kraemer
Modified: 2016-07-07 08:55 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2011-05-26 20:33:46 UTC
Steps to reproduce

1. create an ant-based web app project.
2. create a servlet in that web app project
3. Create an ejb jar project
4. create a session bean in the EJB jar project
5. add a business method to that session bean (like echo(String s))
6. Add the ejb jar project to the web app project's Libraries [use Add Project]
7. Go to the servlet and try to Insert Code... Call Enterprise Bean
    the ejb jar project appears and the web module appears in the 'Call Enterprise Bean' dialog
    You cannot select the ejb if you expand the ejb module project's node.
       There is a warning that the bean is not in the same module or EAR
    There are no bean 'sub nodes' of the web app project
Comment 1 David Konecny 2011-05-26 22:21:16 UTC
In step 6 of your test case do you expect that:

#1) EJB jar will be deployed inside WebApplication's WEB-INF/lib and EJBs will be deployed; or

#2) EJB jar will be added to project's classpath for compilation but will be excluded from packaging into WEB-INF/lib.

In first case (if it is a valid case in terms of EJB specification) Call EJB should let you use the EJBs. But in second case it is valid warning that you cannot reference EJB via local interface unless it is in the same EAR.

Would you agree with this Vince?
Comment 2 Vince Kraemer 2011-05-26 22:35:38 UTC
good point.  My assumption was #1.

After I 'Add Project' with the EJB module, the Package checkbox is selected in the Project Properties dialog; Libraries category; Compile-time libraries list.

When I create the war file, I have the following

foo.war
+ META-INF
+ WEB-INF
   + classes
   + lib
       + BarEjb.jar

So, it looks like the web app project also makes assumption #1.
Comment 3 David Konecny 2011-05-26 22:43:01 UTC
(In reply to comment #2)
> So, it looks like the web app project also makes assumption #1.

It is results of EE6 changes. EJB jar should not have been include in WEB-INF/lib prior to EE6 but it had not caused any problems as EJBs were not loaded from there so nobody complained about it.
Comment 4 Vince Kraemer 2011-05-26 22:50:17 UTC
here is a summary post about EJB 3.1 spec changes...

http://java.sun.com/developer/technicalArticles/JavaEE/JavaEE6Overview_Part3.html

search for 'simplified packaging' or just 'WEB-INF/lib'
Comment 5 Martin Balin 2016-07-07 08:55:05 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss