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 184000 - CompApp deploy fails from (Ant) command line as result of Enhancement #178165 changes
Summary: CompApp deploy fails from (Ant) command line as result of Enhancement #178165...
Status: RESOLVED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: Composite Application (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Alexander Permyakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-13 12:14 UTC by ian_chalmers
Modified: 2010-04-27 12:21 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 ian_chalmers 2010-04-13 12:14:21 UTC
As a result of Enhancement #178165, the clear text password value in the NETBEANS_USER/config/J2EE/InstalledServers/.nbattrs has been replaced by an entry in a secure "keyring". As a result, the SOA deploy command fails from the Ant command line - see example below.

The SOA CompApp command line project code needs updating so that it is using the same password mechanism as the IDE (where the deploy works as expected)

(alias:jbidev.ora):nb/SynchronousSampleApplication -> grep password $NETBEANS_USER/config/J2EE/InstalledServers/.nbattrs
        <attr name="password" stringvalue="ganymede"/>
(alias:jbidev.ora):nb/SynchronousSampleApplication -> nbant run-jbi-deploy-without-build
Buildfile: build.xml

-create-private-props:
     [echo] JBI/QE pre-init patch: generating /Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/install/nb/SynchronousSampleApplication/nbproject/private/private.properties (generate.ats.output=true)

-add-partner-project:
     [echo] JBI/QE pre-init patch: adding partner project NONAME to /Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/install/nb/SynchronousSampleApplication/nbproject/private/private.properties

run-jbi-deploy-without-build:
[jbi-deploy-service-assembly] Apr 13, 2010 12:52:07 PM org.netbeans.modules.j2ee.deployment.impl.ServerRegistry init
[jbi-deploy-service-assembly] WARNING: No DIR_JSR88_PLUGINS folder found, no server plugins will be availabe
[jbi-deploy-service-assembly] [deploy-service-assembly]
[jbi-deploy-service-assembly]     Deploying a service assembly...
[jbi-deploy-service-assembly]         host=localhost
[jbi-deploy-service-assembly]         port=17888
[jbi-deploy-service-assembly]         file=/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/install/nb/SynchronousSampleApplication/dist/SynchronousSampleApplication.zip
[jbi-deploy-service-assembly] [start-service-assembly]
[jbi-deploy-service-assembly]     Starting a service assembly...
[jbi-deploy-service-assembly]         host=localhost
[jbi-deploy-service-assembly]         port=17888
[jbi-deploy-service-assembly]         name=SynchronousSampleApplication

BUILD SUCCESSFUL
Total time: 1 second
(alias:jbidev.ora):nb/SynchronousSampleApplication -> <START NETBEANS>
(alias:jbidev.ora):nb/SynchronousSampleApplication -> grep password $NETBEANS_USER/config/J2EE/InstalledServers/.nbattrs
        <attr name="password" stringvalue="this really long string is used to identify a password that has been stored in the Keyring"/>
(alias:jbidev.ora):nb/SynchronousSampleApplication -> nbant run-jbi-deploy-without-build
Buildfile: build.xml

-create-private-props:
     [echo] JBI/QE pre-init patch: generating /Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/install/nb/SynchronousSampleApplication/nbproject/private/private.properties (generate.ats.output=true)

-add-partner-project:
     [echo] JBI/QE pre-init patch: adding partner project NONAME to /Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/install/nb/SynchronousSampleApplication/nbproject/private/private.properties

run-jbi-deploy-without-build:
[jbi-deploy-service-assembly] Apr 13, 2010 12:53:35 PM org.netbeans.modules.j2ee.deployment.impl.ServerRegistry init
[jbi-deploy-service-assembly] WARNING: No DIR_JSR88_PLUGINS folder found, no server plugins will be availabe

BUILD FAILED
java.lang.RuntimeException: MBeanServerConnection is null. Make sure the App Server is running.
        at org.netbeans.modules.compapp.projects.jbi.AdministrationServiceHelper.getManagementClient(AdministrationServiceHelper.java:140)
        at org.netbeans.modules.compapp.projects.jbi.AdministrationServiceHelper.getRuntimeManagementServiceWrapper(AdministrationServiceHelper.java:91)
        at org.netbeans.modules.compapp.projects.jbi.anttasks.DeployServiceAssembly.execute(DeployServiceAssembly.java:300)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.Main.runBuild(Main.java:758)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 1 minute 34 seconds
(alias:jbidev.ora):nb/SynchronousSampleApplication -> 

Config used:

App Server details:

  app server host              = localhost
  app server version           = Sun GlassFish Enterprise Server v2.1.1 ((v2.1 Patch06)(9.1_02 Patch12)) (build b31g-fcs)
  app server build date        = Mon Oct 19 00:04:12 BST 2009
  app server home              = /Volumes/Work/qe/gf211

Product details:

  type                         = Open ESB
  variant                      = Glassfish
  kit type                     = image

Database details:

  type                         = oracle
  name                         = ora112
  version                      = 11.2.0.1.0
  user                         = qajbi_ianch_mac
  jdbc url                     = jdbc:oracle:thin:@swimsuit.sfbay.sun.com:1521:ora112

JBI details:

  operating system             = Mac OS X 10.6.3 [x86_64] (en_US MacRoman)
  java version                 = 1.6.0_17-b04-248-10M3025 (64-bit)
  java home                    = /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
  java tmp dir                 = /var/folders/RL/RLnqrAAiE+0YBWkpxy26f++++TI/-Tmp-/
  app server type              = GLASSFISH (sub-type = DEVELOPER version = 211)
  app server domains           = 1 (instances = 0 cluster = )
  jbi host                     = localhost
  jbi port                     = 17888 (secure = false)
  runtime build                = 091216 
  runtime version              = 2.6.1
  runtime codeline             = gfesbv22
  runtime component build      = 091215
  runtime component version    = 2.6.1
  runtime component codeline   = gfesbv22
  component build              = 091216
  component version            = 2.6.1
  component codeline           = gfesbv22
  design time build            = unknown
  design time codeline         = unknown


Build details:

  JBI Framework                = Wed Dec 16 03:39:46 GMT 2009 [/Volumes/Work/qe/gf211/jbi/lib/jbi_framework.jar]
  HTTP Binding                 = Tue Dec 15 21:43:50 GMT 2009 [091215,2.6.0,gfesbv22,/Volumes/Work/qe/gf211/jbi/components/sun-http-binding/httpbc.jar]
  BPEL Service Engine          = Wed Dec 16 22:01:10 GMT 2009 [091216,2.6.0,gfesbv22,/Volumes/Work/qe/gf211/addons/jbi-components/bpelserviceengine.jar]

NetBeans build details:

  IDE build                    = 20100408_1405                [/Volumes/Work/qe/netbeans/6.9/platform/build_number]
  IDE build (base)             = 201004070201                 [/Volumes/Work/qe/netbeans/6.9/platform/lib/boot.jar META-INF/MANIFEST.MF]
  IDE build date               = Wed Apr 07 02:36:58 BST 2010 [/Volumes/Work/qe/netbeans/6.9/platform/core/core.jar]
  SOA build date               = Thu Apr 08 14:14:36 BST 2010 [/Volumes/Work/qe/netbeans/6.9/soa/modules/org-netbeans-modules-compapp-projects-jbi.jar]
  home dir                     = /Volumes/Work/qe/netbeans/6.9
  user dir                     = /Volumes/Work/qe/netbeans/userdir.69
Comment 1 Alexander Permyakov 2010-04-23 16:50:54 UTC
fixed at gfesb-main>
changeset:   1534:39ee5bfa3aa7

build: http://nephrite.russia.sun.com:8080/hudson/job/gfesb-main/lastSuccessfulBuild/artifact/cache/latest/gfesb-main.zip


There are two cases:

1) We use default password for the glassfish server (adminadmin). In this case it is necessary to use typical ant script, as earlier without modification:

ant -Desb.netbeans.home=<...> -Desb.netbeans.user=<...> run-jbi-deploy-without-build (run, undeploy)

2) We use special password for the glassfish server. In this case it is necessary to to use ant script with special property (server.password) which correspond to custom password

ant -Desb.netbeans.home=<...> -Desb.netbeans.user=<...> -Dserver.password=<...> run-jbi-deploy-without-build (run, undeploy)

If the password is wrong we will receive an error 

pleas verify.
Comment 2 ian_chalmers 2010-04-26 08:15:22 UTC
Projects now build & deploy with new changes but test case execution fails due to JUnit classpath problem:

(alias:jbidev.ora):nb/SynchronousSampleApplication -> nbant test
Buildfile: build.xml

-create-private-props:
     [echo] JBI/QE pre-init patch: generating /Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/install/nb/SynchronousSampleApplication/nbproject/private/private.properties (generate.ats.output=true)

-do-test-run:
    [junit] Testsuite: org.netbeans.modules.compapp.catd.ConfiguredTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] Null Test:  Caused an ERROR
    [junit] null
    [junit] java.lang.reflect.InvocationTargetException
    [junit] Caused by: java.lang.NoClassDefFoundError: org/netbeans/api/keyring/Keyring
    [junit]     at org.netbeans.modules.sun.manager.jbi.util.ServerInstanceReader.getServerInstances(ServerInstanceReader.java:177)
    [junit]     at org.netbeans.modules.compapp.catd.util.Util.getServerInstance(Util.java:228)
    [junit]     at org.netbeans.modules.compapp.catd.util.Util.getHttpDefaultPorts(Util.java:404)
    [junit]     at org.netbeans.modules.compapp.catd.ConfiguredTest.suite(ConfiguredTest.java:273)
    [junit] Caused by: java.lang.ClassNotFoundException: org.netbeans.api.keyring.Keyring
    [junit]     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    [junit]     at java.security.AccessController.doPrivileged(Native Method)
    [junit]     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
    [junit]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
    [junit]     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
    [junit] Test org.netbeans.modules.compapp.catd.ConfiguredTest FAILED

BUILD FAILED
/Volumes/Work/qe/jdev/paths/jbidev/jbi/shasta/install/nb/SynchronousSampleApplication/nbproject/build-impl.xml:328: Some tests failed; see details above.

Total time: 1 second

classpath requires additional jars:

            <pathelement path="${esb.netbeans.platform}/modules/org-netbeans-modules-keyring.jar"/>
            <pathelement path="${esb.netbeans.platform}/modules/org-openide-dialogs.jar"/>
            <pathelement path="${esb.netbeans.platform}/modules/ext/jna-3.0.9.jar"/>
Comment 3 ian_chalmers 2010-04-27 12:21:51 UTC
Deploy & test now works with SOA build 20100427_0007