我正在使用JBoss 9.x应用程序服务器,我想创建一个REST API来与我的EJB进行通信。 我创建了两个类PlayerRestApi和PlayerEJB和部署到wildfly,但是当我请求/播放器的反应总是404为EJB创建REST API
注:我将张贴PlayerRestApi类与虚拟的回报。
PlayerRestApi代码:
@Local
@Path("/player")
@Consumes("application/json")
@Produces("application/json")
public class PlayerRestApi{
PlayerEJB player;
@GET
public Map<String, String> getPlayer(){
Map<String, String> r = new HashMap<String,String>();
r.put("Name","Ronaldo");
return r;
}
}
当我试图这条路线,本地主机:http://localhost:28070/appname/player Wildfly返回404
我觉得野蛮9.0+不需要web.xml文件,它是正确的? – urb
嗨,我还没有使用wildfly 9.0+。我不知道是否有一个实例可以开箱即可提供休息服务...... –