Verify error

43 views
Skip to first unread message

Glen Stampoultzis

unread,
Oct 25, 2007, 2:47:36 AM10/25/07
to google-guice
Hello guicers.

I've run into a problem that has me scratching my head. On my local
machine my application is working fine but when I deploy to Unix I get
the following error. The jdk versions are:

Windows: 1.6.0_01
Unix: 1.6.0-b105

Any ideas?

java.lang.AssertionError: java.lang.VerifyError: (class: com/sensis/
ems/core/json/PrintHandler$$FastClassByGuice$$3ad0a517, method: invoke
signature: (ILjava
/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;) Inconsistent
stack height 1 != 2
at
com.google.inject.InjectorImpl.getImplicitBinding(InjectorImpl.java:
984)
at
com.google.inject.InjectorImpl.getInternalFactory(InjectorImpl.java:
308)
at
com.google.inject.InjectorImpl.getProvider(InjectorImpl.java:693)
at
com.google.inject.InjectorImpl.getProvider(InjectorImpl.java:689)
at
com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:728)
at com.sensis.ems.core.json.JSONServlet.doGet(JSONServlet.java:
59)
at
com.sensis.ems.core.json.JSONServlet.doPost(JSONServlet.java:25)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
com.sensis.ems.common.RequestCleanupFilter.doFilter(RequestCleanupFilter.java:
20)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:46)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
107)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
541)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
869)
at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
80)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.VerifyError: (class: com/sensis/ems/core/json/
PrintHandler$$FastClassByGuice$$3ad0a517, method: invoke signature:
(ILjava/lang/Object;[L
java/lang/Object;)Ljava/lang/Object;) Inconsistent stack height 1 != 2
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:
2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at
com.google.inject.cglib.core.ReflectUtils.getConstructor(ReflectUtils.java:
244)
at
com.google.inject.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:
220)
at com.google.inject.cglib.reflect.FastClass
$Generator.firstInstance(FastClass.java:76)
at
com.google.inject.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:
231)
at com.google.inject.cglib.reflect.FastClass
$Generator.create(FastClass.java:64)
at
com.google.inject.util.GuiceFastClass.create(GuiceFastClass.java:38)
at
com.google.inject.util.GuiceFastClass.create(GuiceFastClass.java:30)
at
com.google.inject.DefaultConstructionProxyFactory.get(DefaultConstructionProxyFactory.java:
59)
at
com.google.inject.ProxyFactory.createConstructionProxy(ProxyFactory.java:
92)
at com.google.inject.ProxyFactory$1.create(ProxyFactory.java:
57)
at com.google.inject.ProxyFactory$1.create(ProxyFactory.java:
56)
at
com.google.inject.util.ReferenceCache.create(ReferenceCache.java:53)
at
com.google.inject.util.AbstractReferenceCache.internalCreate(AbstractReferenceCache.java:
59)
at
com.google.inject.util.AbstractReferenceCache.get(AbstractReferenceCache.java:
116)
at com.google.inject.ProxyFactory.get(ProxyFactory.java:204)
at
com.google.inject.ConstructorInjector.<init>(ConstructorInjector.java:
41)
at com.google.inject.InjectorImpl$7.create(InjectorImpl.java:
601)
at com.google.inject.InjectorImpl$7.create(InjectorImpl.java:
594)
at
com.google.inject.util.ReferenceCache.create(ReferenceCache.java:53)
at
com.google.inject.util.AbstractReferenceCache.internalCreate(AbstractReferenceCache.java:
59)
at
com.google.inject.util.AbstractReferenceCache.get(AbstractReferenceCache.java:
116)
at
com.google.inject.InjectorImpl.getConstructor(InjectorImpl.java:765)
at
com.google.inject.InjectorImpl.getImplicitBinding(InjectorImpl.java:
973)
... 29 more

Dhanji R. Prasanna

unread,
Oct 25, 2007, 2:56:53 AM10/25/07
to google...@googlegroups.com
Have you tried compiling the deployment binary on our unix env?

Glen Stampoultzis

unread,
Oct 25, 2007, 3:00:14 AM10/25/07
to google-guice
On Oct 25, 4:56 pm, "Dhanji R. Prasanna" <dha...@gmail.com> wrote:
> Have you tried compiling the deployment binary on our unix env?

No as I'd have a bit of setup to do to get that all sorted out. The
bytecode should really be any different I wouldn't have thought. I'll
give it a shot though.


Dhanji R. Prasanna

unread,
Oct 25, 2007, 3:01:33 AM10/25/07
to google...@googlegroups.com
our = your

Glen Stampoultzis

unread,
Oct 25, 2007, 11:31:56 PM10/25/07
to google-guice
I've found what was triggering the problem. There was an inner class
defined in the class that triggered the error. Once refactored that
into an independent class guice stopped producing the error.

Dhanji R. Prasanna

unread,
Oct 26, 2007, 12:59:43 AM10/26/07
to google...@googlegroups.com
was it an parent-referent inner class or a static nested class?
if the former you could probably fix it as follows:

public class WrappingParent {
public static class MyNestedNotInnerClass {

}
}

I believe this came up some time ago as well, I can't remember if the
problem was fixed (inner classes objects have a default reference to
an instance of the enclosing class).

Static nested classes are on the same level as top-level classes, only
namespaced differently.

Dhanji.

Glen Stampoultzis

unread,
Oct 26, 2007, 2:23:13 AM10/26/07
to google-guice
It was a parent-referent inner class. It wasn't too hard to refactor
out into a separate class.

Glen Stampoultzis

unread,
Nov 25, 2007, 5:48:24 PM11/25/07
to google-guice
I'm now getting this error in a class that contains no inner classes.
I like guice but this is a big problem for me.

Brian Slesinsky

unread,
Nov 25, 2007, 6:21:12 PM11/25/07
to google...@googlegroups.com
Do you have a reproducable test case that you could share?

Glen Stampoultzis

unread,
Nov 25, 2007, 6:27:28 PM11/25/07
to google...@googlegroups.com
I'll try and see if I can come up with something. I face two
problems. The first is that it is not obvious what is triggering the
problem. The second is that it doesn't happen on the JDK on my dev
box.

Brian Slesinsky

unread,
Nov 25, 2007, 6:55:22 PM11/25/07
to google...@googlegroups.com
Perhaps switching JVM's would help. Also, I'm not sure whether
bytecode verification happens the same way for a file loaded from
local disk...

Bytecode verification has changed in Java 6.

Glen Stampoultzis

unread,
Nov 25, 2007, 7:18:11 PM11/25/07
to google-guice
I've considered it but can be a little hard getting JDK's changed in
the production environment.

On Nov 26, 10:55 am, "Brian Slesinsky" <bslesin...@gmail.com> wrote:
> Perhaps switching JVM's would help. Also, I'm not sure whether
> bytecode verification happens the same way for a file loaded from
> local disk...
>
> Bytecode verification has changed in Java 6.
>
> On Nov 25, 2007 3:27 PM, Glen Stampoultzis <gst...@gmail.com> wrote:
>
>
>
> > I'll try and see if I can come up with something. I face two
> > problems. The first is that it is not obvious what is triggering the
> > problem. The second is that it doesn't happen on the JDK on my dev
> > box.
>
> ...
>
> read more >>

Brian Slesinsky

unread,
Nov 25, 2007, 7:27:57 PM11/25/07
to google...@googlegroups.com
Sure, but if you run the production VM in development, at least you
could reproduce the problem...

Glen Stampoultzis

unread,
Nov 25, 2007, 7:39:37 PM11/25/07
to google...@googlegroups.com
If differences are pretty minor. build 1.6.0_01-b06 vs build
1.6.0-b105. I'll try anyway.

One interesting thing I've noticed is that guice the source code in
subversion compiles under jdk 1.5 but not under jdk 1.6. Under 1.6 I
get the following error:

D:\projects\guice-head>ant
Buildfile: build.xml
compile:
[javac] Compiling 97 source files to D:\projects\guice-head\build\classes
[javac] D:\projects\guice-head\src\com\google\inject\InjectorImpl.java:394:
reference to visit is ambiguous, both method
visit(com.google.inject.spi.ConstantBinding<? extends T>) in
com.google.inject.spi.BindingVisitor<capture#952 of ?
super T> and method
visit(com.google.inject.spi.ConvertedConstantBinding<? extends T>) in
com.google.inject.spi.BindingVisitor<capture#952 of ? super T> match
[javac] bindingVisitor.visit(this);
[javac] ^
[javac] 1 error
BUILD FAILED
D:\projects\guice-head\common.xml:15: Compile failed; see the compiler
error output for details.


Not sure what to make of "<capture#952 of ?super T>".


On 26/11/2007, Brian Slesinsky <bsles...@gmail.com> wrote:
>

Bob Lee

unread,
Nov 25, 2007, 7:50:43 PM11/25/07
to google...@googlegroups.com
On Nov 25, 2007 4:39 PM, Glen Stampoultzis <gst...@gmail.com> wrote:
> One interesting thing I've noticed is that guice the source code in
> subversion compiles under jdk 1.5 but not under jdk 1.6.  Under 1.6 I
> get the following error:

That's the latest code, not 1.0.

Set the cglib.debugLocation system property, and cglib will write the generated classes to disk so we can debug them: http://cglib.sourceforge.net/howto.html

Bob

Glen Stampoultzis

unread,
Nov 25, 2007, 8:42:44 PM11/25/07
to google-guice
> Set the cglib.debugLocation system property, and cglib will write the
> generated classes to disk so we can debug them:http://cglib.sourceforge.net/howto.html
>
> Bob

Thanks. I've attached the relevant cglib file to issue 168.

http://code.google.com/p/google-guice/issues/detail?id=168&can=4
Reply all
Reply to author
Forward
0 new messages