1
我想在Camunda BPM示例项目(嵌入式弹簧休息)中使用RESTEasy的异步HTTP请求处理功能。为了测试现有的pom file是否可以,我在RestProcessEngineDeployment.java
中输入了对Suspend
和AsynchronousResponse
的声明。但是编译失败了。编译错误:找不到符号挂起和AsynchronousResponse
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project camunda-quickstart-embedded-spring-rest: Compilation failure: Compilation failure:
[ERROR] /home/vagrant/works/eclipse-workspace/camunda-bpm-examples/deployment/embedded-spring-rest/src/main/java/org/camunda/bpm/example/loanapproval/rest/RestProcessEngineDeployment.java:[7,19] cannot find symbol
[ERROR] symbol: class Suspend
[ERROR] location: package javax.ws.rs
[ERROR] /home/vagrant/works/eclipse-workspace/camunda-bpm-examples/deployment/embedded-spring-rest/src/main/java/org/camunda/bpm/example/loanapproval/rest/RestProcessEngineDeployment.java:[8,24] cannot find symbol
[ERROR] symbol: class AsynchronousResponse
[ERROR] location: package javax.ws.rs.core
POM file看起来没问题。它包含必要的依赖关系:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.0.8.Final</version>
</dependency>
web.xml file也看起来没问题。它包含filter
和filter-mapping
,如RESTEasy user guide中所建议的。
<filter>
<filter-name>Resteasy</filter-name>
<filter-class>
org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
</filter-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>org.camunda.bpm.example.loanapproval.rest.RestProcessEngineDeployment</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Resteasy</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
我错过了什么吗?任何线索,我怎么能找出问题?
也许你想['javax.ws.rs.container.AsyncResponse'] (https://docs.oracle.com/javaee/7/api/javax/ws/rs/container/AsyncResponse.html)和['@ javax.ws.rs.container.Suspended'](https:// docs .oracle.com/JavaEE的/ 7/API /的javax/WS/RS /容器/ Suspended.html)。很难说没有看到一些代码。 – 2014-12-07 11:48:34
@peeskillet,你是对的!我提出错误的进口陈述。我应该注意到,在[RESTEasy用户指南](http://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html_single/index。)中,导入语句和实际使用的接口/注释是不同的。 HTML#Asynchronous_HTTP_Request_Processing)。 – 2014-12-07 12:03:46
@peeskillet您能否将评论作为答案。我想接受答案。它解决了这个问题。 – 2014-12-07 23:39:52