Release Automation

 View Only
  • 1.  Git action fails with java.lang.ClassNotFoundException

    Posted May 10, 2016 05:15 PM

    We are moving from one CA Release Automation Management server (6.0) to a new one as part of a database migration. We've imported an application from the old management server to the new and when I test a git action it fails with the following Debugging information in the agent log:

     

    ---- Debugging information ----

    message             : Could not instantiate a class :com.nolio.platform.shared.executables.actions.git.GitCloneAction

    cause-exception     : java.lang.ClassNotFoundException

    cause-message       : com.nolio.platform.shared.executables.actions.git.GitCloneAction

    -------------------------------

     

    • We have the same version of git (1.8.3.1) and git action pack (10.3.1503.1) on both systems.
    • I'm using the agent installed on the Management Server to execute the action (Git - Clone).
    • The action works on the old Management Server, but not on the new one.

     

    The more complete trace is:

     

    2016-05-10 16:40:49,308 [Communication Msg Processor-4] DEBUG (com.nolio.platform.shared.storage.StorageManagerClassLoader:90) - new StorageManagerClassLoader was created. there are approximately 1 active class loaders

    2016-05-10 16:40:49,332 [Communication Msg Processor-4] ERROR (com.nolio.platform.shared.datamodel.Action:92) - com.nolio.platform.shared.executables.actions.git.GitCloneAction

    java.lang.ClassNotFoundException: com.nolio.platform.shared.executables.actions.git.GitCloneAction

            at java.net.URLClassLoader$1.run(Unknown Source)

            at java.net.URLClassLoader$1.run(Unknown Source)

            at java.security.AccessController.doPrivileged(Native Method)

            at java.net.URLClassLoader.findClass(Unknown Source)

            at java.lang.ClassLoader.loadClass(Unknown Source)

            at java.lang.ClassLoader.loadClass(Unknown Source)

            at com.nolio.platform.shared.datamodel.ActionProxy.createAction(ActionProxy.java:56)

            at com.nolio.platform.shared.flowcontrol.service.FlowActionProxyReplacer.createActionFromActionProxy(FlowActionProxyReplacer.java:74)

            at com.nolio.platform.shared.flowcontrol.service.FlowActionProxyReplacer.replaceSingleStepActionProxies(FlowActionProxyReplacer.java:45)

            at com.nolio.platform.shared.flowcontrol.service.FlowActionProxyReplacer.replaceActionProxies(FlowActionProxyReplacer.java:38)

            at com.nolio.platform.shared.flowcontrol.service.FlowDataFactory.initFlow(FlowDataFactory.java:93)

            at com.nolio.platform.shared.flowcontrol.service.FlowDataFactory.create(FlowDataFactory.java:85)

            at com.nolio.platform.shared.flowcontrol.service.FlowDataFactory.create(FlowDataFactory.java:46)

            at com.nolio.platform.shared.flowcontrol.service.FlowControlService.init(FlowControlService.java:80)

            at com.nolio.platform.shared.flowcontrol.service.FlowControlService.handleServiceRequest(FlowControlService.java:49)

            at com.nolio.platform.shared.communication.CommunicationNetworkServiceManager$1.run(CommunicationNetworkServiceManager.java:232)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

            at java.lang.Thread.run(Unknown Source)

    2016-05-10 16:40:49,337 [Communication Msg Processor-4] ERROR (com.nolio.platform.shared.flowcontrol.service.FlowControlService:87) - failed initialize flow for job[32773], jobServerId[32773].

    java.lang.RuntimeException: Failed to create action from ActionProxy[null:ActionProxy]

            at com.nolio.platform.shared.flowcontrol.service.FlowActionProxyReplacer.createActionFromActionProxy(FlowActionProxyReplacer.java:77)

            at com.nolio.platform.shared.flowcontrol.service.FlowActionProxyReplacer.replaceSingleStepActionProxies(FlowActionProxyReplacer.java:45)

            at com.nolio.platform.shared.flowcontrol.service.FlowActionProxyReplacer.replaceActionProxies(FlowActionProxyReplacer.java:38)

            at com.nolio.platform.shared.flowcontrol.service.FlowDataFactory.initFlow(FlowDataFactory.java:93)

            at com.nolio.platform.shared.flowcontrol.service.FlowDataFactory.create(FlowDataFactory.java:85)

            at com.nolio.platform.shared.flowcontrol.service.FlowDataFactory.create(FlowDataFactory.java:46)

            at com.nolio.platform.shared.flowcontrol.service.FlowControlService.init(FlowControlService.java:80)

            at com.nolio.platform.shared.flowcontrol.service.FlowControlService.handleServiceRequest(FlowControlService.java:49)

            at com.nolio.platform.shared.communication.CommunicationNetworkServiceManager$1.run(CommunicationNetworkServiceManager.java:232)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

            at java.lang.Thread.run(Unknown Source)

    Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not instantiate a class :com.nolio.platform.shared.executables.actions.git.GitCloneAction : com.nolio.platform.shared.executables.actions.git.GitCloneAction

    ---- Debugging information ----

    message             : Could not instantiate a class :com.nolio.platform.shared.executables.actions.git.GitCloneAction

    cause-exception     : java.lang.ClassNotFoundException

    cause-message       : com.nolio.platform.shared.executables.actions.git.GitCloneAction

    -------------------------------

            at com.nolio.platform.shared.datamodel.ActionProxy.createAction(ActionProxy.java:93)

            at com.nolio.platform.shared.flowcontrol.service.FlowActionProxyReplacer.createActionFromActionProxy(FlowActionProxyReplacer.java:74)

            ... 11 more

    Caused by: java.lang.ClassNotFoundException: com.nolio.platform.shared.executables.actions.git.GitCloneAction

            at java.net.URLClassLoader$1.run(Unknown Source)

            at java.net.URLClassLoader$1.run(Unknown Source)

            at java.security.AccessController.doPrivileged(Native Method)

            at java.net.URLClassLoader.findClass(Unknown Source)

            at java.lang.ClassLoader.loadClass(Unknown Source)

            at java.lang.ClassLoader.loadClass(Unknown Source)

            at com.nolio.platform.shared.datamodel.ActionProxy.createAction(ActionProxy.java:56)

            ... 12 more

    2016-05-10 16:40:49,339 [Communication Msg Processor-4] DEBUG (com.nolio.platform.shared.datamodel.RunIdUtils:31) - Created name with runId : _32773_edc-v-dcaramgt_novalocal

    2016-05-10 16:40:49,344 [Communication Msg Processor-4] DEBUG (com.nolio.platform.shared.communication.CommunicationNetwork:130) - Send Message was called for:executionLog__32773_edc-v-dcaramgt_novalocal@es_edc-v-dcaramgt.novalocal...



  • 2.  Re: Git action fails with java.lang.ClassNotFoundException

    Broadcom Employee
    Posted May 10, 2016 06:08 PM

    Can you check these directories on the agent machine to see if they have the nolio-git-actions-10.3.1503.1.jar:

    <agentInstallDir>/actionslib

    <agentInstallDir>/lib

     

    It sounds like the file is not in either of these directories. Distributing the file through the NAC/NES should be handled when running a job. But you can also force the jar distribution by running a test "Delay" action.

     

    Regards,

    Gregg



  • 3.  Re: Git action fails with java.lang.ClassNotFoundException
    Best Answer

    Posted May 10, 2016 08:42 PM

    Thanks for the suggestion Gregg. It led me to the underlying problem.

     

    Despite the fact that the new RA Management Server listed nolio-git-actions (and other action packs) as installed, there were a number of .jars missing from the <serverInstallDir>/actionslib directory, including nolio-git-actions-10.3.1503.1.jar. I manually installed the jars to bring the new management server into consistency with the old one. Then the git actions began working. I expect that it I only manually installed the git .jar that other actions would have failed on me later.

     

    To manually install the missing jars;

    1. I did a diff between the contents of the <serverInstallDir>/actionslib directory on the old and new management servers.
    2. On the old server I zipped up the missing jars.
    3. I transferred the zip file to the new management server.
    4. Then unzipped the .jars into the <serverInstallDir>/actionslib directory on the new server.

     

    I do not know how the new Management server got into a state where action packs had apparently been installed at some point (I was told they were by the person who did it), the GUI reflected that, but jars were completely missing from the server.



  • 4.  Re: Git action fails with java.lang.ClassNotFoundException

    Broadcom Employee
    Posted May 11, 2016 09:05 AM

    Fantastic! Glad to hear you were able to pinpoint the problem and fix it. Thanks for the update and outlining the steps you used to solve the problem.

    Something I hadn't picked up on at the time of your original post was the part about database migration. If the new Management server was using the Database from an old Management server then this could happen since the Database keeps track of the action packs installed. So even though the action pack files didn't exist the database thought that they had already been installed.

     

    Cheers,
    Gregg



  • 5.  Re: Git action fails with java.lang.ClassNotFoundException

    Posted May 11, 2016 09:52 AM

    Thanks Gregg.

    FTR, the Management Server was not using the Database from the old Management Server. The migration was all about moving over to an MSSQL database from a MySQL database. We decided to set up a new Management Server as part of that effort rather than try to re-configure the old Management server to talk to the new database. In theory the following happened during the migration...

    1. New MSSQL database setup.
    2. New RA Management Server setup and configured to connect to MSSQL database.
    3. Actions Packs installed on new Management Server using ROC, based on "Installed Action Packs" listed in ROC on old Management Server.
    4. Exported Application from old Management Server.
    5. Imported Application to new Management Server.
    6. Re-configured existing agents to point to supernode on new Management Server (all-in-one setup).

     

    Best,

    Mark.