Cargo
  1. Cargo
  2. CARGO-979

Allow specifying the profile name when remotely deploying to a JBoss 5.1.X-server

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.1.1
    • Component/s: JBoss, Maven2
    • Labels:
      None
    • Environment:
      JBoss AS 5.1.0.GA, cargo-maven2-plugin version 1.1.0
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      When running cargo:deploy with the configuration done according to http://cargo.codehaus.org/JBoss+5.1.x
      (Remote deployment against a running container) this happens:

      Cannot deploy deployable org.codehaus.cargo.container.jboss.deployable.JBossWAR@!26c06b

      ... long stack trace ...

      Caused by: org.jboss.profileservice.spi.NoSuchProfileException: Profile does not
       support deployment actions: ProfileKey@199896a5[domain=default, server=myInstance, name=default]
              at org.jboss.profileservice.management.upload.DeploymentManagerImpl.chec
      kProfile(DeploymentManagerImpl.java:293)
              at org.jboss.profileservice.management.upload.DeploymentManagerImpl.load
      Profile(DeploymentManagerImpl.java:203)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
              at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRem
      

        Activity

        Hide
        Savas Ali Tokmen added a comment -

        What is your JBoss server's active profile name?

        Show
        Savas Ali Tokmen added a comment - What is your JBoss server's active profile name?
        Hide
        Alix Warnke added a comment -

        The profile (instance) running is called myInstance

        Show
        Alix Warnke added a comment - The profile (instance) running is called myInstance
        Hide
        Savas Ali Tokmen added a comment -

        The deployer is looking for domain=default, server=myInstance, name=default

        Are the domain and the target name correct? Also, is myInstance the name of the server or the profile?

        Show
        Savas Ali Tokmen added a comment - The deployer is looking for domain=default, server=myInstance, name=default Are the domain and the target name correct? Also, is myInstance the name of the server or the profile?
        Hide
        Alix Warnke added a comment -

        As far as I could see, the only property that can be configured (of the ones listed) using the maven plugin is "cargo.jboss.configuration" which maps to "server", the JBoss instance name is 'myInstance', e.g. $JBOSS_HOME\server\myInstance

        Show
        Alix Warnke added a comment - As far as I could see, the only property that can be configured (of the ones listed) using the maven plugin is "cargo.jboss.configuration" which maps to "server", the JBoss instance name is 'myInstance', e.g. $JBOSS_HOME\server\myInstance
        Hide
        Savas Ali Tokmen added a comment -

        Do you by chance know the correct domain name and the name?

        Initialization in CARGO is done as ProfileKey(ProfileKey.DEFAULT, server, name); with:

        • server the cargo.jboss.configuration
        • name default or farm
        Show
        Savas Ali Tokmen added a comment - Do you by chance know the correct domain name and the name? Initialization in CARGO is done as ProfileKey(ProfileKey.DEFAULT, server, name); with: server the cargo.jboss.configuration name default or farm
        Hide
        Alix Warnke added a comment -

        I managed to make some progress by changing:
        conf\bootstrap\profile.xml
        and add two constructor parameters:

        <bean name="DefaultProfileKey" class="org.jboss.profileservice.spi.ProfileKey">
        <constructor>
        <parameter>default</parameter>
        <parameter>$

        {jboss.server.name}

        </parameter>
        <parameter>applications</parameter>
        </constructor>
        </bean>

        The deployment now works, however I still get nasty stacktraces on both server- and client side.

        Is there a reason why the profile parameter cannot be set from Cargo?

        Show
        Alix Warnke added a comment - I managed to make some progress by changing: conf\bootstrap\profile.xml and add two constructor parameters: <bean name="DefaultProfileKey" class="org.jboss.profileservice.spi.ProfileKey"> <constructor> <parameter>default</parameter> <parameter>$ {jboss.server.name} </parameter> <parameter>applications</parameter> </constructor> </bean> The deployment now works, however I still get nasty stacktraces on both server- and client side. Is there a reason why the profile parameter cannot be set from Cargo?
        Hide
        Savas Ali Tokmen added a comment - - edited

        The only reason it had not been implemented before is because no one has asked for it before If I understand correctly, you are modifying the first parameter of ProfileKey (domain), right?

        If you have a patch proposition, we are welcome to apply it.

        Show
        Savas Ali Tokmen added a comment - - edited The only reason it had not been implemented before is because no one has asked for it before If I understand correctly, you are modifying the first parameter of ProfileKey (domain), right? If you have a patch proposition, we are welcome to apply it.
        Hide
        Alix Warnke added a comment -

        I looked it up and this is how the source code looks like in the jboss 5.1.0.GA-release.
        There are two constructors for ProfileKey (the bundled profile.xml uses the first one):

        /**

        • Calls this this(DEFAULT, DEFAULT, name)
        • @param name - the profile name
          */
          public ProfileKey(String name) { this(DEFAULT, DEFAULT, name); }

        /**

        • Build a profile key from the domain, server and name. If any parameter
        • is null it defaulted to "default".
        • @param domain - the admin domain
        • @param server - the server instance name
        • @param name - the profile name
          */
          public ProfileKey(String domain, String server, String name) { if( domain == null ) domain = DEFAULT; this.domain = domain; if( server == null ) server = DEFAULT; this.server = server; if( name == null ) name = DEFAULT; this.name = name; }
        Show
        Alix Warnke added a comment - I looked it up and this is how the source code looks like in the jboss 5.1.0.GA-release. There are two constructors for ProfileKey (the bundled profile.xml uses the first one): /** Calls this this(DEFAULT, DEFAULT, name) @param name - the profile name */ public ProfileKey(String name) { this(DEFAULT, DEFAULT, name); } /** Build a profile key from the domain, server and name. If any parameter is null it defaulted to "default". @param domain - the admin domain @param server - the server instance name @param name - the profile name */ public ProfileKey(String domain, String server, String name) { if( domain == null ) domain = DEFAULT; this.domain = domain; if( server == null ) server = DEFAULT; this.server = server; if( name == null ) name = DEFAULT; this.name = name; }
        Hide
        Alix Warnke added a comment -

        "you are modifying the first parameter of ProfileKey (domain), right?"
        No, I changed the profile name to "applications". This profile seems to allow hot deployments (since I'm attempting to deploy to a running remote JBoss server, this is what I need access to do). The domain parameter is here unchanged ("default").

        If I come up with a patch, I'll make sure to pass it along, but I suspect that you guys know more about this than I. Maybe this simply is a configuration that has to be done in JBoss when starting the server and is not editable in run runtime?

        Show
        Alix Warnke added a comment - "you are modifying the first parameter of ProfileKey (domain), right?" No, I changed the profile name to "applications". This profile seems to allow hot deployments (since I'm attempting to deploy to a running remote JBoss server, this is what I need access to do). The domain parameter is here unchanged ("default"). If I come up with a patch, I'll make sure to pass it along, but I suspect that you guys know more about this than I. Maybe this simply is a configuration that has to be done in JBoss when starting the server and is not editable in run runtime?
        Hide
        Savas Ali Tokmen added a comment -

        Committed revision 2904.

        Can you please try the Cargo Maven2 plugin 1.1.1-SNAPSHOT together with the JBoss remote deployer tools' version 1.1.1-SNAPSHOT?

        Detailed information for SNAPSHOTS on http://cargo.codehaus.org/Maven2+Plugin+Installation#Maven2PluginInstallation-snapshots

        Show
        Savas Ali Tokmen added a comment - Committed revision 2904. Can you please try the Cargo Maven2 plugin 1.1.1-SNAPSHOT together with the JBoss remote deployer tools' version 1.1.1-SNAPSHOT? Detailed information for SNAPSHOTS on http://cargo.codehaus.org/Maven2+Plugin+Installation#Maven2PluginInstallation-snapshots
        Hide
        Savas Ali Tokmen added a comment -

        PS: The new property is called cargo.jboss.profile and its constant is JBossPropertySet.PROFILE

        Show
        Savas Ali Tokmen added a comment - PS: The new property is called cargo.jboss.profile and its constant is JBossPropertySet.PROFILE
        Hide
        Alix Warnke added a comment -

        Thank you for your effort! It seems to work, however it also now seems to work when not using any configuration at all. I need to dig deeper into this...

        Show
        Alix Warnke added a comment - Thank you for your effort! It seems to work, however it also now seems to work when not using any configuration at all. I need to dig deeper into this...
        Hide
        Savas Ali Tokmen added a comment -

        Cool, I'm closing this, then

        Enjoy

        Show
        Savas Ali Tokmen added a comment - Cool, I'm closing this, then Enjoy

          People

          • Assignee:
            Savas Ali Tokmen
            Reporter:
            Alix Warnke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: