In this Spring Mobile tutorial we will discuss about how to spring work into web environment to detecting device.
Table of Contents
- Introduction
- Maven Dependency
- Device Module
- Device Resolution Classes
- DeviceResolver
- Device
- DeviceResolverHandlerInterceptor
- DeviceResolverRequestFilter
- DeviceHandlerMethodArgumentResolver
- Site Preference Management
- SitePreferenceHandler
- SitePreference
- SitePreferenceHandlerInterceptor
- SitePreferenceRepository
- Site Switching
- Device Aware View Management
- Enabling Device Aware Views
- Fallback View Resolution
- Sample Example for Spring Mobile Overview
- Summary
1. Introduction
Spring community provide another project Spring Mobile as an extensions to Spring MVC for developing mobile web applications. This module provide the server side device detection and provide site preferences to open website according to device resolution.
2. Maven Dependency
For getting this project following is maven dependency to be added to pom file.
<dependency> <groupId>org.springframework.mobile</groupId> <artifactId>spring-mobile-device</artifactId> <version>${org.springframework.mobile-version}</version> </dependency>
3. Device Module
Spring Mobile provide extension to Spring MVC for device detection. It is useful when any request by mobile deices need to handled differently from requests made by desktop browsers. This supported provided by Spring Module with the help of Device Resolver in the framework. Let see how device resolver works.
4. Device Resolution Framework
This device resolution module is a framework which has collection of interfaces, filters, handler classes and enum to working as device resolver. Lets have look following classes in this module.
4.1 DeviceResolver interface
In Spring Mobile, the DeviceResolver interface defines the API for device resolution:
public interface DeviceResolver { Device resolveDevice(HttpServletRequest request); }
This interface’s method return the Device interface object as below
4.2 Device interface
public interface Device { boolean isNormal(); boolean isMobile(); boolean isTablet(); DevicePlatform getDevicePlatform(); }
Device resolution is nothing but it is the simple process of introspecting an HTTP request to determine the device that originated the request by analyzing the User-Agent header and other request headers.
In Spring MVC, web applications perform device resolution at the beginning before any request handler is invoked. Then by the help of Device resolver implementation request handlers can obtain the Device instance and by using of it request served differently as desktop request.
Spring Mobile provides by default implementation of DeviceResolver is LiteDeviceResolver. It is used for device resolution. You may plug-in another DeviceResolver implementation by injecting a constructor argument. For activating device resolver Spring Mobile provides an interceptor so initially we have register this interceptor as below.
4.3 DeviceResolverHandlerInterceptor interceptor
XML Configuration
<interceptors> <!-- On pre-handle, resolve the device that originated the web request --> <bean class="org.springframework.mobile.device.DeviceResolverHandlerInterceptor" /> </interceptors>
Java Configuration
@Bean public DeviceResolverHandlerInterceptor deviceResolverHandlerInterceptor() { return new DeviceResolverHandlerInterceptor(); } @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(deviceResolverHandlerInterceptor()); }
Alternative to the DeviceResolverHandlerInterceptor, Spring Mobile also provides one servlet filter for support to the device resolver. Configured as below
4.4 DeviceResolverRequestFilter filter
To enable, add the DeviceResolverRequestFilter to your web.xml:
<filter> <filter-name>deviceResolverRequestFilter</filter-name> <filter-class>org.springframework.mobile.device.DeviceResolverRequestFilter</filter-class> </filter>
4.5 DeviceHandlerMethodArgumentResolver
Find the Current Device
There is an Untility class in the Spring Mobile to fetching current device to generate the request.
Device currentDevice = DeviceUtils.getCurrentDevice(servletRequest);
If you’d like to pass the current Device as an argument to one of your @Controller methods, configure a DeviceWebArgumentResolver:
<annotation-driven> <argument-resolvers> <bean class="org.springframework.mobile.device.DeviceWebArgumentResolver" /> </argument-resolvers> </annotation-driven>
You can alternatively configure a DeviceHandlerMethodArgumentResolver using Java-based configuration:
@Bean public DeviceHandlerMethodArgumentResolver deviceHandlerMethodArgumentResolver() { return new DeviceHandlerMethodArgumentResolver(); } @Override public void addArgumentResolvers(List argumentResolvers) { argumentResolvers.add(deviceHandlerMethodArgumentResolver()); }
You can then inject the Device into your @Controllers as shown below:
@Controller public class HomeController { private static final Logger logger = LoggerFactory.getLogger(HomeController.class); @RequestMapping("/") public void home(Device device) { if (device.isMobile()) { logger.info("Hello mobile user!"); } else if (device.isTablet()) { logger.info("Hello tablet user!"); } else { logger.info("Hello desktop user!"); } } }
5. Site Preference Management
This feature called site preference management allows user to set preference (SitePreference) to view a particular site in either “normal”, “mobile” or “tablet” mode from a particular device. After device resolution we have to decide site preference either open mobile site or desktop or tablet site.
5.1 SitePreferenceHandler
Following interface provided by the Spring Mobile.
public interface SitePreferenceHandler { final String CURRENT_SITE_PREFERENCE_ATTRIBUTE = "currentSitePreference"; SitePreference handleSitePreference(HttpServletRequest request, HttpServletResponse response); }
Above interface has one method handleSitePreference with request and response parameters to decide SitePreference, it is actually an enum.
5.2 SitePreference enum
public enum SitePreference { //... }
To selecting site preference as below
Site: <a href=”${currentUrl}?site_preference=normal”>Normal</a> |
<a href=”${currentUrl}?site_preference=mobile”>Mobile</a>
Spring Mobile provides handler for SitePreference is SitePreferenceHandler, it’s implementation is StandardSitePreferenceHandler.
5.3 SitePreferenceHandlerInterceptor
To enable SitePreference management before requests are processed, add the SitePreferenceHandlerInterceptor to your DispatcherServlet configuration:
<interceptors> <!-- On pre-handle, manage the user's site preference (declare after DeviceResolverHandlerInterceptor) --> <bean class="org.springframework.mobile.device.site.SitePreferenceHandlerInterceptor" /> </interceptors>
Java-based configuration is also available:
@Bean public SitePreferenceHandlerInterceptor sitePreferenceHandlerInterceptor() { return new SitePreferenceHandlerInterceptor(); } @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(sitePreferenceHandlerInterceptor()); }
5.4 Site Preference Storage
‘CookieSitePreferenceRepository’ (default implementation of SitePreferenceRepository) stores the user’s preference in client side cookie so that it can be used for the future requests made by that user.
For getting current site preference Spring Mobile provides utility class SitePreferenceUtils, it give current site preference instance as below.
SitePreference sitePreference = SitePreferenceUtils.getCurrentSitePreference(servletRequest);
You could pass this site preference as argument with following configuration.
To configure a SitePreferenceWebArgumentResolver:
<annotation-driven> <argument-resolvers> <bean class="org.springframework.mobile.device.site.SitePreferenceWebArgumentResolver" /> </argument-resolvers> </annotation-driven>
Java-based configuration is also available:
@Bean public SitePreferenceHandlerMethodArgumentResolver sitePreferenceHandlerMethodArgumentResolver() { return new SitePreferenceHandlerMethodArgumentResolver(); } @Override public void addArgumentResolvers(List argumentResolvers) { argumentResolvers.add(sitePreferenceHandlerMethodArgumentResolver()); }
You can then inject the indicated SitePreference into your @Controller as shown below:
@Controller public class HomeController { @RequestMapping("/") public String home(SitePreference sitePreference, Model model) { if (sitePreference == SitePreference.NORMAL) { logger.info("Site preference is normal"); return "home"; } else if (sitePreference == SitePreference.MOBILE) { logger.info("Site preference is mobile"); return "home-mobile"; } else if (sitePreference == SitePreference.TABLET) { logger.info("Site preference is tablet"); return "home-tablet"; } else { logger.info("no site preference"); return "home"; } } }
6. Site Switching
Spring mobile also provides different types of site switchers (like mDot, dotMobi and urlPath SiteSwitcher) which automatically redirect users to the device specific site based on the device generating the request and site preference set by the user.
SiteSwitcherHandlerInterceptor redirect users to device specific site. There are different types of site switchers available like mDot, dotMobi and urlPath SiteSwitcher. Bute here we have used urlPath SiteSwitcher which redirects users to different paths within the application based on the device and site preference.
<interceptors> <!-- On pre-handle, resolve the device that originated the web request --> <bean class="org.springframework.mobile.device.DeviceResolverHandlerInterceptor" /> <!-- On pre-handle, redirects mobile users to "m.myapp.com" (declare after DeviceResolverHandlerInterceptor) --> <bean class="org.springframework.mobile.device.switcher.SiteSwitcherHandlerInterceptor" factory-method="mDot"> <constructor-arg index="0" type="java.lang.String" value="myapp.com"/> </bean> </interceptors>
Java-based configuration is also available:
@Bean public DeviceResolverHandlerInterceptor deviceResolverHandlerInterceptor() { return new DeviceResolverHandlerInterceptor(); } @Bean public SiteSwitcherHandlerInterceptor siteSwitcherHandlerInterceptor() { return SiteSwitcherHandlerInterceptor.mDot("myapp.com", true); } @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(deviceResolverHandlerInterceptor()); registry.addInterceptor(siteSwitcherHandlerInterceptor()); }
7. Device Aware View Management
ViewResolver provides a mapping between logical view name and actual view. Here we have used device aware view resolver (‘LiteDeviceDelegatingViewResolver’) that delegates to InternalResourceViewResolver allowing for resolution of device specific view names by adjusting view name by adding prefix (say ‘m/’ and ‘t/’ for mobile and tablet) or suffix without the need for defining separate mapping for each device specific view.
7.1 Enabling Device Aware Views
XML configuration:
<bean class="org.springframework.mobile.device.view.LiteDeviceDelegatingViewResolver"> <constructor-arg> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/views/" /> <property name="suffix" value=".jsp" /> </bean> </constructor-arg> <property name="mobilePrefix" value="mobile/" /> <property name="tabletPrefix" value="tablet/" /> </bean>
Java-based configuration:
@Bean public LiteDeviceDelegatingViewResolver liteDeviceAwareViewResolver() { InternalResourceViewResolver delegate = new InternalResourceViewResolver(); delegate.setPrefix("/WEB-INF/views/"); delegate.setSuffix(".jsp"); LiteDeviceDelegatingViewResolver resolver = new LiteDeviceDelegatingViewResolver(delegate); resolver.setMobilePrefix("mobile/"); resolver.setTabletPrefix("tablet/"); return resolver; }
7.2 Fallback View Resolution
There may be cases where device specific views for a particular page may not be available. There Fallback resolution (‘enableFallback’) comes into picture. If adjusted view name can not be resolved then original view is used by the ViewResolver.
XML configuration:
<bean class="org.springframework.mobile.device.view.LiteDeviceDelegatingViewResolver"> ... <property name="enableFallback" value="true" /> ... </bean>
Java-based configuration:
@Bean public LiteDeviceDelegatingViewResolver liteDeviceAwareViewResolver() { ... resolver.setEnableFallback(true); ... return resolver; }
8. Sample Example for Spring Mobile Overview
In this section we discuss a sample web application with using Spring Mobile to detect device and accordingly rendering the views.
Source Code of Sample Application
You could find source code this application from GitHub.
9. Summary
In this article we have seen two different module to detecting compatible site to the device one is Device Resolution and another is SitePreference by these we could resolve device aware views. And also add one sample application for Spring Mobile.
- Spring MVC Web Tutorial
- Spring MVC Interview Questions
- MVC Design Pattern
- Spring MVC DispatcherServlet
- Spring MVC WebApplicationContext and Root Application Context
- Spring MVC @Controller Annotation
- Spring MVC @RequestMapping Annotation
- Spring MVC @RequestParam Annotation
- Spring MVC ContextLoaderListener
- Spring MVC @RequestParam and @PathVariable annotations
- Spring MVC Hello World Example
- Spring MVC Exception Handling Example
- Spring MVC with Hibernate CRUD Example
- Spring MVC Tiles Plugin with Example
- Spring MVC Interceptor with example
- Spring MVC with MongoDB CRUD Example
- Spring MVC Internationalization & Localization with Example
Apr 05, 2018 11:00:07 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:trainingstorefront’ did not find a matching property.
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.68
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Feb 8 2016 20:25:54 UTC
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.68.0
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_144
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_144-b01
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: V:\newproject\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: V:\technology\tomcat\apache-tomcat-7.0.68
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=V:\newproject\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=V:\technology\tomcat\apache-tomcat-7.0.68
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=V:\newproject\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=V:\technology\tomcat\apache-tomcat-7.0.68\endorsed
Apr 05, 2018 11:00:07 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Apr 05, 2018 11:00:07 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_144\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_144/bin/server;C:/Program Files/Java/jre1.8.0_144/bin;C:/Program Files/Java/jre1.8.0_144/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\Program Files\Broadcom\Broadcom 802.11;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Hewlett-Packard\SimplePass\;C:\Program Files\Git\cmd;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\Program Files (x86)\Git\cmd;C:\Program Files\nodejs\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Java\jdk1.8.0_144\bin;C:\Program Files\TortoiseGit\bin;C:\Ruby193\bin;C:\Program Files\Java\jdk1.8.0_144\bin;C:\Users\Arun1234\AppData\Local\Microsoft\WindowsApps;C:\maven\apache-maven-3.3.9\bin;V:\project\ant-examples\apache-ant-1.9.7\bin;C:\Users\Arun1234\AppData\Roaming\npm;;V:\technology\eclipse;;.
Apr 05, 2018 11:00:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [“http-bio-8080”]
Apr 05, 2018 11:00:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [“http-bio-8443”]
Apr 05, 2018 11:00:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [“ajp-bio-8009”]
Apr 05, 2018 11:00:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1961 ms
Apr 05, 2018 11:00:08 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 05, 2018 11:00:08 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.68
Apr 05, 2018 11:00:09 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Apr 05, 2018 11:00:14 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Apr 05, 2018 11:00:14 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Apr 05, 2018 11:00:14 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet ‘trainingstorefront’
Apr 05, 2018 11:00:14 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet ‘trainingstorefront’: initialization started
Apr 05, 2018 11:00:14 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace ‘trainingstorefront-servlet’: startup date [Thu Apr 05 23:00:14 IST 2018]; root of context hierarchy
Apr 05, 2018 11:00:14 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/trainingstorefront-servlet.xml]
Apr 05, 2018 11:00:15 PM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
INFO: Loaded JDBC driver: com.mysql.jdbc.Driver
Apr 05, 2018 11:00:16 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager
INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
Apr 05, 2018 11:00:16 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.1.Final}
Apr 05, 2018 11:00:16 PM org.hibernate.cfg.Environment
INFO: HHH000206: hibernate.properties not found
Apr 05, 2018 11:00:16 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Apr 05, 2018 11:00:16 PM org.hibernate.dialect.Dialect
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Apr 05, 2018 11:00:17 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
Apr 05, 2018 11:00:17 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory
INFO: HHH000397: Using ASTQueryTranslatorFactory
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000102: Fetching database metadata
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000396: Updating schema
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.category
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, name, description, id, has_sub_categories]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: []
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [primary]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.customer
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, password, mobile, last_name, id, first_name, email]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: []
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [primary]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.customer_field
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [field_id, fields_id, customer_id]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_mxdqn4nu8n59wgb31xi9bqw9w, fk_jyd428fw45kxy1y01ck6gb6x0, fk_s7p6od0yswq1rc8v1b9wx75wu]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_mxdqn4nu8n59wgb31xi9bqw9w, fk_jyd428fw45kxy1y01ck6gb6x0, primary]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.experience
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [summary, months, id, years, customer]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_sj9isgx3vqwy1ubqdb8ualadl]
Apr 05, 2018 11:00:17 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_sj9isgx3vqwy1ubqdb8ualadl, primary]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.field
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [name, id, fields, fieldid]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_2dqr9q9qvcu4uwq0m0p4xm729, fk_5w3v4al4kn2t7esqot8e3t237]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_2dqr9q9qvcu4uwq0m0p4xm729, primary, fk_5w3v4al4kn2t7esqot8e3t237]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.follower
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, id]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: []
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [primary]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.product
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, category_id, price, name, description, id]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_6oweamgjibmex1v06bgk59asd]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_6oweamgjibmex1v06bgk59asd, primary]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.review
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, rating, comment, id, customer]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_ssu9fcgl440y5e4so2miuhvuu]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_ssu9fcgl440y5e4so2miuhvuu, primary]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.user_role
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, role, id]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: []
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [primary]
Apr 05, 2018 11:00:18 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000232: Schema update complete
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/c/create],methods=[POST]}” onto public void com.training.storefront.controllers.CategoryController.createProduct(com.training.core.data.CategoryData)
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/customer/add-fields],methods=[POST]}” onto public void com.training.storefront.controllers.CustomerController.addFields(java.lang.Long[],java.lang.Long)
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/customer/create],methods=[POST]}” onto public void com.training.storefront.controllers.CustomerController.createCustomer(com.training.core.data.CustomerData)
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/experience/create],methods=[POST]}” onto public void com.training.storefront.controllers.ExperienceController.createExperience(com.training.core.data.ExperienceData)
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/f/create],methods=[POST]}” onto public void com.training.storefront.controllers.FieldController.createProduct(com.training.core.data.FieldData)
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/f/g]}” onto public java.lang.String com.training.storefront.controllers.FollowController.getFollowers()
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/p/create],methods=[POST]}” onto public void com.training.storefront.controllers.ProductController.createProduct(com.training.core.data.ProductData)
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace ‘trainingstorefront-servlet’: startup date [Thu Apr 05 23:00:14 IST 2018]; root of context hierarchy
Apr 05, 2018 11:00:18 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace ‘trainingstorefront-servlet’: startup date [Thu Apr 05 23:00:14 IST 2018]; root of context hierarchy
Apr 05, 2018 11:00:19 PM org.springframework.orm.hibernate4.HibernateTransactionManager afterPropertiesSet
INFO: Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@7ec4b439] of Hibernate SessionFactory for HibernateTransactionManager
Apr 05, 2018 11:00:19 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet ‘trainingstorefront’: initialization completed in 4652 ms
Apr 05, 2018 11:00:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“http-bio-8080”]
Apr 05, 2018 11:00:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“http-bio-8443”]
Apr 05, 2018 11:00:19 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“ajp-bio-8009”]
Apr 05, 2018 11:00:19 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 10414 ms
Hibernate: select customermo0_.id as id1_1_0_, customermo0_.CREATION_TIME as CREATION2_1_0_, customermo0_.EMAIL as EMAIL3_1_0_, customermo0_.FIRST_NAME as FIRST_NA4_1_0_, customermo0_.LAST_NAME as LAST_NAM5_1_0_, customermo0_.MOBILE as MOBILE6_1_0_, customermo0_.PASSWORD as PASSWORD7_1_0_ from CUSTOMER customermo0_ where customermo0_.id=?
Hibernate: select fieldmodel0_.id as id1_4_0_, fieldmodel0_.NAME as NAME2_4_0_ from FIELD fieldmodel0_ where fieldmodel0_.id=?
Hibernate: select fieldmodel0_.id as id1_4_0_, fieldmodel0_.NAME as NAME2_4_0_ from FIELD fieldmodel0_ where fieldmodel0_.id=?
Hibernate: update CUSTOMER set CREATION_TIME=?, EMAIL=?, FIRST_NAME=?, LAST_NAME=?, MOBILE=?, PASSWORD=? where id=?
Hibernate: update FIELD set NAME=? where id=?
Hibernate: update FIELD set NAME=? where id=?
Hibernate: delete from CUSTOMER_FIELD where CUSTOMER_ID=?
Hibernate: insert into CUSTOMER_FIELD (CUSTOMER_ID, FIELD_ID) values (?, ?)
Apr 05, 2018 11:02:24 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 1364, SQLState: HY000
Apr 05, 2018 11:02:24 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: Field ‘fields_id’ doesn’t have a default value
Apr 05, 2018 11:02:24 PM org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl release
INFO: HHH000010: On release of batch it still contained JDBC statements
Apr 05, 2018 11:02:24 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [trainingstorefront] in context with path [/trainingstorefront] threw exception [Request processing failed; nested exception is org.springframework.orm.hibernate4.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [HY000]; error code [1364]; could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement] with root cause
java.sql.SQLException: Field ‘fields_id’ doesn’t have a default value
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2840)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2334)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2262)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2246)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:187)
at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:62)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1311)
at org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:67)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:453)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:345)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1218)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:421)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177)
at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:504)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy29.saveCustomer(Unknown Source)
at com.training.storefront.controllers.CustomerController.addFields(CustomerController.java:67)
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.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
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)
Apr 05, 2018 11:53:12 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/trainingstorefront] has started
Apr 05, 2018 11:53:12 PM org.apache.catalina.core.ApplicationContext log
INFO: Destroying Spring FrameworkServlet ‘trainingstorefront’
Apr 05, 2018 11:53:12 PM org.springframework.web.context.support.XmlWebApplicationContext doClose
INFO: Closing WebApplicationContext for namespace ‘trainingstorefront-servlet’: startup date [Thu Apr 05 23:00:14 IST 2018]; root of context hierarchy
Apr 05, 2018 11:53:12 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
SEVERE: The web application [/trainingstorefront] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Apr 05, 2018 11:53:12 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [/trainingstorefront] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
Apr 05, 2018 11:53:13 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Apr 05, 2018 11:53:14 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Apr 05, 2018 11:53:14 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet ‘trainingstorefront’
Apr 05, 2018 11:53:14 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet ‘trainingstorefront’: initialization started
Apr 05, 2018 11:53:14 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace ‘trainingstorefront-servlet’: startup date [Thu Apr 05 23:53:14 IST 2018]; root of context hierarchy
Apr 05, 2018 11:53:14 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/trainingstorefront-servlet.xml]
Apr 05, 2018 11:53:14 PM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
INFO: Loaded JDBC driver: com.mysql.jdbc.Driver
Apr 05, 2018 11:53:14 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager
INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
Apr 05, 2018 11:53:14 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.1.Final}
Apr 05, 2018 11:53:14 PM org.hibernate.cfg.Environment
INFO: HHH000206: hibernate.properties not found
Apr 05, 2018 11:53:14 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Apr 05, 2018 11:53:15 PM org.hibernate.dialect.Dialect
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Apr 05, 2018 11:53:15 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
Apr 05, 2018 11:53:15 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory
INFO: HHH000397: Using ASTQueryTranslatorFactory
Apr 05, 2018 11:53:15 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
Apr 05, 2018 11:53:15 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000102: Fetching database metadata
Apr 05, 2018 11:53:15 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000396: Updating schema
Apr 05, 2018 11:53:15 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.category
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, name, description, id, has_sub_categories]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: []
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [primary]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.customer
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, password, mobile, last_name, id, first_name, email]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: []
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [primary]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.customer_field
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [field_id, fields_id, customer_id]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_mxdqn4nu8n59wgb31xi9bqw9w, fk_jyd428fw45kxy1y01ck6gb6x0, fk_s7p6od0yswq1rc8v1b9wx75wu]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_mxdqn4nu8n59wgb31xi9bqw9w, fk_jyd428fw45kxy1y01ck6gb6x0, primary]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.experience
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [summary, months, id, years, customer]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_sj9isgx3vqwy1ubqdb8ualadl]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_sj9isgx3vqwy1ubqdb8ualadl, primary]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.field
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [name, id, fields, fieldid]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_2dqr9q9qvcu4uwq0m0p4xm729, fk_5w3v4al4kn2t7esqot8e3t237]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_2dqr9q9qvcu4uwq0m0p4xm729, primary, fk_5w3v4al4kn2t7esqot8e3t237]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.follower
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, id]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: []
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [primary]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.product
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, category_id, price, name, description, id]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_6oweamgjibmex1v06bgk59asd]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_6oweamgjibmex1v06bgk59asd, primary]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.review
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, rating, comment, id, customer]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: [fk_ssu9fcgl440y5e4so2miuhvuu]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [fk_ssu9fcgl440y5e4so2miuhvuu, primary]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000261: Table found: training.user_role
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000037: Columns: [creation_time, role, id]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000108: Foreign keys: []
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.TableMetadata
INFO: HHH000126: Indexes: [primary]
Apr 05, 2018 11:53:16 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000232: Schema update complete
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/c/create],methods=[POST]}” onto public void com.training.storefront.controllers.CategoryController.createProduct(com.training.core.data.CategoryData)
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/customer/add-fields],methods=[POST]}” onto public void com.training.storefront.controllers.CustomerController.addFields(java.lang.Long[],java.lang.Long)
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/customer/create],methods=[POST]}” onto public void com.training.storefront.controllers.CustomerController.createCustomer(com.training.core.data.CustomerData)
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/experience/create],methods=[POST]}” onto public void com.training.storefront.controllers.ExperienceController.createExperience(com.training.core.data.ExperienceData)
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/f/create],methods=[POST]}” onto public void com.training.storefront.controllers.FieldController.createProduct(com.training.core.data.FieldData)
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/f/g]}” onto public java.lang.String com.training.storefront.controllers.FollowController.getFollowers()
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping register
INFO: Mapped “{[/p/create],methods=[POST]}” onto public void com.training.storefront.controllers.ProductController.createProduct(com.training.core.data.ProductData)
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace ‘trainingstorefront-servlet’: startup date [Thu Apr 05 23:53:14 IST 2018]; root of context hierarchy
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace ‘trainingstorefront-servlet’: startup date [Thu Apr 05 23:53:14 IST 2018]; root of context hierarchy
Apr 05, 2018 11:53:16 PM org.springframework.orm.hibernate4.HibernateTransactionManager afterPropertiesSet
INFO: Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@4b183a6] of Hibernate SessionFactory for HibernateTransactionManager
Apr 05, 2018 11:53:16 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet ‘trainingstorefront’: initialization completed in 2764 ms
Apr 05, 2018 11:53:16 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/trainingstorefront] is completed
can any one solve this ?