users@glassfish.java.net

EJB 3.0 + Maven 2.0 + maven-ejb-plugin + glassfish

From: <glassfish_at_javadesktop.org>
Date: Tue, 08 May 2007 06:47:35 PDT

I have a simple EJB 3.0 project with a stateless bean as follows:

The remote interface:

@Remote
public interface IssueBeanRemote {
    public void createIssue();
}


The stateless EJB 3.0 bean:

@Stateless(mappedName = "ejb/IssueBean")
public class IssueBean implements IssueBeanRemote {

    public void createIssue() {
       ...............
       ..........
    }
}

I checked out and installed the latest maven-ejb-plugin as shown here:
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/%3C450C13F4.2000605@gmx.net%3E

I have the following in my pom.xml:
    <modelVersion>4.0.0</modelVersion>
    <groupId>my.ejb</groupId>
    <artifactId>component</artifactId>
    <version>0.0.1</version>
    <packaging>ejb</packaging>
    <build>
       <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <configuration>
                    <ejbVersion>3.0</ejbVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.myfaces.tobago</groupId>
                <artifactId>maven-apt-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <generated>.apt_generated</generated>
                            <target>1.6</target>
                            <nocompile>true</nocompile>
                            <showWarnings>true</showWarnings>
                             <verbose>false</verbose>
                            <fork>false</fork>
                            <sourcePath>
                                 ${basedir}/src/main/java
                            </sourcePath>
                         </configuration>
                      </execution>
                    </executions>
                </plugin>

....................
..........

mvn package cmopiles without any error messages. But when I deploy the
jar file into Glassfish I get the following error message:

[#|2007-05-07T17:22:54.542-0500|SEVERE|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=25;_ThreadName=Thread-47;_RequestID=3a898218-6f83-4579-b28d-5829b7e0ec01;|Exception
occured in J2EEC Phasejava.lang.IllegalArgumentException: Invalid ejb
jar
[/opt/glassfish/glassfish-v2-b42/domains/domain1/applications/j2ee-modules/my-ejb-component]:
it contains zero ejb.

I'd appreciate any help getting this deployment to work.

Thanks in advance.
-sud
[Message sent by forum member 'r_sudh' (r_sudh)]

http://forums.java.net/jive/thread.jspa?messageID=215992