0

Q: Are you using Glassfish 4 and CDI, and have no problems with anonymous inner classes? If so, please give me a hint which version of which CDI framework you are using.

Background:

Glassfish4 brings its own CDI framework, which is Weld 2.0 (downloaded a few days ago). After deploying my first application, I encountered errors. My software has lots of anonymous inner classes, and these caused errors. By googling, I found that Weld 2.0 doesn't work in the presence of anonymous inner classes (cf. https://issues.apache.org/jira/browse/WICKET-5226).

This problem should have been fixed in Weld 2.2. Both Weld 2.2 and 2.3 are available, so I tried to use these with Glassfish4. But appearently you can't just throw some Weld release into Glassfish's module library, as Glassfish brings its own adapters for Weld that are version specific.

I also tried to use another CDI framework (Openwebbeans), but this appears not to be accepted by Glassfish at all.

Please excuse that I don't yet give more specific info like stack traces, server messages, and the like. These would fill lots of space (and your time). I decided the best way to go is to first determine which version of CDI framework definitely works at some place, and then go into the detail work with that framework.

TAM
  • 1,731
  • 13
  • 18
  • Are you trying to ask a question, or simply trying to raise this as an issue? GlassFish will need to upgrade to 2.2.x of Weld, yes. If you're not using CDI, you can try disabling it by setting scanning to none in your beans.xml. – John Ament Jul 16 '14 at 00:00
  • Here's a [post](http://delabassee.com/blog/?p=286) that describes how to upgrade Weld in Glassfish. The versions don't exactly match yours, but I assume that the procedure is similar. – Robby Cornelissen Jul 16 '14 at 05:54
  • My question is whether anyone got GlassFish 4 running with CDI. I want to have CDI, so I wouldn't deactivate it. The post about upgrading describes an upgrade from Weld 2.0.0 to 2.0.5. Possibly the GF4 Weld connector is undisturbed by this minor upgrade. But it seems I would need 2.2.x. – TAM Jul 21 '14 at 18:53

0 Answers0