java - Spring @Controller Method Returning Strange Download Exception -


i have strange error gets returned in spring mvc application. when attempt save user via @restcontroller method, browser seems interpret action request download application. info issue:

  • it returned when application deployed onto remote server (works expected locally)
  • this happens in internet explorer

here error:

enter image description here

details...

operation progress status     * [7/8/2015 6:56:16 pm] : activation of mysite.com/myapp/saveuser/100 has started.  error details     following errors detected during operation.     * [7/8/2015 6:56:17 pm] system.deployment.application.deploymentdownloadexception (unknown subtype)         - downloading mysite.com/myapp/saveuser/100 did not succeed.         - source: system.deployment         - stack trace:             @ system.deployment.application.systemnetdownloader.downloadsinglefile(downloadqueueitem next)             @ system.deployment.application.systemnetdownloader.downloadallfiles()             @ system.deployment.application.filedownloader.download(subscriptionstate substate)             @ system.deployment.application.downloadmanager.downloadmanifestasrawfile(uri& sourceuri, string targetpath, idownloadnotification notification, downloadoptions options, serverinformation& serverinformation)             @ system.deployment.application.downloadmanager.downloaddeploymentmanifestdirectbypass(subscriptionstore substore, uri& sourceuri, tempfile& tempfile, subscriptionstate& substate, idownloadnotification notification, downloadoptions options, serverinformation& serverinformation)             @ system.deployment.application.downloadmanager.downloaddeploymentmanifestbypass(subscriptionstore substore, uri& sourceuri, tempfile& tempfile, subscriptionstate& substate, idownloadnotification notification, downloadoptions options)             @ system.deployment.application.applicationactivator.performdeploymentactivation(uri activationuri, boolean isshortcut, string textualsubid, string deploymentproviderurlfromextension, browsersettings browsersettings, string& errorpageurl)             @ system.deployment.application.applicationactivator.activatedeploymentworker(object state)         --- inner exception ---         system.net.webexception         - remote server returned error: (405) method not allowed.         - source: system         - stack trace:             @ system.net.httpwebrequest.getresponse()             @ system.deployment.application.systemnetdownloader.downloadsinglefile(downloadqueueitem next) 

here controller:

@requestmapping(value = "/saveuser/{id}", method = requestmethod.post)     public string saveuser(@modelattribute("user") user user, @pathvariable long id, model model) {         model.addattribute("user", user);         userrepo.save(user);         return "success";     } 

the method pretty straightforward, , i'm not specifying response headers. ideas why might happening?

update when capturing network traffic, post method type application/x-ms-application on remote server, type standard text/html on local machine

explicitly setting produces attribute "text/html" seems have resolved issue

@requestmapping(value = "/saveuser/{id}", produces="text/html", method = requestmethod.post) 

from spring docs

use of produces condition ensures actual content type used generate response respects media types specified in produces condition


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -