Discussion:
java.lang.VerifyError: incompatible argument to function
Arun Thirupathi
2017-03-16 18:33:47 UTC
Permalink
I am using Guice injection (version 4.0) for a personal project.

On one of my private methods (this method has nothing to do with Guice
Injection, but consructor of this class uses Guice Injection) ,takes an
argument of type com.amazonaws.AmazonWebServiceResult
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/AmazonWebServiceResult.html>
<ResponseMetadata
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/ResponseMetadata.html>>
. The Caller passes in the object of type http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/model/QueryResult.html.
It compiles fine, but during unit testing, it fails with an error


java.lang.VerifyError: (class: <className> , method: <methodName> signature: (L<Param1Class>;L<Param2Class>;Lcom/amazonaws/services/dynamodbv2/model/QueryResult;)Z) Incompatible argument to function

at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getDeclaredConstructors(Class.java:1906)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:890)
at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:134)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)


Is this a known Guice issue ?

I tried moving this method to a new class (the new class does not have
Guice Injection), tried adding one more intermediate method as pass
through, but the error is still the same. But if the method parameter
remains Result, if I extract the fields from the result and pass it down to
another method it does not complain.

I was writing some generic code which could take in any result type and
prints out the information like request id. I have added lots of
duplication of code by defining one method per result type. Can someone
please help me here ?

Thanks,
Arun.
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Luke Sandberg
2017-03-16 18:59:37 UTC
Permalink
That is a verification error thrown by the java reflection apis. that
implies that there is something wrong with the class file (and it just
happens that guice is the first bit of code to notice). Most likely your
class file is simply corrupted
Post by Arun Thirupathi
I am using Guice injection (version 4.0) for a personal project.
On one of my private methods (this method has nothing to do with Guice
Injection, but consructor of this class uses Guice Injection) ,takes an
argument of type com.amazonaws.AmazonWebServiceResult
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/AmazonWebServiceResult.html>
<ResponseMetadata
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/ResponseMetadata.html>>
. The Caller passes in the object of type
http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/model/QueryResult.html.
It compiles fine, but during unit testing, it fails with an error
java.lang.VerifyError: (class: <className> , method: <methodName> signature: (L<Param1Class>;L<Param2Class>;Lcom/amazonaws/services/dynamodbv2/model/QueryResult;)Z) Incompatible argument to function
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getDeclaredConstructors(Class.java:1906)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:890)
at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:134)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
Is this a known Guice issue ?
I tried moving this method to a new class (the new class does not have
Guice Injection), tried adding one more intermediate method as pass
through, but the error is still the same. But if the method parameter
remains Result, if I extract the fields from the result and pass it down to
another method it does not complain.
I was writing some generic code which could take in any result type and
prints out the information like request id. I have added lots of
duplication of code by defining one method per result type. Can someone
please help me here ?
Thanks,
Arun.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/CAO9V1MJErAbWp0XbgUk1Mhf0rBfSBxGA_7xOhZH1YWVC_dGH9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Arun Thirupathi
2017-03-16 19:17:06 UTC
Permalink
Is there any way to verify ? Also what is corrupted, the class I have or
the amazon sdk jar ?

When I stop using the base class, it works well. Also other thing is I have
4 of these result types and I did a mix and match of the base class and it
breaks if I have one of them. So it is hard for me to believe that class
file is corrupted and this is not a Guice Issue.

I tried emptying the gradle cache, maven cache and rebuilding none of them
works.

Thanks,
Arun.
Post by Luke Sandberg
That is a verification error thrown by the java reflection apis. that
implies that there is something wrong with the class file (and it just
happens that guice is the first bit of code to notice). Most likely your
class file is simply corrupted
Post by Arun Thirupathi
I am using Guice injection (version 4.0) for a personal project.
On one of my private methods (this method has nothing to do with Guice
Injection, but consructor of this class uses Guice Injection) ,takes an
argument of type com.amazonaws.AmazonWebServiceResult
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/AmazonWebServiceResult.html>
<ResponseMetadata
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/ResponseMetadata.html>>
. The Caller passes in the object of type
http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/model/QueryResult.html.
It compiles fine, but during unit testing, it fails with an error
java.lang.VerifyError: (class: <className> , method: <methodName> signature: (L<Param1Class>;L<Param2Class>;Lcom/amazonaws/services/dynamodbv2/model/QueryResult;)Z) Incompatible argument to function
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getDeclaredConstructors(Class.java:1906)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:890)
at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:134)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
Is this a known Guice issue ?
I tried moving this method to a new class (the new class does not have
Guice Injection), tried adding one more intermediate method as pass
through, but the error is still the same. But if the method parameter
remains Result, if I extract the fields from the result and pass it down to
another method it does not complain.
I was writing some generic code which could take in any result type and
prints out the information like request id. I have added lots of
duplication of code by defining one method per result type. Can someone
please help me here ?
Thanks,
Arun.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/a272ee38-9418-426a-8338-5cf2a08cecf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Luke Sandberg
2017-03-16 19:18:09 UTC
Permalink
if you call 'getDeclaredConstructors()' on that class (instead of having
guice do it), does it work? that would rule out guice as the culprit
Post by Arun Thirupathi
Is there any way to verify ? Also what is corrupted, the class I have or
the amazon sdk jar ?
When I stop using the base class, it works well. Also other thing is I
have 4 of these result types and I did a mix and match of the base class
and it breaks if I have one of them. So it is hard for me to believe that
class file is corrupted and this is not a Guice Issue.
I tried emptying the gradle cache, maven cache and rebuilding none of them
works.
Thanks,
Arun.
That is a verification error thrown by the java reflection apis. that
implies that there is something wrong with the class file (and it just
happens that guice is the first bit of code to notice). Most likely your
class file is simply corrupted
I am using Guice injection (version 4.0) for a personal project.
On one of my private methods (this method has nothing to do with Guice
Injection, but consructor of this class uses Guice Injection) ,takes an
argument of type com.amazonaws.AmazonWebServiceResult
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/AmazonWebServiceResult.html>
<ResponseMetadata
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/ResponseMetadata.html>>
. The Caller passes in the object of type
http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/model/QueryResult.html.
It compiles fine, but during unit testing, it fails with an error
java.lang.VerifyError: (class: <className> , method: <methodName> signature: (L<Param1Class>;L<Param2Class>;Lcom/amazonaws/services/dynamodbv2/model/QueryResult;)Z) Incompatible argument to function
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getDeclaredConstructors(Class.java:1906)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:890)
at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:134)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
Is this a known Guice issue ?
I tried moving this method to a new class (the new class does not have
Guice Injection), tried adding one more intermediate method as pass
through, but the error is still the same. But if the method parameter
remains Result, if I extract the fields from the result and pass it down to
another method it does not complain.
I was writing some generic code which could take in any result type and
prints out the information like request id. I have added lots of
duplication of code by defining one method per result type. Can someone
please help me here ?
Thanks,
Arun.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/a272ee38-9418-426a-8338-5cf2a08cecf9%40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/a272ee38-9418-426a-8338-5cf2a08cecf9%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/CAO9V1ML1ESY__VUV%3DFYuvO-1ZZapkQrD%3D12TBBfKiSYracz%2BfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Arunachalam
2017-03-16 19:29:50 UTC
Permalink
Note that tests are failing. My test uses Mockito and PowerMock a lot, so
could that be an issue ?

Let me prepend the call with getDeclardConstructors before guice injection
and see if any of them fails and update this thread.

Thanks,
Arun.
Post by Luke Sandberg
if you call 'getDeclaredConstructors()' on that class (instead of having
guice do it), does it work? that would rule out guice as the culprit
Post by Arun Thirupathi
Is there any way to verify ? Also what is corrupted, the class I have or
the amazon sdk jar ?
When I stop using the base class, it works well. Also other thing is I
have 4 of these result types and I did a mix and match of the base class
and it breaks if I have one of them. So it is hard for me to believe that
class file is corrupted and this is not a Guice Issue.
I tried emptying the gradle cache, maven cache and rebuilding none of
them works.
Thanks,
Arun.
That is a verification error thrown by the java reflection apis. that
implies that there is something wrong with the class file (and it just
happens that guice is the first bit of code to notice). Most likely your
class file is simply corrupted
I am using Guice injection (version 4.0) for a personal project.
On one of my private methods (this method has nothing to do with Guice
Injection, but consructor of this class uses Guice Injection) ,takes an
argument of type com.amazonaws.AmazonWebServiceResult
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/AmazonWebServiceResult.html>
<ResponseMetadata
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/ResponseMetadata.html>>
. The Caller passes in the object of type http://docs.aws.amazon.
com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/
dynamodbv2/model/QueryResult.html. It compiles fine, but during unit
testing, it fails with an error
java.lang.VerifyError: (class: <className> , method: <methodName> signature: (L<Param1Class>;L<Param2Class>;Lcom/amazonaws/services/dynamodbv2/model/QueryResult;)Z) Incompatible argument to function
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getDeclaredConstructors(Class.java:1906)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:890)
at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:134)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
Is this a known Guice issue ?
I tried moving this method to a new class (the new class does not have
Guice Injection), tried adding one more intermediate method as pass
through, but the error is still the same. But if the method parameter
remains Result, if I extract the fields from the result and pass it down to
another method it does not complain.
I was writing some generic code which could take in any result type and
prints out the information like request id. I have added lots of
duplication of code by defining one method per result type. Can someone
please help me here ?
Thanks,
Arun.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/
msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%
40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/
msgid/google-guice/a272ee38-9418-426a-8338-5cf2a08cecf9%
40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/a272ee38-9418-426a-8338-5cf2a08cecf9%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "google-guice" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/google-guice/jsf0vJfmBro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/
msgid/google-guice/CAO9V1ML1ESY__VUV%3DFYuvO-1ZZapkQrD%3D12TBBfKiSYracz%
2BfA%40mail.gmail.com
<https://groups.google.com/d/msgid/google-guice/CAO9V1ML1ESY__VUV%3DFYuvO-1ZZapkQrD%3D12TBBfKiSYracz%2BfA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/CAA5E3DWRLFuMZ8MwCGwEXPx_RdzrROuO4YMtf24vn6sVBhPhyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Arunachalam
2017-03-16 20:22:42 UTC
Permalink
Luke you are right. The reason I believe is this.

http://stackoverflow.com/questions/4869083/java-lang-verifyerror-incompatible-argument-to-function

Thanks for the help.

Thanks,
Arun.
Post by Arunachalam
Note that tests are failing. My test uses Mockito and PowerMock a lot, so
could that be an issue ?
Let me prepend the call with getDeclardConstructors before guice injection
and see if any of them fails and update this thread.
Thanks,
Arun.
Post by Luke Sandberg
if you call 'getDeclaredConstructors()' on that class (instead of having
guice do it), does it work? that would rule out guice as the culprit
Post by Arun Thirupathi
Is there any way to verify ? Also what is corrupted, the class I have or
the amazon sdk jar ?
When I stop using the base class, it works well. Also other thing is I
have 4 of these result types and I did a mix and match of the base class
and it breaks if I have one of them. So it is hard for me to believe that
class file is corrupted and this is not a Guice Issue.
I tried emptying the gradle cache, maven cache and rebuilding none of
them works.
Thanks,
Arun.
That is a verification error thrown by the java reflection apis. that
implies that there is something wrong with the class file (and it just
happens that guice is the first bit of code to notice). Most likely your
class file is simply corrupted
I am using Guice injection (version 4.0) for a personal project.
On one of my private methods (this method has nothing to do with Guice
Injection, but consructor of this class uses Guice Injection) ,takes an
argument of type com.amazonaws.AmazonWebServiceResult
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/AmazonWebServiceResult.html>
<ResponseMetadata
<http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/ResponseMetadata.html>>
. The Caller passes in the object of type http://docs.aws.amazon.co
m/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv
2/model/QueryResult.html. It compiles fine, but during unit testing, it
fails with an error
java.lang.VerifyError: (class: <className> , method: <methodName> signature: (L<Param1Class>;L<Param2Class>;Lcom/amazonaws/services/dynamodbv2/model/QueryResult;)Z) Incompatible argument to function
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getDeclaredConstructors(Class.java:1906)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:890)
at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:134)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
Is this a known Guice issue ?
I tried moving this method to a new class (the new class does not have
Guice Injection), tried adding one more intermediate method as pass
through, but the error is still the same. But if the method parameter
remains Result, if I extract the fields from the result and pass it down to
another method it does not complain.
I was writing some generic code which could take in any result type and
prints out the information like request id. I have added lots of
duplication of code by defining one method per result type. Can someone
please help me here ?
Thanks,
Arun.
--
You received this message because you are subscribed to the Google
Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/47241614-1812-4e4b-a9a3-058a4cca7a9a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/google-guice/a272ee38-9418-426a-8338-5cf2a08cecf9%40googlegroups.com
<https://groups.google.com/d/msgid/google-guice/a272ee38-9418-426a-8338-5cf2a08cecf9%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "google-guice" group.
To unsubscribe from this topic, visit https://groups.google.com/d/to
pic/google-guice/jsf0vJfmBro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/google-guice/CAO9V1ML1ESY__VUV%3DFYuvO-1ZZapkQrD%
3D12TBBfKiSYracz%2BfA%40mail.gmail.com
<https://groups.google.com/d/msgid/google-guice/CAO9V1ML1ESY__VUV%3DFYuvO-1ZZapkQrD%3D12TBBfKiSYracz%2BfA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/CAA5E3DUvUmbvMjm_OaUXGdyQVYD8pa-m35xq1qkkdp%3D7Bwzkhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Search results for 'java.lang.VerifyError: incompatible argument to function' (Questions and Answers)
3
replies
Minecraft: I can't install mods?
started 2012-09-02 08:14:24 UTC
video & online games
Loading...