Я получаю эту ошибку при развертывании проекта весеннего отдыха с использованием maven в затмении на сервере tomcat 9.0.
DemoAppConfig. java
package com.pal.springdemo.rest.conf;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@Configuration
@EnableWebMvc
@ComponentScan("com.pal.springdemo.rest")
public class DemoAppConfig {
}
MyDispatcherServletInitilizer
package com.pal.springdemo.rest.conf;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class MySpringMvcDispatcherServletInitilizer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
// TODO Auto-generated method stub
return null;
}
@Override
protected Class<?>[] getServletConfigClasses() {
// TODO Auto-generated method stub
return new Class [] {DemoAppConfig.class};
}
@Override
protected String[] getServletMappings() {
return new String [] {"/"};
}
}
PalController
package com.pal.springdemo.rest.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test")
public class Travel {
@GetMapping("/hello")
public String sethello() {
System.out.println("hello from test");
return "hello";
}
}
Это ошибка, которую я получаю с коротким сообщением:
Приложение неправильно работает отформатирован. Обратитесь за помощью к поставщику приложения.
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.34209
System.Deployment.dll : 4.0.30319.34209 built by: FX452RTMGDR
clr.dll : 4.0.30319.34209 built by: FX452RTMGDR
dfdll.dll : 4.0.30319.34209 built by: FX452RTMGDR
dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES
Deployment url : http://localhost:8080/sanjeet_pal_spring_rest_api/test/hello
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://localhost:8080/sanjeet_pal_spring_rest_api/test/hello resulted in exception. Following failure messages were detected:
+ Exception reading manifest from http://localhost:8080/sanjeet_pal_spring_rest_api/test/hello: the manifest may not be valid or the file could not be opened.
+ Data at the root level is invalid. Line 1, position 1.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [09-Feb-20 10:22:17 PM] : Activation of http://localhost:8080/sanjeet_pal_spring_rest_api/test/hello has started.
ERROR DETAILS
Following errors were detected during this operation.
* [09-Feb-20 10:22:18 PM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from http://localhost:8080/sanjeet_pal_spring_rest_api/test/hello: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Xml.XmlException
- Data at the root level is invalid. Line 1, position 1.
- Source: System.Xml
- Stack trace:
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlCharCheckingReader.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
Индекс работает нормально. jsp без ошибок, но выдает ошибку при остановке контроллера. Сопоставленная ссылка.
ссылка на проект: https://github.com/sanjeet123456789/spring_project/tree/master/sanjeet_pal_spring_rest_api