Java 为什么@GZIP在jboss7.1.0 eap中不返回响应
我正试图从邮递员那里得到回复,我在JBoss7.1.0EAP服务器中部署了war文件。但《邮递员》没有给我任何回应。日志中没有错误。 我在回复中使用了@GZIP,我听说JBoss不支持GZIP,也许这就是为什么它不给出回复的原因。 同一war文件在旧JBoss5.1服务器中给出响应,没有问题 我有什么办法来解决这个问题。 如果我评论一下//@GZIP,它所花费的时间是巨大的,这导致了邮递员本身的崩溃。 如何在JBoss7.1.0中解决此问题Java 为什么@GZIP在jboss7.1.0 eap中不返回响应,java,spring,rest,java-8,jboss,Java,Spring,Rest,Java 8,Jboss,我正试图从邮递员那里得到回复,我在JBoss7.1.0EAP服务器中部署了war文件。但《邮递员》没有给我任何回应。日志中没有错误。 我在回复中使用了@GZIP,我听说JBoss不支持GZIP,也许这就是为什么它不给出回复的原因。 同一war文件在旧JBoss5.1服务器中给出响应,没有问题 我有什么办法来解决这个问题。 如果我评论一下//@GZIP,它所花费的时间是巨大的,这导致了邮递员本身的崩溃。 如何在JBoss7.1.0中解决此问题 @POST @Path("/copy
@POST
@Path("/copyCatalog")
@GZIP
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public com.gee.gecs.cosmos.webservice.autocat.insertupdateresponse.CatalogData getcopyCatalog(CopyCatalogData cd) {
//CopyCatalogResponse response = new CopyCatalogResponse();
//CopyCatalogResponse copyCatalogRes =new CopyCatalogResponse();
com.gee.gecs.cosmos.webservice.autocat.insertupdateresponse.CatalogData copyCatalogRes=
new com.gee.gecs.cosmos.webservice.autocat.insertupdateresponse.CatalogData();
try {
AutoCatRequestProcessorCopyCatalog requestProcessor = new AutoCatRequestProcessorCopyCatalog(cd, copyCatalogRes);
requestProcessor.processRequest();
} catch (AutoCatException e) {
copyCatalogRes.setResponsecode(exceptionMap.get(e.getFaultCode()));
copyCatalogRes.setResponsestatus(e.getFaultMessage());
}
return copyCatalogRes;
}
JBoss服务器中的日志
15:43:06,773 INFO [com.gee.gecs.cosmos.webservice.autocat.util.AutoCatRequestProcessorCopyCatalog] (default task-2) inside copy catalog functionality
15:43:30,631 INFO [com.gee.gecs.cosmos.webservice.autocat.util.AutoCatRequestProcessorCopyCatalog] (default task-2) New Ctlg_ver_in 16479765
15:43:32,470 INFO [com.gee.gecs.cosmos.webservice.autocat.cache.ICAMAutoCATCacheSingleton] (default task-2) Start: ICAMAutoCATCacheSingleton getICAMAutoCATCache()
15:43:32,471 INFO [com.gee.gecs.cosmos.webservice.autocat.cache.ICAMAutoCATCacheSingleton] (default task-2) End: ICAMAutoCATCacheSingleton getICAMAutoCATCache()
该问题已通过谷歌代码webutilities解决。 在pom.xml中添加了依赖项,并在web.xml中添加了过滤器
<dependency>
<groupId>com.googlecode.webutilities</groupId>
<artifactId>webutilities</artifactId>
<version>0.0.8</version>
</dependency>
com.googlecode.webutilities
网络实用程序
0.0.8
在web.xml中,我们添加了压缩过滤器:
<filter>
<filter-name>compressionFilter</filter-name>
<filter-class>com.googlecode.webutilities.filters.CompressionFilter</filter-class>
<init-param>
<param-name>compressionThreshold</param-name>
<param-value>1024</param-value> <!-- compress anything above 1kb -->
</init-param>
<init-param>
<param-name>ignoreURLPattern</param-name>
<param-value>.*\.(flv|mp3|mpg)</param-value> <!-- regex -->
</init-param>
<init-param>
<param-name>ignoreMIMEPattern</param-name>
<param-value>image/.*|video/.*|multipart/x-gzip</param-value> <!-- ignore -->
</init-param>
<init-param>
<param-name>ignoreUserAgentsPattern</param-name>
<param-value>.*MSIE.*</param-value> <!-- regex -->
</init-param>
</filter>
<filter-mapping>
<filter-name>compressionFilter</filter-name>
<url-pattern>/services/xxx/xxxx</url-pattern>
</filter-mapping>
压缩滤波器
com.googlecode.webutilities.filters.CompressionFilter
压缩阈值
1024
忽略模式
*\(flv | mp3 | mpg)
信号模式
图像/*|视频/*|多部分/x-gzip
ignoreUserAgentsPattern
*MSIE.*
压缩滤波器
/服务/xxx/xxxx
请尝试使用curl和soapUI,EAP上的标题有时会出现邮递员默认配置问题使用soapUI无法解决问题。给同样的空白屏幕