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 56421 - Can't package Folder with EJB module or EAR application
Summary: Can't package Folder with EJB module or EAR application
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EAR (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on: 55992
Blocks:
  Show dependency tree
 
Reported: 2005-03-15 08:23 UTC by Petr Blaha
Modified: 2006-05-30 11:18 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 Petr Blaha 2005-03-15 08:23:11 UTC
[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.
Comment 1 Andrei Badea 2005-03-15 08:34:06 UTC
If we allow packaging folders, users will think that they can also package
folders with classes. And I recall we don't support that.
Comment 2 Marek Fukala 2005-03-15 08:39:26 UTC
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.
Comment 3 Marek Fukala 2005-03-15 08:56:16 UTC
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.
Comment 4 wqtnetbeans 2005-03-15 16:18:11 UTC
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 
Comment 5 Marek Fukala 2005-03-15 16:42:31 UTC
We agreed to implement this.
Comment 6 Marek Fukala 2005-03-29 12:26:16 UTC
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
Comment 7 Marek Fukala 2005-03-29 13:33:41 UTC
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?)
Comment 8 Marek Fukala 2005-03-30 08:27:31 UTC
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

Comment 9 Marek Fukala 2005-03-30 08:45:43 UTC
I am sorry - I wanted to write "... Class-path element "." IS added into
module's manifest ..." :-)
Comment 10 Petr Blaha 2005-04-04 08:59:28 UTC
[Build 20050403]