Closed jerseyrobot closed 12 years ago
@glassfishrobot Commented Reported by eigenbrodtm
@glassfishrobot Commented @pavelbucek said: cannot reproduce.
actually I'm little surprised that you are using CDI on Grizzly container (that should not work at all). Anyway, I tried with Grizzly 1 & 2 and test is still passing. Can you please provide complete maven project?
Thanks!
@glassfishrobot Commented eigenbrodtm said: Hm. Maybe I tried to be to simple. The Test are successfull, but there is a serverside exception. However I'll try to create a more complete, mavenized example.
@glassfishrobot Commented eigenbrodtm said: I figured in addition to the code posted above you need a beans.xml and also have to use some annotation that jerey will try to register as qualifier, @QueryParam in the example.
Please find a complete Test here: https://github.com/martinei/jersey-1130 mvn test will give one test failing and one succeeding although they test the very same thingh.
@glassfishrobot Commented eigenbrodtm said: Uploaded zipped copy from the github repo for completness.
@glassfishrobot Commented @pavelbucek said: great, thanks!
@glassfishrobot Commented eigenbrodtm said: I have problems to identify the fixing commit. Could you give me a hint?
@glassfishrobot Commented File: martinei-jersey-1130-628d47f.zip Attached By: eigenbrodtm
@glassfishrobot Commented This issue was imported from java.net JIRA JERSEY-1130
@glassfishrobot Commented Marked as fixed on Monday, May 28th 2012, 9:19:07 am
The CDI Extension uses the Class BeanGenerator to create Classes on the fly and uses a counter
to generate unique Names. However when used in Conjunction with the jersey-test-framework the CID Extension is executed multiple times within the same thread and thus the "unique" Names are no longer unique within the scope of the Thread Classloader. Here is the Exception:
Code to reproduce:
Possible Solution: Make the counter static.
A possible Workaround without patching Jersey is to use a new Classloader for each Test:
Affected Versions
[1.12]