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.
A participant created a session bean into the default package as he didn't notice the warning about the default package in the new file wizard. Recommendation Always fill the package field with an initial value. This way the user has to manually delete the value and then should notice the inline error which appears.
I would recommend that this warning becomes a rule: For web services, we already know they do not work without packages. For ejbs, we should force the existence of a package when created from within the IDE. This will clear up the confusion. (If the user really wante to created without package, she will have to do that outside the IDE, the same way the IDE does not create EJB CMP 1.0 ejbs, but can understand them if imported)
I think this is related to issue 54575.
I agree theat we should provide some non-default package. Anyway, after discussion with HIE I closed issue 54575 with empty-package implementation (to be consistent with other wizards). I am reassigning this to HIE. Please define what should be default package name for all wizards.
I was trying to find some information about the limits of default packages in regards to J2EE, but have not find anything. Could somebody provide me with some links or do a summary for me, please? Are the following points correct and comprehensive? - "default package" is a bad practice - it is recommended not to use it starting with J2SE 1.4 due to some API issues (reflection, or what?) - it does not work in J2EE 1.4 (when exactly?) If they are correct, I would suggest to: - for J2SE classes: use at least the recommandation message as we do now - for J2EE stuff: forbid the usage of default packages (i.e. add a warning and disable the next/finish buttons)
Well, sometimes, the IDE emits this message: You are trying to access file: jndi.properties from the default package. Please see http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc -files/classpath.html#default_package when a propertie file is loaded fromt he default package. Read the link to have more data, that links to http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#40169 I would recommend that by default, we do not use the default package, ancd create one (maybe the project name, javatized). For Web Services, it just does not work: wscompile tool fails with default packages.
Here is a proposal: 1. Let's provide a default value of the package editable-combobox if the list of packages is empty (e.g. a javatized project name). NEW! 2. If the list is not empty, the first element is selected by default (i.e. no default value is "generated") - current behaviour. 3. If the wizard was activated before, the previous value is selected. Every wizard remembers its own "previous package" (e.g. adding Entity Beans to one package and Session Beans to the other) NEW! OPTIONAL. This solutions: - provides novice user with a package name, thus guides him to good practice and/or working code (WS) - does not bother any user with a default value that is much probably going to be replaced (the points #2 and #3 of the solution are very important!) - provides a reasonable default value (previous one) between separate activations of a wizard. Implementation: Since this touches all the wizards throughout the IDE, it is very questionable whether we want to implement this in 4.1 in regards to schedule/risk. Alternative: Forbid the users from creating J2EE artefacts in the "default package". We might even use this rule in case that the proposal is implemented, if folks think this is a correct behaviour - I still don't have an answer (link) about J2EE & "default packages" issue. Ludo, who should I ask for an "official statement"?
I agree with Jirka's proposal (points 1., 2. and 3.). Plus if the user invokes the wizard from contextual menu on a package then the package is well known.
Based on feedback, I'm summing up the conclusion once again: 1. Let's provide a default value of the package editable-combobox if the list of packages is empty (e.g. a javatized project name). NEW! 2. If the list is not empty, the first element is selected by default (i.e. no default value is "generated") - current behaviour. 3. If the wizard was activated before, the previous value is selected. Every wizard remembers its own "previous package" (e.g. adding Entity Beans to one package and Session Beans to the other) NEW! OPTIONAL. And another two points: 4. If the wizard was activated on a specific package, the package is preselected. 5. If the user clears the Package field: - in case of J2EE wizard, the following message appears and the Next/Finish buttons are disabled "Provide a package name." - in case of other wizards, the current warning message appears "Warning: As of JDK 1.4, it is highly ..." Note: there is a BUG - the message does not wrap. I propose the restricted J2EE wizards to be the following: Entity Bean Message-Driven Bean CMP Entity Beans from Database Session Bean Web Service Assigning to Peter J. to decide on the implementation.
For 4.1, we will disable the Next/Finish buttons, I will look at that. The other items are post-4.1.
Fixed the Next/Finish buttons. The rest of this issue is an enhancement, I'd say. Changing to enhancement. j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ejb/wizard session/SessionEJBWizard.java, v1.6 cmp/MultipleEntitySetupPanel.java, v1.15 cmp/Bundle.properties, v 1.16 mdb/MessageEJBWizard.java, v1.5 entity/EntityEJBWizard.java, v1.4
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