Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Optaplanner 6.4.0 webexample车辆路径休息服务未找到错误_Java_Rest_Wildfly_Optaplanner - Fatal编程技术网

Java Optaplanner 6.4.0 webexample车辆路径休息服务未找到错误

Java Optaplanner 6.4.0 webexample车辆路径休息服务未找到错误,java,rest,wildfly,optaplanner,Java,Rest,Wildfly,Optaplanner,我们刚刚开始使用Optaplanner进行试验,并尝试在Optaplanner 6.4.0-SNAPSHOT中运行车辆路径webexamples 当加载传单.jsp时,我们会看到“Error Not found”js弹出窗口。仔细观察,野蝇似乎又回来了 404找不到的错误 获取/休息/车辆路线/解决方案 及 405(不允许使用方法)用于 POST/rest/VehiclerRouting/solution/solve (似乎是由lapper.jsp中的loadsolution ajax函数触发的

我们刚刚开始使用Optaplanner进行试验,并尝试在Optaplanner 6.4.0-SNAPSHOT中运行车辆路径webexamples

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

404找不到的错误

获取/休息/车辆路线/解决方案

及 405(不允许使用方法)用于 POST/rest/VehiclerRouting/solution/solve

(似乎是由lapper.jsp中的loadsolution ajax函数触发的) 在独立模式下使用wildfly-servlet-10.0.0.Beta1(对wildfly来说也是非常新的)。 (操作系统windows 7)

同样的错误也见于6.3

我们非常感谢为解决这一问题所作的任何投入

提前感谢,

普拉萨德 从leaftlet.jsp添加代码段 (与6.4.0快照相同)

loadSolution=function(){
$.ajax({
url:“/rest/VehiclerRouting/solution”,
键入:“获取”,
数据类型:“json”,
成功:功能(解决方案){
var标记=[];
$.each(solution.customerList,函数(索引,客户){
var customerIcon=L.divIcon({
iconSize:新的L点(20,20),
类名:“vehicleRoutingCustomerMarker”,
html:“+customer.demand+”
});
var marker=L.marker([customer.latitude,customer.longitude],{icon:customerIcon});
marker.addTo(map.bindpoop(customer.locationName+“
Deliver”+customer.demand+“items”); 标记器。推(标记器); }); fitBounds(L.featureGroup(markers.getBounds()); },error:function(jqXHR,textStatus,errorhown){ajaxError(jqXHR,textStatus,errorhown)} });
})

来自github:


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


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

编辑了这个问题的代码段:您是在EAP 6.4还是WildFly 8.1+上部署的?我的错,是在“仅Servlet发行版”10.0.0.Beta1上运行的,所以它给出了错误。安装并运行在“ApplicationServerDistribution”10.0.0.Beta1上,现在可以正常工作:)。谢谢你,杰弗里
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)}
});