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.
[Build 20050314] qingtian.wang reported the issue on nbj2ee mailing list. User can't package directory with some user defined configuration files to EAR application. NetBeans doesn't support following scenario: 1) user has some EJB modules in EAR application and wants to add configuration files to module's classpath. These conf files might be shared between EJB modules 2) go to EJB modules's project properties panel 3) select node Libraries, click Add JAR/Folder 4) choose the folder with conf files However, user can't enable packaging this directory with the EJB JAR file for deployment.
If we allow packaging folders, users will think that they can also package folders with classes. And I recall we don't support that.
There is a workaround allowing users to package and link their conf files properly. Their must package the conf/ directory into a jar file and add this jar into all j2ee modules. Then a corresponding Class-path entry will be created in the module manifest and the jar will be copied into the EAR.
Is there any team conclusion about not allowing to package classes from folder libraries in ejbs? It seems to me that allowing to package folders is consistent with the ability to package jar files. See the wang's use case.
IMO, there is nothing wrong with allowing the user to pack a folder even with class files inside it into a j2ee component. 1. With regard to configuration info, the conf/ folder often contains config files that are operating environment specific. So system admins as well as developers like us need to edit files there. Packing it into a jar file makes that awkward. (Side note: One would ask, why wouldn't you put env info in the j2ee dd like the spec encourages?! Answere is: There a lot of things (frameworks and such) people want to be able to work with both in and outside of a j2ee container.) 2. The j2ee spec implies that if you want to ensure your EJB jar to be portable over any containers - includes all the lib needed at runtime, you have only 2 options: a. unpack all the lib jar files into class files, and pack them again directly into your own EJB jar; b. create an EAR file and pack all the lib jar files in paralelle with your EJB jar, and use the MANIFEST.MF of the EJB jar. If I were to go with option a. in 2, I have to be able to pack class files. -Qingtian
We agreed to implement this.
fixed Checking in ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/classpath/ClassPathSupport.java; /cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/classpath/ClassPathSupport.java,v <-- ClassPathSupport.java new revision: 1.5; previous revision: 1.4 done Checking in ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/ClassPathUiSupport.java; /cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/ClassPathUiSupport.java,v <-- ClassPathUiSupport.java new revision: 1.4; previous revision: 1.3 done
the directories are packaged properly, but when you build the ejb module via an ear application no class-path element is created for them in module's manifest. According to Extension Mechanism Architecture document there should an entry even for directories: " These relative URLs may include JAR files and directories for any libraries or resources needed by the application or optional package. Relative URLs not ending with '/' are assumed to refer to JAR files. For example, Class-Path: servlet.jar infobus.jar acme/beans.jar images/ " Petr Blaha will investigate what to add in case that the classpath is set to the ear's root directory ( . or ./ or sg. else?)
fixed - Class-path element "." is not added into module's manifest if there are some directories in libraries. Checking in build-impl.xsl; /cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.42; previous revision: 1.41 done
I am sorry - I wanted to write "... Class-path element "." IS added into module's manifest ..." :-)
[Build 20050403]