Skip to main content

maven / remote EJB client for deployment in JBoss AS?

2 replies [Last post]
Anonymous

Folks;

having a standalone Java EE client built and running using maven (good), I am
trying to take the next step and do as needed - build a web app supposed to
run as part of an enterprise application deployed to a JBoss AS 7.1.1.

So far, however, I see maven2 build for Glassfish standalone clients is a bit
cumbersome; at the moment I have

org.glassfish.appclient
gf-client
3.1
pom
compile

as a dependency in that very module which adds roughly 40 megs of jars to the
project. Adding this setup to a webapp and trying to deploy this to JBoss
makes the JBoss deployer massively complain about things like this...

[...]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]
Caused by: java.lang.IllegalArgumentException: JBAS015533: Web Service
endpoint com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationPortImpl with URL
pattern /RegistrationService_V11 is already registered. Web service endpoint
com.sun.xml.w
s.tx.coord.v11.endpoint.RegistrationRequesterPortImpl is requesting the same
URL pattern.
at
org.jboss.as.webservices.metadata.model.AbstractDeployment.addEndpoint(AbstractDeployment.java:60)
at
org.jboss.as.webservices.metadata.model.JAXWSDeployment.addEndpoint(JAXWSDeployment.java:27)
[...]

... before ultimately stopping deployment. Looking at the kind of jars in the
gf-client pom project, I am not really surprised to see this causing problems,
yet I of course would like to see it work. Can anyone out here point me out
(a) which jars out of gf-client would be required to deploy such a structure
to another application server and/or (b) whether there is a "cleaner" way for
building such things via maven other than adding _all_ the code to the project
via this large pom?

TIA and all the best,
Kristian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rjdkolb
Offline
Joined: 2006-07-20
Points: 0

Hi Kristian

I see nobody has responded yet.

This is a solution/workaround for JAR hell in Maven:
http://maven.apache.org/plugins/maven-shade-plugin/

I've never actually used it in a WAR before.

Hope it helps.

regards
Richard

On 13 November 2012 14:45, Kristian Rink wrote:

> Folks;
>
> having a standalone Java EE client built and running using maven (good), I
> am
> trying to take the next step and do as needed - build a web app supposed to
> run as part of an enterprise application deployed to a JBoss AS 7.1.1.
>
> So far, however, I see maven2 build for Glassfish standalone clients is a
> bit
> cumbersome; at the moment I have
>
>
> org.glassfish.appclient
> gf-client
> 3.1
> pom
> compile
>
>
>
> as a dependency in that very module which adds roughly 40 megs of jars to
> the
> project. Adding this setup to a webapp and trying to deploy this to JBoss
> makes the JBoss deployer massively complain about things like this...
>
> [...]
> at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]
> Caused by: java.lang.IllegalArgumentException: JBAS015533: Web Service
> endpoint com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationPortImpl with URL
> pattern /RegistrationService_V11 is already registered. Web service
> endpoint
> com.sun.xml.w
> s.tx.coord.v11.endpoint.RegistrationRequesterPortImpl is requesting the
> same
> URL pattern.
> at
>
> org.jboss.as.webservices.metadata.model.AbstractDeployment.addEndpoint(AbstractDeployment.java:60)
> at
>
> org.jboss.as.webservices.metadata.model.JAXWSDeployment.addEndpoint(JAXWSDeployment.java:27)
> [...]
>
>
> ... before ultimately stopping deployment. Looking at the kind of jars in
> the
> gf-client pom project, I am not really surprised to see this causing
> problems,
> yet I of course would like to see it work. Can anyone out here point me out
> (a) which jars out of gf-client would be required to deploy such a
> structure
> to another application server and/or (b) whether there is a "cleaner" way
> for
> building such things via maven other than adding _all_ the code to the
> project
> via this large pom?
>
> TIA and all the best,
> Kristian
>

Kristian Rink

Hi Richard;

and first off, thanks a bunch for your comments.

Am Mittwoch, 14. November 2012, 09:33:38 schrieb Richard Kolb:
> I see nobody has responded yet.

No, unfortunately not. Already used to post this question on the glassfish
java.net forums [1] a while ago, but either no one knows or the thing I'd like
to achieve is simply undoable. For that matter, these days I mostly use
RESTful services or, at times, SOAP for communicating with things inside the
'fish, but in a given requirement I wanted for something faster that doesn't
eventually depend upon HTTP. Generally, EJB remoting seems good at this, yet
in our case, it seems just pure infrastructure issues making this extremely
difficult to use. :|

> This is a solution/workaround for JAR hell in Maven:
> http://maven.apache.org/plugins/maven-shade-plugin/

Thanks, I'll have a look at it. Actually, so far I tried the most obvious
approach (adding the gf-client pom and manually excluding all but the jars
required for the client) - however bottom line seems it's impossible to figure
out _which_ jars in gf-client pom are _absolutely_ required and which can be
safely left out without trashing things. Yet, despite knowing even some of the
books out there on Glassfish Java EE development make use of maven2 for
building its tutorials, seems this use case (remote EJB clients) has somehow
got lost all along the way, and this question seems regularly popping up on
stackoverflow et al so I was hoping for someone out of Oracle / the Glassfish
team to shed some light on that. ;)

Cheers and all the best,
Kristian

[1]http://www.java.net/forum/topic/glassfish/glassfish/glassfishv3-ejb-
standalone-client-and-maven