-
1. Re: Could not start Weld Container in DeltaSpike TestControl (Encolsing method not found)
mkouba Apr 6, 2017 8:14 AM (in response to mekor)1 of 1 people found this helpfulHi Paul,
it seems the
org.picketlink:picketlink
dependency is to blame. Not only it contains the whole DeltaSpike core (probably a very outdated version 1.0.0) but is probably also badly compiled (a similar problem to Weld-Se 2.3.4.Final: "Enclosing method not found" on anonymous inner class in lambda expression). Note that it's scope is provided and thus it's available on the test classpath. If I remove the dependency I get an assertion error which is expected. -
2. Re: Could not start Weld Container in DeltaSpike TestControl (Encolsing method not found)
mekor Apr 6, 2017 9:47 AM (in response to mkouba)Hi !
First, Thank you for answering me.
Indeed, removing picketlink from the pom resolve the problem.
But I need picketlink in my full project
I checked the Dependency Hierarchy of my pom.xml and deltaspike-core (1.7.2 managed from 1.0.0) is included only in the picketlink-dektaspike dependency (not picketlink)
I tried to exclude deltaspike from picketlink or picketlink-deltaspike by adding the following code :
<exclusions> <exclusion> <groupId>org.apache.deltaspike.core</groupId> <artifactId>deltaspike-core-api</artifactId> </exclusion> <exclusion> <groupId>org.apache.deltaspike.core</groupId> <artifactId>deltaspike-core-impl</artifactId> </exclusion> </exclusions>
No results.
Hom could I manage to make work the TestControl AND Picketlink together ?
For info, I installed manually picketlink in my Wildfly server with the installer.
The DeltaSpike documentation even speak about using picket link (bottom of Security Module ), so why including picketlink in my pom.xml makes DeltaSpike crash ?
-
3. Re: Could not start Weld Container in DeltaSpike TestControl (Encolsing method not found)
mkouba Apr 6, 2017 9:54 AM (in response to mekor)1 of 1 people found this helpfulWell,
org.picketlink:picketlink
is a shaded jar, ie. it does not define a dependency in pom.xml but contains the classes instead. So if picketlink-dektaspike declares a dependency on picketlink-core it should be safe to remove this dependency. Also I have no idea how deltaspike security module works. -
4. Re: Could not start Weld Container in DeltaSpike TestControl (Encolsing method not found)
manovotn Apr 6, 2017 10:25 AM (in response to mekor)1 of 1 people found this helpfulGood catch Martin! Thanks for looking into it.
So the current problem is that
org.picketlink:picketlink brings in an ancient version of deltaspike. You then have two on classpath and the classloader choses to load the old one, which then tries to boot our container and fails. Not much we can do there, I am afraid.
So, what comes to my mind is - avoid using TestControl.
You can instead try Weld-JUnit, our extension, which leverages JUnit's @Rule to boot the container the way you want to.
Check the repo for more information and examples of usage, it might do just what you need - GitHub - weld/weld-junit: Set of JUnit extensions to enhance the testing of CDI components. Supports Weld 2.4 and 3.0.
Also please try what Martin suggested above - remove the dependency on
org.picketlink:picketlink
because you also depend on picketlink-dektaspike which, I am sure, will bring in the core picketlink (and that one should not bring another DS core impl into the game). -
5. Re: Could not start Weld Container in DeltaSpike TestControl (Encolsing method not found)
mekor Apr 6, 2017 11:01 AM (in response to mekor)Thx matej ! I'll try this and let you informed !
-
6. Re: Could not start Weld Container in DeltaSpike TestControl (Encolsing method not found)
mekor Apr 7, 2017 3:55 AM (in response to manovotn)The project seems to work without the org.picketlink:picketlink. picketlink-deltaspike seems to be enough
Thank you again for your help guys !