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 73475 - Can't import javaEE5 EJB module in IDE
Summary: Can't import javaEE5 EJB module in IDE
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB Project (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords: SIMPLEFIX
: 73617 74427 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-10 09:53 UTC by Petr Blaha
Modified: 2006-06-28 12:15 UTC (History)
3 users (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 Petr Blaha 2006-03-10 09:53:29 UTC
[20060310]
User can't import existing JavaEE5 EJB pproject with existing sources in
Netbeans since ejb-jar.xml file is missing in the project. We should change
alghoritm that verifies that project is EJB. It seems that the Entity, Stateless
or other annotations should be scanned in the EJB module.
Comment 1 Petr Blaha 2006-03-15 19:23:15 UTC
*** Issue 73617 has been marked as a duplicate of this issue. ***
Comment 2 Lukas Jungmann 2006-03-22 14:29:41 UTC
Full set of annotations which can appear only in EJB module is:
javax.ejb.MessageDriven
javax.ejb.Stateless
javax.ejb.Stateful
javax.persistence.Entity(*)

  We should scan found/given source root if there in some file such annotation
appears, if not, then show some warning to the user.

(*) javax.persistence.Entity annotation is not reliable in this case, because it
can be used also in all other project types, but in case when only this
annotation is found we can show warning to the user (eg. "Project location
contains only Entity classes."). In case when no annotations are found just
don't allow user to create project (show error to him, eg. "Project location
does not contain any EJBs.").

Martine A.: Is there something I forgot or is there some better/faster/more
reliable way?
Comment 3 Martin Adamek 2006-03-22 14:43:02 UTC
Scanning for javax.ejb.* annotations might be good for guessing type of the
modules in EAR import, but I think we should not restrict import of projects
without those annotations. I can imagine case where user will want to import his
J2SE project based on Spring framework (which is enterprise application in fact)
as EJB module. He has already some beans, he needs to just annotate them with
@Stateless and he is migrated :-). Let's allow that!
Comment 4 Martin Krauskopf 2006-03-22 14:49:44 UTC
Ok, I'll try to take a look at it. If I need some J2EE hints I'll "ping" you :)
Comment 5 Martin Krauskopf 2006-03-29 17:19:01 UTC
Fixed - simple version as suggested by Martin. Please review functionality. Thanks.

src/wizards/Bundle.properties; 1.26.10.2.2.2 -> 1.26.10.2.2.3;
src/wizards/ImportLocationVisual.java; 1.25.36.6.2.3 -> 1.25.36.6.2.4;
src/wizards/PanelSourceFolders.java; 1.13.26.1.2.1 -> 1.13.26.1.2.2;
Comment 6 Martin Schovanek 2006-04-05 16:24:31 UTC
Still cannot import a EJB Module without .java sources. I do not have a strong
opinion if we should allow it or not. But at least the err message:

'The Location folder does not contain ejb-jar.xml file and Java sources.' should
be changed as well as 'EJB Module with Existing Sources' description in New
Project wizard.
Comment 7 Martin Schovanek 2006-04-05 16:26:02 UTC
*** Issue 74427 has been marked as a duplicate of this issue. ***
Comment 8 Martin Krauskopf 2006-04-05 16:45:27 UTC
Ok. So should I...?

1) allow to import a project without any .java files

2) do not allow to do #1 and adjust the error message to 'The Location
   folder does not contain Java sources.' (ejb-jar.xml ommited) +
   wizard's description as Martin suggested
Comment 9 Petr Jiricka 2006-04-24 08:57:58 UTC
Let's do option 2). Jano, please speak up if you disagree. Decreasing priority
to P3 after discussing with Petr Blaha.
Comment 10 Martin Krauskopf 2006-06-20 08:37:09 UTC
If #2 is enough then should be simplefix now.
Comment 11 Martin Krauskopf 2006-06-27 11:38:58 UTC
So just changing the message.

ui/wizards/Bundle.properties; 1.26.10.2.2.7 -> 1.26.10.2.2.8;
Comment 12 Jindrich Sedek 2006-06-28 12:15:52 UTC
Verified NetBeans5.5Dev200606280200