• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Problem with the spring boot app

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I developed a spring boot rest app, when I run it the console doesn't give error , it says this....



 .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/  ___)| |_)| | | | | || (_| |  ) ) ) )
 '  |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot ::        (v1.5.6.RELEASE)

2017-08-23 16:17:18.472  INFO 11596 --- [           main] com.pgac.devicedector.Application        : Starting Application on NTISL119 with PID 11596 (C:\Krishna's-Dev\Eclipse-WorkSpace\TheGeneral\DeviceDetectorMaster\devicedector\target\classes started by NTISKD30 in C:\Krishna's-Dev\Eclipse-WorkSpace\TheGeneral\DeviceDetectorMaster\devicedector)
2017-08-23 16:17:18.474  INFO 11596 --- [           main] com.pgac.devicedector.Application        : No active profile set, falling back to default profiles: default
2017-08-23 16:17:18.495  INFO 11596 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3d3fcdb0: startup date [Wed Aug 23 16:17:18 CDT 2017]; root of context hierarchy
2017-08-23 16:17:19.077  INFO 11596 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2017-08-23 16:17:19.083  INFO 11596 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2017-08-23 16:17:19.084  INFO 11596 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.16
2017-08-23 16:17:19.128  INFO 11596 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-08-23 16:17:19.128  INFO 11596 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 635 ms
2017-08-23 16:17:19.198  INFO 11596 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-08-23 16:17:19.200  INFO 11596 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-08-23 16:17:19.200  INFO 11596 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-08-23 16:17:19.200  INFO 11596 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-08-23 16:17:19.200  INFO 11596 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-08-23 16:17:19.375  INFO 11596 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3d3fcdb0: startup date [Wed Aug 23 16:17:18 CDT 2017]; root of context hierarchy
2017-08-23 16:17:19.406  INFO 11596 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2017-08-23 16:17:19.407  INFO 11596 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2017-08-23 16:17:19.422  INFO 11596 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-08-23 16:17:19.422  INFO 11596 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-08-23 16:17:19.440  INFO 11596 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-08-23 16:17:19.510  INFO 11596 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2017-08-23 16:17:19.538  INFO 11596 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2017-08-23 16:17:19.540  INFO 11596 --- [           main] com.pgac.devicedector.Application        : Started Application in 1.205 seconds (JVM running for 1.61)
Hello World!
2017-08-23 16:21:29.172  INFO 11596 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-08-23 16:21:29.172  INFO 11596 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization started
2017-08-23 16:21:29.181  INFO 11596 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 9 ms


my code is:
package com.pgac.devicedectorController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;


import org.springframework.mobile.device.Device;
import org.springframework.stereotype.Controller;

import com.scientiamobile.wurfl.core.WURFLEngine;

@Controller
public class DeviceDetectorController {

@Resource(name="WURFLEngine")
WURFLEngine engine;

@RequestMapping("/detect-device")
   public @ResponseBody String detectDevice(Device device, HttpServletRequest request) {

    com.scientiamobile.wurfl.core.Device device2 = engine.getDeviceForRequest(request);

StringBuffer deviceCapabilities = new StringBuffer();

deviceCapabilities.append(" DEVICE_ID : ").append(device2.getId()).append("<br>")
.append(" DEVICE_OS : ").append(device2.getCapability("device_os")).append("<br>")
.append(" DEVICE_OS_VERSION : ").append(device2.getCapability("device_os_version")).append("<br>")
.append(" IS_TABLET : ").append(device2.getCapability("is_tablet")).append("<br>")
.append(" IS_WIRELESS_DEVICE : ").append(device2.getCapability("is_wireless_device")).append("<br>")
.append(" MOBILE_BROWSER : ").append(device2.getCapability("mobile_browser")).append("<br>")
.append(" MOBILE_BROWSER_VERSION : ").append(device2.getCapability("mobile_browser_version")).append("<br>")
.append(" POINTING_METHOD : ").append(device2.getCapability("pointing_method")).append("<br>")
.append(" PREFERRED_MARKUP : ").append(device2.getCapability("preferred_markup")).append("<br>")
.append(" RESOLUTION_HEIGHT : ").append(device2.getCapability("resolution_height")).append("<br>")
.append(" RESOLUTION_WIDTH : ").append(device2.getCapability("resolution_width")).append("<br>")
.append(" UX_FULL_DESKTOP : ").append(device2.getCapability("ux_full_desktop")).append("<br>")
.append(" XHTML_SUPPORT_LEVEL : ").append(device2.getCapability("xhtml_support_level")).append("<br>")
.append(" IS DESKTOP: ").append(device2.getCapability("is_full_desktop")).append("<br>");





       return deviceCapabilities.toString();
   }

}

and browser says this:
http://localhost:8080/detect-device

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Aug 23 16:23:24 CDT 2017
There was an unexpected error (type=Not Found, status=404).
No message available


Please help me out
 
Author
Posts: 110
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aditi, to toot my own horn here, check this out: https://www.marcobehler.com/series/1-spring-boot-from-zero-to-rest  to get started quickly with a working REST controller.
 
bacon. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!