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. On Thu, Mar 16, 2017 at 12:29 PM, Arunachalam <[email protected]> wrote: > 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. > > On Thu, Mar 16, 2017 at 12:18 PM, Luke Sandberg <[email protected]> > wrote: > >> if you call 'getDeclaredConstructors()' on that class (instead of having >> guice do it), does it work? that would rule out guice as the culprit >> >> On Thu, Mar 16, 2017 at 12:17 PM Arun Thirupathi <[email protected]> >> wrote: >> >>> 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. >>> >>> On Thursday, March 16, 2017 at 11:59:50 AM UTC-7, Luke Sandberg wrote: >>> >>> 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 >>> >>> On Thu, Mar 16, 2017 at 11:33 AM Arun Thirupathi <[email protected]> >>> wrote: >>> >>> 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 >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> >>> >>> 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 >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> 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 >> [email protected]. >> To post to this group, send email to [email protected]. >> 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 [email protected]. To post to this group, send email to [email protected]. 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.
