<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-12838780</id><updated>2011-12-23T16:03:02.721-08:00</updated><title type='text'>Bech on Enterprise Java</title><subtitle type='html'>I hereby promise to blog my thoguhts and views on Enterprise java, design patterns, frameworks and all other things that make life as a software developer 
interesting.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12838780.post-8321882970461229772</id><published>2007-03-13T07:23:00.000-07:00</published><updated>2007-04-12T04:10:30.733-07:00</updated><title type='text'>About Eclipse and Tekken</title><content type='html'>&lt;strong&gt;Eclipse and Tekken&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The keyboard shortcuts in eclipse are a bit like advanced Tekken combat moves, for those who aren't into computer games; Tekken is a very good fighting game for the Sony Play Station consoles. A lot of the cool moves can only be made using insane combinations of the controller buttons, in the right sequence. In that sense, Eclipse and the computer game has a lot in common.&lt;br /&gt;&lt;br /&gt;So... I'm using Eclipse for the moment, and have after a long period of swearing started to adapt a way of working that is similar to what I'm used to with IntelliJ. Here are a few painkillers for other Eclipse users that are used to IntelliJ. I guess most of this will be "old news" to experienced Eclipse users, but who knows. Why might pick up a trick or two.&lt;br /&gt;&lt;br /&gt;Before starting I have to say that I try to learn keyboard shortcuts for everything I do. Other people prefer clicking around in the interface and I respect that. However, working with mostly the keyboard has some advantages; It's faster, It's better for your health and it's faster (did I mention that?)&lt;br /&gt;&lt;br /&gt;Even after a months of using Eclipse, I still get confused on what shortcuts that are available through CTRL+SHIFT and what is through ALT+SHIFT. A good way to remember what is what is to think of the alt+shift shortcuts as "menu shortcuts". To Illustrate; Pressing Alt+shift+s gives you about the same options as pressing "source" on the menu. The CTRL+SHIFT shortcurs are more often helper dialogues like Open resource (CTRL+SHIFT+R) or open type. (CTRL+SHIFT+T)&lt;br /&gt;&lt;br /&gt;Anyhow; here's a compilation of my most used keyboard shortcuts for eclipse. If you use these in combination, you can probably put the mouse away entirely.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+M (Maximise) &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I try to do as much work as possible with the source code window maximised. I try to use the "Navigator", and "Package Explorer" windows as little as possible, as I have found no way to switch to them with focus, without using the mouse.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+F7 (Switch views)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;In IntelliJ U can easily hide and show windows like the project navigator using the ALT key and number in combination, when you want the window to go away, you can press the same key, or escape.&lt;br /&gt;&lt;br /&gt;Using the Ctrl+F7 and Ctrl+M (see previous) in combination makes navigating the different windows a bit easier. This shortcut lets you switch between the editor, navigator, console and all other views. I use it a lot to quickly go to the editor and almost always follow up with a CTRL+M, to use the entire screen area for code editing.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl + . (Next problem)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This navigates you to the next "problem" (red or yellow marker in the sidebar).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+Shift+T (Find Type)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Finding a class in the package explorer or navigator can be like finding the famous needle in the haystack. It is often faster to hit this combo, and start typing the name of your class.&lt;br /&gt;&lt;br /&gt;The good news is that wildcards and camel-back searching works like a dream.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+Shift+R (Find Resource)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Same as above, only for resources that is not java classes. (JSP files ,properties etc. )&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Alt+Shift+T (Refactor)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This shortcut is pretty neat as it pops up all refactoring options, given the context of the cursor position. The action you want to take is available in only one more keystroke. In full "Tekken* style" the shortcut key for "rename" is the key 'n', instead of using for example 'r' (that is unused). Don't ask me why.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+F6 (Open files) &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This is probably my single most used Eclipse shortcut. It pops up a list of all the recent files you have edited. An annoying "feature" of this key is that the CTRL key has to be pressed while doing a selection, or at least for a period of time for the window to "stick". If you briefly press Ctrl+F6, you get your last window. The design idea is probably that you often swap between the two most recent files.&lt;br /&gt;&lt;br /&gt;I always use the combo "alt+right/left key" for that, so for me this extra "intelligence" is just annoying.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Alt+Right and left Arrows&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The alt key in combination with the left and right arrow keys can be used as a "back" and "forward" in the file history.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;F3 (Go to declaration) and "Ctrl clicking"&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The entire source code can be navigated as a hyperlinked system. If the cursor is over a class name and you press F3, you immediately go to the declaration of that class.. Pressing F3 while the cursor is over a variable takes you to the declaration of that variable.&lt;br /&gt;&lt;br /&gt;Similar navigation can be done by holding down the ctrl key and moving the mouse around. When the mouse pointer is hovering over a class name or variable, the name of the class or variable turns into a clickable hyperlink.&lt;br /&gt;&lt;br /&gt;other usefull shortcuts that you're probably used to from IntelliJ&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+Shift+O (Optimize Imports)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This is one of many features that IntelliJ has implemented a bit smoother than Eclipse.&lt;br /&gt;&lt;br /&gt;In general, the "Auto import" feature doesn't work to well if your code has compilation errors. This can be impractical if you let's for example say you want to copy / paste a block into your code from somewhere, and get a lot of "red markers" in your code as a result of the unknown classes.&lt;br /&gt;&lt;br /&gt;In Eclipse you should avoid typing entire class names, it's better to type half way through and ctri+space to auto complete. This is because it imples an automatic import.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+Shift+F (Format code)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This key combo formats your code according to default of project specific format.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Alt+Shift+X, T (Run as unit test)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This is one of many Tekken moves in Eclipse. Press Alt+shift+X after a while, a hint-box should appear with your choices. Press T to run the current class as a unit test . A disadvantage of using this shortcut is that the class currently in the editor has to be the unit test. This shortcut is best used in combination with the CTRL+F11 shortcut explained later.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+F11 (Run last launch config)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;If you run your unit test once using alt+shift+X (something that can and will break your fingers over time) there is no need to press the same combo again. Just use Ctrl+F11 to re-execute your last "run" or "debug" configuration.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Alt+Shift+Z&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The nifty surround with functionality, also the home of the automatic collection iterator shortcut.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Alt+Shift+S (source)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Here you'll find shortcuts to all the nifty things like implement/override methods, generate getters/setters etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl+F8&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Working with perspectives is important in eclipse. The whole editor changes it's window layout when working in debug mode. The Ctri+F8 shortcut enables you to switch back to java view (where I usually work) after a debugging session.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ctrl + T&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;View Implementation/type hierarchy. If your editor is showing an interface, and you want to know all available implementations, this shortcut is handy. It also works if your cursor is located over an interface declaration.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-8321882970461229772?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/8321882970461229772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=8321882970461229772' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/8321882970461229772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/8321882970461229772'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2007/03/about-eclipse-and-tekken.html' title='About Eclipse and Tekken'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-116281423170818736</id><published>2006-11-06T03:48:00.000-08:00</published><updated>2007-01-25T10:00:53.406-08:00</updated><title type='text'>Working with JSF &amp; MyFaces ; java.lang.IllegalStateException: Client-id : xxx is duplicated in the faces tree.</title><content type='html'>If you're working with JSF using Myfaces nad Tomahawk, and you are getting a stacktrace like this, you have probably just changed the internal structure of your JSP page. For some strange reason, that doesn't work too well in all cases. &lt;br /&gt;&lt;br /&gt;What you need to do, is to make sure a new browser session is started, and access the page again.&lt;br /&gt;&lt;br /&gt;java.lang.IllegalStateException: Client-id : xxx is duplicated in the faces tree. Component : _idJsp0:minus, path: {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /cars/default/jsp/agreement/bets/doors/viewd........&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-116281423170818736?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/116281423170818736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=116281423170818736' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/116281423170818736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/116281423170818736'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/11/working-with-jsf-javalangillegalstatee.html' title='Working with JSF &amp; MyFaces ; java.lang.IllegalStateException: Client-id : xxx is duplicated in the faces tree.'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-116167897631799280</id><published>2006-10-24T00:47:00.000-07:00</published><updated>2007-01-22T19:51:38.893-08:00</updated><title type='text'>Being an innocent victim of software development communism</title><content type='html'>I like Analogies from the construction industry. &lt;br /&gt;&lt;br /&gt;A carpenter comes to the house you are building. You welcome him, but ask him to leave his tools in the car; all carpenters and craftsmen working on your house have to use the exact same tools! You hand him, not crappy tools, but different ones than he's used to. Now watch this guy fumble, stumble and ask around. &lt;br /&gt;&lt;br /&gt;I started writing, and I am probably going to finish a lengthy post about Eclipse annoyances, and how much I love IntelliJ. After being "force fed" Eclipse for the last 3 weeks, I've got some fuel for the fire so to speak.  But, that's another story.&lt;br /&gt;&lt;br /&gt;What I was thinking the other day, was how crippled I get when someone take away the tools I'm used to and give me new ones. Standardisation may be a good thing, but I say stop when it comes to my personal tools. &lt;br /&gt; &lt;br /&gt;Continuous build systems (including reporting tools). CMS (Code management systems like CVS, Subversion etc), Test frameworks etc of course needs to be common for a development team. &lt;br /&gt;&lt;br /&gt;However, IMO Developer's choice of container for development and IDE must be a personal choice. It's like dictating what kind of deodorant people should put on in the morning! &lt;br /&gt;&lt;br /&gt;Disclaimer; this is my personal view, and not one of my employer. I respect the decisions taken by my current customer to standardize, even if disagree.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-116167897631799280?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/116167897631799280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=116167897631799280' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/116167897631799280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/116167897631799280'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/10/being-innocent-victim-of-software.html' title='Being an innocent victim of software development communism'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-116129250976981582</id><published>2006-10-19T14:10:00.000-07:00</published><updated>2007-01-26T03:24:50.430-08:00</updated><title type='text'>Poke 53281,0</title><content type='html'>I recently heard the "Last ninja 2" soundtrack in a breakfast show on a Norwegian radio show. One thing lead to the other, And before I knew anyting of it I had a c64 emulator installed. To my great amusement, my fingers just automaticly typed in the command poke 53281,0 and poke 53280,0.....&lt;br /&gt;&lt;br /&gt;Honour and respect to those who can reply with the result of theese commands on a C64 system .) &lt;br /&gt;&lt;br /&gt;... And If this  blog entry doesn't make any sense at all to you you're just not old enough :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-116129250976981582?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/116129250976981582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=116129250976981582' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/116129250976981582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/116129250976981582'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/10/poke-532810.html' title='Poke 53281,0'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-115493542514278298</id><published>2006-08-07T00:17:00.000-07:00</published><updated>2006-08-07T00:25:35.183-07:00</updated><title type='text'>More on the BEA 8.1 Servlet Filter &amp; RequestDispatcher issue</title><content type='html'>After doing some more research, it seems that the BEA developers found the Servlet 2.3 specification to be "ambigous", and decided to create an implementation that executes filters on both incoming http requests from cleients, and on request dispatcher requests.&lt;br /&gt;&lt;br /&gt;This issue is resolved in the Servlet 2.4 spec. and there is a "dispatcher" element in the "filter" tag in web.xml&lt;br /&gt;&lt;br /&gt;The valid values are:&lt;br /&gt;&lt;br /&gt;- REQUEST: (default) only when the request comes directly from the client&lt;br /&gt;- FORWARD&lt;br /&gt;- INCLUDE&lt;br /&gt;&lt;br /&gt;Please notice that the default behaviour has changed. Upgrading to Weblogic 9.2 or or doing a manual check in the filter for repeated requests solves the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-115493542514278298?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/115493542514278298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=115493542514278298' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/115493542514278298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/115493542514278298'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/08/more-on-bea-81-servlet-filter.html' title='More on the BEA 8.1 Servlet Filter &amp; RequestDispatcher issue'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-115459613474225645</id><published>2006-08-03T02:00:00.000-07:00</published><updated>2007-01-23T10:49:05.536-08:00</updated><title type='text'>The BEA 8.1 Servlet Container implementation is causing problems for Jakarta Struts applications using filters.</title><content type='html'>I just discovered some strange behavior in a struts based application that uses Hibernate, and a mechanism based on Thread local variables to hold Hibernate Sessions.&lt;br /&gt;&lt;br /&gt;Servlet filters are a great tool to handle aspects of your web application like custom Authorization &amp; Authentication logging, modification of requests etc. The servlet 2.3 specs say the following in Section 6.2.1&lt;br /&gt;&lt;br /&gt;"When the container receives an incoming request, it takes the first filter instance in the list and calls its doFilter method, passing in the ServletRequest and ServletResponse, and a reference to the FilterChain object it will use. "&lt;br /&gt;&lt;br /&gt;The BEA developers have obviously interpreted this to mean incoming request from clients, i.e. "regular" http requests, and requests coming in via the RequestDispatcher class. The Oracle OC4J does not execute the filter chain for incoming RequestDispatcher calls. This is where it gets interesting for Struts based applications.&lt;br /&gt;&lt;br /&gt;There are two types of "forwards" in struts, those with redirect="true", and redirect="false". When the redirect attribute of the forward tag in struts-config.xml is set to "true", a response is sent to the client, forcing it to send a new request to the server.&lt;br /&gt;&lt;br /&gt;The actual HTTP Response going to the web browser may look something like this ;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;HTTP/1.x 302 Moved Temporarily&lt;br /&gt;Date: Thu, 03 Aug 2006 08:37:07 GMT&lt;br /&gt;Server: Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)&lt;br /&gt;Content-Length: 222&lt;br /&gt;Connection: Keep-Alive&lt;br /&gt;Keep-Alive: timeout=15, max=100&lt;br /&gt;Content-Type: text/html&lt;br /&gt;Location: http://localhost:9999/adminssytem/viewEmployees.do&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this case, the filter chain should- and is, executed twice per client transaction. The user does not notice both requests though. This practice is quite common when using the HTTP Post method, so that the user can "reload" the page in his browser without re-posting the form data.&lt;br /&gt;&lt;br /&gt;The forwards with redirect="false", uses a RequestDispatcher to forward requests internally. This is sometimes also called "Server Side redirect", and is very useful since you can chain struts actions together in a "Chain of responsibility pattern". By creating small reusable actions, you can easily use them as building blocks in your application.&lt;br /&gt;&lt;br /&gt;The fact that BEA chooses to execute the filter chain, between struts actions has a huge impact on code relying on this mechanism. Taking the example of Authorization, a costly verification of user credentials will be executed between each Struts action. With long action chains, this can be a huge performance penalty.&lt;br /&gt;&lt;br /&gt;In this Example;&lt;br /&gt;&lt;br /&gt;&amp;lt;action path=&amp;quot;/deletePhoneNumber&amp;quot;&lt;br&gt;&lt;br /&gt;type=&amp;quot;DeletePhoneNumberAction&amp;quot; &lt;br&gt;&lt;br /&gt;name=&amp;quot;PhoneForm&amp;quot;&lt;br&gt;&lt;br /&gt;scope=&amp;quot;request&amp;quot;&amp;gt; &lt;br&gt;&lt;br /&gt;  &amp;lt;forward name=&amp;quot;success&amp;quot; path=&amp;quot;/viewPhoneNumbers.do&amp;quot;/&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;/action&amp;gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;action path=&amp;quot;/viewPhoneNumbers&amp;quot;&lt;br&gt; &lt;br /&gt;type=&amp;quot;ViewPhoneNumbersAction&amp;quot;&lt;br&gt; &lt;br /&gt;name=&amp;quot;PhoneForm&amp;quot;&lt;br&gt; &lt;br /&gt;scope=&amp;quot;request&amp;quot;&amp;gt; &lt;br&gt;&lt;br /&gt;&amp;lt;forward name=&amp;quot;success&amp;quot; path=&amp;quot;/WEB-INF/jsp/displayNumbers.jsp&amp;quot;/&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;/action&amp;gt;&lt;br /&gt;&lt;br /&gt;A filter with a .do mapping, will be executed two times in the Weblogic server.&lt;br /&gt;&lt;br /&gt;1) On the initial HTTP Request hits the deletePhoneNumberAction.&lt;br /&gt;2) After the DeletePhoneNumberAction is finished, and before the viewPhoneNumbers Action is executed.&lt;br /&gt;&lt;br /&gt;This can impact design, cause bugs, and slow down the system significantly. If anyone has a workaround, or know of an entry in the weblogic.xml that solves this, please feel free to comment. It would also be interesting to know the rationale behind the decision to implement the Servlet container with a very “creative” interpretation of the specification in this case.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-115459613474225645?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/115459613474225645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=115459613474225645' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/115459613474225645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/115459613474225645'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/08/bea-81-servlet-container.html' title='The BEA 8.1 Servlet Container implementation is causing problems for Jakarta Struts applications using filters.'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-115383149592317341</id><published>2006-07-25T05:37:00.000-07:00</published><updated>2006-10-13T00:14:10.506-07:00</updated><title type='text'>Struts 1.2: Why is not the reset, validate or even execute invoked?</title><content type='html'>Here is another one of those stupid mistakes that can keep you wondering what's going on;&lt;br /&gt;&lt;br /&gt;As you probably know, Struts lets you override methods in the ActionForm class. It's quite common to override both the validate(), and reset() method.&lt;br /&gt;&lt;br /&gt;It's however very important to notice that there exists two of each ; &lt;br /&gt;&lt;br /&gt;&lt;em&gt;public void reset(ActionMapping mapping,&lt;br /&gt;                  javax.servlet.ServletRequest request)&lt;br /&gt;&lt;br /&gt;public void reset(ActionMapping mapping,&lt;br /&gt;                  javax.servlet.http.HttpServletRequest request)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;and &lt;br /&gt;&lt;br /&gt;&lt;em&gt;public ActionErrors validate(ActionMapping mapping,&lt;br /&gt;                             javax.servlet.ServletRequest request)&lt;br /&gt;&lt;br /&gt;public ActionErrors validate(ActionMapping mapping,&lt;br /&gt;                             javax.servlet.http.HttpServletRequest request)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;If you override the wrong method (the ones with the ServletRequest signature, instead of HttpServletRequest), you'll soon notice that you code is not getting executed. &lt;br /&gt;&lt;br /&gt;The JavaDoc claims for the generic methods "The default implementation attempts to forward to the HTTP version of this method." What "Attemts" means beats me. In the cases where I've made this mistake uptil now, that "attemt" has not succeeded.&lt;br /&gt;&lt;br /&gt;Please note that this fact also applies to the Action class itself. There exists one execute() method for the Generic Servlet Class, and one for the HTTP Servlet.&lt;br /&gt;&lt;br /&gt;I'm not sure why the design is like this; I havn't heard of anyone using Struts to SIP Servlets, or any other kinds of servlet other than HTTP.&lt;br /&gt;&lt;br /&gt;If you googled for the problem, and found my page; Please let me know and add a comment ! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-115383149592317341?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/115383149592317341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=115383149592317341' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/115383149592317341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/115383149592317341'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/07/struts-12-why-is-not-reset-validate-or.html' title='Struts 1.2: Why is not the reset, validate or even execute invoked?'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-115106973653487706</id><published>2006-06-23T06:29:00.000-07:00</published><updated>2007-01-08T20:40:43.103-08:00</updated><title type='text'>Hibernate: Could not synchronize database state with session, Unexpected row count: 0 expected: 1</title><content type='html'>If you get this error message during a session.flush();&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Could not synchronize database state with session  &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt; org.hibernate.HibernateException: &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:32)  &lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;And let's assume you're working with a Persistent object with a generated primitive key, and an "unsaved value" strategy.  &lt;span style="font-style: italic;"&gt;&lt;id name="seq" column="seq" type="long" value="-1"&gt;&lt;id name="seq" column="seq" type="long" value="0"&gt;&lt;generator class="sequence"&gt;&lt;/generator&gt;&lt;/id&gt;&lt;/id&gt;&lt;/span&gt;Your problem is probably that you forgot to initialize the private field used as an id to the "unused value". This means that you should never never never write a persistent class like this ;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;public class MyClass () {&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;  private int id ; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;}&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;But rather do this ;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;public class MyClass () {&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;  private int id = -1 ; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;font&gt;One of those stupid mistakes that can snaeak in and cause some minutes of headache. Did you get here by searching for the exception, and this solved your problem, please leave a comment! :-)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-115106973653487706?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/115106973653487706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=115106973653487706' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/115106973653487706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/115106973653487706'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/06/hibernate-could-not-synchronize.html' title='Hibernate: Could not synchronize database state with session, Unexpected row count: 0 expected: 1'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-114069622113619557</id><published>2006-02-23T03:57:00.000-08:00</published><updated>2007-01-16T04:15:10.846-08:00</updated><title type='text'>Problems with Jakarta Axis 1.3 in Oracle 10g (10.1.0.2)</title><content type='html'>Since I found the solution to this problem on a japanese site (jajakarta), and no trace of it elsewhere I better blog it. I can now only hope that google and all other search engines will index this page, and display it when someone enters the keywords "oracle.xml.parser.v2.XMLDOMException Axis"&lt;br /&gt;&lt;br /&gt;When you atempt to deploy a web service on the Oracle 10g platorm (10.1.0.2), using Axis 1.3 straight out of the box, you run into problems with the Oracle XML parser.&lt;br /&gt;&lt;br /&gt;I'm not sure exactly what causes this, but I've tracked it down to the class &lt;em&gt;org.apache.axis.utils.XMLUtils &lt;/em&gt;It seems this class is not able to initialize fully with the Oracle provided XML libraries.&lt;br /&gt;&lt;br /&gt;The result of this problem, is that if anyone try to auto generate a WSDL file by appending ?wsdl to a service&lt;br /&gt;&lt;br /&gt;example : &lt;a href="http://localhost/services/sampleservice?wsdl"&gt;http://localhost/services/sampleservice?wsdl&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;Axis will provide the following output&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Fault - ; nested exception is: oracle.xml.parser.v2.XMLDOMException: Implementation does not support the object requested.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The soultion to this problem is to specify command line arguments to the java VM running the server during startup like this ;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;-Djavax.xml.parsers.SAXParserFactory=&lt;br /&gt;      org.apache.crimson.jaxp.SAXParserFactoryImpl&lt;br /&gt;-Djavax.xml.parsers.DocumentBuilderFactory=&lt;br /&gt;      org.apache.crimson.jax.DocumentBuilderFactoryImpl&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see, we here decide to use the crimson parser instead of the one provided in the Oracle XML library. We could also have included Xerces in our application and sepcified the parser provided there ofcourse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-114069622113619557?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/114069622113619557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=114069622113619557' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/114069622113619557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/114069622113619557'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/02/problems-with-jakarta-axis-13-in.html' title='Problems with Jakarta Axis 1.3 in Oracle 10g (10.1.0.2)'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-114042879816773658</id><published>2006-02-20T01:40:00.000-08:00</published><updated>2007-01-24T07:05:50.360-08:00</updated><title type='text'>The top 10 Things i Love the most about IntelliJ IDEA (5.1)</title><content type='html'>Just like a carpenter needs a good saw and hammer, having a good IDE is paramount to being a productive developer. I recently upgraded from IDEA 4.5 to 5.1 and would like to tell you all how much I enjoy working with my new tool.&lt;br /&gt;&lt;br /&gt;This is the top 10 features I use most, and that has the greatest impact on my workflow. The focus here is fast code editing, and does not take into consideration major other features like App server integration, code analysis etc.&lt;br /&gt;&lt;br /&gt;Please feel free to comment on this entry with other nifty workflow tips !&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;“Rename”&lt;/strong&gt;&lt;em&gt; (Shift+F6)&lt;/em&gt; with this key combo I can refactor the name of methods and members when I am about to use them. You usually discover that the name of a method is bad when you’re about to use it. Being able to rename it, without going to the declaration saves a lot of time. Bad names are a thing of the past.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;"Recent files"&lt;/strong&gt; &lt;em&gt;(Ctrl + E) &lt;/em&gt;this key combo displays a list of the last edited files. I Usually want to go back to one of the last three files I worked on.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;"Quick find class or file"&lt;/strong&gt; &lt;em&gt;(Ctrl-N and Ctrl-Shift-N)&lt;/em&gt;. This feature really speeds up my workflow. Instead of using the tree-navigator to find a class, I can press ctrl+n, type in the name of a class. Matches are displayed as I type. This also works for other files using the ctrl+shift+n. In conjunction with the "recent files” I end up not using the mouse. In fact, when doing only coding with my laptop, I sometimes don't connect the mouse at all.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;“Delegate”&lt;/strong&gt; &lt;em&gt;(Ctrl+insert)&lt;/em&gt; this neat feature lets you expose the interface of a contained class. If you've been using the decorator design pattern/wrapper you understand the value of this neat feature.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;“Subversion Integration”. &lt;/strong&gt;I was waiting for this. Setting up subversion was a pain in 4.5 involving copying of binaries to your windows directory. In 5.1 Subversion integration is integrated, and works very well. You can even use the IDEA file compare when you have subversion conflicts.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;Ctrl + mouse click&lt;/strong&gt;. If I’m inside a configuration file (Struts-config.xml for example) and need to quickly go to the Action class specified in an action mapping. Hold the Ctrl key in, and the text representing the class name becomes clickable.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;"Reformat code"&lt;/strong&gt; &lt;em&gt;(Ctrl + Alt + L)&lt;/em&gt; I’m currently write code for a client not using the same coding standard I’m used to. Setting up intelliJ to meet their standard was very painless. I find myself pressing this key combo on reflex now.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;"Optimize imports"&lt;/strong&gt;&lt;em&gt; (Ctrl + Alt + O).&lt;/em&gt; Quickly removes redundant and unused class files form my imports.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;"Source health indicator" &lt;/strong&gt;The Red/Green/Yellow light indicating the state of my code. Seeing the green light, I instantly know the file compiles.&lt;br /&gt;&lt;br /&gt;- &lt;strong&gt;"Source problem tags" &lt;/strong&gt;The Red/Green/Yellow bars indicating problems in my code. If I am editing at the bottom of my source file and my source indicator is yellow, I look for see some yellow bars at the “top” of my code, this usually means that some imports are now redundant and I press. Ctrl-Alt-O, and… Voila! The yellow bars disappear and the light is back to green.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-114042879816773658?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/114042879816773658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=114042879816773658' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/114042879816773658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/114042879816773658'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/02/top-10-things-i-love-most-about.html' title='The top 10 Things i Love the most about IntelliJ IDEA (5.1)'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-114008700812667487</id><published>2006-02-16T02:43:00.000-08:00</published><updated>2006-10-16T23:17:49.866-07:00</updated><title type='text'>Intellij IDEA: Additional javadoc tags for xdoclet(Hibernate and ejbdoclet tasks)</title><content type='html'>I recently had the need to collect all tags used by xdoclet for the hibernate, and ejbdoclet tasks so that I could import them into the "unknown javadoc tags" of intelliJ. Since a precompiled comma separated list was hard to find for ejbdoclet, I share them just in case someone should find it useful.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ejbdoclet tags&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;ejb.activation-config-property,ejb.bean,ejb.dao,ejb.data-object,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.destination-ref,ejb.ejb-external-ref,ejb.ejb-ref,ejb.ejb-service-ref,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.env-entry,ejb.facade,ejb.finder,ejb.home,ejb.interface,ejb.message-destination,ejb.permission,ejb.persistence,ejb.pk,ejb.remote-facade,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.resource-env-ref,ejb.resource-ref,ejb.security-identity,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.security-role-ref,ejb.security-roles,ejb.transaction,ejb.util,ejb.value-object,dao.call,ejb.aggregate,ejb.create-method,ejb.ejb-external-ref,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.ejb-ref,ejb.ejb-service-ref,ejb.env-entry,ejb.facade-method,ejb.home-method,ejb.interface-method,ejb.permission,ejb.persistence,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.persistent-field,ejb.pk-field,ejb.relation,ejb.resource-env-ref,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.resource-ref,ejb.select,ejb.transaction,ejb.value-object,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.ejb-external-ref,ejb.ejb-ref,ejb.ejb-service-ref,ejb.env-entry,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;ejb.resource-env-ref,ejb.resource-ref&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Hibernate tags &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;hibernate.cache,hibernate.class,hibernate.discriminator,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;hibernate.jcs-cache,hibernate.joined-subclass,hibernate.joined-subclass-key,hibernate.mapping,hibernate.query,hibernate.subclass,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;hibernate.any,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;hibernate.any-column,hibernate.array,hibernate.bag,hibernate.collection-cache,hibernate.collection-composite-element,hibernate.collection-element,hibernate.collection-index,hibernate.collection-jcs-cache,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;hibernate.collection-key,hibernate.collection-key-column,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;hibernate.collection-many-to-many,hibernate.collection-one-to-many,hibernate.column,hibernate.component,hibernate.generator-param,hibernate.id,hibernate.index-many-to-many,hibernate.list,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;hibernate.many-to-any,hibernate.many-to-any-column,hibernate.many-to-one,hibernate.map,hibernate.one-to-one,hibernate.parent,hibernate.primitive-array,hibernate.property,hibernate.set,&lt;/em&gt;&lt;br /&gt;&lt;em&gt;hibernate.timestamp,hibernate.version&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt; Arne Berner provided me with these ones for Weblogic as well(&lt;a href="http://aberner.blogspot.com/"&gt;http://aberner.blogspot.com/&lt;/a&gt; ) &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; (Moved from comments to main blog entry) &lt;/p&gt;&lt;br /&gt;weblogic.allow-concurrent-calls,weblogic.allow-remove-during-transaction,weblogic.automatic-key-generation,weblogic.cache,weblogic.cache-ref,weblogic.clients-on-same-server,weblogic.clustering,weblogic.create-as-principal-name,weblogic.data-source-name,weblogic.delay-database-insert-until,weblogic.dispatch-policy,weblogic.ejb-local-reference-description,weblogic.ejb-reference-description,weblogic.enable-batch-operations,weblogic.enable-bean-class-redeploy,weblogic.enable-call-by-reference,weblogic.enable-dynamic-queries,weblogic.iiop-security-descriptor,weblogic.instance-lock-order,weblogic.invalidation-target,weblogic.lifecycle,weblogic.lock-order,weblogic.message-driven,weblogic.order-database-operations,weblogic.passivate-as-principal-name,weblogic.persistence,weblogic.pool,weblogic.pool-name,weblogic.remove-as-principal-name,weblogic.resource-description,weblogic.resource-env-description,weblogic.run-as-identity-principal,weblogic.run-as-principal-name,weblogic.transaction-descriptor,weblogic.transaction-isolation,weblogic.use-select-for-update,weblogic.verify-rows&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-114008700812667487?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/114008700812667487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=114008700812667487' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/114008700812667487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/114008700812667487'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/02/intellij-idea-additional-javadoc-tags.html' title='Intellij IDEA: Additional javadoc tags for xdoclet(Hibernate and ejbdoclet tasks)'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-113880487519162040</id><published>2006-02-01T06:32:00.000-08:00</published><updated>2007-01-17T15:12:25.516-08:00</updated><title type='text'>Spring vs. J2EE? Does Spring really suck ? - Let Google decide !!</title><content type='html'>When faced with a tough business-, architectural- or design decision, why listen to Gartner, Jupiter or any so called analysis company? The solution is as always free, and readily available. &lt;br /&gt;&lt;br /&gt;When choosing a middleware or framework, it is crucial that there is a critical mass of users out there, finding &amp; fixing bugs, blogging, producing tutorials etc. This is especially important with open source!&lt;br /&gt;&lt;br /&gt;So! One could easily argue that the maturity and quality of a product can be related to the number of people that are currently building software with it. (aka People are not stupid!) One could also easily assume that the more people that are involved with a product, the larger internet footprint as more web pages are produced!&lt;br /&gt;&lt;br /&gt;So, let's think. Who is currently number #1 at measuring this?  Google is at  least a good candidate. I'm therefore introducing a new measuring unit called IGP (Indexed Google pages) &lt;br /&gt;&lt;br /&gt;Publicity and published pages and number of pages is not always positive.  So let's add another factor to the equation, and introduce yet another TBF called NGP or Negative-Indexed Google pages. The NPG is a measure of how many indexed pages Google has, with the product name in the proximity  of a negative word. &lt;br /&gt;&lt;br /&gt;First, i tried one of there more obscene curse words I know, with let's say "Interesting results". I ended up using "headache" instead since it produces less explicit results, and bad frameworks often gives us developers a lot of headaches. &lt;br /&gt;&lt;br /&gt;Now... Let's put this methodology through the test. Let us put J2EE and the Spring framework Head-to-head!&lt;br /&gt;&lt;br /&gt;Since "Spring" is a fairly general word, I am bold enough to state that pages related to the spring framework should contain both the word "Spring" and "Java". I believe this is a reasonable assumption. &lt;br /&gt;&lt;br /&gt;&lt;table border="1" &gt;&lt;tr&gt;  &lt;td&gt;Words and Technologies&lt;/td&gt;  &lt;td&gt;IGP&lt;/td&gt;  &lt;td&gt;NGP&lt;/td&gt;  &lt;td&gt;Ratio&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;  &lt;td&gt;J2EE + (headache)&lt;/td&gt;  &lt;td&gt;24,900,000&lt;/td&gt;  &lt;td&gt;58,400 &lt;/td&gt;  &lt;td&gt;0,0024&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;  &lt;td&gt;Spring Java + (headache) &lt;/td&gt;  &lt;td&gt;9,740,000 &lt;/td&gt;  &lt;td&gt;208 000 &lt;/td&gt;  &lt;td&gt;0,021&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Looking closer at the table, we can easily conclude that the J2EE framework is far more mature and holds a level of quality (A factor of 10!) superior to the Spring framework! J2EE has both a higher IGP and lower NGP ratio than Spring.  I guess CrazyBob was right after all!&lt;br /&gt;&lt;br /&gt;Feel free to use this methodology to put other technologies head to head, and please blog the results!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-113880487519162040?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/113880487519162040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=113880487519162040' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/113880487519162040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/113880487519162040'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/02/spring-vs-j2ee-does-spring-really-suck.html' title='Spring vs. J2EE? Does Spring really suck ? - Let Google decide !!'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-113879470818941058</id><published>2006-02-01T03:49:00.000-08:00</published><updated>2006-10-28T02:33:03.740-07:00</updated><title type='text'>Struts 1.2 &amp; Velocity Tools; ActionMessagesTool and ErrorsTool confusion</title><content type='html'>This is probably obvious to most experienced front end programmers. But since I spent 30 minutes digging in apache code, and 15 minutes fixing a misunderstanding in my code, I'll blogg my embarrassment. &lt;br /&gt;&lt;br /&gt;Let's say you have a struts action with the following catch clause. Notice that we use the ActionMessages class instead of the ActionErrors class to contain error messages. The use of ActionErrors and ActionError is one of the things that have changed from Struts version 1.1 and 1.2 (See also previous blog entry)&lt;br /&gt;&lt;pre style="code"&gt;&lt;br /&gt;catch (SomebusinessException e)  {&lt;br /&gt;    ActionMessages errors = new ActionMessages();&lt;br /&gt;    errors.add("name", new ActionMessage("error.general.name_already_in_use"));&lt;br /&gt;    saveErrors(request, errors);&lt;br /&gt;    return mapping.findForward("input_error");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This might lead you to think that you should use the ActionMessages Tool in Velocity. This is (of course) not the case since we still use the "saveErrors"  method in our Action subclass. So, when rendering the error message you (still) have to include the ErrorsTool in your toolbox.xml&lt;br /&gt;&lt;pre style="code" &gt;&lt;br /&gt;&amp;lt;tool&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;key&amp;gt;errors&amp;lt;/key&amp;gt;&lt;br /&gt;&amp;lt;scope&amp;gt;request&amp;lt;/scope&amp;gt;&lt;br /&gt;&amp;lt;class&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;org.apache.velocity.tools.struts.ErrorsTool&lt;br /&gt;&amp;lt;/class&amp;gt;&lt;br /&gt;&amp;lt;/tool&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The ActionMessagesTool should NOT be used. ErrorsTool and ActionMessagesTool, and both are actually just very thin wrappers to the StrutsUtils class. The ActionMessagesTool class uses a method in StrutsUtils called getMessages() that does the following ;&lt;br /&gt;&lt;pre style="code"&gt;&lt;br /&gt;ActionMessages errors = &lt;br /&gt;    (ActionMessages)request.getAttribute(Globals.MESSAGE_KEY);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The ErrorsTool uses a method in the StrutsUtils class called getErrors() that does the following ; &lt;br /&gt;&lt;pre style="code"&gt;&lt;br /&gt;ActionMessages errors = &lt;br /&gt;    (ActionMessages)request.getAttribute(Globals.ERRORS_KEY);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So using the wrong Velocity tool (ActionMessagesTool) gives you an empty collection of messages when you have invoked the saveErrors method in your Action class. Beware!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-113879470818941058?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/113879470818941058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=113879470818941058' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/113879470818941058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/113879470818941058'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/02/struts-12-actionmessagestool-and.html' title='Struts 1.2 &amp; Velocity Tools; ActionMessagesTool and ErrorsTool confusion'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-113861458307777189</id><published>2006-01-30T01:41:00.000-08:00</published><updated>2006-11-24T07:29:11.480-08:00</updated><title type='text'>Struts: Going from 1.1 to 1.2 error handling</title><content type='html'>Assigned to upgrade some code for my current client I discover that the way to do error handling and display error messages has changed between version 1.1 and 1.2 of the Struts framework &lt;br /&gt;&lt;br /&gt;There has definitly been some deprecations&lt;br /&gt;&lt;br /&gt;- add(String, ActionError) in the ActionErros classs is deprecated. &lt;br /&gt;- saveErrors(HttpServletRequest, ActionErrors) in the Action class is deprectated.&lt;br /&gt;&lt;br /&gt;The ActionErrors class itself, however, is not deprecated. It seems that there are too many internal dependencies to this class. But the contributors would like to remove it, so it will probably disappear in future releases. &lt;br /&gt;&lt;br /&gt;The ActionError and ActionErros scheme is now replaced with ActionMessage and ActionMessages. &lt;br /&gt;&lt;br /&gt;After doing some reading, it seems the html:messages tag was introduced because people didn't like the fact that using html:errors required HTML markup in the message resources. Using html:messages removes this requirement. &lt;br /&gt;&lt;br /&gt;I found this very good article describing migration on the Struts Wiki. Since there was no mention of this in the "official" developer guide, I guess that more and more informatio will be published through the Wiki. Maybe someone should copy the entire development guide over there. &lt;br /&gt;&lt;br /&gt;The upgrade guide can be found here:&lt;br /&gt;&lt;a href="http://wiki.apache.org/struts/StrutsUpgradeNotes11to124"&gt;http://wiki.apache.org/struts/StrutsUpgradeNotes11to124&lt;/a&gt;&lt;br /&gt;Notes on the deprecations on error handling can be found here:&lt;br /&gt;&lt;a href="http://wiki.apache.org/struts/StrutsDeprecatedActionErrors"&gt;http://wiki.apache.org/struts/StrutsDeprecatedActionErrors&lt;/a&gt;&lt;br /&gt;A Practical example on how-to do it can be found here&lt;br /&gt;&lt;a href="http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html"&gt;http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So... In summary Old Code like this:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;ActionErrors errors = new ActionErrors();&lt;br /&gt;errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError("error.user.internalerror"));&lt;br /&gt;saveErrors(request, errors);&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Has to be replaced with code like this&lt;br /&gt;&lt;br /&gt;ActionMessages errors = new ActionMessages();&lt;br /&gt;errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.user.internalerror", e.getMessage(), e));&lt;br /&gt;saveErrors(request, errors);&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And the JSP code that used to look like this ...&lt;br /&gt;&lt;br /&gt;&amp;lt;html:errors /&amp;gt;&lt;br /&gt;&lt;br /&gt;(Where you had to specify header, footer, prefix and suffix for error messages like this)&lt;br /&gt;&lt;br /&gt;errors.header=&amp;lt;h3&amp;gt;&amp;lt;font color="red"&amp;gt;Validation Errors&amp;lt;/font&amp;gt;&amp;lt;/h3&amp;gt;&amp;lt;ul&amp;gt;errors.footer=&amp;lt;/ul&amp;gt;&lt;br /&gt;errors.prefix=&amp;lt;li&amp;gt;&lt;br /&gt;errors.suffix=&amp;lt;/li&amp;gt;&amp;lt;/em&amp;gt;&lt;br /&gt;&lt;br /&gt;... Is now replaced with JSP code like this ;&lt;br /&gt;&lt;br /&gt;&amp;lt;logic:messagesPresent&amp;gt;&lt;br /&gt;&amp;lt;h3&gt;&amp;lt;font color="red"&gt;&amp;lt;bean:message key="myForm.error.header" /&amp;gt;&amp;lt;/font&gt;&amp;lt;/3&amp;gt;&lt;br /&gt;&amp;lt;ul&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;html:messages id="msg"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;li&amp;gt;bean:write name="msg" /&amp;gt;&amp;lt/li&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/html:messages&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;&amp;lt;/logic:messagesPresent&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;A change for the better if you ask me, Let's hope the Struts guys will put all the documentation in one place soon, and take out that last ActionErrors class that still isn't deprecated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-113861458307777189?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/113861458307777189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=113861458307777189' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/113861458307777189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/113861458307777189'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2006/01/struts-going-from-11-to-12-error.html' title='Struts: Going from 1.1 to 1.2 error handling'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-112172888967071944</id><published>2005-07-18T16:18:00.000-07:00</published><updated>2006-04-16T07:16:00.110-07:00</updated><title type='text'>"Improving software quality, - by accounting for our slow brains"</title><content type='html'>&lt;p class="MsoNormal"&gt;Isn’t it amusing that the solution to complex problems you encounter in your work all of a sudden pop into your head? Maybe during dinner? In the shower? while watching a movie? How  about that test you took at school, with that last tricky question, that you all of a sudden see the solution to, clear as day, three days after turning in the test?!&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;     &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;Have you noticed that the code you wrote a month ago now seems to suck? I’ve definitely had both the “&lt;st1:place st="on"&gt;&lt;st1:city st="on"&gt;Eureka&lt;/st1:City&gt;&lt;/st1:place&gt;”- and the “what the heck did I do here!?” syndrome lots of times over the years.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;     &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;If you look up the scientific papers, I’m sure you’ll discover that the brain isn’t very fast. It can process massive amounts of data, but the throughput just isn’t all that great. So! How can we take this into account when trying to improve as software professionals?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;The solution might be to constantly have a number (two to three) tasks going on at the same time. That way, thoughts and Ideas can mature over time, and smart solutions might appear almost by themselves.-) so… My theory is &lt;span style=""&gt; &lt;/span&gt;that we can improve quality and maintain productivity by working multitasked but at a slower pace…&lt;br /&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;What do you think?&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-112172888967071944?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/112172888967071944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=112172888967071944' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/112172888967071944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/112172888967071944'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2005/07/improving-software-quality-by.html' title='&quot;Improving software quality, - by accounting for our slow brains&quot;'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-111890949075751915</id><published>2005-06-16T00:59:00.000-07:00</published><updated>2005-06-16T23:40:32.956-07:00</updated><title type='text'>Java SE: Avoiding NullpointerExceptions by not initializing local variables to null</title><content type='html'>I'm sure this is fairly obvious to a lot of experienced programmers. However, having not paid enoght attention to the small details this was recently pointed out for me (emberrasingly enough!) It's now a part of my "good coding practices".&lt;br /&gt;&lt;br /&gt;In this piece of code we might get a NullPointerException at the 0.toString(). This happens if an exception is thrown inside the try/catch block We shold have logged the event and terminatet the flow of execution in the catch block, but forgot to do so!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    public void bad() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    Object o  = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    try {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        o = callSomeMethod();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    } catch (Exception someException) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        someException.printStackTrace();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    o.toString() ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This code compiles, but will result in a nullpointer exception when in the cases where someMethod throws someException.&lt;br /&gt;&lt;br /&gt;Situations like this can easily be avoided by not initializing the variable o to null. In this piece of code we not NOT initialize the object o, and get a compiler error at the .toString() method call, because there is a change that the variable 'o' has not been initialized.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    public void good() {&lt;br /&gt;   Object o ;&lt;br /&gt;   try {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;        o = callSomeMethod();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    } catch (Exception someException) {&lt;br /&gt;       someException.printStackTrace();&lt;br /&gt;}&lt;br /&gt;   o.toString() ;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;By avoiding  initializing local varibales to null, we can avoid some of those NullpointerExceptions, and get more robust code!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-111890949075751915?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/111890949075751915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=111890949075751915' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111890949075751915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111890949075751915'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2005/06/java-se-avoiding-nullpointerexceptions.html' title='Java SE: Avoiding NullpointerExceptions by not initializing local variables to null'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-111869317668603262</id><published>2005-06-13T12:35:00.000-07:00</published><updated>2005-06-13T13:18:44.336-07:00</updated><title type='text'>Team dynamics; What happened to all the emails ?</title><content type='html'>After working two or three weeks as a consultant for a very small client I'm  puzzled by my current working environment!&lt;br /&gt;&lt;br /&gt;My sureprise might come from fact that I've spent the last three years as an employed developer in in a fairly large financial organisation. A month ago I had a spacious desk, located in an open office solution with my project coworkers located in both the same room and the one adjacent. The customer was located in a different building.&lt;br /&gt;&lt;br /&gt;At the moment, Im crammed into a small office, working with six or seven developers, litteraly sharing a desk with a co-worker. The closest thing to a "Customer", is the manager of the company (also speaking "tech") coming in from coffee once in a while.&lt;br /&gt;&lt;br /&gt;It's natural to guess that it's going to be less formal and written communication in such an organisation, but what sureprises me is that almost no emails are sent!&lt;br /&gt;&lt;br /&gt;Working for the large oranisation , I would often write lengthy emails to developers working in the room adjacent to mine, and cc the customer (or project manager) just to keep things "on the record" or to inform. I would use email to send files, tools, documents or whatever information that I wanted to distribute to team members.&lt;br /&gt;&lt;br /&gt;The Outlook calendar was the plan of the day, and I would use it to organize meetings with my co-workers (located in the same room!) Even repeated meetings were scheduled this way.&lt;br /&gt;&lt;br /&gt;Now things are different. USB Memory sticks are litterly flying around in the room, other files, links, code and documents are transfered using MSN or other IM variants. Meetings seem to be organised on a "need to have" basis, both regarding to timing and who actually participates.&lt;br /&gt;&lt;br /&gt;In three weeks, I have received one or two emails from team members, in the same period of time, working for the financial institution my number written and receieved project related emails would have been in the range 100-150 (aproxemately 10 a day).&lt;br /&gt;&lt;br /&gt;Im not sure what to make of this; It's just very interesting to see how different teams work differently. But Im sure I could have spent less hours writing emails and more hours writing code :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-111869317668603262?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/111869317668603262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=111869317668603262' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111869317668603262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111869317668603262'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2005/06/team-dynamics-what-happened-to-all.html' title='Team dynamics; What happened to all the emails ?'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-111858727974305590</id><published>2005-06-12T07:24:00.000-07:00</published><updated>2006-04-13T06:43:42.936-07:00</updated><title type='text'>Distributed Caching mechanisms and sharing data in a cluster</title><content type='html'>&lt;span style="font-size:100%;"&gt;Working in the area of telecom, I just had the need to share data in an environment that has to ble highly scalable. The system will be set up as a cluster of BEA weblogic servers.&lt;br /&gt;&lt;br /&gt;So.. How is it possible to share data, and efficiently cache data in such environments ? Im currently researching this, and have to implement some kind of sollution. The alternatives so far seems to be either to do it in the managed Weblogic environment, or do it on a lowever&lt;br /&gt;level (Using socket communications).&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Managed environments&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This article describes a mechanisms for configuring up a Cache MBean in the weblogic server.&lt;br /&gt;This article describes both an "easy to configure" solution that requires the administration server to be up and running all time. That is probably not acceptable in a HA environment.&lt;br /&gt;&lt;br /&gt;It also introduces a JMS based broadcast sollution that are more robust, but requires more code.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dev2dev.bea.com/pub/a/2004/01/jiang.html"&gt;http://dev2dev.bea.com/pub/a/2004/01/jiang.html&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Using  lower level mechanism&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Distributed sharing of data and caching is also possible using TCP/UDP directly. The downside is that you have to configure this outside the component container, reducing maintainability.&lt;br /&gt;&lt;br /&gt;(Copied from the site) JCS is a distributed caching system written in java for server-side java applications. It is intended to speed up dynamic web applications by providing a means to manage cached data of various dynamic natures. Like any caching system, the JCS is most useful for high read, low put applications. Dynamic content and reporting systems can benefit most. However, any site that repeatedly constructs pages, dropdowns, or common search results from a database that is updated at intervals (rather than across categories continuously) can improve performance and scalability by implementing caching. Latency times drop sharply and bottlenecks move away from the database in an effectively cached system.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jakarta.apache.org/jcs/index.html"&gt; http://jakarta.apache.org/jcs/index.html&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-111858727974305590?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/111858727974305590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=111858727974305590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111858727974305590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111858727974305590'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2005/06/distributed-caching-mechanisms-and.html' title='Distributed Caching mechanisms and sharing data in a cluster'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-111687082403146085</id><published>2005-05-23T10:53:00.000-07:00</published><updated>2005-05-23T10:59:16.850-07:00</updated><title type='text'>Frameworks: Increasing productivity with Spring?</title><content type='html'>&lt;p class="mobile-post"&gt;I read this article on Spring and found it very usefull as a good starting point  for myself. Having experienced the pain of writing testable and nice looking code in enterprise environments, I must honestly say that the framework looks promising.&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;a href="http://www.onjava.com/pub/a/onjava/2005/05/11/spring.html"&gt;http://www.onjava.com/pub/a/onjava/2005/05/11/spring.html&lt;/a&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;My first thoughts lead my mind back to the first time I started using  EJBDoclet in conjunction with Maven (Wich I found reveloutionary  at the time) &lt;/p&gt;&lt;p class="mobile-post"&gt;Since I knew the EJB 2.x Specification by heart I had no trouble finding my ways around cryptic error messages, generated descriptors with bugs in them, merge-files problems etc. I knew what all the generated stuff were supposed to look like.&lt;/p&gt;&lt;p class="mobile-post"&gt;So, The future will be very intersting; And a question came to mind&lt;/p&gt;&lt;p class="mobile-post"&gt;&lt;em&gt;&lt;strong&gt;Do frameworks make you more productive before you know all the nitty-gritty details of  all It's building blocks ?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;Dependency injection, IOC patterns in general, Micro Containers and Hibernate are fairly new terms in my vocabulary. How much of this must I learn to get increased developer efficiency with Spring ? How much time will I spend debugging Hibernate code ? &lt;/p&gt;&lt;p class="mobile-post"&gt;Only time will show  .-)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-111687082403146085?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/111687082403146085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=111687082403146085' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111687082403146085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111687082403146085'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2005/05/frameworks-increasing-productivity.html' title='Frameworks: Increasing productivity with Spring?'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-111588995366579180</id><published>2005-05-12T02:21:00.000-07:00</published><updated>2005-05-12T05:51:51.686-07:00</updated><title type='text'>Patterns: Decorator. A Real life example</title><content type='html'>&lt;i&gt;The book Design Patterns:&lt;/i&gt; Elements of Reusable Object-Oriented Software, by Erich Gamma et al, classifies the Decorator pattern as a structural pattern. This pattern offers a flexible alternative to subclass. The main difference between subclassing and the Decorator pattern is this: with subclassing, you work with the class, whereas in the Decorator pattern, you modify objects dynamically. When you extend a class, the change you make to the child class will affect all instances of the child class. With the Decorator pattern, however, you apply changes to each individual object you want to change.&lt;br /&gt;&lt;br /&gt;Need a very tangible and real example ?&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;img src="http://www.autolicenseframes.com/store/product_image.php?imageid=83" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/i&gt; Car suppliers often attach license plates to framings with their brand name printed on it. This framing, with the plate attached, are then again mounted on the car. In This way everyone can see where you bought your brand new car. If you're real cool you replace it with a custom one, like the one's show here from http://www.autolicenseframes.com&lt;br /&gt;&lt;br /&gt;The framing is just a few centimeters wider than the license plate. The license plate fits into the framing. The bolt holes in the frame and the license plate are perfectly aligned with the holes in the car. This can be viewed as the interface or contract. &lt;br /&gt;&lt;br /&gt;The framing can therefore be said to comply to this &lt;em&gt;interface&lt;/em&gt; and it &lt;em&gt;wraps&lt;/em&gt; the license plate. The framing adds functionality (aestethics) to the license plate without modifying it. No subclassing needed, in other words a real life decorator !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-111588995366579180?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/111588995366579180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=111588995366579180' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111588995366579180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111588995366579180'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2005/05/patterns-decorator-real-life-example.html' title='Patterns: Decorator. A Real life example'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12838780.post-111588970982559616</id><published>2005-05-12T01:40:00.000-07:00</published><updated>2005-05-13T07:00:53.296-07:00</updated><title type='text'>Patterns: Factory and Decorator, a powerfull combination</title><content type='html'>&lt;span style="FONT-WEIGHT: bold"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While working on a system that distributes passwords throgh different communication channles (email, SMS, snailmail etc) I noticed that the sloppy programmer (hired consultant ofcourse) had written the system with no audit logging what-so-ever.&lt;br /&gt;&lt;br /&gt;Since the system had a fair general design, I figured out that adding logging, transparently to clients, without having to change the implementation should possible.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;The old design&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An interface called Distributor, and a set of implementations are the main point of interest. The Distributor interface declares one method called distribute. All concrete distributors implement this method.&lt;br /&gt;&lt;br /&gt;A DistributionFactory class creates implementation clases based on an input parameter holding customer information. The business rules are not really important in this case so I've removed the argument to the constructor for simplicity&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Exploring alternatives &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The easiest way out here is of course to just go ahed and implement audit logging in all the Distributor implementations. Of course, this would be a violation of the DRY principle.&lt;br /&gt;&lt;br /&gt;At one point I was tempted to create a Template. This would require me to create an abstract base class for all distributors with an abstract method called handleDistribution (or something similar)&lt;br /&gt;&lt;br /&gt;I would then have had to modify all distributors and rename the method that implemented the functionality to &lt;em&gt;handleDistribution&lt;/em&gt;, and of course implement the distribute (in the abstract base class) so that it would first call handledistribution, and then do logging later&lt;br /&gt;&lt;br /&gt;The total impact of this would have been&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;No Change in the factory class, that's great!&lt;/li&gt;&lt;li&gt;Code changes in all distributors. Modify to extends the parent class. Not so great!&lt;/li&gt;&lt;li&gt;Rename of one method in every distributor. Not so great!&lt;/li&gt;&lt;li&gt;Create one new abstract base class with the template code. Not so great!&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Using a Decorator&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/img/164/5727/640/class_before1.jpg"&gt;&lt;img style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; MARGIN: 2px; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" src="http://photos1.blogger.com/img/164/5727/400/class_before.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A real elegant solution is introducing a Decorator. The Decorator class conforms to the exising Distributor interface. The Decorator in this case is called &lt;em&gt;LoggingDistributor&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;The &lt;em&gt;LoggingDistributor &lt;/em&gt;takes a Distributor as an argument in the constructor, and impelments the distribute method by delegating the method calls to that actual instance. After&lt;br /&gt;the delagation, it logs the event.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I was very satisified with this design, since it enabled me to change the system with minimal impact on the existing code. Only the Factory class is modified, and only one class added. &lt;/p&gt;&lt;p&gt;I think this is a great example, outside the GUI world, on how the Decorator and Factory pattern together can be very usefull in adding functionality to an existing system causing a minimal amound of modification. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.glennbech.com/java/source/decoratorsource.jar"&gt;source code available here&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12838780-111588970982559616?l=bechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bechblog.blogspot.com/feeds/111588970982559616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12838780&amp;postID=111588970982559616' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111588970982559616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12838780/posts/default/111588970982559616'/><link rel='alternate' type='text/html' href='http://bechblog.blogspot.com/2005/05/patterns-factory-and-decorator.html' title='Patterns: Factory and Decorator, a powerfull combination'/><author><name>Glenn Bech</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
