0

Developing a Google App Engine app with Spring MVC, the following exception presents itself while running the dev server on OSX:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0':
Initialization of bean failed [...]    


nested exception is java.lang.NoClassDefFoundError:
java.time.format.FormatStyle is a restricted class. Please see the
Google  App Engine developer's guide for more details.

This error does not present itself if I upload my app to Google App Engine's cloud server.

How to get around it?

Matt
  • 45,022
  • 8
  • 78
  • 119
Matoe
  • 2,742
  • 6
  • 33
  • 52
  • Possible duplicate of [BeanCreationException throwed when trying to run my project](http://stackoverflow.com/questions/29543131/beancreationexception-throwed-when-trying-to-run-my-project) – Nayan May 03 '16 at 10:38

2 Answers2

6

Downgrading Java 1.8 to 1.7 fixed the issue.

Matoe
  • 2,742
  • 6
  • 33
  • 52
2

Well, that is not the answer most people would look for. Following is the solution to fix the problem.

use <runtime>java8</runtime> in appengine-web.xml

This will fix the problem. This doesn't require you to downgrade you java version from 1.8 to 1.7.

sabbir
  • 686
  • 1
  • 9
  • 15