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 160283 - EJB projects fail to build from command line using NB 6.5.1
Summary: EJB projects fail to build from command line using NB 6.5.1
Status: CLOSED DUPLICATE of bug 162215
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-13 21:22 UTC by ian_chalmers
Modified: 2009-04-16 15:54 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example EJB project (472.26 KB, application/x-compressed)
2009-03-13 21:24 UTC, ian_chalmers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ian_chalmers 2009-03-13 21:22:49 UTC
EJB projects fail to build from the command line using NB 6.5.1. They build fine w/NB 6.1. It seems a call to nbundeploy
task has been added which has no declaration when using command line.

Build error:

Buildfile: build.xml

-create-private-props:
     [echo] JBI/QE pre-init patch: generating
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/nbproject/private/private.properties

-make_src_dirs:
    [mkdir] Created dir:
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/src/jbiasa
    [mkdir] Created dir:
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/src/bindingComponentASA
    [mkdir] Created dir:
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/src/jbiServiceUnits

BUILD FAILED
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/nbproject/build-impl.xml:567:
Problem: failed to create task or type nbundeploy
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Total time: 0 seconds

Config used:

(alias:jbidev.gfesb):TravelReservationService/ReservationPartnerServices -> jbimgr -v
App Server details:

  app server host              = ianch-mac
  app server version           = Sun GlassFish Enterprise Server v2.1 (9.1.1) (build b60-fcs)
  app server build date        = Mon Nov 17 02:36:32 GMT 2008
  app server home              = /Volumes/Work/qe/gfesbv21/gf911

Product details:

  type                         = GFESB
  variant                      = Glassfish
  kit type                     = product
  build                        = 20090310-1706
  version                      = 2.1

Database details:

  type                         = javadb
  user                         = app
  jdbc url                     = jdbc:derby://localhost:1527/

JBI details:

  operating system             = Mac OS X 10.5.6 [i386] (en_US MacRoman)
  java version                 = 1.5.0_16-b06-284 (32-bit)
  java home                    = /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
  java tmp dir                 = /tmp
  app server type              = GLASSFISH (sub-type = DEVELOPER version = 911)
  app server domains           = 1 (instances = 0 cluster = )
  jbi host                     = ianch-mac
  jbi port                     = 17888 (secure = false)
  runtime build                = 090310_2 
  runtime version              = 2.5
  runtime codeline             = main
  runtime component build      = 090310_1
  runtime component version    = 2.5
  runtime component codeline   = main
  component build              = 090310_2
  component version            = 2.5
  component codeline           = main
  design time build            = unknown
  design time codeline         = unknown

  build details:

  JBI Framework                = Tue Mar 10 13:55:12 GMT 2009 [source:
/Volumes/Work/qe/gfesbv21/gf911/jbi/lib/jbi_framework.jar]
  HTTP Binding                 = Tue Mar 10 11:33:16 GMT 2009 [build: 090310_1 source:
/Volumes/Work/qe/gfesbv21/gf911/jbi/components/sun-http-binding/httpbc.jar]
  DB Binding                   = Tue Mar 10 13:59:50 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/databasebc.jar]
  FILE Binding                 = Tue Mar 10 14:01:18 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/filebc.jar]
  FTP  Binding                 = Tue Mar 10 14:01:38 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/ftpbc.jar]
  JMS  Binding                 = Tue Mar 10 14:04:10 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/jmsbc.jar]
  LDAP Binding                 = Tue Mar 10 14:04:18 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/ldapbc.jar]
  Scheduler Binding            = Tue Mar 10 14:05:04 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/schedulerbc.jar]
  BPEL Service Engine          = Tue Mar 10 14:09:02 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/bpelserviceengine.jar]
  XSLT Service Engine          = Tue Mar 10 14:07:28 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/xsltserviceengine.jar]
  EDM  Service Engine          = Tue Mar 10 14:05:22 GMT 2009 [build: 090310_2 source:
/Volumes/Work/qe/gfesbv21/gf911/addons/jbi-components/edmse.jar]


NetBeans build details:

  IDE build                    = 200903101801                 [source:
/Volumes/Work/qe/gfesbv21/netbeans.app/Contents/Resources/netbeans/platform9/lib/boot.jar META-INF/MANIFEST.MF]
  IDE build date               = Tue Mar 10 18:33:28 GMT 2009 [source:
/Volumes/Work/qe/gfesbv21/netbeans.app/Contents/Resources/netbeans/platform9/core/core.jar]
  SOA build date               = Tue Mar 10 03:28:54 GMT 2009 [source:
/Volumes/Work/qe/gfesbv21/netbeans.app/Contents/Resources/netbeans/soa2/modules/org-netbeans-modules-compapp-projects-jbi.jar]
  home dir                     = /Volumes/Work/qe/gfesbv21/netbeans.app/Contents/Resources/netbeans
  user dir                     = /Volumes/Work/qe/netbeans/userdir.gfesbv21
Comment 1 ian_chalmers 2009-03-13 21:24:06 UTC
Created attachment 78170 [details]
Example EJB project
Comment 2 Sergey Lunegov 2009-03-17 09:04:51 UTC
David, please provide evaluation
Comment 3 David Konecny 2009-03-17 09:39:26 UTC
Petr, are you aware of 'undeploy' task being added in 6.5? If no pass back to me and I will have a look. Thanks.
Comment 4 Petr Hejl 2009-03-17 13:46:04 UTC
Which target do you use to build app?
Comment 5 ian_chalmers 2009-03-17 14:03:38 UTC
I always run clean before a build hence the problem - seems be an issue with the clean target? If you manually clean,
you can build:

(alias:jbidev.gfesb):TravelReservationService/ReservationPartnerServices -> nbant clean dist
Buildfile: build.xml

-create-private-props:
     [echo] JBI/QE pre-init patch: generating
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/nbproject/private/private.properties

BUILD FAILED
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/nbproject/build-impl.xml:567:
Problem: failed to create task or type nbundeploy
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Total time: 0 seconds
(alias:jbidev.gfesb):TravelReservationService/ReservationPartnerServices -> rm -rf dist build && nbant dist
Buildfile: build.xml

-create-private-props:
     [echo] JBI/QE pre-init patch: generating
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/nbproject/private/private.properties

-pre-pre-compile:
    [mkdir] Created dir:
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/build/jar

-copy-meta-inf:
     [copy] Copying 10 files to
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/build/jar/META-INF

-do-compile:
    [javac] Compiling 11 source files to
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/build/jar
     [copy] Copying 6 files to
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/build/jar

-do-dist-without-manifest:
    [mkdir] Created dir:
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/dist
      [jar] Building jar:
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/e2e/nb/TravelReservationService/ReservationPartnerServices/dist/ReservationPartnerServices.jar

BUILD SUCCESSFUL
Total time: 1 second
Comment 6 Petr Hejl 2009-03-17 18:31:59 UTC
Ian, David
what is nbant actually? I tested both from command line with ant and from the IDE - it works? Could it be configuration
issue? There is new nbundeploy however it obviosly works within IDE and in pure CL this won't be executed.

Thanks,
P.
Comment 7 ian_chalmers 2009-03-17 18:40:12 UTC
nbant is a QE environment alias:

-> alias nbant
${netbeans_ant}
-> echo $netbeans_ant
/Volumes/Work/qe/jdev/paths/jbidev/jbi/cmn/tools/pkg/ant.170/bin/ant -noinput -logger
org.apache.tools.ant.NoBannerLogger
-Dnetbeans.home=/Volumes/Work/qe/gfesbv21/netbeans.app/Contents/Resources/netbeans/platform9
-Dnetbeans.user=/Volumes/Work/qe/netbeans/userdir.gfesbv21 -Dfrom.commandline=true -Dallow.build.with.error=false
-Djava.awt.headless=true

This issue seems only a command line problem and seems to be localized to the clean target. In command line mode, how
does the nbundeploy task get declared?
Comment 8 David Konecny 2009-03-18 00:01:11 UTC
Ian, why do you set netbeans.home in your nbant? There is a nbundeploy task which is called from clean target and which
purpose is to undeploy app from app server before clean is called (to prevent issues that app server is locking some
files which clean consequently cannot remove). But this task should be run only when Ant is executed within NetBeans.
And whether Ant script is run within NetBeans is driven by presence of netbeans.home property. Removing that property
from your nbant should resolve your problems.
Comment 9 ian_chalmers 2009-03-18 09:59:05 UTC
Hi Petr,

The netbeans.home property is required by other projects e.g. CompApp when running in command line mode e.g.

    <target name="-init-taskdefs" if="from.commandline">
        <path id="ant.task.classpath">
            <pathelement location="${soa.module.install.dir}/org-netbeans-modules-compapp-projects-jbi.jar"/>
            <pathelement location="${soa.module.install.dir}/org-netbeans-modules-compapp-manager-jbi.jar"/>
            <pathelement location="${soa.module.install.dir}/org-netbeans-soa-libs-xmlbeans.jar"/>
            <pathelement location="${soa.module.install.dir}/ext/jbi/jbi-admin-common.jar"/>
            <pathelement location="${soa.module.install.dir}/../ant/nblib/org-netbeans-modules-compapp-projects-jbi.jar"/>
            <pathelement location="${netbeans.home}/lib/org-openide-util.jar"/>
            <pathelement location="${netbeans.home}/lib/org-openide-modules.jar"/>
            <pathelement location="${netbeans.home}/modules/org-openide-options.jar"/>
            <pathelement location="${netbeans.home}/modules/org-openide-text.jar"/>
            <pathelement location="${netbeans.home}/modules/org-openide-loaders.jar"/>
            <pathelement location="${netbeans.home}/modules/org-openide-nodes.jar"/>
            <pathelement location="${netbeans.home}/modules/org-openide-dialogs.jar"/>
            <pathelement location="${netbeans.home}/core/org-openide-filesystems.jar"/>
            <pathelement location="${ide.module.install.dir}/ext/xerces-2.8.0.jar"/>
            <pathelement location="${ide.module.install.dir}/ext/xml-commons-dom-ranges-1.0.b2.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-xml-retriever.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-xml-schema-model.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-xml-wsdl-model.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-xml-xam.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-xml-text.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-editor.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-editor-lib.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-editor-util.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-projectapi.jar"/>
            <pathelement location="${ide.module.install.dir}/org-netbeans-modules-classfile.jar"/>
            <pathelement location="${ide.module.install.dir}/org-apache-xml-resolver.jar"/>
            <pathelement location="${xml.module.install.dir}/org-netbeans-modules-xml-wsdl-extensions.jar"/>
            <pathelement location="${ide.module.install.dir}/ext/jaxb/api/jaxb-api.jar"/>
            <pathelement location="${ide.module.install.dir}/ext/jaxb/jaxb-impl.jar"/>
            <pathelement location="${ide.module.install.dir}/ext/jaxb/activation.jar"/>
            <pathelement location="${enterprise.module.install.dir}/org-netbeans-modules-j2eeserver.jar"/>
            <pathelement location="${enterprise.module.install.dir}/ext/jsr88javax.jar"/>
        </path>

Without it, the taskdef fails.

Could we not make this change?

    <target name="undeploy-clean" depends="init" if="netbeans.home" unless="from.commandline">
        <nbundeploy failOnError="false" startServer="false"/>
    </target>

Would this work?
Comment 10 Petr Hejl 2009-03-18 11:26:44 UTC
I'm not sure where the xml fragments come from, but perhaps this addition would help as well...

<pathelement location="${enterprise.module.install.dir}/../ant/nblib/org-netbeans-modules-j2ee-ant.jar"/>

unless="from.commandline" on undeploy-clean should work as well.

Comment 11 David Konecny 2009-03-19 09:17:23 UTC
Or you could run your task conditionally to presence of task's class. Something like:

 <condition property="run-undeploy-clean">
   <available classname="org.netbeans.your.UndeployClass"/>
 </condition>

Since Ant 1.7 there is even condition "typefound" but I think we still supports Ant 1.6.5.
Comment 12 David Konecny 2009-03-26 02:21:56 UTC
Just for record I'm adding bits from offline discussion:

Primary purpose of netbeans.home property is to distinguish whether Ant script is run from IDE or from command line and
that concept should stay as is. We should not further spread "from.commandline" property.

Suggested short term solutions: you are in control of your project type and build scripts so you should be able to alter
your build scripts and use different property than netbeans.home. There is no need to use exactly that property name,
right? That would be first thing I would explore and it should allow you to get rid of from.commandLine property as well.

Long term goal: build scripts generated by project type should never refer directly to jars in NB installation. They
should introduce a Java Library which should be added to project's classpath and that allows user to decide if they want
to use global version of the library from IDE or make sharable one which is stored alongside the project and stored in
VCS so that project is buildable from command line and works for any team member regardless of IDE they are using.

Problem with fixing EJB build script is that there are very likely other project types which would have to be fixed
accordingly and from that point of view it is not a good fix.

If above suggested solution does not work we will resume this discussion.
Comment 13 David Konecny 2009-04-13 23:31:01 UTC
.
Comment 14 David Konecny 2009-04-13 23:31:15 UTC

*** This issue has been marked as a duplicate of 162215 ***
Comment 15 ian_chalmers 2009-04-16 15:54:52 UTC
Closing ...