users@glassfish.java.net

Re: war to ejb-jar... how to?

From: Danilo Levantesi <danilo.levantesi_at_gmail.com>
Date: Thu, 2 Oct 2008 09:12:14 +0200

You may need to create an EJB client jar.
If you are using Maven, try the EJB plugin: put something like this in
pom.xml :

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-ejb-plugin</artifactId>
  <configuration>
    <ejbVersion>3.0</ejbVersion>
    <generateClient>true</generateClient>
  </configuration>
</plugin>

This will generate a second jar including only the remote classes.
Then you can use it in your war as a dependency:

<dependency>
  <groupId>your.group.id</groupId>
  <artifactId>your.artifact.id</artifactId>
  <version>your-version</version>
  <type>ejb-client</type>
  <scope>compile</scope>
</dependency>

Il Wednesday 01 October 2008 19:47:55 glassfish_at_javadesktop.org ha scritto:
> Well,
>
> i've asked many questions about this issue. The reponses were never what i
> expected. Someone suggested to me to ask in this forum. I've created a
> web-bean project which use a JSP/Servlet client and EJB objects
> (sessionBean). Both are on the same Glassfish server. From them, i've
> deployed on the server a .war and a ejb-jar. But the only way to the war
> can invoke interface of the ejb jar, is to include in the classpath of the
> war the ejb jar. Which means that it exists two (2) ejb jar deployed on the
> server. A first one deployed normally in the same context of the war and a
> second one located into the wef-inf/lib of the war. But i didn't see any
> example or tutorial who talk about adding the ejb-jar into the classpath of
> the war. Is this the good way? Could it be possible to only add a refence
> to the ejb jar instead of adding it into the war package?
>
> I'm developping this project with MyEclipse 6.x and GlassFish 2.x
> I based my project from this example:
> https://glassfish.dev.java.net/javaee5/ejb/examples/Sful.html.
>
> Any suggestion would be appreciate. I can provided the project if needed!
>
> martin
> [Message sent by forum member 'pmrenaud' (pmrenaud)]
>
> http://forums.java.net/jive/thread.jspa?messageID=302791
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net