Reputation: 2367
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?
Upvotes: 1
Views: 625
Reputation: 5208
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.
Upvotes: 1