[jboss-as7-dev] NPE in POST_MODULE processors

Jaikiran Pai jpai at redhat.com
Wed Aug 15 04:43:37 EDT 2012


Like Stuart says, it isn't right that each of the deployment unit 
processor should check for the presence of a module, when they already 
explicitly state that they want to run POST_MODULE (i.e. they require a 
module to be available).

In the past, this issue with OSGi processing and the absence of modules 
has caused NPEs all over the place in many EJB DUPs. We "fixed" some of 
them by adding a null check but that really isn't right IMO, for the 
reason I stated above.

I have zero knowledge about OSGi and how it's integrated within AS7. 
Some of the questions that I have about this is:

- Why isn't a module created for the deployment if it's a OSGi 
deployment (note that I've seen cases where certain deployments were 
unintentionally picked up as OSGi deployments)? Why not just create a 
module deployment.XXX just like it's done for all other deployments in 
AS7? Maybe that module won't expose any resources but at least it won't 
lead to issues like NPE in POST_MODULE processors. Again, I don't have a 
clue about OSGi, so what I'm suggesting might not be right but I would 
like to understand why this can't be done.

- Why is OSGi service/processing special in AS7? Why doesn't it behave 
like other "services"/DUPs which act like add-ons rather than tripping 
other unrelated DUPs? For example, the disabling of EJB DUPs won't cause 
web DUPs to start failing.

-Jaikiran
On Wednesday 15 August 2012 10:35 AM, Thomas Diesler wrote:
> Folks,
>
> a quick reminder that you cannot assume a valid Module attachment in
> Phase.POST_MODULE or after.
>
> An OSGi deployment that cannot resolve won't have a Module attached to
> the DU. There is talk about aligning the deployment phase names with
> Bundle life cycle terminology. IMHO Phase.POST_MODULE and Phase.INSTALL
> are not so lucky names because they imply meaning that may not be true.
> For suggested improvement see https://issues.jboss.org/browse/AS7-3585
>
> This is related to: https://issues.jboss.org/browse/AS7-5376
>
> cheers
> --thomas
>



More information about the jboss-as7-dev mailing list