users@glassfish.java.net

maven-embedded-glassfish-plugin and integration testing maven multi-module

From: <forums_at_java.net>
Date: Tue, 22 Nov 2011 08:45:36 -0600 (CST)

Hi,
We are using maven-embedded-glassfish-plugin to integration test our
webserves, ensuring that they deploy in a Glassfish instance and that they
can call out to the other webservices they are required too.

This all works perfectly fine (mostly) when the test are run localy, but
fails when the Maven (via our CI tool) does a build. 
This appears to be an issue with the use of maven multi module project, that
is we have a parent project that has a module for each webservice, and as
each webservice has its own set of integration tests, each of which make use
of their own maven-embedded-glassfish-plugin we seem to be having problems.

When using version 3.1 the the second webservice project is unable to load
the Glassfish plugin
WARNING: Error registering contexts
java.lang.ClassCastException: com.sun.enterprise.web.VirtualServer cannot be
cast to org.apache.catalina.Host

When moving to version 3.1.1 the second webservice project appears to start
up the Glassfish plugin but fails to load the webservice application:
SEVERE: PWC1305: Exception during cleanup after start failed
org.apache.catalina.LifecycleException: PWC2769: Manager has not yet been
started

Which is then followed by:
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'com.sun.xml.ws.transport.http.servlet.SpringBinding#0' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot create
inner bean '(inner bean)' of type
[org.jvnet.jax_ws_commons.spring.SpringService] while setting bean property
'service'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)#1': FactoryBean threw exception on object creation;
nested exception is java.lang.IllegalStateException: Illegal class loader
binding

My guess is there is some sort of class loader issue going on, I am wondering
if the two instances of teh glassfish plugin are being "mixed up" somehow and
this is causing a major plugin failure in 3.1, but as an application load
issue in 3.1.1

The first plugin instance is configured to have both a database (H2) and has
JMS resources configured, while the second has no additional resources
configured.

I have tried having both plugins use different ports, this did not solve
matters.  I have also tried having the plugin available to only one
applciation at a time, when it is the sole maven-embedded-glassfish-plugin in
the build it works as expected.

 

I was hoping somebody might have some insight or advice.

Thanks

Gavin

 

 

 

 

 

 


--
[Message sent by forum member 'encrypt']
View Post: http://forums.java.net/node/866700