<?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-4485062814756213985</id><updated>2011-09-11T08:05:18.278-04:00</updated><category term='Sorting query results'/><category term='JPA'/><category term='Repeatable Test'/><category term='non Object level query'/><category term='JDK Proxy'/><category term='TopLink'/><category term='Unit Test'/><category term='Junit'/><category term='JSR 220'/><category term='cobol'/><category term='Java'/><category term='NetBeans'/><category term='Hot Swapping'/><category term='EJB 3.0'/><category term='microfocus'/><category term='Swing'/><category term='conformresultsinunitofwork'/><category term='EJB'/><category term='Spring MVC'/><category term='EJB 2.1'/><category term='Maven'/><category term='Eclipse'/><category term='Annotation'/><category term='Debug'/><category term='Object level query'/><category term='DAO'/><title type='text'>Make I.T. Simple</title><subtitle type='html'>To Share my personal experience in Information Technology: Java, TopLink, Hibernate, Oracle, JPA, EJB and Agile, etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>IT-Worx</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>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4485062814756213985.post-301916243048338905</id><published>2010-04-26T14:40:00.000-04:00</published><updated>2010-04-26T23:21:19.486-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sorting query results'/><category scheme='http://www.blogger.com/atom/ns#' term='conformresultsinunitofwork'/><category scheme='http://www.blogger.com/atom/ns#' term='TopLink'/><title type='text'>Sorting results when using TopLink ObjectLevelReadQuery conformresultsinunitofwork()</title><content type='html'>This article explains odd TopLink behaviors when&amp;nbsp; sorting query results that includes both in memory as well as persistent data from database.&lt;br /&gt;&lt;br /&gt;As you know, &lt;b&gt;conformresultsinunitofwork &lt;/b&gt;enables the query to merge results from database with those in-memory objects. For instance, the following data exist in EMPLOYEE table:&lt;br /&gt;name&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type&lt;br /&gt;-----&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ------&lt;br /&gt;employee 1&amp;nbsp;&amp;nbsp;&amp;nbsp; contractor&lt;br /&gt;employee 2&amp;nbsp;&amp;nbsp;&amp;nbsp; contractor&lt;br /&gt;&lt;br /&gt;And in the session of the same transaction, there are newly created Employee objects "emplyee 3" and "emplyee 4", also contractors. If we want to find all the contractor employees including the ones in the memory, we should use &lt;b&gt;conformresultsinunitofwork&lt;/b&gt;(), and the query result will be:&lt;br /&gt;"employee 3"&lt;br /&gt;"employee 2"&lt;br /&gt;"employee 1"&lt;br /&gt;"employee 4"&lt;br /&gt;&lt;br /&gt;If the query result is sorted by name, like&lt;br /&gt;ExpressionBuilder builder = new ExpressionBuilder(); &lt;br /&gt;query.&lt;b&gt;addOrdering&lt;/b&gt;(builder.get("name").ascending());&lt;br /&gt;&lt;br /&gt;You would expect that the result be:&lt;br /&gt;"employee 1"&lt;br /&gt;"employee 2"&lt;br /&gt;"employee 3"&lt;br /&gt;"employee 4"&lt;br /&gt;&lt;br /&gt;You are wrong! &lt;b&gt;The end result is not actually sorted!!!&lt;/b&gt; TopLink will actually just send the query to Oracle &lt;br /&gt;server, which executes it and sorts the result by name, then TopLink will again add the in-memory objects on the top of collection returned from database:&lt;br /&gt;"employee 3" (in-memory)&lt;br /&gt;"employee 4" (in-memory)&lt;br /&gt;"employee 1" (from DB)&lt;br /&gt;"employee 2" (from DB)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note that the in memory objects are not sorted at all&lt;/b&gt;, but the ones from DB are. The reason it behaves like this, is that Oracle server has no idea about the newly created objects, though I believe TopLink can be improved by not sending the "order by" to Oracle, instead just doing it in the session before returning the combined result to your application code. Anyway, if you run into such issue, just implement the query without sorting, and once you get the result, you then sort results in memory using Java. &lt;b&gt;Just remember not to sort it twice, once in Oracle server and once in your Java code.&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-301916243048338905?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/301916243048338905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=301916243048338905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/301916243048338905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/301916243048338905'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/04/sorting-results-when-using-toplink.html' title='Sorting results when using TopLink ObjectLevelReadQuery conformresultsinunitofwork()'/><author><name>IT-Worx</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-4485062814756213985.post-7413055732753112822</id><published>2010-04-02T11:48:00.000-04:00</published><updated>2010-04-02T11:55:38.342-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DAO'/><category scheme='http://www.blogger.com/atom/ns#' term='JDK Proxy'/><category scheme='http://www.blogger.com/atom/ns#' term='Hot Swapping'/><category scheme='http://www.blogger.com/atom/ns#' term='Unit Test'/><title type='text'>Functional Junit Test - Part 3 - Hot Swapping Using JDK Proxy</title><content type='html'>Have you ever wished that you could replace an instance with another stub during runtime? Spring framework provides an TargetSource implementation - HotSwappableTargetSource that facilitates such hot swapping at runtime. If for whatever reason, you are not using Spring framework, here is an alternative - JDK Proxy.&lt;br /&gt;&lt;br /&gt;The following example shows how to implement JDK Proxy to swap the DAO implementation at runtime. The idea applies to any implementation as long as there is an interface backing it up (as you are aware that JDK proxy only works for interfaces).&lt;br /&gt;&lt;br /&gt;Please note the code below only demonstrates the concept and is not working code.&lt;br /&gt;&lt;br /&gt;Create an InvocationHandler:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;public class Swapper implements java.lang.reflect.InvocationHandler {&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private Object impl;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private Object realDAO;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private Object stubDAO;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boolean useRealDAO;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;also define="" setters=""&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Object invoke(Object proxy, Method method, Object[] args) {&lt;/also&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //the logic to choose real or stub depends on your  own system. e.g. you may use a flag&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //to determine which object to return. &lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (useRealDAO) impl = realDAO;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else impl=stubDAO;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return method.invoke(impl, args);&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;}&lt;/div&gt;&lt;br /&gt;When the DAO is created, it has to use proxy:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Swapper swapper= new Swapper(readDAO, stubDAO);&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Object proxy = Proxy.newProxyInstance(stubDAO.getClass().getClassLoader(),&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; new Class[] { theInterface }, swapper);&lt;/div&gt;&lt;br /&gt;where "theInterface" is the interface name for real and stub DAO.&lt;br /&gt;&lt;br /&gt;In your business service class:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SomeServiceClass&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;{&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmployeeDAO employeeDAO= &lt;the above="" created="" proxy=""&gt;&lt;use above="" created="" proxy="" the=""&gt;(use the above created proxy)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void loadEmployeeDetails(Employee employee)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dao.loadDetails();&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/use&gt;&lt;/the&gt;&lt;/div&gt;&lt;the above="" created="" proxy=""&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To swap at runtime:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;((Swapper)employeeDAO).setUseRealDAO(true);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt; &lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; service.loadEmployeeDetails(employee); //loads detail through the &lt;/span&gt;&lt;b style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;real&lt;/b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; DAO&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt; &lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; ((Swapper)employeeDAO).setUseRealDAO(false);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt; &lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; service.loadEmployeeDetails(employee); //loads detail through the &lt;/span&gt;&lt;b style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;stub&lt;/b&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; DAO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please note that, in real world, the DAO will most like be created by a factory class or a container so that the code creating the proxy doesn't need to duplicate.&lt;/the&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This shows the simple idea:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Service&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Proxy&lt;br /&gt;&lt;br /&gt;&amp;nbsp; /&amp;nbsp;&amp;nbsp;&amp;nbsp; \&lt;br /&gt;real&amp;nbsp; stub&lt;br /&gt;&lt;br /&gt;This technique will also support dynamic reconfiguration of any Java application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-7413055732753112822?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/7413055732753112822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=7413055732753112822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/7413055732753112822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/7413055732753112822'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/04/functional-junit-test-part-3-hot.html' title='Functional Junit Test - Part 3 - Hot Swapping Using JDK Proxy'/><author><name>IT-Worx</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-4485062814756213985.post-8263993620162436998</id><published>2010-03-30T16:45:00.000-04:00</published><updated>2010-03-30T23:26:39.612-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBeans'/><title type='text'>Developing a Spring Framework MVC application step-by-step</title><content type='html'>Recommending the following tutorials on Spring MVC:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://static.springsource.org/docs/Spring-MVC-step-by-step/"&gt;Spring MVC using Eclipse&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://aruld.info/spring-mvc-step-by-step-tutorial-ported-on-netbeansglassfish/"&gt;Spring MVC using NetBeans&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&amp;nbsp;#2 is same as #1 except for the use NetBeans.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Some thoughts&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;The way they set up the&amp;nbsp; message bundle is confusing: in the section "Add the Message Bundle", it says to add message.properties into WEB-INF/classes folder. Well, of course, it works that way. But in a real project, you won't be adding stuff in the classes directory. It should be deployed there. So just put the message.properties in your source package or a resource folder, and let the build script copy into the classes directory.&lt;br /&gt;Spring MVC supports 4 kinds of handler mapping:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;BeanNameUrlHandlerMapping&lt;/li&gt;&lt;li&gt;SimpleUrlHandlerMapping&lt;/li&gt;&lt;li&gt;CommonsPathMapHandlerMapping&lt;/li&gt;&lt;li&gt;ControllerClassNameHandlerMapping &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;By default, if no handler mapping is registered in the application context file, Spring&lt;br /&gt;Dispatcher Servlet will use #1, i.e. BeanNameURLHandlerMapping. The above 2 tutorials are actually using the default BeanNameUrlHandlerMapping created by the dispatcher servlet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-8263993620162436998?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/8263993620162436998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=8263993620162436998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/8263993620162436998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/8263993620162436998'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/developing-spring-framework-mvc.html' title='Developing a Spring Framework MVC application step-by-step'/><author><name>IT-Worx</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-4485062814756213985.post-992730075620443946</id><published>2010-03-25T17:00:00.000-04:00</published><updated>2010-03-25T17:00:00.215-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB'/><category scheme='http://www.blogger.com/atom/ns#' term='cobol'/><category scheme='http://www.blogger.com/atom/ns#' term='microfocus'/><title type='text'>Microfocus Cobol Calling Remote EJB Services</title><content type='html'>I'm working on&amp;nbsp; a Loans project for which we are exploring an option in order to address some critical system issues. The option requires a Cobol program running in a server (within a nightly flow) to call a EJB service running in another Websphere server (this will physically reside in a different server than the Cobol one). How interesting this is going to be? It sounds doable, but I don't know anything about cobol and will post new stuff here to tell the interesting story as the project moves on. Stay tuned!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-992730075620443946?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/992730075620443946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=992730075620443946' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/992730075620443946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/992730075620443946'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/microfocus-cobol-calling-remote-ejb.html' title='Microfocus Cobol Calling Remote EJB Services'/><author><name>IT-Worx</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-4485062814756213985.post-3502939947926432486</id><published>2010-03-22T17:32:00.000-04:00</published><updated>2010-03-22T17:32:01.973-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Repeatable Test'/><category scheme='http://www.blogger.com/atom/ns#' term='Swing'/><category scheme='http://www.blogger.com/atom/ns#' term='TopLink'/><title type='text'>Repeatable read only integration test</title><content type='html'>Have you ever wished that, changes are not committed to the database so that your test will be repeatable when you are testing from a typical desktop application? This posting shares some of my experience.&lt;br /&gt;&lt;br /&gt;Settings: my local environment is a 2-tier Java Swing desktop application using TopLink against Oracle database. &lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create a connection proxy that implements java.lang.reflect.InvocationHandler,  in which, the invoke() method should check the value of  method.getName() and trap the call here, e.g. if the method name is  "commit", you want to return null so that the driver won't commit the  changes. Otherwise, let it go by returning method.invoke(connection,  args).&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Create a read only driver (implements java.sql.Driver interface), which should implement "connect()" method. The method should connect to the DB using oracle.jdbc.driver.OracleDriver class, and should return an instance of the above connection proxy.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;In your test driver, call java.sql.DriverManager.registerDriver() to register your driver proxy and launch your desktop application as you normally do.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-3502939947926432486?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/3502939947926432486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=3502939947926432486' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/3502939947926432486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/3502939947926432486'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/repeatable-read-only-integration-test.html' title='Repeatable read only integration test'/><author><name>IT-Worx</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-4485062814756213985.post-2565054706515184559</id><published>2010-03-18T15:52:00.000-04:00</published><updated>2010-03-18T15:53:12.548-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA'/><title type='text'>Running JPA examples in Java SE (non-Managed) and EE (managed) environment</title><content type='html'>This article explains how to run JPA programs in Java SE (non-Managed) and EE (managed) environment&lt;br /&gt;&lt;a href="https://glassfish.dev.java.net/javaee5/persistence/persistence-example.html#Using_in_Java_SE"&gt;https://glassfish.dev.java.net/javaee5/persistence/persistence-example.html#Using_in_Java_SE&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-2565054706515184559?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/2565054706515184559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=2565054706515184559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/2565054706515184559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/2565054706515184559'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/running-jpa-examples-in-java-se-non.html' title='Running JPA examples in Java SE (non-Managed) and EE (managed) environment'/><author><name>IT-Worx</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-4485062814756213985.post-7389080358534173386</id><published>2010-03-17T17:15:00.000-04:00</published><updated>2010-03-17T17:17:31.304-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB 3.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Annotation'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA'/><category scheme='http://www.blogger.com/atom/ns#' term='EJB 2.1'/><title type='text'>The Java Persistence API - A Simpler Programming Model for Entity Persistence</title><content type='html'>Recommending a great article, describing the enhancement in EJB 3.0 comparing to EJB 2.1:&lt;br /&gt;http://java.sun.com/developer/technicalArticles/J2EE/jpa/&lt;br /&gt;&lt;br /&gt;The only thing I don't like about the annotation, e.g. look at the way the many-to-many relationship is implemented. It's NOT intuitive to read. It would have been better if we could do something like this:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @JoinTable(CUSTOMERBEANSUBSCRIPTIONBEAN#CUST_FK-&amp;gt;CUSTOMERBEAN#ID,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUSTOMERBEANSUBSCRIPTIONBEAN#TITLE_FK-&amp;gt;SUBSCRIPTIONBEAN#ID)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-7389080358534173386?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/7389080358534173386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=7389080358534173386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/7389080358534173386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/7389080358534173386'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/java-persistence-api-simpler.html' title='The Java Persistence API - A Simpler Programming Model for Entity Persistence'/><author><name>IT-Worx</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-4485062814756213985.post-5807889465405844077</id><published>2010-03-16T17:34:00.000-04:00</published><updated>2010-03-17T17:22:52.310-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB 3.0'/><category scheme='http://www.blogger.com/atom/ns#' term='JSR 220'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA'/><category scheme='http://www.blogger.com/atom/ns#' term='TopLink'/><title type='text'>Standardizing Java Persistence with the EJB3 Java Persistence API - O'Reilly Media</title><content type='html'>&lt;a href="http://onjava.com/pub/a/onjava/2006/05/17/standardizing-with-ejb3-java-persistence-api.html?page=5"&gt;Standardizing Java Persistence with the EJB3 Java Persistence API - O'Reilly Media&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Posted using &lt;a href="http://sharethis.com/"&gt;ShareThis&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Coming from TopLink/Hibernate background, I can see how simple JPA is, comparing to TopLink or Hibernate (the non-JPA implementation). Note that,as of 2009&lt;sup class="plainlinks noprint asof-tag update" style="display: none;"&gt;&lt;a class="external text" href="http://en.wikipedia.org/w/index.php?title=Java_Persistence_API&amp;amp;action=edit" rel="nofollow"&gt;[update]&lt;/a&gt;&lt;/sup&gt; projects like &lt;a href="http://en.wikipedia.org/wiki/Hibernate_%28Java%29" title="Hibernate (Java)"&gt;Hibernate&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/TopLink" title="TopLink"&gt;Open-Source  Version TopLink Essentials&lt;/a&gt; have become implementations of the Java  Persistence API.&lt;br /&gt;&lt;br /&gt;Mapping is much cleaner. Named queries are better implemented! You can now forget all the amender classes/methods:) Annotations rock. Even better, JPA provides a consistent persistence layer regardless of the implementation details (e.g. TopLink essentials or Hibernate). God bless!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-5807889465405844077?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/5807889465405844077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=5807889465405844077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/5807889465405844077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/5807889465405844077'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/standardizing-java-persistence-with.html' title='Standardizing Java Persistence with the EJB3 Java Persistence API - O&amp;#39;Reilly Media'/><author><name>IT-Worx</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-4485062814756213985.post-6014001594194352320</id><published>2010-03-11T17:11:00.000-05:00</published><updated>2010-03-11T17:11:38.233-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Junit'/><category scheme='http://www.blogger.com/atom/ns#' term='non Object level query'/><category scheme='http://www.blogger.com/atom/ns#' term='Object level query'/><category scheme='http://www.blogger.com/atom/ns#' term='TopLink'/><title type='text'>Functional Junit Test - Part 2 - Making newly created session objects available for query</title><content type='html'>&lt;div style="background-color: #336699;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;&lt;span style="color: white;"&gt;Making new session objects available for Object Level Query&lt;/span&gt; &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;Sometimes you may need to create data in the TopLink session to support your test scenarios. To make those newly created objects available for object level queries down the road in your execution patch, you need to do the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;register the new object into the session using UnitOfWork.registerNewObject() &lt;/li&gt;&lt;li&gt;call alwaysConformResultsInUnitOfWork.&lt;/li&gt;&lt;/ol&gt;Then, the new object (though not committed to the database) will be seen by object level queries, e.g. when you call oracle.toplink.sessions.Session.readAllObjects(entityClass, expression), the new object, if satisfying the expression, will be included in the returned collection.&lt;br /&gt;&lt;br /&gt;Remember that, if you read &lt;a href="http://it-worx.blogspot.com/2010/03/functional-junit-test-database-rollback.html"&gt;Part 1&lt;/a&gt; of this series, the new object will not be saved into database. The changes are being rolled back for each test case as described in &lt;a href="http://it-worx.blogspot.com/2010/03/functional-junit-test-database-rollback.html"&gt;Part 1&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #336699;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;&lt;span style="color: white;"&gt;Making new session objects available for non-Object Level Query&lt;/span&gt; &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;If there are non-object level queries in your application, e.g. Named Query, and you want to create test data for the query, then do the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;register the new object into the session using UnitOfWork.registerNewObject() &lt;/li&gt;&lt;li&gt;call UnitOfWork.writeChanges().&lt;/li&gt;&lt;/ol&gt;&amp;nbsp;There is a limitation: you can only call writeChanges() once per session.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-6014001594194352320?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/6014001594194352320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=6014001594194352320' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/6014001594194352320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/6014001594194352320'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/functional-junit-test-part-2-making.html' title='Functional Junit Test - Part 2 - Making newly created session objects available for query'/><author><name>IT-Worx</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-4485062814756213985.post-8006528840162870013</id><published>2010-03-11T15:43:00.000-05:00</published><updated>2010-03-11T23:01:00.884-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Junit'/><category scheme='http://www.blogger.com/atom/ns#' term='Repeatable Test'/><category scheme='http://www.blogger.com/atom/ns#' term='Unit Test'/><category scheme='http://www.blogger.com/atom/ns#' term='TopLink'/><title type='text'>Functional Junit Test - Part 1 - Database Rollback</title><content type='html'>&lt;div style="background-color: #336699;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;&lt;span style="color: white;"&gt;Overview&lt;/span&gt; &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;Unit tests should be isolated and repeatable. Many are using mock frameworks like JMock, EasyMock etc. And those test cases should not interact with other layers (e.g. network services or database, etc).&lt;br /&gt;&lt;br /&gt;This post is not going to talk about those mocking frameworks. Instead, I'll share with you some of my experience working on integration test: functional Junit test cases that interact with database server.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;This is not a place to debate whether dependencies should be mocked out or not. &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Our development settings are Eclipse + TopLink + Oracle and test cases run in a local environment (not JTA environment). I'll publish a series of posts in my blog about functional Junit test.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #336699; color: white;"&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Database Rollback&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;This 1st post is about database rollback, which makes Junit test cases repeatable. Implementation is very simple. In the tearDown(), you just need to call&lt;br /&gt;&lt;ol&gt;&lt;li&gt;oracle.toplink.sessions.UnitOfWork.release().&lt;/li&gt;&lt;li&gt;oracle.toplink.sessions.Session.release().&lt;/li&gt;&lt;/ol&gt;with the assumption that the TopLink session and unit of work is being created somewhere in your application code, e.g. when registering a new object into TopLink or when retrieving data from the database. By calling the above two methods, you are basically rolling back all the changes made by your test cases. In my projects, we used a base test case to host the rollback logic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-8006528840162870013?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/8006528840162870013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=8006528840162870013' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/8006528840162870013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/8006528840162870013'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/functional-junit-test-database-rollback.html' title='Functional Junit Test - Part 1 - Database Rollback'/><author><name>IT-Worx</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-4485062814756213985.post-3237042862551243390</id><published>2010-03-08T13:39:00.000-05:00</published><updated>2010-03-08T23:06:05.468-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debug'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Debug Maven project in Eclipse</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;Recently I read the instruction about debugging Maven project in Eclipse&amp;nbsp;&lt;a href="http://docs.codehaus.org/display/MAVENUSER/Dealing+with+Eclipse-based+IDE"&gt;&lt;span class="Apple-style-span"&gt;http://docs.codehaus.org/display/MAVENUSER/Dealing+with+Eclipse-based+IDE&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;It mentioned that you need to create a Java project (e.g. "Maven Debug") in order to attach the debugger. I found this unnecessary and you don't have to create such additional project. Here is how:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;Click "Run" -&amp;gt; "External Tools" -&amp;gt; "External Tools Configurations..."&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;Create new configuration.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_Ho_NbTsw0G4/S5VBf-zw9gI/AAAAAAAAFDI/SvA0SnzmRiI/s1600-h/debug.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span class="Apple-style-span"&gt;&lt;img border="0" height="512" src="http://3.bp.blogspot.com/_Ho_NbTsw0G4/S5VBf-zw9gI/AAAAAAAAFDI/SvA0SnzmRiI/s640/debug.jpg" width="640" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;Where maven_exe points to your Maven installation folder. Click "run" and you should see in the console that it launched the debugger, listening to port 8000.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;Now go to "Run"-&amp;gt; "Debug Configurations..." and create a new "Remote Java Application":&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_Ho_NbTsw0G4/S5VChTvwpiI/AAAAAAAAFDQ/X6OssEEHMZE/s1600-h/debug.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span class="Apple-style-span"&gt;&lt;img border="0" height="512" src="http://1.bp.blogspot.com/_Ho_NbTsw0G4/S5VChTvwpiI/AAAAAAAAFDQ/X6OssEEHMZE/s640/debug.jpg" width="640" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;On "connect" tab, set project to your Eclipse project you want to debug. Host = localhost, port = 8000.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;On "Source" tab, add your Eclipse project as the source lookup path&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;Finally, click "debug" and it will stop at your breakpoints.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Happy debugging!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;(I used Eclipse 3.4, Maven 2.2.1 and Maven Integration for Eclipse)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4485062814756213985-3237042862551243390?l=it-worx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://it-worx.blogspot.com/feeds/3237042862551243390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4485062814756213985&amp;postID=3237042862551243390' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/3237042862551243390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4485062814756213985/posts/default/3237042862551243390'/><link rel='alternate' type='text/html' href='http://it-worx.blogspot.com/2010/03/debug-maven-project-in-eclipse.html' title='Debug Maven project in Eclipse'/><author><name>IT-Worx</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Ho_NbTsw0G4/S5VBf-zw9gI/AAAAAAAAFDI/SvA0SnzmRiI/s72-c/debug.jpg' height='72' width='72'/><thr:total>2</thr:total></entry></feed>
