OK, this one was rather tricky.
After some searches and tries, I removed weld dependencies (in order to go back to a more classical main).
Then, I replaced my (old-style) appserv-rt.jar
dependency with
<dependency>
<groupId>org.glassfish.appclient</groupId>
<artifactId>gf-client</artifactId>
<version>3.1</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
This is not a little change, as gf-client
pulls all jars for Glassfish, which obviously makes a lot of jars (hopefully there is a method to optimize jar number, although we all know about premature optimization).
So, once it's done, it's perfectly possible to use EJB remote interface, but not JMS (due to incomprehensible reasons). In order to make JMS work with gf-client, one then have to go create maven dependencies for imqjmsra.jar
and imqbroker.jar
, both located in %GLASSFISH3_INSTALL_DIR%/glassfish/lib/install/applications/jmsra
. Furthermore, as imqjmsra.jar
internally uses imqbroker.jar
, I recommend you to create the following poms :
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish.external.jms</groupId>
<artifactId>imqjmsra</artifactId>
<version>3.1.0</version>
<description>POM was created by Sonatype Nexus</description>
<dependencies>
<dependency>
<groupId>org.glassfish.external.jms</groupId>
<artifactId>imqbroker</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</project>
associated to imqjmsra.jar
and
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish.external.jms</groupId>
<artifactId>imqbroker</artifactId>
<version>3.1.0</version>
<description>POM was created by Sonatype Nexus</description>
</project>
associated to imqbroker.jar
.
Obviously, as I use Nexus repository management, it was easier for me to create these dependencies in our company 3rd parties local repository using Nexus "upload artifact page".
Once it's done, My POM dependencies now are
<dependency>
<groupId>org.glassfish.appclient</groupId>
<artifactId>gf-client</artifactId>
<version>3.1</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.external.jms</groupId>
<artifactId>imqjmsra</artifactId>
<version>3.1.0</version>
</dependency>
And I can totally poll my JMS queue.