JBPM 6 REST接口响应404

时间:2014-05-03 11:03:56

标签: java rest jbpm

在BRM​​S 5(使用JBPM 5.2)中,当我转到http://localhost:8080/business-central-server/rs/server/resources/jbpm时,我列出了所有可用的方法,但在BRMS 6中没有业务中心服务器应用程序,它只是业务 - 中心 - 我在哪里可以找到类似的页面?

我还尝试使用以下代码连接REST:

public class Test {
    public static void main(String[] args) throws MalformedURLException {
        String deploymentId = "com.example.test:test_project:1.0";
        URL baseUrl = new URL("http://localhost:8080/business-central");
        String user = "aswu";
        String password = "uwsa@123";
        RemoteRestRuntimeFactory restSessionFactory = new RemoteRestRuntimeFactory(
                deploymentId, baseUrl, user, password);
        System.out.println("Is RemoteRestRuntimeFactory created : "
            + (restSessionFactory != null));
        RemoteRuntimeEngine runtimeEngine = restSessionFactory
                .newRuntimeEngine();
        KieSession kieSession = runtimeEngine.getKieSession();
        System.out.println("Is KieSession obtained : " + (kieSession != null));
        kieSession.startProcess("test-project.test-process");
    }
}

我得到了例外:

Exception in thread "main" java.lang.RuntimeException: Error invoking StartProcessCommand via REST (http://localhost:8080/business-central/rest/runtime/com.example.test:test_project:1.0/execute):

<html><head><title>JBoss Web/7.2.2.Final-redhat-1 - JBWEB000064: Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>JBWEB000065: HTTP Status 404 - Could not find resource for relative : /runtime/com.example.test:test_project:1.0/execute of full path: http://localhost:8080/business-central/rest/runtime/com.example.test:test_project:1.0/execute</h1><HR size="1" noshade="noshade"><p><b>JBWEB000309: type</b> JBWEB000067: Status report</p><p><b>JBWEB000068: message</b> <u>Could not find resource for relative : /runtime/com.example.test:test_project:1.0/execute of full path: http://localhost:8080/business-central/rest/runtime/com.example.test:test_project:1.0/execute</u></p><p><b>JBWEB000069: description</b> <u>JBWEB000124: The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.2.2.Final-redhat-1</h3></body></html>
at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:342)
at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:110)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:232)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)
at pl.worc.pwr.student.vl.workflow.brms.Test.main(Test.java:30)

2 个答案:

答案 0 :(得分:0)

您可以尝试将代码中的网址更改为:&#34; http://:8080 / business-central-server&#34; ?没有&lt;&gt;

答案 1 :(得分:0)

也许你已经在创作环境中安装了BRMS,而不是执行一个。所以你不能在它上面运行这个过程。

https://community.jboss.org/thread/240717