- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个在 tomcat 和 jetty 服务器上运行的 spring web 应用程序,但是当我在 jboss 服务器(7.1.1 版本)中部署它时出现错误 404。
我在web.xml中的配置是
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
<display-name>rci_sof</display-name>
<!-- Servlet de démarrage de l'application -->
<servlet>
<servlet-name>AppContextInitializerServlet</servlet-name>
<servlet-class>com.rcibanque.sof.server.servlet.SofContextInitializerServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Services RPC -->
<servlet>
<servlet-name>dataServiceRPC</servlet-name>
<servlet-class>com.rcibanque.sof.server.service.data.SofDataServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dataServiceRPC</servlet-name>
<url-pattern>/rci_sof/dataService.rpc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dataServiceRPC</servlet-name>
<url-pattern>/rci_admin/dataService.rpc</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>dataModuleServiceRPC</servlet-name>
<servlet-class>com.rcibanque.sof.server.service.data.SofDataModuleServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dataModuleServiceRPC</servlet-name>
<url-pattern>/rci_sof/dataModuleService.rpc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dataModuleServiceRPC</servlet-name>
<url-pattern>/rci_admin/dataModuleService.rpc</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>tariffingServiceRPC</servlet-name>
<servlet-class>com.rcibanque.sof.server.service.tariffing.TariffingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>tariffingServiceRPC</servlet-name>
<url-pattern>/rci_sof/tariffingService.rpc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>tariffingServiceRPC</servlet-name>
<url-pattern>/rci_admin/tariffingService.rpc</url-pattern>
</servlet-mapping>
<!-- RPC Chart -->
<servlet>
<servlet-name>chartRPC</servlet-name>
<servlet-class>com.rcibanque.sof.server.chart.ChartGeneratorImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>chartRPC</servlet-name>
<url-pattern>/rci_sof/chart.rpc</url-pattern>
</servlet-mapping>
<!-- RPC Print Report -->
<servlet>
<servlet-name>printReportRPC</servlet-name>
<servlet-class>com.rcibanque.sof.server.print.report.SofPrintReportImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>printReportRPC</servlet-name>
<url-pattern>/rci_sof/printReport.rpc</url-pattern>
</servlet-mapping>
<!-- RPC Mail -->
<servlet>
<servlet-name>messagingServiceRPC</servlet-name>
<servlet-class>com.rcibanque.sof.server.print.messaging.SofMessagingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>messagingServiceRPC</servlet-name>
<url-pattern>/rci_sof/messagingService.rpc</url-pattern>
</servlet-mapping>
<!-- RPC TOPCAR -->
<servlet>
<servlet-name>topCarServiceRPC</servlet-name>
<servlet-class>com.rcibanque.sof.server.service.topcar.TopCarService</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>topCarServiceRPC</servlet-name>
<url-pattern>/rci_sof/topCarService.rpc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>topCarServiceRPC</servlet-name>
<url-pattern>/rci_admin/topCarService.rpc</url-pattern>
</servlet-mapping>
<!-- RPC Fiscalité CO2 -->
<servlet>
<servlet-name>fiscaliteCO2</servlet-name>
<servlet-class>com.rcibanque.socle.server.service.data.FiscaliteCO2Service</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>fiscaliteCO2</servlet-name>
<url-pattern>/rci_sof/fiscaliteCO2Service.rpc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>fiscaliteCO2</servlet-name>
<url-pattern>/rci_admin/fiscaliteCO2Service.rpc</url-pattern>
</servlet-mapping>
<!-- RPC Offre -->
<servlet>
<servlet-name>offreServiceRPC</servlet-name>
<servlet-class>com.rcibanque.sof.server.service.offre.OffreServiceRPCImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>offreServiceRPC</servlet-name>
<url-pattern>/rci_sof/offreService.rpc</url-pattern>
</servlet-mapping>
<!-- Servlets -->
<servlet>
<servlet-name>displayChartServlet</servlet-name>
<servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>displayChartServlet</servlet-name>
<url-pattern>/rci_sof/displayChart</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>downloadServlet</servlet-name>
<servlet-class>com.rcibanque.socle.server.servlet.DownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>downloadServlet</servlet-name>
<url-pattern>*.pdf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>downloadServlet</servlet-name>
<url-pattern>*.xls</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>downloadServlet</servlet-name>
<url-pattern>*.txt</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>downloadServlet</servlet-name>
<url-pattern>*.csv</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>topcarDownloadServlet</servlet-name>
<servlet-class>com.rcibanque.socle.server.servlet.TopcarDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>topcarDownloadServlet</servlet-name>
<url-pattern>/rci_sof/download</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>com.rcibanque.socle.server.servlet.UploadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/rci_sof/upload</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/rci_admin/upload</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>uploadTopcarServlet</servlet-name>
<servlet-class>com.rcibanque.socle.server.servlet.UploadTopcarServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>uploadTopcarServlet</servlet-name>
<url-pattern>/rci_sof/uploadTopcar</url-pattern>
</servlet-mapping>
<!-- Filtre de gestion des caches -->
<filter>
<filter-name>gwtCacheControlFilter</filter-name>
<filter-class>com.rcibanque.socle.server.filter.GWTCacheControlFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>gwtCacheControlFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Index.html</welcome-file>
</welcome-file-list>
<!-- Timeout QC32499 session connexion timeout <session-config> <session-timeout>300</session-timeout>
</session-config> -->
</web-app>
我们使用 AbstractAnnotationConfigDispatcherServletInitializer 通过 java 配置来配置 Spring
public class SoftWebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] { SoftWebConfig.class };
}
@Override
protected Class<?>[] getServletConfigClasses() {
return null;
}
@Override
protected String[] getServletMappings() {
return new String[] { "/*", "/ws/*" };
}
}
我的 SoftWebConfig 是
@Configuration
@Import(SoftDBConfig.class)
@EnableScheduling
@EnableWebMvc
@EnableHypermediaSupport(type = { HypermediaType.HAL })
@ComponentScan(basePackages = { "com.rcibanque.socle.server.*", "com.rcibanque.sof.server.*",
"com.rcibanque.socle.server.ws.*" })
public class SoftWebConfig implements SchedulingConfigurer {
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
taskRegistrar.setScheduler(taskExecutor());
}
@Bean(name = "TOPCAR-EXECUTOR", destroyMethod = "shutdown")
public Executor taskExecutor() {
return Executors.newScheduledThreadPool(1);
}
}
此应用程序在 TOMCAT 和 JETTY 服务器中运行完美,但当我将其部署在 Jboss 服务器中并使用 http://localhost:8080/rci_sof/index.html 访问该应用程序时出现 404 错误,在 server.log 中我找到了这个日志:
11:30:07,927 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/inffr/mat/{codeModele}/{codeVersion}],methods=[GET],consumes=[text/plain || application/],produces=[application/hal+json]}" onto public org.springframework.http.ResponseEntity> com.rcibanque.socle.server.ws.inffr.WsVehiculeInffr.findByCodesMat(java.lang.String,java.lang.String,boolean,boolean) 11:30:07,933 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/inffr/mat/{codeModele}],methods=[GET],consumes=[text/plain || application/],produces=[application/hal+json]}" onto public org.springframework.http.ResponseEntity> com.rcibanque.socle.server.ws.inffr.WsVehiculeInffr.findByCodesMat(java.lang.String,boolean) 11:30:07,939 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/inffr/renault/{codeModeleRenault}/{libelleVersionRenault}],methods=[GET],consumes=[text/plain || application/],produces=[application/hal+json]}" onto public org.springframework.http.ResponseEntity> com.rcibanque.socle.server.ws.inffr.WsVehiculeInffr.findByCodesRenault(java.lang.String,java.lang.String,boolean,boolean) 11:30:07,945 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/inffr/renault/{codeModeleRenault}],methods=[GET],consumes=[text/plain || application/],produces=[application/hal+json]}" onto public org.springframework.http.ResponseEntity> com.rcibanque.socle.server.ws.inffr.WsVehiculeInffr.findByCodesRenault(java.lang.String,boolean) 11:30:07,952 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/historiquedlo/{siren}/{codeProduit}/{debut}],methods=[GET],consumes=[text/plain || application/],produces=[application/hal+json]}" onto public org.springframework.http.ResponseEntity> com.rcibanque.socle.server.ws.dlo.WsHistoriqueDlo.findHistoriqueDlo(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) 11:30:07,958 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/historiquedlo/{siren}/{debut}],methods=[GET],consumes=[text/plain || application/],produces=[application/hal+json]}" onto public org.springframework.http.ResponseEntity> com.rcibanque.socle.server.ws.dlo.WsHistoriqueDlo.findHistoriqueDlo(java.lang.String,java.lang.String,java.lang.String,java.lang.String) 11:30:08,198 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] (MSC service thread 1-8) Looking for @ControllerAdvice: Root WebApplicationContext: startup date [Thu Aug 16 11:30:04 CEST 2018]; root of context hierarchy 11:30:08,248 INFO [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver] (MSC service thread 1-8) Detected @ExceptionHandler methods in wsExceptionHandlerAdvice 11:30:08,327 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-8) Root WebApplicationContext: initialization completed in 3565 ms 11:30:08,334 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/rci-sof-web-16.6.01-SNAPSHOT]] (MSC service thread 1-8) Initializing Spring FrameworkServlet 'dispatcher' 11:30:08,337 INFO [org.springframework.web.servlet.DispatcherServlet] (MSC service thread 1-8) FrameworkServlet 'dispatcher': initialization started 11:30:08,340 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] (MSC service thread 1-8) Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Thu Aug 16 11:30:08 CEST 2018]; parent: Root WebApplicationContext 11:30:08,345 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (MSC service thread 1-8) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 11:30:08,361 INFO [org.springframework.web.servlet.DispatcherServlet] (MSC service thread 1-8) FrameworkServlet 'dispatcher': initialization completed in 23 ms 11:30:08,364 INFO [stdout] (MSC service thread 1-8) null
11:30:08,365 INFO [com.rcibanque.socle.server.servlet.AbstractContextInitializerServlet] (MSC service thread 1-8) Propriétés chargées à partir de : null\rci_sof.properties 11:30:08,382 INFO [org.jboss.web] (MSC service thread 1-8) JBAS018210: Registering web context: /rci-sof-web-16.6.01-SNAPSHOT 11:30:08,388 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015951: Admin console listening on http://127.0.0.1:9990 11:30:08,390 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 66742ms - Started 263 of 341 services (76 services are passive or on-demand) 11:30:08,569 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "rci-sof-web-16.6.01-SNAPSHOT.war"
11:48:15,691 WARN [org.springframework.web.servlet.PageNotFound] (http--127.0.0.1-8080-2) No mapping found for HTTP request with URI [/rci-sof-web-16.6.01-SNAPSHOT/rci_sof/Index.html] in DispatcherServlet with name 'dispatcher' 11:48:20,311 WARN [org.springframework.web.servlet.PageNotFound] (http--127.0.0.1-8080-2) No mapping found for HTTP request with URI [/rci-sof-web-16.6.01-SNAPSHOT/Index.html] in DispatcherServlet with name 'dispatcher' 11:48:25,258 WARN [org.springframework.web.servlet.PageNotFound] (http--127.0.0.1-8080-2) No mapping found for HTTP request with URI [/rci-sof-web-16.6.01-SNAPSHOT/rci_sof/Index.html] in DispatcherServlet with name 'dispatcher' 11:48:42,939 WARN [org.springframework.web.servlet.PageNotFound] (http--127.0.0.1-8080-2) No mapping found for HTTP request with URI [/rci-sof/Index.html] in DispatcherServlet with name 'dispatcher'
感谢您的帮助。
最佳答案
我通过用“/”替换“/*”解决了这个问题,现在它可以在 Jboss、Jetty 和 Tomcat 中工作。
关于java - 为什么 spring 应用程序在 tomcat 和 jetty 服务器上工作,而在 jboss 服务器上以 404 响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51872884/
在没有指定上下文和上下文处理程序的情况下启动 jetty 实例是否正确,然后在服务器启动后继续向其添加上下文。尽管我能够使用可变 HandlerCollection 执行此操作并且日志显示服务器和上下
在没有指定上下文和上下文处理程序的情况下启动 jetty 实例是否正确,然后在服务器启动后继续向其添加上下文。尽管我能够使用可变 HandlerCollection 执行此操作并且日志显示服务器和上下
我正在尝试让 Jetty 在我的 Ubuntu 上自动启动。 我已经完成了这些命令: cp /opt/jetty/bin/jetty.sh /etc/init.d update-rc.d jett
我是 Jetty 和客户端/服务器架构的新手。 我设法在 Eclipse 中编写了一个 jetty 服务器,它可以工作。 但是我怎样才能停止 jetty 服务器呢?我听说过 stop.jar 和 st
我已经使用Jetty / tomcat应用服务器使用Spring Web应用程序工作了大约两年了,但是让我感到困惑的是如何在这些服务器中处理多个请求。我知道 Spring 有助于单例,但我的理解仅限于
我正在尝试使用 jetty 来使用 maven 托管一个简单的 helloworld servlet。我很困惑。 我关注了这些 instructions ,但是当我发出 mvn jetty:run ,
我正在使用 Jetty 9,我有 jetty.base 和 jetty.home,我想知道我什么时候启动 jetty,它以什么样的顺序调用 jetty.base 和 jetty.home,我的意思是一
我有一个 Ubuntu 服务器 10.10 64 位 在 上运行 Web 应用程序 jetty 6.1.24-6 在 Sun 的 JVM ,两者都是从标准 Ubuntu 存储库安装的。 我正在尝试查找
我在集成测试中使用 ShrinkWrap 启动 Jetty 服务器。 问题: 当我启动我的测试 jetty 服务器而不是制作我的 Controller 模型时 - 模型不起作用! 我认为原因是不同的类
使用Gradle帮助运行Jetty 9 我已经看到了在how-to-run-jetty-7-with-specified-war-with-groovy-gradle和setting_up_embed
我正在将一个项目打包到 docker jetty 镜像中,并且我正在尝试访问日志,但没有访问日志。 文件 FROM jetty:9.2.10 MAINTAINER Me "me@me.com" ADD
有没有办法解决jetty引起的文件锁定问题?完全来自 gradle ? 一些澄清: 使用 Gradle Jetty plugin 时通过运行 gradle jettyRun, jetty 导致静态资源
我最近才开始使用 Java(我最近的大部分经验都在 .NET 中)。作为这项工作的一部分,我一直在对 Jetty 和 Tomcat 进行一些比较。 我认为在我们的环境中 Tomcat 的一个功能是内置
我已将 Jetty 嵌入到 Java 应用程序中,并在 Jetty 服务器对象的实例上调用 start() 方法(在设置描述静态和动态 Web 内容位置的处理程序列表之后)。 start() 调用会阻
我正在使用 Jetty 部署生产网站。假设我的网站是 foo.com 当我将浏览器指向一个不存在的上下文(比如 foo.com/notavailable)时,Jetty 会显示一个错误页面,其中包含部
我想使用 Jetty 的嵌入式版本创建一个应用程序。不幸的是,我找不到有关我需要这样做的 jar 文件的任何信息。 Maven 存储库中有几个( http://repo2.maven.org/mave
This answer explains how the server version header can be completely removed通过使用 HttpConfiguration.s
有人可以告诉我DispatcherType在做什么吗? 似乎是重要的配置。 指向ServletContextHandler#addFilter之类的东西对类的使用也没有帮助,对我来说,“ aa”是明智
我正在尝试使用jetty gradle插件运行Jetty服务器进行功能测试。但是,我得到了java.lang.IllegalArgumentException: Object is not of ty
我需要在gradle构建中创建多种不同的模式来运行 jetty 。 它们的系统属性和类路径不同。 如何使用Gradle Jetty插件进行操作? 最佳答案 您可以创建JettyRun类型的多个任务。要
我是一名优秀的程序员,十分优秀!