//No 'Access-Control-Allow-Origin' header is present on the requested resource__ Access-Control-Allow-Origin error mostly when you access web api without client like from ajax or javascrip call Issue can be resolved in following steps. 1) Goto global aspx calss of WebApi 2) After default start method add below mentioned code in step 3 3) protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*"); if (HttpContext.Current.Request.HttpMethod == "OPTIONS") { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "POST, PUT, DELETE"); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept"); HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000"); HttpContext.Current.Response.End(); } } ___Stay Happy_____________
When I try to launch the tomcat from Eclipse, I encountered the following error Server Tomcat v8.5 Server at localhost failed to start. Solution Step 1 Delete the .snap file located at the following location eclipse workspace Path\ .metadata\.plugins\org.eclipse.core.resources Step 2 Delete the tmp0 folder from the following path eclipse workspace Path \.metadata\.plugins\org.eclipse.wst.server.core Step 3 Delete the server from servers list Step 4 Remove already added Tomcat Server i) Click on Define a new Server ii) Select Server Runtime Environments iii) Select the Tomcat Server and remove it as follows Remove Selected Server Step 5 Make sure that correct version of Server is configured in Project Properties Step 6 Restart the Eclipse IDE.
Comments
Post a Comment