8 Replies Latest reply on Jan 15, 2010 2:33 AM by Joshua Skirde

    Referencing a class locally in a blpackage

      Hi all,


      I've got a number of classes setup (one for each application we have automated) and I've just added a user and group to each of these. We previous used properties on the Server class to define these but we subsequently needed to deploy different applications with different usernames to the same hosts.


      So essentially I used to use ??TARGET.CUST_USER?? to reference a user and now I'm trying to use ??TARGET.CUST_ENV.app1.user?? where both CUST_ENV and app1 were instantiated and the server was associated with one of these instantiations (thereby classing it is as test / dev / prod etc...).

      Now that works... but I don't want to embed the application name in my package because the same steps are used for 25+ applications and that would be a major step backwards as we have scripted package creations and such.


      So I thought I'd add a local property on my package and have it of type "app1" and set its default value to ??TARGET.CUST_ENV.app1?? which seems to work in the package. I can then refer to the my local property in the steps and continue with my generic packages.


      (finally getting to the point...) Just putting a simple "echo ??LOCAL_APP.user??" as an external command in my package and it fails at Simulate without explanation ... just says "The job "job1" has failed".


      Any ideas? Can anyone think of a better way to do this that works?



        • 1. Re: Referencing a class locally in a blpackage

          If you just make you external command `echo "Output here"` does it succeed?

          • 2. Re: Referencing a class locally in a blpackage

            Nope, still fails. So it's obviously the local property default value that's annoying it which is quite disturbing considering I navigate to the value using the drop down and it restricts values to the same class (for obvious reasons).

            • 3. Re: Referencing a class locally in a blpackage

              Yeah, I just set the value to null and it works.

              It also works with an instantiated value, just not when it has to determine the value from TARGET.CUST_ENV.app1 (which I believe is valid).

              • 4. Re: Referencing a class locally in a blpackage

                What does it say in the config and job server logs?

                • 5. Re: Referencing a class locally in a blpackage

                  I got a stack dump in the appserver.log. It didn't reach the agent (nothing in rscd.log or Transactions/log):


                  [13 Jan 2010 15:43:08,034] [Job-WorkItem-Thread-1880] [INFO] [::] [Appserver] Work item thread started.
                  [13 Jan 2010 15:43:08,935] [Job-WorkItem-Thread-1879] [ERROR] [joshuas:BuildEnv:] [Deploy] com.bladelogic.model.typesystem.value.SimpleProper
                  java.lang.ClassCastException: com.bladelogic.model.typesystem.value.SimplePropertyReferenceBlValueImpl
                          at com.bladelogic.model.typesystem.value.SimplePropertyReferenceBlValueImpl.evaluate(SimplePropertyReferenceBlValueImpl.java:400)
                          at com.bladelogic.ast.evaluator.ReferenceEvaluator.evaluateRecursively(ReferenceEvaluator.java:131)
                          at com.bladelogic.ast.evaluator.ReferenceEvaluator.evaluate(ReferenceEvaluator.java:82)
                          at com.bladelogic.model.job.deploy.DepolyJobFileUtil.createParamFileOutput(DepolyJobFileUtil.java:166)
                          at com.bladelogic.model.job.deploy.DepolyJobFileUtil.createParamFileOnTarget(DepolyJobFileUtil.java:185)
                          at com.bladelogic.model.job.deploy.DeployJobStepWorkItemImpl.createParamFileOnTarget(DeployJobStepWorkItemImpl.java:1184)
                          at com.bladelogic.model.job.deploy.DeployJobDryRunWorkItemImpl.internalExecute(DeployJobDryRunWorkItemImpl.java:242)
                          at com.bladelogic.model.job.deploy.DeployJobDryRunWorkItemImpl.doExecute(DeployJobDryRunWorkItemImpl.java:70)
                          at com.bladelogic.model.job.workitem.BaseJobWorkItemImpl.execute(BaseJobWorkItemImpl.java:117)
                          at com.bladelogic.app.service.workitem.WorkItemThread.run(WorkItemThread.java:140)


                  Are you thinking bug too?

                  • 6. Re: Referencing a class locally in a blpackage

                    Yeah. Very possible. What version and hotfix are you at?

                    • 7. Re: Referencing a class locally in a blpackage

                      Hi Adam,


                      We're on 7.4.3 SP1, looking to move to 7.6 in the next few weeks (but waiting on hardware).




                      • 8. Re: Referencing a class locally in a blpackage

                        I have a workaround to this; whilst not as elegant I can create multiple local parameters each referring to the primitive type in my subclass.

                        So I define a String TARGET.CUST_ENV.app1.application_user and TARGET.CUST_ENV.app1.application_group and then set the default values of the local parameters LOCAL_USER = TARGET.CUST_ENV.app1.application_user and LOCAL_GROUP = TARGET.CUST_ENV.app1.application_group.


                        Of course if I add more properties to my class then I in turn then need to add them locally to my package.


                        I'll raise the issue with support as to why referencing the class doesn't work.

                        1 of 1 people found this helpful