Deploy scripts failures under java 7

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

Deploy scripts failures under java 7

harel.eran
Hi Yan,

We stumbled into an issue with deployment scripts running under Java 7 - glu 4.7.x.

The problem pops up whenever shell.exec() fails. We get that funky exception in the log:

2013/06/12 06:05:11.683 ERROR [ShutdownProxy] public abstract boolean org.linkedin.glu.agent.api.Agent.waitForState(java.lang.Object) throws org.linkedin.glu.agent.api.AgentException
java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.Exception do not match. Expected 4 but got 5
        at groovy.lang.MetaClassImpl.selectConstructorAndTransformArguments(MetaClassImpl.java:1403)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.selectConstructorAndTransformArguments(ScriptBytecodeAdapter.java:237)
        at org.linkedin.glu.agent.api.AgentException.<init>(AgentException.groovy:38)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        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:52)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:202)
        at org.linkedin.glu.agent.impl.AgentImpl.handleException(AgentImpl.groovy:603)
        at org.linkedin.glu.agent.impl.AgentImpl.this$2$handleException(AgentImpl.groovy)
        at org.linkedin.glu.agent.impl.AgentImpl$this$2$handleException.callCurrent(Unknown Source)
...

I think the workaround you introduced to fix the Groovy under Java 7 issue does not apply to the deployment scripts.

Please advise.

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

Re: Deploy scripts failures under java 7

sodul
This is known issue (I was getting similar exceptions). Upgrading to Glu 5 will solve it since it is no longer compiled for Java 6 compatibility and workarounds are removed.
Reply | Threaded
Open this post in threaded view
|

Re: Deploy scripts failures under java 7

frenchyan
Administrator
In reply to this post by harel.eran
Can you confirm the exact version of the agent where you saw the issue? It should not happen with 4.7.2, but it will happen with 4.7.1. Please let me know.

Also since there is no code difference between 4.7.x (which is built with java 1.6) and 5.0.0 which is built directly with java 1.7, you should be able to upgrade all agents running glu 4.7.x under java 1.7 with glu 5.0.0

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Deploy scripts failures under java 7

harel.eran
We were still running 4.4.0 when we upgraded to Java 7, and got this.
We tried migrating to 4.7.2 but we still got it.
Will validate this again tomorrow, as we were doing this "under fire". Our Chef recipe may have been bogus.

We can't really use Glu 5 yet, because not all of our code and infrastructure can run under Java 7 yet...
Reply | Threaded
Open this post in threaded view
|

Re: Deploy scripts failures under java 7

frenchyan
Administrator
I really doubt that this issue can happen under 4.7.2. So yes if you can confirm when you get a chance that would be sweet. (note that you can check the version of an agent directly in the console by going to the page for this agent and clicking 'View Details')

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

Re: Deploy scripts failures under java 7

frenchyan
Administrator
In reply to this post by harel.eran
Also a quick check shows the following:

v4.4.0

v4.7.2:

or in other words your stack trace showing this:

at org.linkedin.glu.agent.impl.AgentImpl.handleException(AgentImpl.groovy:603)

was generated by v4.4.0 not v4.7.2

Yan

Reply | Threaded
Open this post in threaded view
|

Re: Deploy scripts failures under java 7

sodul
In reply to this post by harel.eran
We use Java 7 for Glu only and all our other apps are still on Java 6. When launching the Agents and console just  add the java 7 bin path in front of PATH and point JAVA_HOME to Java 7.

All our startup scripts are explicit about which Java to use so there is no conflict.
Reply | Threaded
Open this post in threaded view
|

Re: Deploy scripts failures under java 7

harel.eran
In reply to this post by frenchyan
It turns out that we were confused

4.7.2 works just fine.

Thanks Yan, and sorry for the wasted time.