2016-09-19 2 views
0

Я пытаюсь изучить проект с открытым исходным кодом на GitHub.here here is the link to project Я могу выполнить mvn clean install successfully.but, проблема когда я иду, чтобы развернуть с помощью -DskipTests = верно, то это дает ошибку below.so, как я могу настроить этот тип проекта на местном уровне и, пожалуйста, помогите, как успешно развернуть его ниже ошибки --->Не удалось выполнить цель org.codehaus.mojo: exec-maven-plugin: 1.2.1: exec (

------------------------------------------------------------------------ 
Building Spring Blog 1.0-SNAPSHOT 
------------------------------------------------------------------------ 

--- exec-maven-plugin:1.2.1:exec (default-cli) @ spring-blog --- 



          `......`       
         `............``      
          ``............`     
           `............`    
            `............`   
     `:++:.`       `...........`  
     :++oooo+:.`       `......--.  
     :+++ooooooo+:.`       .----.  
     :+++++ooooooooo+:.`      `----.  
     :++++.`-:+ooooooooo+:.`     `----.  
     :++++. `-:+ooooooooo+     `----.  
     :++++.  `-:+oooooo`     `----.  
     :++++.   `-:+oo`     `----.  
     :++++. --`   `-     `----.  
     :++++. +oo+:.       `----.  
     :++++. +oooo:       `----.  
     :++++. .:/+o:       `----.  
     :++++.  `..       `----.  
     :++++-`         `.:---.  
     :+//////:.`       `.-:::::::.  
     `-//////////:-`     `.-::::::::::-`  
     `.-//////////:-`   `.-::::::::::-.`   
      `.-//////////:-.` `.-::::::::::-.`    
       `.-://///////::::::::::-.`     
        `.-///////:::::-.`      
         `.-:/::-.`       



2016-09-19 10:07:11.150 INFO 8368 --- [ restartedMain] me.woemler.springblog.Application  : Starting Application on yogesh-GL552VW with PID 8368 (/media/yogesh/68BFB7DA4E8F9CBB/TEMP/spring-blog-master/target/classes started by yogesh in /media/yogesh/68BFB7DA4E8F9CBB/TEMP/spring-blog-master) 
2016-09-19 10:07:11.153 INFO 8368 --- [ restartedMain] me.woemler.springblog.Application  : No active profile set, falling back to default profiles: default 
2016-09-19 10:07:11.202 INFO 8368 --- [ restartedMain] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]4d1cba86: startup date [Mon Sep 19 10:07:11 IST 2016]; root of context hierarchy 
2016-09-19 10:07:11.619 WARN 8368 --- [ restartedMain] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [me.woemler.springblog.Application]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.context.web.SpringBootServletInitializer 
2016-09-19 10:07:11.625 ERROR 8368 --- [ restartedMain] o.s.boot.SpringApplication    : Application startup failed 

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [me.woemler.springblog.Application]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.context.web.SpringBootServletInitializer 
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:181) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:321) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:764) [spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE] 
    at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:357) [spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:305) [spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1124) [spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1113) [spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE] 
    at me.woemler.springblog.Application.main(Application.java:21) [classes/:na] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_73] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_73] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_73] 
    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_73] 
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.3.1.RELEASE.jar:1.3.1.RELEASE] 
Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.context.web.SpringBootServletInitializer 
    at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:163) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:291) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:231) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    ... 17 common frames omitted 
Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContext 
    at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_73] 
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_73] 
    at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_73] 
    at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:152) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] 
    ... 21 common frames omitted 
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContext 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_73] 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_73] 
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_73] 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_73] 
    ... 25 common frames omitted 

2016-09-19 10:07:11.627 INFO 8368 --- [ restartedMain] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/media/yogesh/68BFB7DA4E8F9CBB/TEMP/spring-blog-master/target/classes/] 
------------------------------------------------------------------------ 
BUILD FAILURE 
------------------------------------------------------------------------ 
Total time: 1.844s 
Finished at: Mon Sep 19 10:07:11 IST 2016 
Final Memory: 11M/212M 
------------------------------------------------------------------------ 
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project spring-blog: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1] 

To see the full stack trace of the errors, re-run Maven with the -e switch. 
Re-run Maven using the -X switch to enable full debug logging. 

For more information about the errors and possible solutions, please read the following articles: 
+1

Пожалуйста, поделитесь полной командой, которая приведет к сбою и содержимому pom.xml. ссылка на проекты не полезна, если вы не делитесь деталями. – nullpointer

+1

Как предлагалось @nullpointer, поделитесь используемой вами командой. Если вы хотите выполнить/запустить приложение, используйте «mvn spring-boot: run» –

ответ

1

У вас не хватает сервлет -api зависимость, как вы можете видеть в

Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContext 
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_73] 
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_73] 
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_73] 
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_73] 
... 25 common frames omitted 

Зависимость «jstl» имеет временную зависимость для сервлета-api, но где-то в цепочке зависимостей существует, вероятно, «предоставленная» область, поэтому зависимость не распространяется.

«Платформа-бон» определяет «сервлет-апи», так что вы просто должны добавить к вашему ПОМ

<dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
    </dependency> 

И вы должны быть хорошо идти.

+0

его уже там –

+0

У pom в репо нет ссылки на артефакт «javax.servlet-api». Если вы используете другой, пожалуйста, измените свой вопрос, как предлагается @nullpointer. Это сделает процесс более последовательным и для будущих пользователей. – Sammyrulez

+0

Произошла непредвиденная ошибка (тип = Внутренняя ошибка сервера, статус = 500). Свойство «tagName» не найдено по типу java.lang.String при доступе к приложению url--> http: // localhost: 8080/admin/tags –

Смежные вопросы