drools workbench + kie server+spiringboot 地址不正确(ERORR 404))

weixin_40564561 weixin_40564561 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
报错信息如下:

15:36:02.908 [main] DEBUG org.kie.server.client.impl.AbstractKieServicesClientImpl - Unexpected HTTP response code when requesting URI 'http://localhost:8180/kie-server/services/rest/server//containers/instances/entity'! Error code: 404, message: RESTEASY003210: Could not find resource for full path: http://localhost:8180/kie-server/services/rest/server//containers/instances/entity, response body: RESTEASY003210: Could not find resource for full path: http://localhost:8180/kie-server/services/rest/server//containers/instances/entity

org.kie.server.api.exception.KieServicesHttpException: Unexpected HTTP response code when requesting URI 'http://localhost:8180/kie-server/services/rest/server//containers/instances/entity'! Error code: 404, message: RESTEASY003210: Could not find resource for full path: http://localhost:8180/kie-server/services/rest/server//containers/instances/entity

at org.kie.server.client.impl.AbstractKieServicesClientImpl.createExceptionForUnexpectedResponseCode(AbstractKieServicesClientImpl.java:617)
at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(AbstractKieServicesClientImpl.java:290)
at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(AbstractKieServicesClientImpl.java:264)
at org.kie.server.client.impl.RuleServicesClientImpl.executeCommandsWithResults(RuleServicesClientImpl.java:66)
at KieServerTest.test1(KieServerTest.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)




http://localhost:8180/kie-server/services/rest/server/
信息入下:

http://localhost:8180/kie-server/services/rest/server/containers
信息如下:

spring boot 代码如下
pom.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starters</artifactId>
<version>2.0.6.RELEASE</version>
</parent>
<groupId>com.itheima</groupId>
<artifactId>calculation</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<!--drools规则引擎-->
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>7.31.0.Final</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>7.31.0.Final</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-templates</artifactId>
<version>7.31.0.Final</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>7.31.0.Final</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-spring</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
<version>7.31.0.Final</version>
</dependency>

<dependency>
<groupId>org.kie.server</groupId>
<artifactId>kie-server</artifactId>
<version>7.12.0.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.22</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.51</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.9</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>


测试代码如下:

import com.alibaba.fastjson.JSONObject;
import com.itheima.drools.entity.Calculation;
import org.junit.Test;
import org.kie.api.KieServices;
import org.kie.api.command.BatchExecutionCommand;
import org.kie.api.command.Command;
import org.kie.api.command.KieCommands;
import org.kie.api.runtime.ExecutionResults;
import org.kie.server.api.marshalling.MarshallingFormat;
import org.kie.server.api.model.ServiceResponse;
import org.kie.server.client.KieServicesClient;
import org.kie.server.client.KieServicesConfiguration;
import org.kie.server.client.KieServicesFactory;
import org.kie.server.client.RuleServicesClient;

import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

import static com.itheima.drools.config.KieServerConfig.KIE_CONTAINER_ID;

public class KieServerTest {

public static final String SERVER_URL = "http://localhost:8180/kie-server/services/rest/server/";
public static final String PASSWORD = "admin";
public static final String USERNAME = "admin";
//public static final String KIE_CONTAINER_ID = "entity_1.0.0-SNAPSHOT";
public static final String KIE_CONTAINER_ID = "entity";
//public static final String KIE_CONTAINER_ID = "com.itheima.drools.entity.entity_1.0.0-SNAPSHOT";
@Test
public void test1(){

// KisService 配置信息设置
KieServicesConfiguration kieServicesConfiguration =
KieServicesFactory.newRestConfiguration(SERVER_URL, USERNAME, PASSWORD, 10000L);
kieServicesConfiguration.setMarshallingFormat(MarshallingFormat.JSON);

// 创建规则服务客户端
KieServicesClient kieServicesClient = KieServicesFactory.newKieServicesClient(kieServicesConfiguration);
RuleServicesClient ruleServicesClient = kieServicesClient.getServicesClient(RuleServicesClient.class);

KieServices kieServices = KieServices.Factory.get();
KieCommands kieCommands = kieServices.getCommands();
List<Command<?>> commands = new LinkedList<>();

Calculation calculation = new Calculation();
calculation.setWage(10000);

commands.add(kieCommands.newInsert(calculation, "calculation"));
commands.add(kieCommands.newFireAllRules());
BatchExecutionCommand batchExecutionCommand = kieCommands.newBatchExecution(commands, "session2");
ServiceResponse<ExecutionResults> results = ruleServicesClient.executeCommandsWithResults(KIE_CONTAINER_ID, batchExecutionCommand);

Calculation value = (Calculation) results.getResult().getValue("calculation");
System.out.println(JSONObject.toJSON(value).toString());
}
}
...全文

相关推荐

智慧家居App系统方案[可运行源码]

本文详细介绍了基于SpringBoot+Vue的安卓智慧家居App系统的技术栈、功能模块、数据库设计及系统测试方案。技术栈涵盖后端(SpringBoot 2.7.x + MySQL + Redis)、前端(Vue 3 + TypeScript)和安卓端(Kotlin + Retrofit)。功能模块包括用户管理、设备控制、智能场景、数据统计和消息推送。数据库设计部分提供了核心表结构,如用户表、设备表和场景规则表。系统测试方案包括接口测试、MQTT消息测试、安卓端兼容性测试和压力测试。源码结构示例展示了后端、前端和安卓端的代码组织方式。

pink

40-基于89C52的量程自适应切换数字电压表设计(设计+说明+原理+仿真).rar

项目40-基于89C52的量程自适应切换数字电压表设计 资料包括Proteus仿真+Keil程序+Altium Designer原理图+软件安装包+参考设计说明书+答辩PPT+设计流程图,保证资料完整性! 功能: (1)本设计以89C52单片机为控制核心,具备高效数据处理与控制能力,可稳定驱动量程自适应切换数字电压表工作。 (2)采用ADC0808作为模数转换传感器,精准将模拟电压信号转换为数字信号,为电压测量提供准确数据基础。 (3)配备数码管显示器,清晰直观呈现测量得到的电压数值,方便用户快速读取电压信息,了解测量结果。 (4)具有自动量程切换功能,能依据输入电压大小智能调整量程,确保测量精度,拓宽电压测量范围。 (5)以待测电压输入为监测对象,资料包含原理图等,助力学生掌握量程自适应数字电压表设计要点。

创界工坊工作室

《人形机器人自适应形态学的变形覆盖建模与控制》,.zip

1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

海神之光

neo4j-community-5.26.32-unix.tar 自己编译 带neo4j-browser-2026.10.08+0.zip 解压可直接运行

neo4j-community-5.26.32-unix.tar 自己编译 带neo4j-browser-2026.10.08+0.zip 解压可直接运行

夢隨心逝

三电平ANPC并网逆变器+DPWMA调制控制+正负序分离+电网前馈控制仿真

内容概要:本资源系统性地提供了三电平ANPC并网逆变器的Simulink仿真体系,聚焦于DPWMA调制控制、正负序电流分离、电网电压前馈补偿、中点电位平衡控制以及虚拟同步发电机(VSG)等核心技术,构建了完整的构网型逆变器控制框架。内容涵盖弱电网条件下逆变器的正负序阻抗建模与稳定性分析,采用扫频法实现精确的序阻抗辨识,并集成低电压穿越(LVRT)、孤岛检测、预测电流控制等多种典型工况仿真模型。所有模块均配套参考文献与仿真文件,部分为SCI论文复现成果,兼具理论深度与工程实用性,适用于先进控制策略的研发与验证。; 适合人群:面向电力电子、新能源发电、微电网及电力系统自动化等方向的研究生、科研人员及从事并网逆变器控制算法开发的工程技术人员,要求具备扎实的电力系统基础知识和一定的Simulink建模能力。; 使用场景及目标:①支持高校与科研机构开展三电平ANPC逆变器先进控制策略的教学与研究;②服务于高水平学术论文的复现与创新性控制方法(如VSG、MPC、DPWMA)在复杂电网环境下的性能验证;③助力工程师进行并网逆变器控制系统的设计、优化与稳定性评估。; 阅读建议:建议结合所提供的参考文献与仿真模型同步学习,先掌握双闭环控制与中点电位调节的基本架构,再逐步深入正负序分离、阻抗建模与稳定判据等高阶内容,注重理论推导、参数设计与仿真实验之间的闭环验证与相互印证。

欢多天天写代码
评论
收藏 已收藏
分享
返回顶部
weixin_40564561
Java 51,407 成员 86,130 内容