开发者

JBoss not recognizing EJB jar inside of an EAR

开发者 https://www.devze.com 2023-02-28 04:39 出处:网络
I\'m trying to deploy a simple test EAR containing and EJB project to JBoss AS 6. I copy my EAR file to my JBOSS_HOME/server/default/deploy dir.I can see my SUP.ear show up in the JBoss AS 6 Admin Co

I'm trying to deploy a simple test EAR containing and EJB project to JBoss AS 6.

I copy my EAR file to my JBOSS_HOME/server/default/deploy dir. I can see my SUP.ear show up in the JBoss AS 6 Admin Console under 开发者_开发技巧Enterprise Application (EAR)s, but I do NOT see the EJB3 jar show up under Embedded EJB3 JARs. I don't see the beans load in the JBoss console, and cannot access them.

I tried downloading the JBoss tutorials from www.manning.com/panda and built and deployed the chapter 1 example, and those beans load fine and I can access them from a client with no problems...

Here is the structure of my EAR file:

SUP.ear
|--META-INF
  |--application.xml
  |--jboss-app.xml
  |--MANIFEST.MF
|--SUP-ejb.jar
  |--com
    |--tomtresansky
      |--sup
        |--server
          |--ejb
            |--CalculatorBean.class
            |--CalculatorLocal.class
            |--CalculatorRemote.class
  |--META-INF
    |--MANIFEST.MF

Application.xml:

<?xml version="1.0"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd">
<application>
  <display-name>SUP</display-name>
  <module>
    <ejb>SUP-ejb.jar</ejb>
  </module>
</application>

jboss-app.xml:

<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
<jboss-app>
  <loader-repository>SUP:app=ejb3</loader-repository>
</jboss-app>

Both MANIFEST.MF files look like this:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_24-b07 (Sun Microsystems Inc.)

Classes are built from the following source files:

CalculatorBean.java:

package com.tomtresansky.sup.server.ejb;

import javax.ejb.Stateless;

@Stateless
public class CalculatorBean implements CalculatorRemote, CalculatorLocal {
  @Override
  public int add(final int x, final int y) {
    return x + y;
  }

  @Override
  public int subtract(final int x, final int y) {
    return x - y;
  }
}

CalculatorLocal.java:

package com.tomtresansky.sup.server.ejb;

import javax.ejb.Local;

import com.tomtresansky.sup.shared.Calculator;

@Local
public interface CalculatorLocal extends Calculator {
}

CalculatorRemote.java:

package com.tomtresansky.sup.server.ejb;

import javax.ejb.Remote;

import com.tomtresansky.sup.shared.Calculator;

@Remote
public interface CalculatorRemote extends Calculator {

}


Well, found the answer...I wasn't including the com.tomtresansky.sup.shared.Calculator inferface in the SUP-ejb.jar.

It would have been nice if JBoss had provided some type of error message for a missing type...

0

精彩评论

暂无评论...
验证码 换一张
取 消