[jboss-as7-dev] Detecting deployment location errors for xml files using a JEE schema

Scott Marlow smarlow at redhat.com
Fri Feb 24 11:01:31 EST 2012


I like the idea but wonder what the implementation will look like.  I 
think detecting deployment errors and giving good error messages, is a 
great idea (improving the developer experience).  I think having some 
additional thread-local context available to deployers would help.  I'm 
thinking that some base deployment exception class could get additional 
context from the thread-local to show in the deployment exception (e.g. 
class name that contains a bad annotation and other app details). 
Higher level deployment code, would add details to the thread-local that 
they want included in lower level deployment exceptions.  We probably 
need to start with very specific deployment errors that we want to 
present (like noticing a persistence.xml in the wrong place) and build 
it up from there.  I'm interested in helping with this if we can agree 
on how we want to get started (this approach or something else).

I think we should also include improving the runtime experience as well, 
as much as possible by improving error messages to be more 
understandable as much as possible.  For example, JBTM-960 improved an 
error message to show the actual resource instead of an internal 
wrapper.  As we see unclear (runtime) error messages, I'd like to see 
them be improved.

At some point, I'd like to see an optional monitor that could collect 
details about what occurs in each JTA transaction and report on it.  The 
purpose being to reduce the time it takes to understand what happened in 
a transaction that didn't complete successfully or to find out how long 
each step took. Also, being able to see what happens inside of each 
transaction.  We would need a cross project SPI for this that could be 
used by JCA/JPA/TM (and some AS.futureVersion).


On 02/24/2012 09:36 AM, Paul Robinson wrote:
> A common problem I see again and again is when people miss-spell the
> filenames of XML artefacts that live in the META-INF and WEB-INF
> directories of a JEE archive. I also see people (myself included)
> putting these artefacts in the wrong location, For example, putting the
> beans.xml file in the META-INF of a .war when it belongs in the WEB-INF.
> This can cause a big headache as it looks like you have created the
> right artifact, but it is not taking effect. It would be great if we
> could detect this type of thing and warn the developer at deploy time.
> There seems to be a move towards using marker files (beans.xml,
> faces-config.xml) to enable technologies, so this issue could become
> more prevalent.
>
> One solution, I was thinking about, is to check the schema type of all
> the XML files in the META-INF and WEB-INF directories. For each schema
> that we recognize (http://java.sun.com/xml/ns/persistence for example),
> we check that it's file name is correct and it is in a location where it
> will be processed.
>
> Does this sound like a sensible thing for us to do?
>
> Paul.
>



More information about the jboss-as7-dev mailing list