Optaplanner 6.4.0 webexample vehicle routing rest service not found报错

Optaplanner 6.4.0 webexample vehicle routing rest service not found error

我们刚刚开始使用 Optaplanner 进行试验,并正在尝试 运行 OptaPlanner 6.4.0-SNAPSHOT 中的车辆路线网络示例。

当 leaflet.jsp 加载时,我们会看到 "Error Not found" js 弹出窗口。仔细观察,似乎野蝇又回来了

404 未找到错误。

获取/rest/vehiclerouting/solution

和 405(不允许的方法)对于 POST/rest/vehiclerouting/solution/求解

(好像是由leaflet.jsp中的loadsolution ajax函数触发的) 在独立模式下使用 wildfly-servlet-10.0.0.Beta1(对于 wildfly 来说也是非常新的)。 (OS windows 7)

6.3 中也出现同样的错误。

感谢任何解决此问题的意见。

提前致谢,

普拉萨德

添加来自 leaftlet.jsp 的代码片段 (来自 6.4.0 快照)

loadSolution = function() {
$.ajax({
  url: "<%=application.getContextPath()%>/rest/vehiclerouting/solution",
  type: "GET",
  dataType : "json",
  success: function(solution) {
    var markers = [];
    $.each(solution.customerList, function(index, customer) {
      var customerIcon = L.divIcon({
        iconSize: new L.Point(20, 20),
        className: "vehicleRoutingCustomerMarker",
        html: "<span>" + customer.demand + "</span>"
      });
      var marker = L.marker([customer.latitude, customer.longitude], {icon: customerIcon});
      marker.addTo(map).bindPopup(customer.locationName + "</br>Deliver " + customer.demand + " items.");
      markers.push(marker);
    });
    map.fitBounds(L.featureGroup(markers).getBounds());
  }, error : function(jqXHR, textStatus, errorThrown) {ajaxError(jqXHR, textStatus, errorThrown)}
});

};

来自 github :

VehicleRoutingRestService.java

web.xml

其余的 api 需要支持 JAX-RS 的应用服务器,例如 JBoss EAP 6.4 或 WildFly 8.1。

对于 Tomcat 等,必须以某种方式专门添加 JAX-RS(例如 RESTEasy)。