title: Dropbox V1 to V2 migration Error in Spring Web MVC Project
body: <p>As per <a href="https://www.dropbox.com/developers/documentation/java#tutorial" rel="nofollow">Dropbox API V2(<strong><em>dropbox-core-sdk-2.1.1.jar</em></strong>) tutorial</a>, I have been migrated in Java console application as shown in the following code.</p>
  
  <pre><code>import java.io.IOException;
  import com.dropbox.core.DbxException;
  import com.dropbox.core.DbxRequestConfig;
  import com.dropbox.core.v2.DbxClientV2;
  import com.dropbox.core.v2.files.ListFolderResult;
  import com.dropbox.core.v2.files.Metadata;
  
  public class Main {
      private static final String ACCESS_TOKEN = "xxxx-xxxx-xxxx";
  
      public static void main(String args[]) throws DbxException, IOException {
          DbxRequestConfig config = new DbxRequestConfig("");
          DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);
          try {
  
              ListFolderResult result = client.files().listFolder("");
              while (true) {
                  for (Metadata metadata : result.getEntries()) {
                      System.out.println(metadata.getPathLower());
                  }
  
                  if (!result.getHasMore()) {
                      break;
                  }
  
                  result = client.files().listFolderContinue(result.getCursor());
              }
          } catch (Exception er) {
              er.printStackTrace();
          }
  
      }
  
  }
  </code></pre>
  
  <p>Above code compiled and run perfectly. But the same code I have been implemented in the Spring web application. But it is not working, only thrown the following exception.</p>
  
  <pre><code>Aug 26, 2016 3:18:30 PM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/dropboxz] threw exception [Handler processing failed; nested exception is java.lang.ExceptionInInitializerError] with root cause
  java.lang.RuntimeException: Error loading version from resource "sdk-version.txt": Text doesn't follow expected pattern: "${project.version}"
      at com.dropbox.core.DbxSdkVersion.loadVersion(DbxSdkVersion.java:66)
      at com.dropbox.core.DbxSdkVersion.&lt;clinit&gt;(DbxSdkVersion.java:17)
      at com.dropbox.core.DbxRequestUtil.buildUserAgentHeader(DbxRequestUtil.java:144)
      at com.dropbox.core.DbxRequestUtil.addUserAgentHeader(DbxRequestUtil.java:129)
      at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:226)
      at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:100)
      at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:252)
      at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:97)
      at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:629)
      at com.dropbox.core.v2.files.DbxUserFilesRequests.listFolder(DbxUserFilesRequests.java:656)
      at com.doj.spring4.controller.HelloSpring4Controller.viewDropboxLoginScreen(HelloSpring4Controller.java:34)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:445)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:433)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:947)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:878)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:946)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:837)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:822)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Please give the solution.</p>