Getting a "java.lang.VerifyError: Cannot inherit from final class" when running in Tomcat

3,615 views
Skip to first unread message

Oliver

unread,
Sep 21, 2012, 6:50:20 AM9/21/12
to adwor...@googlegroups.com
I'm hoping someone with better Java knowledge than ours can help us with this one.

Our code works fine when running standalone.  But when we run in Tomcat, this line:

String clientLoginToken = new ClientLoginTokens.Builder().forApi(ClientLoginTokens.Api.ADWORDS).from(mapConfiguration).build().requestToken();

is throwing this error:

java.lang.VerifyError: Cannot inherit from final class
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        at com.google.api.ads.common.lib.auth.ClientLoginTokens$Builder.<init>(ClientLoginTokens.java:567)


Any ideas what is going on?

Oliver




Oliver

unread,
Sep 24, 2012, 8:19:22 AM9/24/12
to adwor...@googlegroups.com
We managed to narrow down the error to this jar file google-api-client-http-1.2.3-alpha.jar  which uses some classes that are not of the same version as other API jar files in the classpath.  We excluded this jar from our build and our code continued to work as before.  I was wondering what this jar file actually does and if it's ok to exclude it going forward?

By the way, another jar file (google-api-client-util-1.2.3-alpha.jar) had a dependency on the above and we excluded it too.  The code still works as before.

I'm surprised other Tomcat users have not come across this as the adwords Java client library would not deploy on Tomcat without the above workaround.

It would be great if the one who maintains this library shed some light.

Many thanks

Oliver

David Torres

unread,
Sep 28, 2012, 5:33:06 PM9/28/12
to adwor...@googlegroups.com
Hi Oliver,

Do you mind filing a bug in the library issue tracker, you'll get a quick response from the lib maintainers.

Best,

-David Torres - AdWords API Team
Reply all
Reply to author
Forward
0 new messages