title: GoogleAuthorizationCodeTokenRequest Error with tomcat + spring
body: <p>I have this error when i start tomcat</p>
  
  <pre><code>2013-09-26 10:27:24,616  INFO [localhost-startStop-1] UrlRewriteFilter.(Log.java:227) - loaded (conf ok)
  2013-09-26 10:27:24,657 DEBUG [localhost-startStop-1] LocaleFilter.(GenericFilterBean.java:172) - Initializing filter 'localeFilter'
  2013-09-26 10:27:24,657 DEBUG [localhost-startStop-1] LocaleFilter.(GenericFilterBean.java:197) - Filter 'localeFilter' configured successfully
  2013-09-26 10:27:24,693 DEBUG [localhost-startStop-1] SessionFilter.(GenericFilterBean.java:172) - Initializing filter 'sessionFilter'
  2013-09-26 10:27:24,694 DEBUG [localhost-startStop-1] SessionFilter.(GenericFilterBean.java:197) - Filter 'sessionFilter' configured successfully
  2013-09-26 10:27:24,728  INFO [localhost-startStop-1] ResponseOverrideFilter.(ResponseOverrideFilter.java:108) - Filter initialized. Response buffering is enabled
  2013-09-25 19:13:15,856 ERROR [localhost-startStop-1] DispatcherServlet (FrameworkServlet.java:468) - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping': Initialization of bean failed; nested exception is java.lang.VerifyError: Cannot inherit from final class
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:532)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:289)
  at org.springframework.web.servlet.DispatcherServlet.createDefaultStrategy(DispatcherServlet.java:810)
  at org.springframework.web.servlet.DispatcherServlet.getDefaultStrategies(DispatcherServlet.java:779)
  at org.springframework.web.servlet.DispatcherServlet.initHandlerMappings(DispatcherServlet.java:549)
  at org.springframework.web.servlet.DispatcherServlet.initStrategies(DispatcherServlet.java:443)
  at org.springframework.web.servlet.DispatcherServlet.onRefresh(DispatcherServlet.java:432)
  at org.springframework.web.servlet.FrameworkServlet.onApplicationEvent(FrameworkServlet.java:773)
  at org.springframework.web.servlet.FrameworkServlet$ContextRefreshListener.onApplicationEvent(FrameworkServlet.java:1063)
  at org.springframework.web.servlet.FrameworkServlet$ContextRefreshListener.onApplicationEvent(FrameworkServlet.java:1060)
  at org.springframework.context.event.GenericApplicationListenerAdapter.onApplicationEvent(GenericApplicationListenerAdapter.java:51)
  
  Caused by: 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:2888)
  at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1172)
  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
  at java.lang.Class.getDeclaredMethods0(Native Method)
  at java.lang.Class.privateGetDeclaredMethods(Class.java:2436)
  at java.lang.Class.getDeclaredMethods(Class.java:1793)
  </code></pre>
  
  <p>I found out that the error comes from this code</p>
  
  <pre><code>String code = request.getReader().toString();
  GoogleTokenResponse tokenResponse = new GoogleAuthorizationCodeTokenRequest(TRANSPORT,
                  JSON_FACTORY, CLIENT_ID, CLIENT_SECRET, code,"postmessage").execute();
  </code></pre>
  
  <p>this code is inside a function call with request spring </p>
  
  <p>UPDATE
  When i comment this code part, the error doesn't occur and the application work fine.
  I think something that causes conflict between the call at the google API and spring.</p>
  
  <p>SOLVED</p>
  
  <p>I solve this problem, i have inizialized GoogleTokenResponse before assign them a value of GoogleAuthorizzationCodeTokenRequest.execute and the error has disappeared.</p>