如何访问JBossAS7中部署的spring启动应用程序?
我是spring mvc的新手,我已经遵循了导入如何访问JBossAS7中部署的spring启动应用程序?,spring,maven,spring-mvc,jboss,Spring,Maven,Spring Mvc,Jboss,我是spring mvc的新手,我已经遵循了导入hello web应用程序的步骤(spring工具套件中的服务web内容)。它作为一个使用嵌入式TomcatServlet的独立应用程序非常有效 然后我开始打包申请。实际采取的步骤如下: 使应用程序类扩展SpringBootServletializer,并添加SpringApplicationBuilder配置方法 将嵌入式tomcat设置为提供的 将Maven打包设置为war 然而,在将gs-service-web-content-initial
hello web
应用程序的步骤(spring工具套件中的服务web内容
)。它作为一个使用嵌入式TomcatServlet的独立应用程序非常有效
然后我开始打包申请。实际采取的步骤如下:
李>
war
http://localhost:8080/greeting
和http://localhost:8080/gs-提供web内容首字母/问候语
会提供相同的404请求的资源(/greeting)不可用。
。(之前使用structs构建的另一个war在同一jboss上测试运行良好)
添加一个函数也不起作用。那么我错过了什么
更新20151217:
相关JBoss日志附加如下。部署战争时会显示一条警告(JBAS011006),但它似乎是
09:06:06107信息[org.jboss.as.server.deployment](MSC服务线程1-2)JBAS015876:开始部署“gs服务web内容initial.war”
09:06:06970警告[org.jboss.as.ee](MSC服务线程1-2)JBAS011006:未安装可选组件org.springframework.http.server.ServletServerHttpAsyncRequestControl,因为异常:org.jboss.as.server.deployment.DeploymentUnitProcessingException:JBAS011054:找不到类org.springframework.http.server.ServletServerHttpAsyncRequestControl的默认构造函数
在org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)上
位于org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
在org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
在org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
在org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[rt.jar:1.7.091]
在java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[rt.jar:1.7.091]
在java.lang.Thread.run(Thread.java:745)[rt.jar:1.7.091]
09:06:06971警告[org.jboss.as.ee](MSC服务线程1-2)JBAS011006:未安装可选组件org.springframework.web.context.request.async.StandardServletAsyncWebRequest,因为出现异常:org.jboss.as.server.deployment.DeploymentUnitProcessingException:JBAS011054:找不到类org.springframework.web.context.request.async.StandardServletAsyncWebRequest的默认构造函数
在org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)上
位于org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
在org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
在org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
在org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[rt.jar:1.7.091]
在java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[rt.jar:1.7.091]
在java.lang.Thread.run(Thread.java:745)[rt.jar:1.7.091]
09:06:07142信息[org.apache.catalina.core.ContainerBase.[jboss.web].[default host].[gs servicing web content initial]](MSC服务线程1-2)在类路径[org.springframework.boot.autoconfigure.jersey]上检测到Spring WebApplicationInitializers。JerseyAutoConfiguration@52fd8833你好Application@2f8f6d6]
09:06:08149信息[stdout](MSC服务线程1-2)
09:06:08149信息[stdout](MSC服务线程1-2)。\uuuuuuuuuuuuuuuuuuuuuuuuuu_
09:06:08149信息[stdout](MSC服务线程1-2)/\\\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
09:06:08149信息[stdout](MSC服务线程1-2)(()\\\\\\\\\\\\\\\\\\\\\'\\\\\\\\'\\\\\\'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\
09:06:08149信息[stdout](MSC服务线程1-2)\\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
09:06:08149信息[标准输出](MSC服务线程1-2)| | | | | | | | | | | | | | | |///
09:06:08149信息[stdout](MSC服务线程1-2)=========|_|==============|___/=/_/_/_/
09:06:08150信息[stdout](MSC服务线程1-2)::Spring启动::(v1.3.0.版本)
09:06:08150信息[stdout](MSC服务线程1-2)
09:06:08241信息[hello.Application](MSC服务线程1-2)使用PID 16909在localhost.localdomain上启动应用程序(由jboss在/usr/share/jboss-as-7.1.1.Final中启动)
09:06:08242信息[hello.Application](MSC服务线程1-2)没有激活的配置文件
09:06:08456信息[org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext](MSC服务线程1-2)刷新org.springframework.boot.context.embedded。AnnotationConfigEmbeddedWebApplicationContext@116d77df:启动日期[Thu Dec 17 09:06:08 HKT 2015];上下文层次结构的根
09:06:09278信息[org.springframework.beans.factory.support.DefaultListableBeanFactory](MSC服务线程1-2)使用不同的定义覆盖bean“beanNameViewResolver”的bean定义:替换[Root bean:class[nul]
09:06:06,107 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "gs-serving-web-content-initial.war"
09:06:06,970 WARN [org.jboss.as.ee] (MSC service thread 1-2) JBAS011006: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.http.server.ServletServerHttpAsyncRequestControl
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_91]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_91]
09:06:06,971 WARN [org.jboss.as.ee] (MSC service thread 1-2) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.web.context.request.async.StandardServletAsyncWebRequest
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_91]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_91]
09:06:07,142 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/gs-serving-web-content-initial]] (MSC service thread 1-2) Spring WebApplicationInitializers detected on classpath: [org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration@52fd8833, hello.Application@2f8f6d6]
09:06:08,149 INFO [stdout] (MSC service thread 1-2)
09:06:08,149 INFO [stdout] (MSC service thread 1-2) . ____ _ __ _ _
09:06:08,149 INFO [stdout] (MSC service thread 1-2) /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
09:06:08,149 INFO [stdout] (MSC service thread 1-2) ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
09:06:08,149 INFO [stdout] (MSC service thread 1-2) \\/ ___)| |_)| | | | | || (_| | ) ) ) )
09:06:08,149 INFO [stdout] (MSC service thread 1-2) ' |____| .__|_| |_|_| |_\__, | / / / /
09:06:08,149 INFO [stdout] (MSC service thread 1-2) =========|_|==============|___/=/_/_/_/
09:06:08,150 INFO [stdout] (MSC service thread 1-2) :: Spring Boot :: (v1.3.0.RELEASE)
09:06:08,150 INFO [stdout] (MSC service thread 1-2)
09:06:08,241 INFO [hello.Application] (MSC service thread 1-2) Starting Application on localhost.localdomain with PID 16909 (started by jboss in /usr/share/jboss-as-7.1.1.Final)
09:06:08,242 INFO [hello.Application] (MSC service thread 1-2) No profiles are active
09:06:08,456 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] (MSC service thread 1-2) Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@116d77df: startup date [Thu Dec 17 09:06:08 HKT 2015]; root of context hierarchy
09:06:09,278 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (MSC service thread 1-2) Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
09:06:09,537 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (MSC service thread 1-2) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
09:06:09,580 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/gs-serving-web-content-initial]] (MSC service thread 1-2) Initializing Spring embedded WebApplicationContext
09:06:09,581 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-2) Root WebApplicationContext: initialization completed in 1126 ms
09:06:10,062 INFO [org.springframework.boot.context.embedded.ServletRegistrationBean] (MSC service thread 1-2) Mapping servlet: 'dispatcherServlet' to [/]
09:06:10,063 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (MSC service thread 1-2) Mapping filter: 'errorPageFilter' to: [/*]
09:06:10,063 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (MSC service thread 1-2) Mapping filter: 'characterEncodingFilter' to: [/*]
09:06:10,063 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (MSC service thread 1-2) Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
09:06:10,063 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (MSC service thread 1-2) Mapping filter: 'httpPutFormContentFilter' to: [/*]
09:06:10,063 INFO [org.springframework.boot.context.embedded.FilterRegistrationBean] (MSC service thread 1-2) Mapping filter: 'requestContextFilter' to: [/*]
09:06:10,208 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] (MSC service thread 1-2) Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@116d77df: startup date [Thu Dec 17 09:06:08 HKT 2015]; root of context hierarchy
09:06:10,347 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-2) Mapped "{[/greeting]}" onto public java.lang.String hello.GreetingController.greeting(java.lang.String,org.springframework.ui.Model)
09:06:10,349 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-2) Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
09:06:10,349 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-2) Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
09:06:10,374 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (MSC service thread 1-2) Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
09:06:10,375 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (MSC service thread 1-2) Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
09:06:10,451 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (MSC service thread 1-2) Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
09:06:10,896 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter] (MSC service thread 1-2) Registering beans for JMX exposure on startup
09:06:11,231 INFO [hello.Application] (MSC service thread 1-2) Started Application in 3.996 seconds (JVM running for 78143.668)
09:06:11,235 INFO [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /gs-serving-web-content-initial
09:06:11,269 INFO [org.jboss.as.server] (HttpManagementService-threads - 4) JBAS018559: Deployed "gs-serving-web-content-initial.war"
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>myapp</context-root>
</jboss-web>
09:53:57,523 INFO [hello.Application] (MSC service thread 1-1) Started Application in 3.192 seconds (JVM running for 167409.96)
09:53:57,541 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /myapp
09:53:57,591 INFO [org.jboss.as.server] (HttpManagementService-threads - 7) JBAS018559: Deployed "gs-serving-web-content-initial.war"
server.servlet-path=/*