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?
Well, that is not the answer most people would look for. Following is the solution to fix the problem.
use
<runtime>java8</runtime>
inappengine-web.xml
This will fix the problem. This doesn't require you to downgrade you java version from 1.8 to 1.7.
Downgrading Java 1.8 to 1.7 fixed the issue.