OfBiz找不到Java服务

OfBiz找不到Java服务,java,ofbiz,Java,Ofbiz,我正在使用OfBiz 16.11.03并尝试实现一些新服务。使用engine=“entity auto”设置的每个服务都可以正常工作。但是,当我尝试在运行时使用engine=“java”创建服务时,它无法定位实现类。 以下是我所做的: 在热部署文件夹中,我有一个ofbiz-component.xml规范 <service-resource type="model" loader="main" location="servicedef/services.xml"/> <!--

我正在使用OfBiz 16.11.03并尝试实现一些新服务。使用engine=“entity auto”设置的每个服务都可以正常工作。但是,当我尝试在运行时使用engine=“java”创建服务时,它无法定位实现类。 以下是我所做的: 在热部署文件夹中,我有一个ofbiz-component.xml规范

<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<classpath type="jar" location="build/libs/*"/>

<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->


<test-suite loader="main" location="testdef/MyappTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="myapp"
    title="Myapp"
    server="default-server"
    location="webapp/myapp"
    base-permission="OFBTOOLS,MYAPP"
    mount-point="/myapp"/>
当然,该插件是用gradlew createPlugin-PpluginId=myplugin创建的,移动到热部署,并从specialpurpose中的component-load.xml中删除了相应的条目,因此调度器存在

<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<classpath type="jar" location="build/libs/*"/>

<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->


<test-suite loader="main" location="testdef/MyappTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="myapp"
    title="Myapp"
    server="default-server"
    location="webapp/myapp"
    base-permission="OFBTOOLS,MYAPP"
    mount-point="/myapp"/>
有什么东西不见了吗

<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<classpath type="jar" location="build/libs/*"/>

<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->


<test-suite loader="main" location="testdef/MyappTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="myapp"
    title="Myapp"
    server="default-server"
    location="webapp/myapp"
    base-permission="OFBTOOLS,MYAPP"
    mount-point="/myapp"/>
更新: 似乎在我的应用程序的类路径中没有相应地设置ofbiz库。 我通过添加
(完整的biz-component.xml见下文)。 现在,SomeServices.class被放在ofbiz.jar根目录中,而不是com/mycompany/myapp/services/SomeServices.class。 我可以通过将服务定位在services.xml中服务定义中的“SomeServices”来访问该服务,但我认为缺少将SomeServices放入正确文件夹的部分

<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<classpath type="jar" location="build/libs/*"/>

<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->


<test-suite loader="main" location="testdef/MyappTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="myapp"
    title="Myapp"
    server="default-server"
    location="webapp/myapp"
    base-permission="OFBTOOLS,MYAPP"
    mount-point="/myapp"/>
更新#2:IDE没有将类SomeServices.java放入正确的包中。添加
包com.mycompany.myapp.services到类解决了问题

<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<classpath type="jar" location="build/libs/*"/>

<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->


<test-suite loader="main" location="testdef/MyappTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="myapp"
    title="Myapp"
    server="default-server"
    location="webapp/myapp"
    base-permission="OFBTOOLS,MYAPP"
    mount-point="/myapp"/>
以下是我的ofbiz-component.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<classpath type="jar" location="build/libs/*"/>

<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->


<test-suite loader="main" location="testdef/MyappTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="myapp"
    title="Myapp"
    server="default-server"
    location="webapp/myapp"
    base-permission="OFBTOOLS,MYAPP"
    mount-point="/myapp"/>

<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<classpath type="jar" location="build/libs/*"/>

<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->


<test-suite loader="main" location="testdef/MyappTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="myapp"
    title="Myapp"
    server="default-server"
    location="webapp/myapp"
    base-permission="OFBTOOLS,MYAPP"
    mount-point="/myapp"/>


请复制插件的ofbiz-component.xml文件的内容好吗?检查组件中的build.xml。您需要在之前包含build lib。请复制插件的ofbiz-component.xml文件的内容好吗?请检查组件中的build.xml。您需要在之前包含构建库。
<!-- place the config directory on the classpath to access configuration files -->
<classpath type="dir" location="config"/>
<classpath type="dir" location="dtd"/>
<classpath type="jar" location="build/libs/*"/>

<!-- entity resources: model(s), eca(s), group, and data definitions -->
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
<!-- <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> -->
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappTypeData.xml"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyappSecurityPermissionSeedData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappSecurityGroupDemoData.xml"/>
<entity-resource type="data" reader-name="demo" loader="main" location="data/MyappDemoData.xml"/>

<!-- service resources: model(s), eca(s) and group definitions -->
<service-resource type="model" loader="main" location="servicedef/services.xml"/>
<!--
<service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
<service-resource type="group" loader="main" location="servicedef/groups.xml"/>
-->


<test-suite loader="main" location="testdef/MyappTests.xml"/>

<!-- web applications; will be mounted when using the embedded container -->
<webapp name="myapp"
    title="Myapp"
    server="default-server"
    location="webapp/myapp"
    base-permission="OFBTOOLS,MYAPP"
    mount-point="/myapp"/>