<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CEYBRXs5cCp7ImA9WhRaEUQ.&quot;"><id>tag:blogger.com,1999:blog-6988195</id><updated>2012-02-14T05:02:34.528+01:00</updated><category term="NotSerializableException" /><category term="nb60" /><category term="Netbeans" /><category term="SCEA" /><category term="Jetspeed" /><category term="javaranch" /><category term="UML 2.0" /><category term="Unit tests" /><category term="CMS" /><category term="JSTL" /><category term="UML" /><category term="Alfresco" /><category term="Java" /><category term="J2EE" /><category term="Keyboard" /><category term="Shortcut" /><category term="Conventions" /><title>Java Notes</title><subtitle type="html">Here I will describe my learnings when using java...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://marcels-javanotes.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/RCuT" /><feedburner:info uri="blogspot/rcut" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D0QCSX88eip7ImA9WhZRFUQ.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-4348596987531287009</id><published>2011-04-12T09:55:00.001+02:00</published><updated>2011-04-12T10:02:48.172+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-12T10:02:48.172+02:00</app:edited><title>Fine grained authorization with Spring Security 3</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KeQLKcp-wJ5wm-6JDsVw-LomxOU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KeQLKcp-wJ5wm-6JDsVw-LomxOU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KeQLKcp-wJ5wm-6JDsVw-LomxOU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KeQLKcp-wJ5wm-6JDsVw-LomxOU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;For a project I'm currently working on the authorization requuirements are such that we need method level authorization.&lt;br /&gt;
The projects will create a REST service whoes functionality I will not describe here, but it is based on Spring MVC, requires authentication based on Kerberos and user ID/password and fine grained authorization based on roles. The roles are taken from the Active Directory.&lt;br /&gt;
&lt;br /&gt;
Since &lt;a href="http://www.springsource.org/about"&gt;Spring&lt;/a&gt; is already used and because we need two distinct manners for authentication, &lt;a href="http://static.springsource.org/spring-security/site/index.html"&gt;spring security&lt;/a&gt; seems to be the best choice for this.&lt;br /&gt;
Using spring security, the authorization checks can be configured using annotations on the MVC controller using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;@PreAuthorize("hasRole('ROLE_USER')")&lt;/span&gt; and the like.&lt;br /&gt;
&lt;br /&gt;
Starting with spring security works like a breeze, until you try to step outside of the boundaries.&lt;br /&gt;
Setting up simple authentication based on hard coded user ID's with hard coded password and hard coded roles goes like this:&lt;br /&gt;
&lt;pre&gt;&amp;lt;beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:sec="http://www.springframework.org/schema/security"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
    "&amp;gt;

    &amp;lt;sec:http auto-config="true"&amp;gt;
        &amp;lt;sec:intercept-url pattern="/*" access="ROLE_USER" /&amp;gt;
    &amp;lt;/sec:http&amp;gt;

    &amp;lt;sec:authentication-manager alias="authenticationManager"&amp;gt;
        &amp;lt;sec:authentication-provider&amp;gt;
                &amp;lt;sec:user-service&amp;gt;
                    &amp;lt;sec:user authorities="ROLE_USER"
                        name="jim" password="morisson"/&amp;gt;
                    &amp;lt;sec:user authorities="ROLE_USER,ROLE_OPERATOR"
                        name="stevie" password="vaughan"/&amp;gt;
                    &amp;lt;sec:user authorities="ROLE_USER,ROLE_OPERATOR,ROLE_DEPLOYMENT_ENGINEER"
                        name="brian" password="jones"/&amp;gt;
                &amp;lt;/sec:user-service&amp;gt;
        &amp;lt;/sec:authentication-provider&amp;gt;
    &amp;lt;/sec:authentication-manager&amp;gt;
&amp;lt;/beans&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
According to the documentation, all you need to do to enable the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;@PreAuthorize&lt;/span&gt; annotation is adding &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;sec:global-method-security pre-post-annotations="enabled"/&amp;gt;&lt;/span&gt;&lt;br /&gt;
So I did, but the authorization checks did not kick in at all.&lt;br /&gt;
I have been struggling with this for a while until I stumbled over &lt;a href="http://stackoverflow.com/questions/3087548/can-spring-security-use-preauthorize-on-spring-controllers-methods"&gt;this post on stackoverflow&lt;/a&gt;. The solution is as simple as it is strange, I only needed to move the line &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;sec:global-method-security pre-post-annotations="enabled"/&amp;gt;&lt;/span&gt; from the security-context.xml to the dispatcher-servlet.xml. Nowhere else can I find this suggestion, even in &lt;a href="http://www.packtpub.com/spring-security-3/book"&gt;Peter Mularien's book&lt;/a&gt; its written as:&lt;br /&gt;
&lt;blockquote&gt;&lt;span style="font-size: large;"&gt;Instructing Spring Security to use method annotations&lt;/span&gt;&lt;br /&gt;
We'll also need to make a one-time change to dogstore-security.xml, where we've got the rest of our Spring Security configuration. Simply add the following element right before the &amp;lt;http&amp;gt; declaration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;global-method-security pre-post-annotations="enabled"/&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;
It seems that the above declaration registers a bean post-processor that is applied to the context in which it is declared, that means that declaring it in the security context, the post-processor is not applied to beans declared in the web context.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-4348596987531287009?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/F1sA4hph6ig" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/4348596987531287009/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=4348596987531287009&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4348596987531287009?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4348596987531287009?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/F1sA4hph6ig/fine-grained-authorization-with-spring.html" title="Fine grained authorization with Spring Security 3" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2011/04/fine-grained-authorization-with-spring.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cGRnk-fyp7ImA9Wx9VFkk.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-320940001873279108</id><published>2011-02-02T12:02:00.001+01:00</published><updated>2011-02-02T12:10:27.757+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-02T12:10:27.757+01:00</app:edited><title>Create mock objects in spring configuration</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jnBgt8BA5MJF8JWbIfHgdiv6reU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jnBgt8BA5MJF8JWbIfHgdiv6reU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jnBgt8BA5MJF8JWbIfHgdiv6reU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jnBgt8BA5MJF8JWbIfHgdiv6reU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In case you ever need to supply a mock object in spring configuration, here's a snippet that does just that:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;!-- Define the Mockito class as factory for creating the mock --&amp;gt;&lt;br /&gt;
&amp;lt;bean id="restTemplate" class="org.mockito.Mockito" factory-method="mock"&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;!-- The constructor contains the full name of the class being mocked --&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;constructor-arg value="org.springframework.web.client.RestTemplate"/&amp;gt;&lt;br /&gt;
&amp;lt;/bean&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
The defined restTemplate bean can be be referenced in other bean definitions, for instance the object under test.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-320940001873279108?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/HXzlyttfHlc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/320940001873279108/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=320940001873279108&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/320940001873279108?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/320940001873279108?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/HXzlyttfHlc/create-mock-objects-in-spring.html" title="Create mock objects in spring configuration" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2011/02/create-mock-objects-in-spring.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8CQ3g7eSp7ImA9Wx5SFUw.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-1748367833747255615</id><published>2010-08-11T09:17:00.003+02:00</published><updated>2010-08-11T10:04:22.601+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-11T10:04:22.601+02:00</app:edited><title>How to test a class that directly uses java.rmi.Naming</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Izq7svQs8Au0drStfVF-fUmGRcE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Izq7svQs8Au0drStfVF-fUmGRcE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Izq7svQs8Au0drStfVF-fUmGRcE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Izq7svQs8Au0drStfVF-fUmGRcE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;While in the process of doing a handover of a project, some pieces of the projects source do not comply with the code standard. In this holiday season the original developer wasn't available, so I made my sleeves wet and hands dirty again, and started fixing it.&lt;br /&gt;&lt;br /&gt;The major thing the code lacked was a proper unit test with coverage higher than 80%, well it didn't have a unit test at all.&lt;br /&gt;Adding a unit test normally is not a big deal, but in this case, the class, a simple servlet that connects to a remote RMI object and calls a status method on it, directly uses &lt;code&gt;java.rmi.Naming&lt;/code&gt;.&lt;br /&gt;&lt;code&gt;java.rmi.Naming&lt;/code&gt; is notorious for its static methods, which are hard to mock when unit testing.&lt;br /&gt;There are great products out there, like &lt;a href="http://code.google.com/p/powermock/"&gt;powermock&lt;/a&gt; that can actually mock static methods, but not in &lt;a href="http://blog.jayway.com/2009/05/17/mocking-static-methods-in-java-system-classes/"&gt;system classes&lt;/a&gt;.&lt;br /&gt;I could change the servlet code and provide a wrapper around accessing the &lt;code&gt;java.rmi.Naming&lt;/code&gt; class, but I didn't want to change the code.&lt;br /&gt;&lt;br /&gt;Instead I chose to not mock &lt;code&gt;java.rmi.Naming&lt;/code&gt;, but instead just create my own instance:&lt;br /&gt;&lt;pre&gt;@BeforeClass&lt;br /&gt;public static void initNamingRegistry() throws RemoteException {&lt;br /&gt;   // Create a local registry with an arbitrary port number&lt;br /&gt;   rmiRegistry = LocateRegistry.createRegistry(9901);&lt;br /&gt;&lt;/pre&gt;This registry is alive and kickin' during the execution of my test suite, so I can now register the mock object that implements the remote business interface:&lt;br /&gt;&lt;pre&gt;@Before&lt;br /&gt;public void registerRemoteMock() throws Exception {&lt;br /&gt;   // Register the mock of the remote business object&lt;br /&gt;   rmiRegistry.bind("testName", remoteMock);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Then the actual servlet method can bet tested:&lt;br /&gt;&lt;pre&gt;@Test&lt;br /&gt;public void testSomeBehaviour()&lt;br /&gt;  // Prepare the mocks&lt;br /&gt;  when(requestMock.getParameter("name").thenReturn("val");&lt;br /&gt;  ...&lt;br /&gt;  // Call the test method&lt;br /&gt;  testObject.doGet(requestMock, responseMock);&lt;br /&gt;  &lt;br /&gt;  // Verify the calls if needed&lt;br /&gt;  verify(remoteMock).doIt();&lt;br /&gt;&lt;/pre&gt;Nice, clean and simple!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-1748367833747255615?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/2UR2yEfmVYY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/1748367833747255615/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=1748367833747255615&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1748367833747255615?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1748367833747255615?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/2UR2yEfmVYY/how-to-test-class-that-directly-uses.html" title="How to test a class that directly uses java.rmi.Naming" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2010/08/how-to-test-class-that-directly-uses.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YMSH84eSp7ImA9WxdXFEo.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-6849994450419864190</id><published>2008-06-26T11:06:00.001+02:00</published><updated>2008-06-26T11:06:29.131+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-26T11:06:29.131+02:00</app:edited><title>Passed !!</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/u1gpVfL4ehqBeWtDp5TTJRxPX9g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/u1gpVfL4ehqBeWtDp5TTJRxPX9g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/u1gpVfL4ehqBeWtDp5TTJRxPX9g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/u1gpVfL4ehqBeWtDp5TTJRxPX9g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Grade:      P&lt;br/&gt;Score:     75&lt;br/&gt;Comment:     This report shows the total points that could have been awarded in each section and the actual amount of points you were awarded. This information is provided in order to give you feedback on your relative strengths on a section basis. The maximum number of points you could have received is 100, minimum to pass is 70. &lt;br/&gt;&lt;br/&gt;Class Diagram (44 maximum) .......................... 31&lt;br/&gt;Component Diagram (44 maximum) ...................... 32&lt;br/&gt;Sequence/Collaboration Diagrams (12 maximum) ........ 12 &lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-6849994450419864190?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/y-PXg8-WmSs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/6849994450419864190/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=6849994450419864190&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/6849994450419864190?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/6849994450419864190?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/y-PXg8-WmSs/passed.html" title="Passed !!" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2008/06/passed.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MMSX8zfSp7ImA9WxdQF04.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-1043501631274398412</id><published>2008-06-17T21:35:00.002+02:00</published><updated>2008-06-17T21:38:08.185+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-17T21:38:08.185+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="J2EE" /><category scheme="http://www.blogger.com/atom/ns#" term="SCEA" /><title>SCEA part III</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3HbdbjwLlPb0itq1uR-xeo-kPdE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3HbdbjwLlPb0itq1uR-xeo-kPdE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3HbdbjwLlPb0itq1uR-xeo-kPdE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3HbdbjwLlPb0itq1uR-xeo-kPdE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;As we say in holland, "the bullit has gone through the church", altough we usually say it in Dutch like: "De kogel is door de kerk", which means something like I have finally done it...&lt;br /&gt;Last week Sunday I've uploaded my assignment, and today I took me essay exams.&lt;br /&gt;&lt;br /&gt;So now its waiting, and waiting...&lt;br /&gt;Until the results are published.&lt;br /&gt;&lt;br /&gt;Keep you posted.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-1043501631274398412?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/n7Zx4tQZkwo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/1043501631274398412/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=1043501631274398412&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1043501631274398412?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1043501631274398412?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/n7Zx4tQZkwo/scea-part-iii.html" title="SCEA part III" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2008/06/scea-part-iii.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8MQnw_eyp7ImA9WxZWEUg.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-24215423295915468</id><published>2008-03-10T15:21:00.001+01:00</published><updated>2008-03-10T15:21:23.243+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-10T15:21:23.243+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="NotSerializableException" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title>java.io.NotSerializableException</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RzJfySJgHSLSGKmRfuJf2JK-C48/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RzJfySJgHSLSGKmRfuJf2JK-C48/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RzJfySJgHSLSGKmRfuJf2JK-C48/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RzJfySJgHSLSGKmRfuJf2JK-C48/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I can't fully dedicate my time to the SCEA assignment, I am also fulltime working on projects.&lt;br/&gt;Today I ran into a java.io.NotSerializableException. &lt;br/&gt;The stack trace is not at all helpfull, it just says "Caused by: java.io.NotSerializableException: foo.bar.FooBar."&lt;br/&gt;While I am sure that foo.bar.FooBar implements java.io.Serializable.&lt;br/&gt;I checked all the class members and marked some of the members transient (log4j Logger), but still the thing is popping up.&lt;br/&gt;&lt;br/&gt;Googling for that exception showed &lt;a href='http://herebebeasties.com/2007-02-08/javaionotserializableexception-in-your-httpsession/'&gt;this blog post&lt;/a&gt;. As it appeared, their first attempt wasn't very useful, although the idea looked promising.&lt;br/&gt;Their DebugObjectOutputStream doesn't handle private fields, and can't cope with inheritance.&lt;br/&gt;These issues seem to have been resolved in the wicked code itself, but that is a bit too harsh to just get &lt;br/&gt;&lt;br/&gt;Browsing the comments posted underneath the post showed a link to &lt;a href='http://crazybob.org/2007/02/debugging-serialization.html'&gt;Bob Lee's&lt;/a&gt; blog where he tackles the same problem.&lt;br/&gt;Although the output generated by his solution isn't as verbose as the other one, it does give the expected results.&lt;br/&gt;This showed me that I missed out on some of the fields.&lt;br/&gt;Great help. Thanks Bob.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-24215423295915468?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/cSGzy5iP00I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/24215423295915468/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=24215423295915468&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/24215423295915468?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/24215423295915468?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/cSGzy5iP00I/javaionotserializableexception.html" title="java.io.NotSerializableException" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2008/03/javaionotserializableexception.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUECRXs4eyp7ImA9WxZRGEw.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-3700177961588271498</id><published>2008-02-12T12:53:00.001+01:00</published><updated>2008-02-12T13:01:04.533+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-02-12T13:01:04.533+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="UML 2.0" /><category scheme="http://www.blogger.com/atom/ns#" term="J2EE" /><category scheme="http://www.blogger.com/atom/ns#" term="SCEA" /><category scheme="http://www.blogger.com/atom/ns#" term="javaranch" /><title>Creating sequence diagrams</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fj39UxWlYrBrr3gDxJFRYpLEYLQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fj39UxWlYrBrr3gDxJFRYpLEYLQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fj39UxWlYrBrr3gDxJFRYpLEYLQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fj39UxWlYrBrr3gDxJFRYpLEYLQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;The sequence diagrams are getting complicated.&lt;br /&gt;I am now looking at the benefits that UML 2.0 can bring us in reducing the complexity.&lt;br /&gt;I mean I started off modelling the sequence diagram for the prepare itinerary use case and ended up with a diagram that didn't fit on the screen any more, and I didn't even modelled the business functionality yet, I stopped at the business delegate.&lt;br /&gt;So looking at the new elements in UML 2.0 I found the Interaction Overview diagrams useful for splitting the complex sequence diagram into smaller more usable chunks.&lt;br /&gt;I'd like to soon finish the sequence diagram for this first, but major, use case and then start modelling the class diagram.&lt;br /&gt;When that has been done, most likely I will need to correct my sequence diagrams again to reflect corrected flaws discovered when doing the class diagram.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the mean time I am having a great discussion on &lt;a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&amp;amp;f=26&amp;amp;t=007507"&gt;javaranch&lt;/a&gt; about a discrepancy in the requirements. The prepare itinerary scenario mentions alternative flights within one hour and less than the selected, while in the given interview with CEO and CIO the flights have a flat price per destination, per seat class. &lt;a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&amp;amp;f=26&amp;amp;t=007520"&gt;Another thread&lt;/a&gt; on javaranch discusses the difference (or lack off) between flight and segment.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Speeking with UB40: both these discussions give me quite some &lt;a href="http://ub40.popbang.co.uk/"&gt;food for thought&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-3700177961588271498?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/lEgnhKjOpkk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/3700177961588271498/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=3700177961588271498&amp;isPopup=true" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/3700177961588271498?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/3700177961588271498?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/lEgnhKjOpkk/creating-sequence-diagrams.html" title="Creating sequence diagrams" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>3</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2008/02/creating-sequence-diagrams.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MMR30zfSp7ImA9WxZSFk0.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-1932587551903745035</id><published>2008-01-28T23:04:00.001+01:00</published><updated>2008-01-29T13:24:46.385+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-29T13:24:46.385+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="UML" /><category scheme="http://www.blogger.com/atom/ns#" term="J2EE" /><category scheme="http://www.blogger.com/atom/ns#" term="SCEA" /><title>Going thru the requirements</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Hsg02nlK5ng2QeQzfBHU9duPowk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hsg02nlK5ng2QeQzfBHU9duPowk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Hsg02nlK5ng2QeQzfBHU9duPowk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hsg02nlK5ng2QeQzfBHU9duPowk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;I have some problems getting myself up to speed on this assignment. I can blame lots of things like work load, my wife and children needing atention, but in the end I can only just blame myself. It seems to be hard just starting on it.&lt;br /&gt;But allright finally I started really reading the requirements specs a couple of times.&lt;br /&gt;Going thru them I wrote down the things that seemed unclear.&lt;br /&gt;&lt;br /&gt;Then going over the scenario's given, I started out in writing down the entities I discovered in there, these are possible classes and/or attributes.&lt;br /&gt;&lt;br /&gt;Now I am working on the creation of the sequence diagrams based on the scenraio's this will also result in class diagrams.&lt;br /&gt;&lt;br /&gt;Well I just must make sure that I keep this up and continue...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-1932587551903745035?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/gBtk5bwzEd8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/1932587551903745035/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=1932587551903745035&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1932587551903745035?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1932587551903745035?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/gBtk5bwzEd8/going-thru-requirements.html" title="Going thru the requirements" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2008/01/going-thru-requirements.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYGSX8_fSp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-7791926304633036800</id><published>2008-01-21T09:20:00.001+01:00</published><updated>2008-01-22T07:42:08.145+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:42:08.145+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="UML" /><category scheme="http://www.blogger.com/atom/ns#" term="SCEA" /><title>Using stereotypes to describe J2EE components</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cJjDiVbIEAcIOwh-3SP0LsA3rn0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cJjDiVbIEAcIOwh-3SP0LsA3rn0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cJjDiVbIEAcIOwh-3SP0LsA3rn0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cJjDiVbIEAcIOwh-3SP0LsA3rn0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;For the SCEA assignment the architecture needs to be documented using UML.&lt;br/&gt;Most architectures will have J2EE components like EJB's or servlets.&lt;br/&gt;When these are documented you can opt to fully document each EJB, meaning adding all interfaces as separate elements on a class diagram, and incorporating the complete message flow in sequence diagrams containing all standard EJB message calls, like ejbCreate, etc.&lt;br/&gt;I think that documenting the design and architecture in such a way will clutter the diagrams too much, thereby making the design/architecture harder to read.&lt;br/&gt;&lt;br/&gt;Simplifying the diagrams by adding stereotypes to these elements, like &amp;amp;lt;ejb&amp;amp;gt; makes reading the the design/architecture easier and keeps the focus on the essential parts.&lt;br/&gt;&lt;br/&gt;Sun has &lt;a href='http://java.sun.com/developer/technicalArticles/J2EE/patterns/UseOfUML.html'&gt;documented some annotations they use in their pattern catalog&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;In addition to these stereotypes I will add Stateless/Stateful to designate the different session beans when needed, and maybe come up with some additional stereotypes when necessary.&lt;br/&gt;&lt;a href='http://java.sun.com/developer/technicalArticles/J2EE/patterns/UseOfUML.html'&gt;&lt;br/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-7791926304633036800?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/cWhLj_Vwu3w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/7791926304633036800/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=7791926304633036800&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/7791926304633036800?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/7791926304633036800?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/cWhLj_Vwu3w/using-stereotypes-to-describe-j2ee.html" title="Using stereotypes to describe J2EE components" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2008/01/using-stereotypes-to-describe-j2ee.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMGRX4-eSp7ImA9WxZTFUg.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-4137691629949060952</id><published>2008-01-17T09:10:00.001+01:00</published><updated>2008-01-17T09:10:24.051+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-17T09:10:24.051+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Keyboard" /><category scheme="http://www.blogger.com/atom/ns#" term="nb60" /><category scheme="http://www.blogger.com/atom/ns#" term="Shortcut" /><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans" /><title>Netbeans 6.0 Keyboard shortcuts</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MlglxMZSpzOlyJYqSaGNcvDSorY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MlglxMZSpzOlyJYqSaGNcvDSorY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MlglxMZSpzOlyJYqSaGNcvDSorY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MlglxMZSpzOlyJYqSaGNcvDSorY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I am trying to switch from eclipse to Netbeans when doing some Java coding.&lt;br/&gt;The biggest problem that came up is the keyboard shortcuts, obviously they all differ, so I miss the ones I learned to love and use a lot in eclipse, like pressing Ctrl-1, in eclipse this opens an assistant that helps you resolve compilation problems.&lt;br/&gt;&lt;br/&gt;I found a &lt;a href='http://www.javalobby.org/java/forums/t102769.html'&gt;link &lt;/a&gt;that at least shows some of the shortcuts, and &lt;a href='http://javahowto.blogspot.com/2006/06/netbeans-keyboard-shortcuts-on.html'&gt;one&lt;/a&gt; that describes where to find a keyboard shortcut list in the netbeans installation. The shortcuts.pdf file also contains a link to a &lt;a href='http://wiki.netbeans.org/wiki/view/KeymapProfileFor60'&gt;wiki&lt;/a&gt; page that describes the keyboard shortcuts specification.&lt;br/&gt;&lt;br/&gt;From the wiki page I learned that the shortcut I so desperately need is Alt + Enter, as explained in the 'Coding in Java' section under 'Show suggestion/Tip/Hint'.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-4137691629949060952?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/9zUV3DRtKPA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/4137691629949060952/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=4137691629949060952&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4137691629949060952?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4137691629949060952?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/9zUV3DRtKPA/netbeans-60-keyboard-shortcuts.html" title="Netbeans 6.0 Keyboard shortcuts" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>2</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2008/01/netbeans-60-keyboard-shortcuts.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYGSX8_fSp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-821402391118773614</id><published>2008-01-02T21:28:00.001+01:00</published><updated>2008-01-22T07:42:08.145+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:42:08.145+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="UML" /><category scheme="http://www.blogger.com/atom/ns#" term="SCEA" /><title>SCEA Part I</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NGLsNkX29fJ0kWKJMu0cdzxiyKI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NGLsNkX29fJ0kWKJMu0cdzxiyKI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NGLsNkX29fJ0kWKJMu0cdzxiyKI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NGLsNkX29fJ0kWKJMu0cdzxiyKI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;On December 14th I passed for the first part of the Sun Certified Enterprise Architect exam (SCEA), with a score of 93%.&lt;br /&gt;Immediately after this multiple choice exam I registered for its follow-up: the assignment.&lt;br /&gt;The assignment consists of some requirements, a business domain model and use cases for a flight booking system for the airliner &lt;i&gt;Fly By Night&lt;/i&gt;. Due to the non diclosure agreement I have signed when registering for the assignment, I cannot write about the assignment and my solution in much detail, but I will try to keep a record of my doings here on the blog from now on.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-821402391118773614?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/KqECJm2vE0I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/821402391118773614/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=821402391118773614&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/821402391118773614?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/821402391118773614?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/KqECJm2vE0I/scea-part-i.html" title="SCEA Part I" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2008/01/scea-part-i.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAERXw9fyp7ImA9WB9SFUo.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-4028672591269706247</id><published>2007-10-05T10:25:00.001+02:00</published><updated>2007-10-05T10:25:04.267+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-10-05T10:25:04.267+02:00</app:edited><title>Using spring's webflow package</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4bkW7GlpftrWzqtmixBwpqKVAmM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4bkW7GlpftrWzqtmixBwpqKVAmM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4bkW7GlpftrWzqtmixBwpqKVAmM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4bkW7GlpftrWzqtmixBwpqKVAmM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;As an architect I get a lot of challenging questions.&lt;br/&gt;Like this week, a team of the company I am currently working for needs to migrate a number of simple applications written in PHP to a J2EE environment.&lt;br/&gt;In addition to this, the first release will run as standalone web applications while in the (near) future they need to be incorporated into the soon to be released company web portal.&lt;br/&gt;So I needed to come up with a way that simplifies the transition of a web application into a portlet application.&lt;br/&gt;Since almost any web application can be in different states, as is the case with these applications, I thought of &lt;a href='http://www.springframework.org/webflow'&gt;Spring's webflow&lt;/a&gt; package.&lt;br/&gt;Spring's webflow uses either &lt;a href='http://www.springframework.org/docs/reference/mvc.html'&gt;Spring Web MVC&lt;/a&gt; or &lt;a href='http://www.springframework.org/docs/reference/portlet.html'&gt;Spring Portlet MVC&lt;/a&gt; underneath, so is it possible to easily swap either of them without changing the code?&lt;br/&gt;&lt;br/&gt;Let's find out...&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-4028672591269706247?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/YNngKQIa1hY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/4028672591269706247/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=4028672591269706247&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4028672591269706247?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4028672591269706247?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/YNngKQIa1hY/using-spring-webflow-package.html" title="Using spring&amp;#39;s webflow package" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/10/using-spring-webflow-package.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUDR3c4fCp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-7352661125390202722</id><published>2007-09-26T09:38:00.003+02:00</published><updated>2008-01-22T07:44:36.934+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:44:36.934+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Conventions" /><title>Java coding tips</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/B5Z72vKlZkM8jFxO99j9ANMiu7k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/B5Z72vKlZkM8jFxO99j9ANMiu7k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/B5Z72vKlZkM8jFxO99j9ANMiu7k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/B5Z72vKlZkM8jFxO99j9ANMiu7k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;This page, &lt;a href='http://www.javalobby.org/java/forums/t101755.html'&gt;7 Top Tips for Quality Java Software&lt;/a&gt;, contains some really useful tips. Although most of it seems common sense to me, it did reactivate the associated neurons in my brain.&lt;br/&gt;Good piece Jason!&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-7352661125390202722?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/dSO6oOcbbX0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/7352661125390202722/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=7352661125390202722&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/7352661125390202722?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/7352661125390202722?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/dSO6oOcbbX0/java-coding-tips.html" title="Java coding tips" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/09/java-coding-tips.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4CSHw5fCp7ImA9WxRbGEo.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-5589524034903793692</id><published>2007-07-16T08:56:00.001+02:00</published><updated>2008-12-10T03:09:29.224+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-10T03:09:29.224+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Alfresco" /><category scheme="http://www.blogger.com/atom/ns#" term="CMS" /><title>Using Alfresco's WCM</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KHPkX1FGYP2wwUqJGcJs4U3xuh0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KHPkX1FGYP2wwUqJGcJs4U3xuh0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KHPkX1FGYP2wwUqJGcJs4U3xuh0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KHPkX1FGYP2wwUqJGcJs4U3xuh0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Alfresco is supplying a nicely looking &lt;a href="http://puzzle.dl.sourceforge.net/sourceforge/alfresco/WCM_Eval_Guide2.0.pdf"&gt;evaluation&lt;/a&gt; guide for using their Web Content Management package.&lt;br /&gt;After briefly giving an overview of the Web Content Management Package, a scenario can be followed along while reading.&lt;br /&gt;The scenario describes using Alfresco WCM with a couple of different users, each having a different role in the system.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_-NWpnIPlnWs/RpsW4IH3AaI/AAAAAAAAAAs/Qbr7cn1izwQ/s1600-h/ExpandFolderNPE.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: right; cursor: pointer;" src="http://1.bp.blogspot.com/_-NWpnIPlnWs/RpsW4IH3AaI/AAAAAAAAAAs/Qbr7cn1izwQ/s320/ExpandFolderNPE.png" alt="" id="BLOGGER_PHOTO_ID_5087685357554041250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I followed this scenario from creating new users and assigning roles to them, creating a new web project, creating new web forms for the project, etc. until I came to the point of creating new web content. When trying expand the list of web forms next to my sandbox, I stumbled into a NullPointerException:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;So a good citizen of the open source world, I immediately went to Alfresco's issue tracker and found a report about this issue (&lt;a href="http://issues.alfresco.com/browse/WCM-486"&gt;WCM-486&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sadly this prevents me from finishing the scenario, So today I will see if the issue report can help me fix this on my system.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-5589524034903793692?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/pnZgSbkcy7o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/5589524034903793692/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=5589524034903793692&amp;isPopup=true" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/5589524034903793692?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/5589524034903793692?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/pnZgSbkcy7o/using-alfresco-wcm.html" title="Using Alfresco&amp;#39;s WCM" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_-NWpnIPlnWs/RpsW4IH3AaI/AAAAAAAAAAs/Qbr7cn1izwQ/s72-c/ExpandFolderNPE.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/07/using-alfresco-wcm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYBQnY7fCp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-5768264143913978094</id><published>2007-07-12T16:06:00.001+02:00</published><updated>2008-01-22T07:42:33.804+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:42:33.804+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Alfresco" /><category scheme="http://www.blogger.com/atom/ns#" term="CMS" /><title>How to setup a WCMS</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/irPLQYkKMyOX1vcafvRz53gzexM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/irPLQYkKMyOX1vcafvRz53gzexM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/irPLQYkKMyOX1vcafvRz53gzexM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/irPLQYkKMyOX1vcafvRz53gzexM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;OK I am going to try to setup alfresco 2.0 WCM on &lt;a href="http://labs.jboss.com/jbossas"&gt;JBoss AS&lt;/a&gt; using &lt;a href="http://www.hsqldb.org/"&gt;Hypersonic SQL&lt;/a&gt; as database.&lt;br /&gt;I am using HSQL because the can easily be zipped and distributed to fellow developers.&lt;br /&gt;&lt;br /&gt;As usual I'll first create a dedicated server configuration and name it alfresco20, this instance can be started using &amp;lt;jboss-root&amp;gt;/bin/run.sh -c alfresco20.&lt;br /&gt;&lt;br /&gt;Upfront I know that the alfresco.war must be deployed exploded in JBoss. So the war file is unzipped into &amp;lt;jboss-root&amp;gt;/server/alfresco20/deploy/alfresco.war.&lt;br /&gt;&lt;br /&gt;Two issue's arise immediately:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.alfresco.com/"&gt;Alfresco&lt;/a&gt; has a version of log4j packaged in the war, this generates &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassCastException.html"&gt;ClassCastExceptions&lt;/a&gt;, so the log4j is removed from alfresco.war/WEB-INF/lib.&lt;/li&gt;&lt;li&gt;The log4j configuration in JBoss lacks a root logger, and alfresco generates a lot log messages, so I opened &amp;lt;jboss-root&amp;gt;/server/alfresco20/conf/log4j.xml, and added &amp;lt;level value="warn"/&amp;gt; to the &amp;lt;root&amp;gt; element.&lt;/li&gt;&lt;/ol&gt;Configuring HSQL as database for alfresco is properly documented at the &lt;a href="http://wiki.alfresco.com/wiki/Database_Configuration#Hypersonic_SQL_Databases"&gt;alfresco wiki&lt;/a&gt;, I know because I did it myself ;-)&lt;br /&gt;&lt;br /&gt;When starting JBoss, after quite a while and a lot of warn and info log messages on the console, the server is started. Checking the base functionality at http://localhost:8080/alfresco shows the login page.&lt;br /&gt;But this merrily is alfresco's CMS not the WCM version, so stop the server again, either via the jmx-console or using Ctrl-C.&lt;br /&gt;According to the readme that comes with alfresco's WCM, the wcm-bootstrap-context.xml file needs to be placed in the &amp;lt;jboss-root&amp;gt;/server/alfresco20/conf/alfresco/extension directory.&lt;br /&gt;&lt;br /&gt;That should be it, unless the website preview feature is needed. For now lets first try if this works as suggested. After starting JBoss again using the above command, the server starts without a problem, and when browsing to the alfresco page, I get presented with the login screen. So the JBoss server appears to be working fine.&lt;br /&gt;Now lets start the virtualization server.&lt;br /&gt;&lt;br /&gt;Out of the box, the virtualization server did not need any configuration and it started without any problem. Great.&lt;br /&gt;&lt;br /&gt;Now I want to evaluate the functionality supplied, but that'll have to wait till next time.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-5768264143913978094?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/7xVxlj51Fj0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/5768264143913978094/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=5768264143913978094&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/5768264143913978094?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/5768264143913978094?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/7xVxlj51Fj0/how-to-setup-wcms.html" title="How to setup a WCMS" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/07/how-to-setup-wcms.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYBQnY7fCp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-1076317525734903351</id><published>2007-07-11T07:50:00.001+02:00</published><updated>2008-01-22T07:42:33.804+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:42:33.804+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Alfresco" /><category scheme="http://www.blogger.com/atom/ns#" term="CMS" /><title>Alfresco Content Package</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Xo8GXZW1T_hybEPaDjRAuFvz0sY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Xo8GXZW1T_hybEPaDjRAuFvz0sY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Xo8GXZW1T_hybEPaDjRAuFvz0sY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Xo8GXZW1T_hybEPaDjRAuFvz0sY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;One of my colleague suggested to look at &lt;a href="http://wiki.alfresco.com/wiki/Export_and_Import#Alfresco_Content_Package_.28ACP.29_File_Format"&gt;ACP&lt;/a&gt;, Alfresco's content package. This could be useful in the publication of content from one repository into the other, but we have a JCR compliant repository on the published end, not necessarily an Alfresco repository.&lt;br /&gt;&lt;br /&gt;An ACP package is a zipped directory structure, that has the extension '.acp'.&lt;br /&gt;When doing an export, an acp file is created inside alfresco itself, in a space that can be arbitrarily chosen.&lt;br /&gt;Besides the target space, the package name must be provided.&lt;br /&gt;The acp file, assuming package as package name, has the following structure:&lt;br /&gt;&lt;pre&gt;/package.xml&lt;br /&gt;/package&lt;br /&gt;     /content0.html&lt;br /&gt;     /content1.pdf&lt;br /&gt;     /content2.jpg&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The package.xml has a proprietary XML structure and looks like:&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;view:view xmlns:view="http://www.alfresco.org/view/repository/1.0"&amp;gt;&lt;br /&gt;&amp;lt;view:metadata&amp;gt;&lt;br /&gt; &amp;lt;view:exportBy&amp;gt;admin&amp;lt;/view:exportBy&amp;gt;&lt;br /&gt; &amp;lt;view:exportDate&amp;gt;2007-07-10T13:45:02.277+02:00&amp;lt;/view:exportDate&amp;gt;&lt;br /&gt; &amp;lt;view:exporterVersion&amp;gt;2.0.0 (build-185)&amp;lt;/view:exporterVersion&amp;gt;&lt;br /&gt; &amp;lt;view:exportOf&amp;gt;/app:company_home/cm:Books&amp;lt;/view:exportOf&amp;gt;&lt;br /&gt;&amp;lt;/view:metadata&amp;gt;&lt;br /&gt;&amp;lt;cm:content xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:alf="http://www.alfresco.org" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:wcm="http://www.alfresco.org/model/wcmmodel/1.0" xmlns:wca="http://www.alfresco.org/model/wcmappmodel/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:wcmwf="http://www.alfresco.org/model/wcmworkflow/1.0" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:custom="custom.model" xmlns="" view:childName="cm:index.html"&amp;gt;&lt;br /&gt; &amp;lt;view:aspects&amp;gt;&lt;br /&gt;   &amp;lt;cm:titled&amp;gt;&amp;lt;/cm:titled&amp;gt;&lt;br /&gt;   &amp;lt;cm:auditable&amp;gt;&amp;lt;/cm:auditable&amp;gt;&lt;br /&gt;   &amp;lt;sys:referenceable&amp;gt;&amp;lt;/sys:referenceable&amp;gt;&lt;br /&gt;   &amp;lt;cm:author&amp;gt;&amp;lt;/cm:author&amp;gt;&lt;br /&gt;   &amp;lt;app:inlineeditable&amp;gt;&amp;lt;/app:inlineeditable&amp;gt;&lt;br /&gt; &amp;lt;/view:aspects&amp;gt;&lt;br /&gt; &amp;lt;view:properties&amp;gt;&lt;br /&gt;   &amp;lt;app:editInline&amp;gt;true&amp;lt;/app:editInline&amp;gt;&lt;br /&gt;   &amp;lt;cm:description&amp;gt;Index page for books&amp;lt;/cm:description&amp;gt;&lt;br /&gt;   &amp;lt;sys:node-uuid&amp;gt;59d1c1dc-2e12-11dc-8613-e518334e1caa&amp;lt;/sys:node-uuid&amp;gt;&lt;br /&gt;   &amp;lt;sys:node-dbid&amp;gt;397&amp;lt;/sys:node-dbid&amp;gt;&lt;br /&gt;   &amp;lt;cm:content&amp;gt;contentUrl=backup\content0.html|mimetype=text/html|size=51|encoding=UTF-8|locale=nl_NL_&amp;lt;/cm:content&amp;gt;&lt;br /&gt;   &amp;lt;cm:title&amp;gt;Books&amp;lt;/cm:title&amp;gt;&lt;br /&gt;   &amp;lt;cm:author&amp;gt;Stephen King&amp;lt;/cm:author&amp;gt;&lt;br /&gt;   &amp;lt;cm:created&amp;gt;2007-07-09T13:48:46.673+02:00&amp;lt;/cm:created&amp;gt;&lt;br /&gt;   &amp;lt;cm:modifier&amp;gt;admin&amp;lt;/cm:modifier&amp;gt;&lt;br /&gt;   &amp;lt;cm:modified&amp;gt;2007-07-10T12:15:31.346+02:00&amp;lt;/cm:modified&amp;gt;&lt;br /&gt;   &amp;lt;cm:creator&amp;gt;admin&amp;lt;/cm:creator&amp;gt;&lt;br /&gt;   &amp;lt;sys:store-protocol&amp;gt;workspace&amp;lt;/sys:store-protocol&amp;gt;&lt;br /&gt;   &amp;lt;cm:name&amp;gt;index.html&amp;lt;/cm:name&amp;gt;&lt;br /&gt;   &amp;lt;sys:store-identifier&amp;gt;SpacesStore&amp;lt;/sys:store-identifier&amp;gt;&lt;br /&gt; &amp;lt;/view:properties&amp;gt;&lt;br /&gt; &amp;lt;view:associations&amp;gt;&amp;lt;/view:associations&amp;gt;&lt;br /&gt;&amp;lt;/cm:content&amp;gt;&lt;br /&gt;&amp;lt;cm:content xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:alf="http://www.alfresco.org" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:wcm="http://www.alfresco.org/model/wcmmodel/1.0" xmlns:wca="http://www.alfresco.org/model/wcmappmodel/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:wcmwf="http://www.alfresco.org/model/wcmworkflow/1.0" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:custom="custom.model" xmlns="" view:childName="cm:DarkTower.pdf"&amp;gt;&lt;br /&gt; &amp;lt;view:aspects&amp;gt;&lt;br /&gt;   &amp;lt;cm:auditable&amp;gt;&amp;lt;/cm:auditable&amp;gt;&lt;br /&gt;   &amp;lt;cm:titled&amp;gt;&amp;lt;/cm:titled&amp;gt;&lt;br /&gt;   &amp;lt;sys:referenceable&amp;gt;&amp;lt;/sys:referenceable&amp;gt;&lt;br /&gt;   &amp;lt;cm:author&amp;gt;&amp;lt;/cm:author&amp;gt;&lt;br /&gt; &amp;lt;/view:aspects&amp;gt;&lt;br /&gt; &amp;lt;view:properties&amp;gt;&lt;br /&gt;   &amp;lt;cm:description&amp;gt;&amp;lt;/cm:description&amp;gt;&lt;br /&gt;   &amp;lt;sys:node-uuid&amp;gt;c0db7bd5-2eda-11dc-96f5-878a8c8564f1&amp;lt;/sys:node-uuid&amp;gt;&lt;br /&gt;   &amp;lt;sys:node-dbid&amp;gt;404&amp;lt;/sys:node-dbid&amp;gt;&lt;br /&gt;   &amp;lt;cm:content&amp;gt;contentUrl=backup\content1.pdf|mimetype=application/pdf|size=1366321|encoding=UTF-8|locale=nl_NL_&amp;lt;/cm:content&amp;gt;&lt;br /&gt;   &amp;lt;cm:title&amp;gt;DarkTower.pdf&amp;lt;/cm:title&amp;gt;&lt;br /&gt;   &amp;lt;cm:author&amp;gt;Stephen King&amp;lt;/cm:author&amp;gt;&lt;br /&gt;   &amp;lt;cm:created&amp;gt;2007-07-10T13:43:18.809+02:00&amp;lt;/cm:created&amp;gt;&lt;br /&gt;   &amp;lt;cm:modifier&amp;gt;admin&amp;lt;/cm:modifier&amp;gt;&lt;br /&gt;   &amp;lt;cm:modified&amp;gt;2007-07-10T13:43:26.637+02:00&amp;lt;/cm:modified&amp;gt;&lt;br /&gt;   &amp;lt;cm:creator&amp;gt;admin&amp;lt;/cm:creator&amp;gt;&lt;br /&gt;   &amp;lt;sys:store-protocol&amp;gt;workspace&amp;lt;/sys:store-protocol&amp;gt;&lt;br /&gt;   &amp;lt;cm:name&amp;gt;DarkTower.pdf&amp;lt;/cm:name&amp;gt;&lt;br /&gt;   &amp;lt;sys:store-identifier&amp;gt;SpacesStore&amp;lt;/sys:store-identifier&amp;gt;&lt;br /&gt; &amp;lt;/view:properties&amp;gt;&lt;br /&gt; &amp;lt;view:associations&amp;gt;&amp;lt;/view:associations&amp;gt;&lt;br /&gt;&amp;lt;/cm:content&amp;gt;&lt;br /&gt;&amp;lt;cm:content xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:alf="http://www.alfresco.org" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:wcm="http://www.alfresco.org/model/wcmmodel/1.0" xmlns:wca="http://www.alfresco.org/model/wcmappmodel/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:wcmwf="http://www.alfresco.org/model/wcmworkflow/1.0" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:custom="custom.model" xmlns="" view:childName="cm:Cover.jpg"&amp;gt;&lt;br /&gt; &amp;lt;view:aspects&amp;gt;&lt;br /&gt;   &amp;lt;cm:auditable&amp;gt;&amp;lt;/cm:auditable&amp;gt;&lt;br /&gt;   &amp;lt;cm:titled&amp;gt;&amp;lt;/cm:titled&amp;gt;&lt;br /&gt;   &amp;lt;sys:referenceable&amp;gt;&amp;lt;/sys:referenceable&amp;gt;&lt;br /&gt;   &amp;lt;cm:author&amp;gt;&amp;lt;/cm:author&amp;gt;&lt;br /&gt; &amp;lt;/view:aspects&amp;gt;&lt;br /&gt; &amp;lt;view:properties&amp;gt;&lt;br /&gt;   &amp;lt;cm:description&amp;gt;&amp;lt;/cm:description&amp;gt;&lt;br /&gt;   &amp;lt;sys:node-uuid&amp;gt;cf782d38-2eda-11dc-96f5-878a8c8564f1&amp;lt;/sys:node-uuid&amp;gt;&lt;br /&gt;   &amp;lt;sys:node-dbid&amp;gt;405&amp;lt;/sys:node-dbid&amp;gt;&lt;br /&gt;   &amp;lt;cm:content&amp;gt;contentUrl=backup\content2.jpg|mimetype=image/jpeg|size=64599|encoding=UTF-8|locale=nl_NL_&amp;lt;/cm:content&amp;gt;&lt;br /&gt;   &amp;lt;cm:title&amp;gt;Cover.jpg&amp;lt;/cm:title&amp;gt;&lt;br /&gt;   &amp;lt;cm:author&amp;gt;Stephen King&amp;lt;/cm:author&amp;gt;&lt;br /&gt;   &amp;lt;cm:created&amp;gt;2007-07-10T13:43:43.309+02:00&amp;lt;/cm:created&amp;gt;&lt;br /&gt;   &amp;lt;cm:modifier&amp;gt;admin&amp;lt;/cm:modifier&amp;gt;&lt;br /&gt;   &amp;lt;cm:modified&amp;gt;2007-07-10T13:43:49.106+02:00&amp;lt;/cm:modified&amp;gt;&lt;br /&gt;   &amp;lt;cm:creator&amp;gt;admin&amp;lt;/cm:creator&amp;gt;&lt;br /&gt;   &amp;lt;sys:store-protocol&amp;gt;workspace&amp;lt;/sys:store-protocol&amp;gt;&lt;br /&gt;   &amp;lt;cm:name&amp;gt;Cover.jpg&amp;lt;/cm:name&amp;gt;&lt;br /&gt;   &amp;lt;sys:store-identifier&amp;gt;SpacesStore&amp;lt;/sys:store-identifier&amp;gt;&lt;br /&gt; &amp;lt;/view:properties&amp;gt;&lt;br /&gt; &amp;lt;view:associations&amp;gt;&amp;lt;/view:associations&amp;gt;&lt;br /&gt;&amp;lt;/cm:content&amp;gt;&lt;br /&gt;&amp;lt;/view:view&amp;gt;&lt;/pre&gt;&lt;br /&gt;This view does contain most of the information I need. The jcr system view as exported by alfresco, lacks the mime type, which &lt;b&gt;is&lt;/b&gt; included in alfresco's acp descriptor: &lt;pre&gt;&amp;lt;cm:content&amp;gt;contentUrl=backup\content2.jpg|&lt;b&gt;mimetype=image/jpeg&lt;/b&gt;|size=64599|encoding=UTF-8|locale=nl_NL_&amp;lt;/cm:content&amp;gt;&lt;/pre&gt;.&lt;br /&gt;&lt;br /&gt;Maybe I am overseeing something, but shouldn't the mime type info be part of JCR's system view as well?&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-1076317525734903351?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/qILBxnMQmUk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/1076317525734903351/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=1076317525734903351&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1076317525734903351?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1076317525734903351?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/qILBxnMQmUk/alfresco-content-package.html" title="Alfresco Content Package" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/07/alfresco-content-package.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYBQnY7fCp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-8547790190630035825</id><published>2007-07-05T12:06:00.001+02:00</published><updated>2008-01-22T07:42:33.804+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:42:33.804+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Alfresco" /><category scheme="http://www.blogger.com/atom/ns#" term="CMS" /><title>Custom JCR node types in Alfresco</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BWa6tQ9lyf6DqhDd4853Mi3IxoE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BWa6tQ9lyf6DqhDd4853Mi3IxoE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BWa6tQ9lyf6DqhDd4853Mi3IxoE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BWa6tQ9lyf6DqhDd4853Mi3IxoE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;With the document &lt;a href='http://ecmarchitect.com/archives/2007/06/09/756'&gt;"Working with Custom Content Types"&lt;/a&gt; on my desk, I started to develop my own content model to be used in alfresco.&lt;br/&gt;Naive as I can be, I tried to convert the jackrabbit based cnd into alfresco's content definition. Obviously that failed, alfresco does not support multiple inheritance. Alright, that one can be circumvented.&lt;br/&gt;After deploying, correcting and re-deploying the model until satisfied, I tried to add the model to the web client user interface, but it was not accepted. It appears that if you want to expose your custom content model to the web client user interface, the defined types must extend cm:content or one of its descendants. Sadly this is not mentioned in the named document.&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-8547790190630035825?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/09gR_IdpEME" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/8547790190630035825/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=8547790190630035825&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/8547790190630035825?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/8547790190630035825?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/09gR_IdpEME/custom-jcr-node-types-in-alfresco.html" title="Custom JCR node types in Alfresco" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/07/custom-jcr-node-types-in-alfresco.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYBQnY7fCp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-4018235570912475820</id><published>2007-06-19T11:25:00.001+02:00</published><updated>2008-01-22T07:42:33.804+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:42:33.804+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Alfresco" /><category scheme="http://www.blogger.com/atom/ns#" term="CMS" /><title>Problems exporting content</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JHPSoQfXRM_4xSeC7DdHE_V8FCk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JHPSoQfXRM_4xSeC7DdHE_V8FCk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JHPSoQfXRM_4xSeC7DdHE_V8FCk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JHPSoQfXRM_4xSeC7DdHE_V8FCk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;The export process seemed to work fine, until I took a close look at the actual exported XML.&lt;br /&gt;&lt;br /&gt;It appears that the actual content is stored in a binary format, which prevents adjustments within the actual HTML itself, like references to content stored in the same repository.&lt;br /&gt;&lt;br /&gt;To try to circumvent this, I changed the cm:content property of the cm:content type, as defined in alfresco's contentModel.xml, to d:text instead of d:content, but this gave the following error:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;11:11:58,926 ERROR [Utils] A system error happened during the operation: The node property must be of type content:&lt;br /&gt;&amp;nbsp;&amp;nbsp;node: workspace://SpacesStore/221a7c69-1e45-11dc-a1bf-4985acca4591&lt;br /&gt;&amp;nbsp;&amp;nbsp;property name: {http://www.alfresco.org/model/content/1.0}content&lt;br /&gt;&amp;nbsp;&amp;nbsp;property type: {http://www.alfresco.org/model/dictionary/1.0}text&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;So its time to create our own model for alfresco.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-4018235570912475820?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/RZsUUsS2u4A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/4018235570912475820/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=4018235570912475820&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4018235570912475820?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4018235570912475820?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/RZsUUsS2u4A/problems-exporting-content.html" title="Problems exporting content" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/06/problems-exporting-content.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYBQnY7fSp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-4011652221980673967</id><published>2007-06-11T13:45:00.001+02:00</published><updated>2008-01-22T07:42:33.805+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:42:33.805+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Alfresco" /><category scheme="http://www.blogger.com/atom/ns#" term="CMS" /><title>Exporting content from Alfresco</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tMJnSZtuHTzzm_Av-sMYL7x5x5I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tMJnSZtuHTzzm_Av-sMYL7x5x5I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tMJnSZtuHTzzm_Av-sMYL7x5x5I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tMJnSZtuHTzzm_Av-sMYL7x5x5I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;The JCR defines a standard format for importing/exporting content: the system view mapping. So how can I export a particular node from alfresco as final part of a work flow?&lt;br /&gt;&lt;br /&gt;First I need to create a simple work flow in alfresco that allows me to edit content and then mark that content for publication. In alfresco I created a space to contain draft content and a space to contain to be published content. I added a rule to the draft content space that allows the author to submit content for publication, this rule copies the selected content item to the publish space.&lt;br /&gt;&lt;br /&gt;I added another rule, this time to the publish space, that activates the publication process. For this a custom &lt;a href="http://wiki.alfresco.com/wiki/Custom_Actions"&gt;alfresco 'action'&lt;/a&gt; is developed that exports the selected node to an XML stream that complies to the &lt;a href="http://jcp.org/aboutJava/communityprocess/maintenance/jsr170/index.html"&gt;JCR system view&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The resulting XML stream must be converted because it contains e.g. node types that are not supported on the serving repository. So these node types must be converted into supported node types.&lt;br /&gt;&lt;br /&gt;The conversion is implemented using the Java rules engine API (JSR-94). This API defines how rules engines can be acquired and used, it does not describe how rules are defined.&lt;br /&gt;&lt;br /&gt;Using the Java rule engine API allows changing the rules engine without the need to change the code. For starters I chose &lt;a href="http://labs.jboss.com/jbossrules"&gt;JBossRules&lt;/a&gt; as rule engine.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-4011652221980673967?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/cyHCQie3we8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/4011652221980673967/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=4011652221980673967&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4011652221980673967?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/4011652221980673967?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/cyHCQie3we8/exporting-content-from-alfresco.html" title="Exporting content from Alfresco" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/06/exporting-content-from-alfresco.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYBQnY7fSp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-120461226650821299</id><published>2007-06-11T10:47:00.001+02:00</published><updated>2008-01-22T07:42:33.805+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:42:33.805+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Alfresco" /><category scheme="http://www.blogger.com/atom/ns#" term="CMS" /><title>Publishing content</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7Kd3T-arBj_XJnGMT0my-B9leP4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7Kd3T-arBj_XJnGMT0my-B9leP4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7Kd3T-arBj_XJnGMT0my-B9leP4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7Kd3T-arBj_XJnGMT0my-B9leP4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;The &lt;a href="http://www.epo.org/"&gt;company&lt;/a&gt; I am currently working for wants its new website implemented using a JBoss Portal system.&lt;br /&gt;The current website uses &lt;a href="http://lenya.apache.org/"&gt;Apache Lenya&lt;/a&gt; as CMS but with a nightly export to static HTML pages. This prevents instant publishing of single items.&lt;br /&gt;Some of the entry pages contain lists showing recently changed items, news items etc. These lists are handcrafted while based on certain criteria, these lists could be generated automagically.&lt;br /&gt;&lt;br /&gt;Other area's of the companies presence on the internet provided web applications like &lt;a href="http://www.epoline.org/"&gt;my.epoline&lt;/a&gt; and &lt;a href="http://www.espacenet.com/"&gt;esp@cenet&lt;/a&gt;, these applications, and others, need to be part of the main website, hence a portal solution is chosen.&lt;br /&gt;Based on some demo content, portlets have been developed that shows the content and provides means of navigating through the content.&lt;br /&gt;&lt;br /&gt;In the architecture it has been chosen that each portal server instance will have its own dedicated read only JCR compliant repository (A.K.A. the rendering repository), physically separated from the CMS's repository (A.K.A. the authoring repository).&lt;br /&gt;&lt;br /&gt;Since content written by authors in the end will have to enter the rendering repositopry, we need a process that takes care of that, the publication process. Currently I am working on that publication process.&lt;br /&gt;&lt;br /&gt;As CMS system we have chosen alfresco. So my first task is to get alfresco up and running on JBoss on my dev box.&lt;br /&gt;&lt;br /&gt;Since I don't like prepackaged downloads, I downloaded the war file package of alfresco 2.0, the alfresco sdk and the alfresco WCM package.&lt;br /&gt;I wanted to create a dedicated JBoss server instance for alfresco so I copied the default server configuration and named it alfresco. I dumped the war file in JBoss's deploy directory, changed the database configuration following the &lt;a href="http://wiki.alfresco.com/wiki/Database_Configuration"&gt;database configuration&lt;/a&gt; topic at alfresco wiki.&lt;br /&gt;&lt;br /&gt;The app server started up fine, so far so good...&lt;br /&gt;&lt;br /&gt;Next thing, exporting content, is the subject of a future posting.&lt;br /&gt;&lt;br /&gt;CU then&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-120461226650821299?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/VXRn7z8dJf8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/120461226650821299/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=120461226650821299&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/120461226650821299?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/120461226650821299?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/VXRn7z8dJf8/publishing-content.html" title="Publishing content" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/06/publishing-content.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUDR3c4fSp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-8789736836517743978</id><published>2007-05-10T10:53:00.001+02:00</published><updated>2008-01-22T07:44:36.935+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:44:36.935+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Conventions" /><title>Naming conventions</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kEvog0EcIbifE7odDskekUCG00U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kEvog0EcIbifE7odDskekUCG00U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kEvog0EcIbifE7odDskekUCG00U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kEvog0EcIbifE7odDskekUCG00U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Naming conventions are a good thing, there's no doubt abou that.&lt;br /&gt;&lt;br /&gt;But its usually quite difficult to establish a proper naming convention, so its far eassier to use an existing naming convention that can be ammended if needed. On &lt;a href="http://java.net/"&gt;java.net&lt;/a&gt; a project exists that establishes such a &lt;a href="https://jjguidelines.dev.java.net/book/html/index.html"&gt;naming convention&lt;/a&gt; for J2EE projects, very handy!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-8789736836517743978?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/-dfATECXNB4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/8789736836517743978/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=8789736836517743978&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/8789736836517743978?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/8789736836517743978?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/-dfATECXNB4/naming-conventions.html" title="Naming conventions" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/05/naming-conventions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YFR304eip7ImA9WB5REkg.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-1005557930387347659</id><published>2007-04-20T09:22:00.001+02:00</published><updated>2007-06-19T14:11:56.332+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-06-19T14:11:56.332+02:00</app:edited><title>Using JConsole</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FOYPyC8NIHFMSZcwE1KOJfMHYCk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FOYPyC8NIHFMSZcwE1KOJfMHYCk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FOYPyC8NIHFMSZcwE1KOJfMHYCk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FOYPyC8NIHFMSZcwE1KOJfMHYCk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;I updated my eclipse to version 3.2.2, lucky me did not remove the previous version just yet, and run into a crashing system that seems to run out of memory. So I decided to connect jconsole to eclipse to view its memory consumption.&lt;br /&gt;To do so I needed to start eclipse using JDK 5, with the system property &lt;code&gt;-Dcom.sun.management.jmxremote&lt;/code&gt;.&lt;br /&gt;Now JConsole is able to connect to the eclipse process and show its memory consumption.&lt;br /&gt;&lt;br /&gt;After playing a while with eclipse the OOM exception hapened again, but saidly JConsole has lost its connection, so nothing to see what/.where had happened.&lt;br /&gt;&lt;br /&gt;The story continues...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-1005557930387347659?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/t7TGho0q0pM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/1005557930387347659/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=1005557930387347659&amp;isPopup=true" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1005557930387347659?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/1005557930387347659?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/t7TGho0q0pM/using-jconsole.html" title="Using JConsole" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>3</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/04/using-jconsole.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYNSXY6eSp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-3023021982696189867</id><published>2007-04-03T08:47:00.001+02:00</published><updated>2008-01-22T07:43:18.811+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:43:18.811+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Unit tests" /><title>Mocking a base class</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8bsokRNF6PRBaUcQVcshTVNwCak/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8bsokRNF6PRBaUcQVcshTVNwCak/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8bsokRNF6PRBaUcQVcshTVNwCak/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8bsokRNF6PRBaUcQVcshTVNwCak/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;The next problem that arose when trying to unit test my portlet, is that my portlet implementation calls some methods of its base class, &lt;code&gt;javax.portlet.GenericPortlet&lt;/code&gt;. How can these method calls be mocked?&lt;br /&gt;&lt;br /&gt;In the unit test implementation an inner class is defined that extends the class under test.&lt;br /&gt;This inner class can then mock any base class method called from the class under test:&lt;br /&gt;&lt;pre&gt;public class MyPortletTest extends TestCase {&lt;br /&gt;&lt;br /&gt;  private PortletContext portletContext = EasyMock.createMock(PortletContext.class);&lt;br /&gt;&lt;br /&gt;  protected void setUp() throws Exception {&lt;br /&gt;     super.setUp();&lt;br /&gt;&lt;br /&gt;     // Use the inner class derived from the actual CUT that provides&lt;br /&gt;     // overrides for the base class methods.&lt;br /&gt;     testObject = new TestObject();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // Additional methods removed for clarity...&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * Need to extend the portlet under test for overriding base class methods.&lt;br /&gt;   */&lt;br /&gt;  private class TestObject extends MetaInfoPortlet {&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;      * A mock needs to be returned&lt;br /&gt;      */&lt;br /&gt;     @Override&lt;br /&gt;     public PortletContext getPortletContext() {&lt;br /&gt;        return portletContext;&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;Using this scheme one can override any of the base classes methods used in the class under test (CUT), and provide a mock based implementation.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-3023021982696189867?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/j1RnyAnYgho" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/3023021982696189867/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=3023021982696189867&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/3023021982696189867?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/3023021982696189867?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/j1RnyAnYgho/mocking-base-class.html" title="Mocking a base class" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/04/mocking-base-class.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYNSXY6eSp7ImA9WxZTGUU.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-7137874672596722119</id><published>2007-03-29T11:56:00.001+02:00</published><updated>2008-01-22T07:43:18.811+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-01-22T07:43:18.811+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Unit tests" /><title>EasyMock and IllegalStateException</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HvEoc-_REIn2KLHPFfb9kf6Uq5s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HvEoc-_REIn2KLHPFfb9kf6Uq5s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HvEoc-_REIn2KLHPFfb9kf6Uq5s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HvEoc-_REIn2KLHPFfb9kf6Uq5s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;When writing a portlet and trying to unit test it, you definitly need somekind of mock implementation. I chose to use &lt;a href="http://www.easymock.org/"&gt;EasyMock 2.2&lt;/a&gt; for that purpose because I think its easier to use. I will not explain nor defend this decision.&lt;br /&gt;&lt;br /&gt;I have been using EasyMock for some time now, and every now and then I stumble over the problem IllegalStateException problem. Sometimes this is caused by not having 'replay'ed the mocks, but now its different. The stack look s like this:&lt;br /&gt;&lt;pre&gt;java.lang.IllegalStateException: 2 matchers expected, 1 recorded.&lt;br /&gt;at org.easymock.internal.ExpectedInvocation.createMissingMatchers(ExpectedInvocation.java:41)&lt;br /&gt;at org.easymock.internal.ExpectedInvocation.&lt;init&gt;(ExpectedInvocation.java:33)&lt;br /&gt;at org.easymock.internal.ExpectedInvocation.&lt;init&gt;(ExpectedInvocation.java:26)&lt;br /&gt;at org.easymock.internal.RecordState.invoke(RecordState.java:64)&lt;br /&gt;at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:24)&lt;br /&gt;at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:45)&lt;/init&gt;&lt;/init&gt;&lt;/pre&gt;This exception is thrown when executing &lt;code&gt;request.setAttribute(MetaInfoPortlet.BEAN_ATTR, EasyMock.anyObject());&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;So why is this excpetion being thrown at me? The message gives a hint, 2 matchers expected, recorded 1. So it lacks a matcher...&lt;br /&gt;&lt;br /&gt;If I now change the code to &lt;code&gt;request.setAttribute(EasyMock.matches(MetaInfoPortlet.BEAN_ATTR), EasyMock.anyObject());&lt;/code&gt;, it works fine. Now why is this? If I change the code to &lt;code&gt;request.setAttribute(MetaInfoPortlet.BEAN_ATTR, "something");&lt;/code&gt;, it works as well, but now I get the following:&lt;br /&gt;&lt;pre&gt;java.lang.AssertionError:&lt;br /&gt;Unexpected method call setAttribute("bean", {test=Let's see if this tst value comes through?}):&lt;br /&gt;  setAttribute("bean", "something"): expected: 1, actual: 0&lt;/pre&gt;So it looks like the you either have to supply your mock with fixed values or you have to supply it with matchers, as it says in &lt;a href="http://www.easymock.org/EasyMock2_2_Documentation.html"&gt;EasyMocks documentation&lt;/a&gt;: "&lt;i&gt;If you would like to use matchers in a call, you have to specify matchers for all&lt;br /&gt;arguments of the method call.&lt;/i&gt;"&lt;br /&gt;&lt;br /&gt;Bottom line: read the documentation.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-7137874672596722119?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/QR3-az2GihQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/7137874672596722119/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=7137874672596722119&amp;isPopup=true" title="23 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/7137874672596722119?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/7137874672596722119?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/QR3-az2GihQ/easymock-and-illegalstateexception.html" title="EasyMock and IllegalStateException" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>23</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/03/easymock-and-illegalstateexception.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYGQn8_fyp7ImA9WhZaGUk.&quot;"><id>tag:blogger.com,1999:blog-6988195.post-3881377927186061816</id><published>2007-03-21T14:31:00.002+01:00</published><updated>2011-07-06T12:12:03.147+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-06T12:12:03.147+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JSTL" /><title>JSTL and JSP Expression Language used in JSP 2.0</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bHeTL-lVokJ__cxZYS1F9KxuC2g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bHeTL-lVokJ__cxZYS1F9KxuC2g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bHeTL-lVokJ__cxZYS1F9KxuC2g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bHeTL-lVokJ__cxZYS1F9KxuC2g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;The release of the JSP 2.0 and servlet 2.4 specification has changed the way expressions are used within JSP pages.&lt;br /&gt;
From now on you can use expressions throughout the whole JSP page.&lt;br /&gt;
There appeared to be some limitations though, when mixing expressions with tags, you can only use expressions within tag attribute values.&lt;br /&gt;
So  name is ${your.name}. is perfectly legal, as well as  href="${link.url}" /&amp;gt;But  ${attrName} is not.&lt;br /&gt;
&lt;br /&gt;
When trying to figure this out, I stumbled over several issues before I got the desired output. First you must declare your application as a 2.4 webapp using the following declaration:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
version="2.4" /&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
When using the JSTL taglibrary, you must be aware that the taglib url is different, jsp is added prior to jstl within the URL.&lt;br /&gt;
&lt;br /&gt;
For 2.3 webapps you should use  taglib &lt;code&gt;&amp;lt;%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%&amp;gt;&lt;/code&gt; while for 2.4 webapps you use &lt;code&gt;&amp;lt;%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&amp;gt; /&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6988195-3881377927186061816?l=marcels-javanotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/RCuT/~4/flO7s8Awdnc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://marcels-javanotes.blogspot.com/feeds/3881377927186061816/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6988195&amp;postID=3881377927186061816&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/3881377927186061816?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6988195/posts/default/3881377927186061816?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/RCuT/~3/flO7s8Awdnc/jstl-and-jsp-expression-language-used.html" title="JSTL and JSP Expression Language used in JSP 2.0" /><author><name>SpiderMars</name><uri>http://www.blogger.com/profile/14127963147847070570</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_-NWpnIPlnWs/SYGDTw5sRKI/AAAAAAAABRA/IGWWuJPtAiI/S220/DukeWithBlackStratocaster-small.png" /></author><thr:total>2</thr:total><feedburner:origLink>http://marcels-javanotes.blogspot.com/2007/03/jstl-and-jsp-expression-language-used.html</feedburner:origLink></entry></feed>

