Showing posts with label debugging. Show all posts
Showing posts with label debugging. Show all posts

Tuesday, July 22, 2014

Jenkins/Stapler: @DataBoundConstructor being ignored, parameter values not passed or null

If you're developing a plugin or patch for Jenkins, which uses the Stapler framework, you might run into issues where you define a new @DataBoundConstructor with an additional parameter, but it just seems to be ignored by the framework.

If so, look for an overridden newInstance method. It's probably being used instead of the constructor annotation.

Tuesday, July 17, 2012

Tips for interactively debugging CDI applications

I've grown to really like Contexts and Dependency Injection (JSR299, CDI), a part of the Java EE 6 suite. It's relatively simple and clean, it's extensible, and it allows for a really nice loosely-coupled programming model. It gives you the freedom to use event-driven or direct call operation and can take care of most of your lifetime/lifecycle issues for you.

Of course, this is my blog, so you know there's a "but". Sure enough there is, albeit a pretty minor one: It's a mess for interactive debugging, because stepping through a CDI invocation takes you through layers of weld proxies, scope lookups, and all sorts of other crud you usually don't want to see. LOTS of it. CDI isn't unique in this respect, as anyone who's stepped through EJB calls will know, but it's perhaps worse than some due to extensive use of proxies, interceptors, etc.

There's a solution in Eclipse. It could be simpler and it could be more complete, but it's a heck of a lot better than nothing.

Tuesday, June 19, 2012

JBAS011440: Can't find a persistence unit named null in deployment

Encountering the deployment error "JBAS011440: Can't find a persistence unit named null in deployment" on JBoss AS 7? Using Arquillian?

You probably put your persistence.xml in the wrong place in your archive. Try printing the archive contents.