不能在ejb@remote接口中包含实体依赖项,但可以在ejb实现中工作

guicsvcw  于 2021-08-25  发布在  Java
关注(0)|答案(0)|浏览(209)

大家好,我试过以下方法

package fr.usu.server.service.instance;

import java.util.List;

import javax.ejb.Remote;

import fr.usu.server.commons.exceptions.SmartCollectException;
import fr.usu.server.dto.instance.InstanceSoftwareDto;
import fr.usu.server.dto.smartcollect.ServerSoftwareDto;
import fr.usu.server.entity.referential.software.Software;

@Remote
public interface InstanceSoftwareService {
    List<ServerSoftwareDto> getInstanceSoftwareByServerAndEditorAndCompany(Long serverId, Long editorId, Long companyId, Long lang);

    List<ServerSoftwareDto> getInstanceSoftwareByServerAndEditorAndCompany(Software soft);

使用maven编译和创建项目,但在运行时得到以下结果
查找usu服务器ear/usu服务器服务/instancesoftwareserviceimpl失败[根异常为java.lang.noclassdeffounderror:fr/usu/server.entity.referential.software.software]
事实上,在服务的实现中,我被允许使用实体。。。似乎它们不允许作为方法参数。。。
这里是服务项目的pom.xml片段

<parent>
        <groupId>fr.usu.server</groupId>
        <artifactId>usu-server</artifactId>
        <version>5.16.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>usu-server-services</artifactId>
    <packaging>ejb</packaging>

    <dependencies>
        <dependency>
            <groupId>fr.usu.server</groupId>
            <artifactId>usu-server-ejb-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.usu.server</groupId>
            <artifactId>usu-server-dto</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.usu.server</groupId>
            <artifactId>usu-server-model</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.usu.server</groupId>
            <artifactId>usu-server-ws-commons</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fr.usu.server</groupId>
            <artifactId>usu-server-model</artifactId>
            <type>test-jar</type>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>

这里是来自wildfly的server.log

... 155 more
Caused by: javax.naming.NamingException: WFLYNAM0062: Failed to lookup usu-server-ear/usu-server-services/InstanceSoftwareServiceImpl [Root exception is java.lang.NoClassDefFoundError: fr/usu/server/entity/instance/InstanceSoftware]
    at org.jboss.as.naming@20.0.1.Final//org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:159)
    at org.jboss.as.naming@20.0.1.Final//org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:83)
    at org.jboss.as.naming@20.0.1.Final//org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
    at org.jboss.as.naming@20.0.1.Final//org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)
    at org.jboss.as.naming@20.0.1.Final//org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)
    at org.jboss.as.naming@20.0.1.Final//org.jboss.as.naming.deployment.ContextNames$BindInfo$1$1.getReference(ContextNames.java:322)
    ... 156 more
Caused by: java.lang.NoClassDefFoundError: fr/usu/server/entity/instance/InstanceSoftware
    at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3166)
    at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3191)
    at java.base/java.lang.Class.getMethods(Class.java:1904)
    at java.base/java.lang.reflect.Proxy$ProxyBuilder.referencedTypes(Proxy.java:712)
    at java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:624)
    at java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:635)
    at java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Proxy.java:415)
    at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
    at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
    at java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:413)
    at java.base/java.lang.reflect.Proxy.getProxyClass(Proxy.java:384)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBProxyInformation$1.doCompute(EJBProxyInformation.java:77)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBProxyInformation$1.computeValue(EJBProxyInformation.java:72)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBProxyInformation$1.computeValue(EJBProxyInformation.java:66)
    at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:226)
    at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:208)
    at java.base/java.lang.ClassValue.get(ClassValue.java:114)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBProxyInformation.forViewType(EJBProxyInformation.java:242)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBLocator.getProxyInformation(EJBLocator.java:375)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBLocator.getProxyConstructor(EJBLocator.java:370)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBLocator.createProxyInstance(EJBLocator.java:387)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBClient.createProxy(EJBClient.java:161)
    at org.jboss.ejb-client@4.0.33.Final//org.jboss.ejb.client.EJBClient.createProxy(EJBClient.java:156)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题