简体   繁体   English

Wildfly 8托管EJB 3.x应用程序问题

[英]Wildfly 8 host EJB 3.x application problems

I use Wildfly 8, SDK 1.7, and Intellij IDE and try to make basic ejb server. 我使用Wildfly 8,SDK 1.7和Intellij IDE,并尝试制作基本的ejb服务器。

I made the project which contains two child modules: interface and server. 我制作了包含两个子模块的项目:接口和服务器。

Interface: 接口:

package testing;
...
@Remote
public interface Test {
public void sayHi();
}

Server: 服务器:

package srv;
...
import testing.Test;

@Stateless
public class TestBean implements Test {

    @Override
    public void sayHi() 
    {
        System.out.println("Hi");
    }
}

The dependencies are javax.ejb.jar for both modules and jboss-client + my interface for server one. 这两个模块的依赖关系均为javax.ejb.jar ,服务器一的依赖关系为jboss-client + my interface Everything compiles fine. 一切都编译良好。

So, i tried to deploy server:ejb artifact into Wildfly, but it's unsuccessful: 因此,我尝试将server:ejb工件部署到Wildfly中,但未成功:

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."server_ejb.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."server_ejb.jar".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "server_ejb.jar"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
...
Caused by: java.lang.LinkageError: Failed to link srv/TestBean (Module "deployment.server_ejb.jar:main" from Service Module Loader)
...
Caused by: java.lang.NoClassDefFoundError: testing/Test
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_67]
at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_67]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482) [jboss-modules.jar:1.3.3.Final]
... 19 more

Whats wrong? 怎么了?

The EJB JAR contains one or more EJBs, including their interface definitions, any related Java classes that are being used by the EJBs, and a deployment descriptor describing these EJBs. EJB JAR包含一个或多个EJB,包括其接口定义,该EJB使用的任何相关Java类以及描述这些EJB的部署描述符。

Given this exception: 鉴于此例外:

Caused by: java.lang.NoClassDefFoundError: testing/Test

server_ejb.jar not include Test interface, you must include that in your deployment. server_ejb.jar不包括Test接口,您必须在部署中包括该接口。

I hope this help. 希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM