Wildfly 8 host EJB 3.x application problems

女生的网名这么多〃 提交于 2019-12-11 09:35:59

问题


I use Wildfly 8, SDK 1.7, and Intellij IDE and try to make basic ejb server.

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. Everything compiles fine.

So, i tried to deploy server:ejb artifact into Wildfly, but it's unsuccessful:

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?


回答1:


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.

Given this exception:

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

server_ejb.jar not include Test interface, you must include that in your deployment.

I hope this help.



来源:https://stackoverflow.com/questions/26690027/wildfly-8-host-ejb-3-x-application-problems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!