I have used spring framework 3 for my application. Everything is ok while developed in
Netbeans But i need a custom build and done for the same The build created without any
issue, but i got the following error The error occurred while calling the following method
#RequestMapping(value = "/security/login", method = RequestMethod.POST)
public ModelAndView login(#RequestParam String userName, #RequestParam String password,
HttpServletRequest request) {
......................
But There is no issue while creating the war with netbeans
(I am sure it is about the compilation issue)
have you any experiance on this issue ...
There is any additional javac argument for compile the same (netbeans used there custom task for the compilation)
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method [public org.springframework.web.servlet.ModelAndView com.mypackage.security.controller.LoginController.login(java.lang.String,java.lang.String,javax.servlet.http.HttpServletRequest)]; nested exception is java.lang.IllegalStateException: No parameter name specified for argument of type [java.lang.String], and no parameter name information found in class file either.
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:659)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.mypackage.security.controller.AuthFilter.doFilter(Unknown Source)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
root cause
org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method [public org.springframework.web.servlet.ModelAndView com.mypackage.security.controller.LoginController.login(java.lang.String,java.lang.String,javax.servlet.http.HttpServletRequest)]; nested exception is java.lang.IllegalStateException: No parameter name specified for argument of type [java.lang.String], and no parameter name information found in class file either.
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:414)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:402)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.mypackage.security.controller.AuthFilter.doFilter(Unknown Source)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
root cause
java.lang.IllegalStateException: No parameter name specified for argument of type [java.lang.String], and no parameter name information found in class file either.
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.getRequiredParameterName(HandlerMethodInvoker.java:618)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveRequestParam(HandlerMethodInvoker.java:417)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:277)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:163)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:414)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:402)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.mypackage.security.controller.AuthFilter.doFilter(Unknown Source)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Argument names are stored in the compiled code only when it's compiled in debug mode, so you should either compile it in debug mode or supply #RequestParam with explicit parameter names. The latter approach is more reliable because it doesn't depend on the environment:
#RequestMapping(value = "/security/login", method = RequestMethod.POST)
public ModelAndView login(#RequestParam("userName") String userName,
#RequestParam("password") String password,
HttpServletRequest request) {
......................
Related
I am continuously getting HystrixTimeOut exception when invoking another microservice via feign.
I have read all the soultions on StackOverFlow and github community but nothing worked for me.
below is my configuration:
hystrixProperties:
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 6000000
code
#FeignClient(value = "some-service", decode404 = true)
public interface UserClient extends UserUtil {
#GetMapping("/names")
ResponseEntity<UserResponse> getUserData(#RequestHeader("Authorization") String tokenKey);
Exception:
04-12-2020 12:37:16.459 [https-jsse-nio-20104-exec-6] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet].log - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.netflix.hystrix.exception.HystrixRuntimeException: UserClient#getUserData(String) timed-out and no fallback available.] with root cause
java.util.concurrent.TimeoutException: null
at com.netflix.hystrix.AbstractCommand.handleTimeoutViaFallback(AbstractCommand.java:997)
at com.netflix.hystrix.AbstractCommand.access$500(AbstractCommand.java:60)
at com.netflix.hystrix.AbstractCommand$12.call(AbstractCommand.java:609)
at com.netflix.hystrix.AbstractCommand$12.call(AbstractCommand.java:601)
at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$4.onError(OperatorOnErrorResumeNextViaFunction.java:140)
at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87)
at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onError(OnSubscribeDoOnEach.java:87)
at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$1.run(AbstractCommand.java:1142)
at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:41)
at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:37)
at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable.run(HystrixContextRunnable.java:57)
at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$2.tick(AbstractCommand.java:1159)
at com.netflix.hystrix.util.HystrixTimer$1.run(HystrixTimer.java:99)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
My calling service is able to reach called(User) service. User service is also completing the processing very fast and returning the data. Issue is I am getting exception at my calling service.
Please help me
In my Spring batch configuration, I'm trying to setup a partitioned step, which accesses values from JobParameters as follows :
#Bean
#Qualifier("partitionJob")
public Job partitionJob() throws Exception {
return jobBuilderFactory
.get("partitionJob")
.incrementer(new RunIdIncrementer())
.start(partitionStep(null))
.build();
}
#Bean
#StepScope //I'm getting exception here - > Error creating bean
public Step partitionStep(
#Value("#{jobParameters[gridSize]}") String gridSize)
throws Exception {
return stepBuilderFactory
.get("partitionStep")
.partitioner("slaveStep", partitioner())
.gridSize(
StringUtils.isEmpty(gridSize) ? 10 : Integer
.parseInt(gridSize))
.step(slaveStep(50000))
.taskExecutor(threadPoolTaskExecutor()).build();
}
#Bean
#StepScope
public Step slaveStep(int chunkSize) throws Exception {
return stepBuilderFactory
.get("slaveStep")
.<Person,Person> chunk(chunkSize)
.reader(jdbcPagingItemReader()),
.writer(csvFileWriterParts())
.listener(stepExecutionListener()).build();
}
I have added #EnableBatchProcessing annotation to my SpringBoot application.
Since I wanted to access JobParameters while constructing a step, I used #StepScope. I have an example that works fine, without #StepScope annotation, but in that case I'm not accessing any JobParameters or anything from context.
But If I use StepScope annotation on partitionStep, I'm getting
Error creating bean with name 'scopedTarget.partitionStep': Scope
'step' is not active for the current thread; consider defining a
scoped proxy for this bean if you intend to refer to it from a
singleton; nested exception is java.lang.IllegalStateException: No
context holder available for step scope
but If I change it to JobScope, then it is failing at slaveStep() with same error message.
What is the correct scope to be used in such cases and how to resolve this issue I'm getting ?
What is the better way of accessing JobParameters while configuring spring beans ?
Exception stack is as below
2018-05-25 21:07:32,075 ERROR [main]
org.springframework.batch.core.job.AbstractJob : Encountered fatal
error executing job
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'scopedTarget.partitionStep': Scope 'step' is
not active for the current thread; consider defining a scoped proxy
for this bean if you intend to refer to it from a singleton; nested
exception is java.lang.IllegalStateException: No context holder
available for step scope at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:361)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at
org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:192)
at com.sun.proxy.$Proxy55.getName(Unknown Source) at
org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:115)
at
org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:392)
at
org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:135)
at
org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:306)
at
org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)
at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at
org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at
org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy54.run(Unknown Source) at
com.sample.main(ExtractApplication.java:58)
Caused by: java.lang.IllegalStateException: No context holder
available for step scope at
org.springframework.batch.core.scope.StepScope.getContext(StepScope.java:167)
at
org.springframework.batch.core.scope.StepScope.get(StepScope.java:99)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:346)
... 23 common frames omitted
If I modify to JobScope, I get exception on slaveStep, which is similar to the above exception.
Please try the option Spring batch scope issue while using spring boot, posted by Manh. I guess it solved the problem. Unfortunately I no longer have access to the code base, to confirm what I did for the fix.
Situation: I'm making a POST request to a Spring controller using Postman. There is a text JSON, and a Multipart file.
Problem: I get an error as follows:
Method [public java.lang.String com.dure.ivizard.core.datamanagement.export.controller.FileUploadAction.uploadFileHandler(org.springframework.web.multipart.MultipartFile,javax.servlet.http.HttpSession,java.lang.String)]
Resolved arguments:
[0] [type=org.springframework.web.multipart.commons.CommonsMultipartFile] [value=org.springframework.web.multipart.commons.CommonsMultipartFile#e421749]
[1] [type=org.apache.catalina.session.StandardSessionFacade] [value=org.apache.catalina.session.StandardSessionFacade#725e9373]
[2] [type=java.lang.String] [value={
"userid":"1",
"email":"admin#gmail.com"
}]
] with root cause
java.lang.IllegalArgumentException: object is not an instance of declaring class
The input parameters are as follows:
Key: inputdataJsonStr
Type: String
Value: {"userid" : "1", "email" :"abc#gmail.com"
Key: file
Type: File
Value:
Here is the Spring controller's declaration:
#SuppressWarnings("rawtypes")
#Transactional
#RequestMapping(value = "/confirmUploadLocalAttrFile_new", method = RequestMethod.POST)
public #ResponseBody
String uploadConfirmLocalAttrHandler_new(#RequestParam("file") MultipartFile file, HttpSession session, #RequestParam String inputdataJsonStr){
Full stack trace is as follows:
2018-01-08 12:27:35 INFO DureContextListenerImpl:85 - ********************Application conext set
2018-01-08 12:27:35 INFO SimpleCORSFilter:24 - SimpleCORSFilter init
2018-01-08 12:27:35 INFO DispatcherServlet:473 - FrameworkServlet 'spring': initialization completed in 4026 ms
Jan 08, 2018 12:27:35 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [spring] in context with path [/ivizard] threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: object is not an instance of declaring class
HandlerMethod details:
Controller [com.sun.proxy.$Proxy48]
Method [public java.lang.String com.dure.ivizard.core.datamanagement.export.controller.FileUploadAction.uploadConfirmLocalAttrHandler_new(org.springframework.web.multipart.MultipartFile,java.lang.String,javax.servlet.http.HttpSession)]
Resolved arguments:
[0] [type=org.springframework.web.multipart.commons.CommonsMultipartFile] [value=org.springframework.web.multipart.commons.CommonsMultipartFile#b32dcc0]
[1] [type=java.lang.String] [value={
"dataformat":"1",
"userid":"1",
"datacategory": "2",
"countryid":"0",
"targetOrIndicatorId":"21",
"email":"admin#gmail.com"
}]
[2] [type=org.apache.catalina.session.StandardSessionFacade] [value=org.apache.catalina.session.StandardSessionFacade#67577440]
] with root cause
java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
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.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
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:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
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:962)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
What's puzzling is that even simple POST requests with just a JSON parameter have stopped working, and give the same error.
#SuppressWarnings("rawtypes")
#Transactional
#RequestMapping(value = "/confirmUploadLocalAttrFile_new", method =
RequestMethod.POST)
public #ResponseBody
String uploadConfirmLocalAttrHandler_new(#RequestParam("file") MultipartFile
file, HttpSession session, #RequestParam("jsonStr") String inputdataJsonStr){
It worked by simply copying the controller and the entire function as it was to another file.
How did it work ? Why did it work ? These questions will be answered by God when we go to Heaven.
I am working on a spring application which put the uploaded the file in a server path and update the details in the table. But getting error while uploading the file as below,
[ERROR ] SRVE0777E: Exception thrown by application class
'org.springframework.web.servlet.FrameworkServlet.processRequest:948'
org.springframework.web.util.NestedServletException:
Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is
org.apache.commons.fileupload.FileUploadException: Connection closed: Read failed. Possible end of stream encountered.
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at [internal classes]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at [internal classes]
at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
at [internal classes]
And my controller method is follows
#RequestMapping(params = "action=uploadfile", method = RequestMethod.POST)
public ModelAndView uploadParameters(#ModelAttribute("uploadParametersForm")
UploadParameterFormBean uploadParamForm, HttpServletRequest request,
HttpServletResponse response) {
ModelAndView modelAndView = null;
modelAndView = buildModelAndView(request, uploadParamForm);
FulfillmentParameterService parameterService =
parameterServiceFactory.getParameterServiceObj(uploadParamFo
rm.getParamType()); parameterService.uploadParameters(uploadParamForm);
return modelAndView;
}
I have a very simple Spring 3 ReST web service that looks like this
#RequestMapping(method = RequestMethod.POST, value = "/user")
public #ResponseBody
UserDTO saveUser(#RequestBody UserDTO userDTO)
{
// Functionality removed as it is not needed for this example
return userDTO;
}
This web service works great. I noticed a weird issue though when I added a 'catch-all' #ExceptionHandler though. On this POST call, even though it returns correctly, it seems an exception is thrown behind the scenes somewhere. So if I add the code:
#ExceptionHandler(Exception.class)
public ModelAndView handleRemainingExceptions(Exception ex)
{
logger.error("Unhandled exception", ex);
return new ModelAndView("error");
}
I suddenly get this error:
07.06.2011 22:54:05 ERROR-ImportController: [Unhandled exception]:
Cannot extract parameter (UserDTO userDTO): no Content-Type found]
org.springframework.web.HttpMediaTypeNotSupportedException: Cannot extract parameter (UserDTO userDTO): no Content-Type found
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.readWithMessageConverters(HandlerMethodInvoker.java:620)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveRequestBody(HandlerMethodInvoker.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:346)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Anybody know what is going on here?
The exception appears to be complaining that your request does not include a Content-Type header and therefore Spring doesn't know which MessageConverter to use to create the method parameter UserDTO.