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.
[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.
*** Issue 73617 has been marked as a duplicate of this issue. ***
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?
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!
Ok, I'll try to take a look at it. If I need some J2EE hints I'll "ping" you :)
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;
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.
*** Issue 74427 has been marked as a duplicate of this issue. ***
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
Let's do option 2). Jano, please speak up if you disagree. Decreasing priority to P3 after discussing with Petr Blaha.
If #2 is enough then should be simplefix now.
So just changing the message. ui/wizards/Bundle.properties; 1.26.10.2.2.7 -> 1.26.10.2.2.8;
Verified NetBeans5.5Dev200606280200