Extending a deployer script

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Extending a deployer script

yoron
Hello,

Glu agent and console version is 4.7.2.

As part of our deployment system, I would like to have the following:

AbstractDeployer.groovy:
abstract class AbstractDeployer {
  abstract public SomeClass getSomeClass()

  /* some code */
}

Deployer.groovy:
class Deployer extends AbstractDeployer {
  public SomeClass getSomeClass() {
    return new SomeClass()
  }
}

We are using a jar for deployment, and the "script" in the static model entries looks like that:
  "script": "class:/com.path.to.class.Deployer?cp=<url to jar>"

Deployments fails immediately on install script phase, with the following stack trace:
[+] org.linkedin.groovy.util.rest.RestException: class: groovy.lang.MissingPropertyException, message: No such property: self for class: org.linkedin.glu.agent.impl.script.ScriptManagerImpl
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at org.linkedin.glu.agent.impl.script.ScriptManagerImpl$_createNode_closure14.doCall(ScriptManagerImpl.groovy:215)
at org.linkedin.glu.agent.impl.script.ScriptManagerImpl$_createNode_closure14.doCall(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:313)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at com.outbrain.deployers.GluScriptWrapper.getParams(GluScriptWrapper.groovy:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3493)
at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:84)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at com.outbrain.deployers.utils.ConfigFileFetcher.createConfigFileUrl(ConfigFileFetcher.groovy:58)
at com.outbrain.deployers.utils.ConfigFileFetcher.this$3$createConfigFileUrl(Native Method)
at com.outbrain.deployers.utils.ConfigFileFetcher$this$3$createConfigFileUrl.callCurrent(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at com.outbrain.deployers.utils.ConfigFileFetcher.configFileExists(ConfigFileFetcher.groovy:48)
at com.outbrain.deployers.utils.ConfigFileFetcher$configFileExists.call(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.outbrain.deployers.ExperimentalGluAgentDeployer.calculateDeploymentStrategy(ExperimentalGluAgentDeployer.groovy:30)
at com.outbrain.deployers.ExperimentalGluAgentDeployer.this$3$calculateDeploymentStrategy(Native Method)
at com.outbrain.deployers.ExperimentalGluAgentDeployer$this$3$calculateDeploymentStrategy.callCurrent(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
at com.outbrain.deployers.ExperimentalGluAgentDeployer.getDeploymentStrategy(ExperimentalGluAgentDeployer.groovy:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:57)
at groovy.lang.MetaBeanProperty$getProperty.call(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.linkedin.glu.agent.impl.script.ScriptState.isPartOfScriptPermanentState(ScriptState.groovy:220)
at org.linkedin.glu.agent.impl.script.ScriptState.this$2$isPartOfScriptPermanentState(Native Method)
at sun.reflect.GeneratedMethodAccessor61.invoke(Native Method)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.linkedin.glu.agent.impl.script.ScriptState$_collectScriptPermanentState_closure9.doCall(ScriptState.groovy:283)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:425)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1326)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1298)
at org.codehaus.groovy.runtime.dgm$148.invoke(Native Method)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.linkedin.glu.agent.impl.script.ScriptState.collectScriptPermanentState(ScriptState.groovy:281)
at org.linkedin.glu.agent.impl.script.ScriptState.collectScriptState(ScriptState.groovy:297)
at org.linkedin.glu.agent.impl.script.ScriptState.<init>(ScriptState.groovy:93)
at sun.reflect.GeneratedConstructorAccessor460.newInstance(Native Method)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:198)
at org.linkedin.glu.agent.impl.script.ScriptNode.<init>(ScriptNode.groovy:58)
at sun.reflect.GeneratedConstructorAccessor459.newInstance(Native Method)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.linkedin.glu.agent.impl.script.ScriptManagerImpl.createNode(ScriptManagerImpl.groovy:228)
at org.linkedin.glu.agent.impl.script.ScriptManagerImpl.this$2$createNode(Native Method)
at sun.reflect.GeneratedMethodAccessor8538.invoke(Native Method)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
at org.linkedin.glu.agent.impl.script.ScriptManagerImpl$_installScript_closure2.doCall(ScriptManagerImpl.groovy:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.linkedin.glu.agent.impl.script.ScriptNode.addChild(ScriptNode.groovy:183)
at org.linkedin.glu.agent.impl.script.ScriptNode$addChild.call(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
at org.linkedin.glu.agent.impl.script.ScriptManagerImpl.installScript(ScriptManagerImpl.groovy:160)
at org.linkedin.glu.agent.impl.script.ScriptManager$installScript.call(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.linkedin.glu.agent.impl.script.StateKeeperScriptManager.installScript(StateKeeperScriptManager.groovy:123)
at org.linkedin.glu.agent.impl.script.ScriptManager$installScript.call(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.linkedin.glu.agent.impl.AgentImpl$_installScript_closure6.doCall(AgentImpl.groovy:285)
at org.linkedin.glu.agent.impl.AgentImpl$_installScript_closure6.doCall(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at org.linkedin.glu.agent.impl.AgentImpl.handleException(AgentImpl.groovy:653)
at org.linkedin.glu.agent.impl.AgentImpl.this$2$handleException(Native Method)
at org.linkedin.glu.agent.impl.AgentImpl$this$2$handleException.callCurrent(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.linkedin.glu.agent.impl.AgentImpl.installScript(AgentImpl.groovy:282)
at sun.reflect.GeneratedMethodAccessor8591.invoke(Native Method)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.linkedin.util.lifecycle.ShutdownProxy.invoke(ShutdownProxy.java:112)
at $Proxy12.installScript(Native Method)
at org.linkedin.glu.agent.api.Agent$installScript.call(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.linkedin.glu.agent.rest.resources.MountPointResource$_installScript_closure2.doCall(MountPointResource.groovy:102)
at org.linkedin.glu.agent.rest.resources.MountPointResource$_installScript_closure2.doCall(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at org.linkedin.glu.agent.rest.resources.BaseResource.noException(BaseResource.groovy:103)
at sun.reflect.GeneratedMethodAccessor37024.invoke(Native Method)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.linkedin.glu.agent.rest.resources.MountPointResource.installScript(MountPointResource.groovy:99)
at sun.reflect.GeneratedMethodAccessor8590.invoke(Native Method)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:503)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:552)
at org.restlet.resource.ServerResource.put(ServerResource.java:1244)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:432)
at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:350)
at org.restlet.resource.ServerResource.handle(ServerResource.java:952)
at org.restlet.resource.Finder.handle(Finder.java:246)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Router.doHandle(Router.java:431)
at org.restlet.routing.Router.handle(Router.java:648)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Router.doHandle(Router.java:431)
at org.restlet.routing.Router.handle(Router.java:648)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Router.doHandle(Router.java:431)
at org.restlet.routing.Router.handle(Router.java:648)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:155)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.routing.Filter.doHandle(Filter.java:159)
at org.restlet.routing.Filter.handle(Filter.java:206)
at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
at org.restlet.Component.handle(Component.java:392)
at org.restlet.Server.handle(Server.java:516)
at org.restlet.engine.ServerHelper.handle(ServerHelper.java:72)
at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:152)
at org.restlet.ext.jetty.JettyServerHelper$WrappedServer.handle(JettyServerHelper.java:170)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:943)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
at java.lang.Thread.run(Thread.java:722)

Any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: Extending a deployer script

frenchyan
Administrator
From the stack trace I see something weird:

* the state of the script is being collected (at org.linkedin.glu.agent.impl.script.ScriptState.isPartOfScriptPermanentState(ScriptState.groovy:220) 

the state of the script is all the properties/members that are stored in ZooKeeper (and on the file system)

but this call ends up calling a bunch of internal code like

at com.outbrain.deployers.ExperimentalGluAgentDeployer$this$3$calculateDeploymentStrategy.callCurrent(Native Method) 

So it seems that you have a field which is not a value but some computation which somehow ends up triggering looking for the self property (because it uses "params"). Can you mark this field "transient"? It seems that it should not fail like it does, I would have to take a look at why self is not recognized when using inheritance (that may be the real problem...)

Yan
 
Reply | Threaded
Open this post in threaded view
|

Re: Extending a deployer script

yoron
Problem solved. Here is what happened:
In the abstract deployer, I had the 6 callback closures for the state machine.
I also had a 'abstract DeploymentStrategy getDeploymentStrategy()' in the abstract deployer, with the steps closures calling it (for the customized part of each step).
Thing is, when groovy sees getXxx(), it treats it as a property, and when a
getXxx() is in a closure - it will try to get that property so it can create the closure.
That lead to the implementation of getDeploymentStrategy() to be called, but that function relied on the script already being instantiated and ready to go.
All I had to do was to change the name of the function.
Reply | Threaded
Open this post in threaded view
|

Re: Extending a deployer script

frenchyan
Administrator
Interesting. Thanks for investigating. Do you think there is something I should do to prevent this from happening?

Thanks
Yan
Reply | Threaded
Open this post in threaded view
|

Re: Extending a deployer script

yoron
Can't think of anything, I should know my groovy better :-)


On Tue, Apr 22, 2014 at 8:06 PM, frenchyan [via glu] <[hidden email]> wrote:
Interesting. Thanks for investigating. Do you think there is something I should do to prevent this from happening?

Thanks
Yan



If you reply to this email, your message will be added to the discussion below:
http://glu.977617.n3.nabble.com/Extending-a-deployer-script-tp4026574p4026594.html
To start a new topic under glu, email [hidden email]
To unsubscribe from Extending a deployer script, click here.
NAML



--
Don't forget to brush your teeth,
Yotam Oron.

To infinity - and beyond!

The above terms reflect a potential business arrangement, are provided solely as a basis for further discussion, and are not intended to be and do not constitute a legally binding obligation. No legally binding obligations will be created, implied, or inferred until an agreement in final form is executed in writing by all parties involved.

This email and any attachments hereto may be confidential or privileged.  If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person. Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Extending a deployer script

lukestephenon
Similar to the issue I had with a method called 'getPid' being invoked when groovy was finding properties which could be a timer.
http://glu.977617.n3.nabble.com/Adding-a-server-monitor-causes-function-to-be-invoked-td4025417.html#a4025419