Monday, December 29, 2014

Using Domino Designer's 'Sign Design' to solve strange Java exceptions

Today, I reached out to another XPages developer who works on the same project in order to help me get past a strange error I was getting. The issue was that Java code within an XPages application that previously worked fine started failing, even though it had not been altered. He had experienced this issue before and knew what to do to fix it. The fix I am about to describe was new to me, so I felt it was worth sharing here.

The exception I was getting was this:
javax.servlet.ServletException: java.lang.Error: Unresolved compilation problem:  

When I first got the error, I naturally thought that it was something that I had changed. I didn't know what to make of an unresolved compilation problem, it seemed a bit generic, like the check engine light on your car. Even after I was able to isolate the line causing the problem, it made no sense because it was run of the mill Java code, the kind of snippet you use and reuse. In this case, it was a variable resolver that gets a handle to the current session.  

My coworker suggested performing a "Sign Design" on the whole application. To do this, right click on the application name, then click "Application", and then "Sign Design". Sure enough, this fixed the issue, no more Java exceptions. This is one of those fixes that is worth trying when nothing else is making sense. Of course this issue is most likely to happen for applications where work is shared by a team of developers, as is the case here. The downside of this fix of course, is that you lose some of the history, and it looks like you touched every design element.
The way to find the option to Sign Design is to right-click on the application title, and choose Application, and then choose Sign Design.

PS:  I want to wish Best Wishes for 2015 to all who stumble across my ramblings.

2 comments:

  1. I hope I didn't get you wrong: you are working on a single app with other developers and you do all the sign / clean stuff on that single instance? I so, then please check how to use source control and local / separate instances of that applications on each developer's machine. Create different branches in the source control system (each for every developer) and then merge the changes with tools that help you to do it right and safe.
    Once you got in trouble after a clean or sign design action on a single instance you won't do it again ;-)

    ReplyDelete
    Replies
    1. Good points Oliver and a good warning. Unfortunately my company doesn't use source control for XPages, so we are managing the design the hard way. Thanks for your comment and Happy New Year

      Delete