Please use the Apache issue tracking system for new NetBeans issues ( !!

Bug 122748

Summary: [60cat] Build of EE project doesn't build the WAR and EJB projects anymore
Product: javaee Reporter: ieising <ieising>
Component: EARAssignee: David Konecny <dkonecny>
Status: VERIFIED FIXED QA Contact: issues <>
Priority: P2 CC: dkonecny, non_migrated_user, pjiricka, tmysik
Version: 6.x   
Target Milestone: 6.x   
Hardware: All   
OS: All   
Whiteboard: release601_fixes_candidate1, release601_fixes_fixed
Issue Type: DEFECT Exception Report:
Attachments: The build-impl file of the JavaEE project that works.
The build-impl file of the JavaEE project that doesn't work. I didn't change this, all changes were done by NB. I'm not sure that RC1 worked, but the other attached file did work
All project related files of the project that works correctly
All project related files of the project that doesn't work correctly
All project related files of the project that works correctly

Description ieising 2007-11-26 10:14:34 UTC
[ BUILD # : RC2 ]
[ JDK VERSION : 1.6.0_02 ]


I just noticed the blazingly fast performance of the clean/build
action on my JavaEE project... and while running it over and over
again, I noticed that the WAR and EJB projects are not cleaned and
build anymore.

Opening the project's properties I found that there is no more a
dependency between the Enterprise project and the EJB and WAR
projects embedded in it.
Nothing changed after adding these two projects again as a dependency
in the libraries of the Enterprise project.

The only thing I did was opening the projects in RC2. In RC1 it all
worked fine I believe. I need to find out what had changed while
opening the projects in RC2.

Comment 1 Tomas Mysik 2007-11-26 15:36:17 UTC
That's weird because there are not many changes between RC 1 and RC 2 - I cannot think about any change that could be 
related to your problem.
Anyway, are you able to attach your project please (the original one)? It would be very helpful, thanks.
Comment 2 ieising 2007-11-26 20:36:35 UTC
Created attachment 53506 [details]
The build-impl file of the JavaEE project that works.
Comment 3 ieising 2007-11-26 20:37:57 UTC
Created attachment 53507 [details]
The build-impl file of the JavaEE project that doesn't work. I didn't change this, all changes were done by NB. I'm not sure that RC1 worked, but the other attached file did work
Comment 4 David Konecny 2007-11-27 08:31:57 UTC
Could you attach also corresponding project.xml? If you open project properties of your EnterpriseApp and go to
Packaging panel can you see there EJBs/WARs your ear app is composed of?
Comment 5 ieising 2007-11-27 09:15:57 UTC
The proper projects are listed, my client, ejb and war project.

Comment 6 Tomas Mysik 2007-11-27 10:33:46 UTC
Is it possible to attach your project? If not in which NB version have you created it? Thanks.
Comment 7 ieising 2007-11-28 22:54:34 UTC
Created attachment 53629 [details]
All project related files of the project that works correctly
Comment 8 ieising 2007-11-28 22:56:55 UTC
Created attachment 53630 [details]
All project related files of the project that doesn't work correctly
Comment 9 ieising 2007-11-28 22:57:32 UTC
Created attachment 53631 [details]
All project related files of the project that works correctly
Comment 10 ieising 2007-11-28 22:58:28 UTC
Please ignore attachment "Wed Nov 28 22:54:00 +0000 2007:" as it has the wrong mime type.
Comment 11 David Konecny 2007-11-29 08:29:57 UTC
This is duplicate of your issue 120154. Unfortunately it was too late to fix that one for NB6.

*** This issue has been marked as a duplicate of 120154 ***
Comment 12 ieising 2007-11-29 19:16:59 UTC
I am not entirely satisfied by this final answer. Especially since it used to work and all of a sudden NB breaks my
build file and it doesn't work any more. When I restore a backup of my build-impl.xml files, all works fine.

NB should break build files. The build file as it is right now, does NOT build my JavaEE project, irrespective of the
JavaME library that is in there. It used to do that. To me that means a showstopper. Hence the re-open and the P1 and
the target to NB6.

Comment 13 David Konecny 2007-11-30 12:34:07 UTC
The two issues are about the same underlying problem. Once you add a J2ME project to a J2EE project the J2EE project's
tag <references> in project.xml is upgraded to '' namespace. And the
underlying problem is that this namespace is not properly handled by J2EE projects. This defect was there always and
needs to be fixed.

Once the project is upgraded it will not build required projects regardless of their type, e.g. removing J2ME and adding
J2EE will result into the same problem.

Is this really showstopper for NB6? The scenario to reproduce it is to add J2ME project to J2EE. How common is this? IMO
this is P2.

The workaround (till the issue is resolved) is to override for example 'pre-compile' target in build.xml and build
required projects, e.g.:

<target name="pre-compile">
    <ant antfile="${project.EnterpriseApplication5-ejb}/build.xml" inheritall="false" target="dist-ear">
        <property location="${build.dir}" name="dist.ear.dir"/>

If your project is not using J2ME libs anymore you can downgrade <references> tag back to ant-project-references/1 and
it should start working again.
Comment 14 Petr Jiricka 2007-11-30 12:55:40 UTC
Hi Iwan, I agree this is serious and should be fixed in a patch on the update center shortly after the release. Since
there is a workaround, I don't think this is a showstopper for NetBeans 6. We plan to release 6.0 FCS *really soon* now.

Comment 15 ieising 2007-11-30 14:24:52 UTC
There is no workaround for this issue, unless you have a working backup of the project and keep on restoring it.
Furthermore, as soon as I want to change the JavaEE client from the WAR project to a Swing project, which I have to test
my webservices, the build-impl.xml file is crippled.

I have tried to work for a while to keep remembering rebuilding all the relevant projects myself, but that turned out to
be a non-workable solution, as I think I've lost about 50% of my productivity if not more.

On part of the reference to the J2ME library issue (issue 120154), it used to work with that reference being the only
one not being rebuild. Only since shortly (noticed with RC2) none of the references are being rebuild. Mind that the
original project was a regular run of the mill JavaEE project.

Comment 16 David Konecny 2007-11-30 17:41:11 UTC

I'm going to start working on the fix. The question remains whether this should be fixed for NB6 or not.

To your claim that this is regression I must (unfortunately) say that none of the J2EE projects (web, ejb, ear,
appclient) ever supported (since NB 4.1) having dependency on a project which provides 'extended' artifact (I just
checked the source code). As far as I know only J2ME and (optionally) freeform projects provides them at the moment.

The testcase you provided demonstrates J2EE project having dependency on J2ME project, for example (correct me please if
I'm wrong) IFFSharedLib J2ME library is required by IFFServer-ejb J2EE project. This is one of the scenarios where the
problem manifests.

My reasoning for downgrading this to P2 and fix it after NB6 (update center; 6.0.x release) is: not a regression; not a
common scenario (the problem exists since 4.1).

I'm going to close your issue 120154 as duplicate of this one - it is the same problem.

I have also a question. What is the scenario behind using J2ME project in Enterprise App? I'm not familiar with J2ME and
at the moment I cannot see any usefulness in doing so. Running such J2EE app in application server would require J2ME
platform be included as well, right? I must be missing something here. Thanks for clarification.

Re. "There is no workaround for this issue" - there is always a workaround, it just may not be trivial or nice. In your
case for example for already mentioned IFFServer-ejb it would mean (off the top of my head; I cannot test it) adding to

<target name="-pre-compile">
    <ant antfile="${project.BouncyCastleME}/build.xml" inheritall="false" target="jar">
        <property location="" name=""/>
    <ant antfile="${project.IFFSharedLib}/build.xml" inheritall="false" target="jar">
        <property location="" name=""/>

<target name="-post-clean">
    <ant antfile="${project.BouncyCastleME}/build.xml" inheritall="false" target="clear">
        <property location="" name=""/>
    <ant antfile="${project.IFFSharedLib}/build.xml" inheritall="false" target="clean">
        <property location="" name=""/>

That should resolve your building problem. Changing required projects will always require some hand work here. It is
just workaround.
Comment 17 David Konecny 2007-11-30 17:42:01 UTC
*** Issue 120154 has been marked as a duplicate of this issue. ***
Comment 18 ieising 2007-11-30 20:18:46 UTC
Well you are right in that my project depends on a J2ME project. But it used to work without problems, well not for the
J2ME project, hence the 120154 issue. But until recently the problem only existed for the J2ME project. Since that only
contains data structures that I use in both the mobile application and the web application it connects to, it doesn't
change that much.

My apologies on the subject that there is no workaround, your suggestion to put the 'right code' into build.xml is
actually a good workaround.

Again, I apologize and can't wait until the fix is out.

Comment 19 ieising 2007-11-30 20:49:56 UTC
Just to clarify the use case a bit further: J2ME has obviously more limitations on supported data structures as J2SE (or
J2EE). In order to be sure that the Enterprise Application returns on the web services interface J2ME supported objects,
I create these types in a J2ME project, have NB verify that the types are supported on the J2ME platform, but since it
is just Java, I can use these JARs in my J2EE project as well. And I am sure that the interface is compatible.

Comment 20 David Konecny 2007-12-10 10:13:28 UTC
tmysik, please review the fix. thx.

iwan, we would appreciate if you could download tomorrow's daily build and test this - just opening project in IDE
should regenerate build-impl.xml. thx.

Fixed in:
Checking in j2ee/archiveproject/src/org/netbeans/modules/j2ee/archive/project/resources/build-impl.xsl;
new revision: 1.5; previous revision: 1.4
Checking in j2ee/clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/build-impl.xsl;
new revision: 1.27; previous revision: 1.26
Checking in j2ee/earproject/src/org/netbeans/modules/j2ee/earproject/resources/build-impl.xsl;
new revision: 1.33; previous revision: 1.32
Checking in j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/resources/build-impl.xsl;
new revision: 1.82; previous revision: 1.81
Checking in web/project/src/org/netbeans/modules/web/project/resources/build-impl.xsl;
new revision: 1.169; previous revision: 1.168
Comment 21 Tomas Mysik 2007-12-11 14:10:21 UTC
Seems to be ok.

Product Version: NetBeans IDE Dev (Build 071211)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.23-gentoo-r3 running on i386; UTF-8; cs_CZ (nb)

Reporter, could you please verify that everything is ok now? Thanks.
Comment 22 ieising 2007-12-11 20:03:26 UTC
I am currently on vacation until December 19th, so than I will check and respond. Apologies for the delay.

Comment 23 ieising 2007-12-23 12:21:41 UTC
Yes it works.

Comment 24 David Konecny 2008-01-03 10:00:01 UTC
Thanks Iwan. -D
Comment 25 Petr Blaha 2008-01-28 21:23:20 UTC
Comment 26 khu 2008-02-07 19:18:57 UTC
The fixes have been ported into the release601_fixes branch.

Checking in build-impl.xsl;
/cvs/j2ee/archiveproject/src/org/netbeans/modules/j2ee/archive/project/resources/Attic/build-impl.xsl,v  <--  build-impl.xsl
new revision:; previous revision: 1.4
Checking in build-impl.xsl;
/cvs/j2ee/clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/Attic/build-impl.xsl,v  <--  build-impl.xsl
new revision:; previous revision:
Checking in build-impl.xsl;
/cvs/j2ee/earproject/src/org/netbeans/modules/j2ee/earproject/resources/Attic/build-impl.xsl,v  <--  build-impl.xsl
new revision:; previous revision: 1.32
Checking in build-impl.xsl;
/cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/resources/Attic/build-impl.xsl,v  <--  build-impl.xsl
new revision:; previous revision:
Checking in build-impl.xsl;
/cvs/web/project/src/org/netbeans/modules/web/project/resources/Attic/build-impl.xsl,v  <--  build-impl.xsl
new revision:; previous revision:
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo