<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xebia Blog &#187; Lonneke Dikmans</title>
	<atom:link href="http://blog.xebia.com/author/ldikmans/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xebia.com</link>
	<description>Software development done right!</description>
	<lastBuildDate>Wed, 01 Feb 2012 00:30:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using property files in OC4J10.1.3</title>
		<link>http://blog.xebia.com/2006/10/01/using-property-files-in-oc4j1013/</link>
		<comments>http://blog.xebia.com/2006/10/01/using-property-files-in-oc4j1013/#comments</comments>
		<pubDate>Sun, 01 Oct 2006 20:11:26 +0000</pubDate>
		<dc:creator>Lonneke Dikmans</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>

	<!-- AutoMeta Start -->
	<category>applib</category>
	<category>oc4j</category>
	<category>directory</category>
	<category>property</category>
	<category>shared</category>
	<category>oracle_home</category>
	<category>libraries</category>
	<category>library</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/2006/10/01/using-property-files-in-oc4j1013/</guid>
		<description><![CDATA[Often JEE applications contain property files with environment specific information. Because deployment should be automated, you need some way of dealing with these property files. Basically you have three options: Put a default property file in the ear and edit it after deploying it to the server. This means you have to do some scripting [...]]]></description>
			<content:encoded><![CDATA[<p>Often JEE applications contain property files with environment specific information. Because deployment should be automated, you need some way of dealing with these property files. Basically you have three options:</p>
<ol>
<li>Put a default property file in the ear and edit it after deploying it to the server. This means you have to do some scripting with Perl or some other language.</li>
<li>Choose the property file to put in the ear before you deploy. If you choose this option, you need to know the correct property values in advance. Further more, you need to tell maven or ant which property file to deploy by setting some sort of environment flag</li>
<li>Store the property file on the system classpath instead of in the ear. This has the disadvantage that you need to restart the server every time you want to change something in the file.</li>
</ol>
<p>Usually property files are application specific, so I prefer either of the first two options. The other day, however, I got a call from someone who needed to store the property file on the servers&#8217; classpath.<br />
Of course(!?) every application server is different. In IBM Websphere you put property files in the [WAS_HOME]/appserver/properties directory and configure the server, so it knows where to find the property file.<br />
<em>(NB: for those of you who have been looking for this feature: it is hidden under Application Servers > [server] > Process Definition > Java Virtual Machine &#8211; Custom Properties) </em> The Oracle application server doesn&#8217;t have a folder like that, nor does it have any options to specify property file locations. So where do you put property files if you want to put them on the system classpath? The Oracle container (OC4J) has two possible candidates for this property file:</p>
<ul>
<li>the applib directory</li>
<li>shared-lib directory.</li>
</ul>
<p>I decided to do a little test: I created a test application that displays the values in a property file. I used the standalone OC4J(10.1.3) for this test, but it works the same way in the Oracle Application Server 10g. First I tried the applib directory. I deployed the application to the OC4J, stopped the server and copied the property file into the [ORACLE_HOME]/j2ee/home/applib directory. Then I restarted OC4J. The web application displayed the values in the property files correctly. Next, I removed the property file from the applib directory and put it in the [ORACLE_HOME]/j2ee/home/shared-lib directory. I restarted the server and tried again. This time, the property file was not found.<br />
This made me wonder about the differences between the two. The applib directory is used by all applications. Libraries and other files that are put in this directory are loaded before libraries and files in the WEB-INF/lib directory of your ear file. In the <a href="http://download-west.oracle.com/otn_hosted_doc/ias/preview/web.1013/b14433.pdf">Oracle® Containers for J2EE Developer’s Guide 10g Release 2 (10.1.3) </a>, shared libraries are explained in great detail. Basically you use these if you have an application that needs to use a different library than the standard library that is packaged with OC4J. An example can be the XML Parser you want to use, or a different version of the Oracle JDBC driver. Another reason to use shared libraries is to share proprietary classes across specific applications, rather than across all applications. To accomplish this, you obviously need to configure your application to work with the shared libraries. The developers guide describes the steps to do this. So if I really wanted to try if the shared-lib folder works for the property file, I would have to configure the shared libraries and my application. I decided not to bother&#8230;I am not sure what happens if the application is clustered, but since this was not a requirement when I got the question, the applib directory looks like the simplest solutions that could work in this particular case. </p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2006/10/01/using-property-files-in-oc4j1013/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2006%2F10%2F01%2Fusing-property-files-in-oc4j1013%2F&amp;title=Using%20property%20files%20in%20OC4J10.1.3" id="wpa2a_2"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2006/10/01/using-property-files-in-oc4j1013/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Article &#8220;Using Oracle TopLink with the Spring Framework&#8221; published on OTN</title>
		<link>http://blog.xebia.com/2006/09/26/article-using-oracle-toplink-with-the-spring-framework-published-on-otn/</link>
		<comments>http://blog.xebia.com/2006/09/26/article-using-oracle-toplink-with-the-spring-framework-published-on-otn/#comments</comments>
		<pubDate>Tue, 26 Sep 2006 19:58:19 +0000</pubDate>
		<dc:creator>Lonneke Dikmans</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Spring]]></category>

	<!-- AutoMeta Start -->
	<category>toplink</category>
	<category>oracle</category>
	<category>jdeveloper</category>
	<category>article</category>
	<category>editing</category>
	<category>today</category>
	<category>technoly</category>
	<category>workbench</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/2006/09/26/article-using-oracle-toplink-with-the-spring-framework-published-on-otn/</guid>
		<description><![CDATA[Today the Oracle Technology Network published my article Using Oracle TopLink with the Spring Framework. In this article I explain step by step how to build a sample application using Spring 1.2.8 and Oracle TopLink with Oracle JDeveloper 10g. JDeveloper has built in support for TopLink, but you can build the sample application with Eclipse [...]]]></description>
			<content:encoded><![CDATA[<p>Today the <a href="http://otn.oracle.com">Oracle Technology Network</a> published my article <a href="http://www.oracle.com/technology/pub/articles/dikmans-spring-toplink.html">Using Oracle TopLink with the Spring Framework</a>. In this article I explain step by step how to build a sample application using Spring 1.2.8 and Oracle TopLink with Oracle JDeveloper 10g. </p>
<p>JDeveloper has built in support for TopLink, but you can build the sample application with Eclipse as well. Download the sources and follow the steps in the article. Instead of editing the TopLink sessions in JDeveloper, edit the xml files in the Eclipse editor or the TopLink workbench. </p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2006/09/26/article-using-oracle-toplink-with-the-spring-framework-published-on-otn/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2006%2F09%2F26%2Farticle-using-oracle-toplink-with-the-spring-framework-published-on-otn%2F&amp;title=Article%20%26%238220%3BUsing%20Oracle%20TopLink%20with%20the%20Spring%20Framework%26%238221%3B%20published%20on%20OTN" id="wpa2a_4"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2006/09/26/article-using-oracle-toplink-with-the-spring-framework-published-on-otn/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing DB2 for Oracle dummies</title>
		<link>http://blog.xebia.com/2006/04/20/installing-db2-for-oracle-dummys/</link>
		<comments>http://blog.xebia.com/2006/04/20/installing-db2-for-oracle-dummys/#comments</comments>
		<pubDate>Thu, 20 Apr 2006 21:17:11 +0000</pubDate>
		<dc:creator>Lonneke Dikmans</dc:creator>
				<category><![CDATA[Java]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/2006/04/20/installing-db2-for-oracle-dummys/</guid>
		<description><![CDATA[I am working on a project where they use IBM tools at the client site: Websphere 5.1.8, DB2 and Eclipse. I already have a MySQL instance running, an Oracle 9 RDMBS and some version of SQL Server that came with Windows XP so I did not install DB2 on my laptop. Of course it&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on a project where they use IBM tools at the client site: Websphere 5.1.8, DB2 and Eclipse. I already have a MySQL instance running, an Oracle 9 RDMBS and some version of SQL Server that came with Windows XP so I did not install DB2 on my laptop.</p>
<p>Of course it&#8217;s a bad idea to develop an application on a different platform than the production platform, so inevitably, we ran into trouble. Specifically with datatypes. Some code would run fine on WAS with MySQL but as soon as we deployed it to the (AS400) DB2 environment the JDBC exceptions started flooding.</p>
<p>I decided to take the plunge (I am more an Oracle type of person) and install DB2 Personal Edition for Windows on my machine. This would make my machine more compatible with the production database, although there are differences between DB2 for Windows and DB2 for AS400. I anticipated a long download (I aborted the Websphere download after two hours), but after ten minutes the entire DB2 Personal Edition was downloaded to my machine. Next I unpacked the zipfile. Still everything went smoothly: if only it had stayed that way&#8230;</p>
<p><span id="more-46"></span></p>
<p>I was starting to think this might not be such a big deal after all&#8230;. <strong>wishful thinking: mistake number 1!</strong></p>
<p>I double clicked the setup.exe and started clicking &#8216;next&#8217; in the wizard. I assumed that leaving the defaults was the best way to go. Defaults are designed for people that don&#8217;t know what they are doing, right? <strong>Assumptions: mistake number 2! </strong> The only thing I changed, was the option to start the database automatically.<br />
When I finished the wizard, I shut down my PC and decided wait until the next morning to check what happened with the database.</p>
<p>When I logged on, I noticed to my surprise that a new user was present: &#8216;db2admin&#8217;. I logged on with my own username and started the database.</p>
<p>Then I tried to access the database with the control center.</p>
<p>I got hit with the error message <code>SQL1035N  The database is currently in use.  SQLSTATE=57019</code>. The problems and possible solutions I found on the IBM website did not help at all. I tried a couple of things:</p>
<ul>
<li>I added my windows user to the group of DB2 ADMINISTRATORS</li>
<li>I started and stopped the database</li>
<li>I restarted my machine</li>
<li>I waited (also one of the suggestions).</li>
<li>I logged on as db2admin on my machine. I figured that maybe the database was in use by &#8216;db2admin&#8217;. This did not help: when I launched the control center and tried to access anything, I got the same message</li>
</ul>
<p>I was ready to give up. One of the other developers on the project tried to install DB2 on his machine. Because he heard me complain (I tend to &#8216;think&#8217; aloud), he used his &#8216;normal&#8217; windows account as administrator for the database. He managed to get the database up and running in no time. I don&#8217;t like to be defeated by some tool, so tonight I started over: I deinstalled DB2, renamed my windows user so it does not contain any spaces (yes you can do that!), created a TOOLDB, lowered the memory use for the instance and clicked &#8216;finish&#8217;.<br />
The database started, and I could access it using the control center! I then created a new database (I needed to use &#8216;standard&#8217; as type, other types still give me weird errors) and a new user. I then spend some time figuring out how to change the password. I finally came across this link: <a href="http://sqlzoo.net/howto/source/z.dir/tip988922/i10others.xml">sqlzoo</a> and decided I was done.</p>
<p>Tomorrow I am going to try to connect Websphere to this database. I hope this will be an easier exercise: my collegue already managed to do this. If I just follow his instructions noting can go wrong, right? Hmm, reading this I can see the two mistakes popping up again: assumptions and wishfull thinking. But then again, nothing would ever happen, if you give up before you even try!</p>
<p>To sum up: I still don&#8217;t know exactly what caused the problem, but I learned a couple of interesting lessons:</p>
<ol>
<li>You can actually change your windows username, without having to change anything else.</li>
<li>Don&#8217;t use the default db2admin as the administrator when you use the personal edition for Windows</li>
<li>Try to get a DB2 DBA or Expert sitting next to you, when you click your way though the wizard</li>
</ol>
<p>Basically it is like installing an Oracle database: all you have to do is click &#8216;next&#8217;. If it fails, you are in trouble and you need an expert. If it succeeds, you were lucky and (people think) you are the expert.</p>
<p>Tags: <a href="http://technorati.com/tag/oracle" rel="tag">oracle</a>, <a href="http://technorati.com/tag/db2" rel="tag">db2</a>, <a href="http://technorati.com/tag/database" rel="tag">database</a></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2006/04/20/installing-db2-for-oracle-dummys/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2006%2F04%2F20%2Finstalling-db2-for-oracle-dummys%2F&amp;title=Installing%20DB2%20for%20Oracle%20dummies" id="wpa2a_6"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2006/04/20/installing-db2-for-oracle-dummys/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JDeveloper 10.13 Early Access Edition… Mission impossible?</title>
		<link>http://blog.xebia.com/2006/01/10/jdeveloper1013-early-access-edition%e2%80%a6-mission-impossible/</link>
		<comments>http://blog.xebia.com/2006/01/10/jdeveloper1013-early-access-edition%e2%80%a6-mission-impossible/#comments</comments>
		<pubDate>Mon, 09 Jan 2006 22:01:00 +0000</pubDate>
		<dc:creator>Lonneke Dikmans</dc:creator>
				<category><![CDATA[Java]]></category>

	<!-- AutoMeta Start -->
	<category>jdeveloper</category>
	<category>faces</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/2006/01/10/jdeveloper1013-early-access-edition%e2%80%a6-mission-impossible/</guid>
		<description><![CDATA[A little while ago, we decided to take the new JDeveloper 10.1.3 Early Access edition for a spin. At Xebia we mostly use Eclipse with open source frameworks like Hibernate and Spring. We are very productive and successful, but something is missing from our toolset. Hand-coding the presentation layer and binding it to the services [...]]]></description>
			<content:encoded><![CDATA[<p>A little while ago, we decided to take the new JDeveloper 10.1.3 Early Access edition for a spin. At Xebia we mostly use Eclipse with open source frameworks like Hibernate and Spring. We are very productive and successful, but something is missing from our toolset. Hand-coding the presentation layer and binding it to the services and domain classes is a tedious job, even with frameworks like Spring MVC and Tapestry. Oracle’s ADF Data binding framework provides a solution for this problem. It offers .NET-like capabilities, with all the advantages of Java and <a href='http://www.jcp.org/en/jsr/detail?id=227'>open standards</a>. The second reason to try JDeveloper 10.1.3 EA is the emerging EJB 3.0 persistence standard. Both Oracle TopLink and Hibernate implement this <a href='http://glassfish.dev.java.net/javaee5/persistence/entity-persistence-support.html'>standard</a>. And last but not least, Oracle has made a contribution to the Spring framework by <a href='http://static.springframework.org/spring/docs/1.2.x/reference/orm.html#orm-toplink'>adding support for TopLink</a> to the Spring DAO package.<br />
Our assignment was to rebuild our timesheet application using JDeveloper 10.1.3 Early Access edition and Oracle ADF. My expectations were high, based on the skills of my colleagues and my experience with Oracle ADF in earlier versions of JDeveloper.</p>
<h4>Getting started</h4>
<p>After a brief introduction of Oracle ADF everybody started building the application. Right away we got lost: the workspace and project organization in JDeveloper 10.1.3 is very different from Eclipse. Unfortunately it has also changed compared to previous JDeveloper versions, so it took a while before we were on our way. Deleting files from both the project and the file system has always been very awkward and the embedded OC4J gave us a lot of headaches (out of memory exceptions and mySQL datasource trouble).</p>
<h4>The domain classes and the services layer</h4>
<p>Because we were rebuilding an existing application with a simple domain we generated the EJB entity beans from the database. This went smooth with both the Oracle RDBMS and MySQL. We did find a strange bug: when the access type is changed from property to field, JDeveloper still generates the annotations on the properties (“getXXX” methods). This results in an error when the entity beans are deployed to OC4J. We did not want to spend too much time on the business services, so we decided to generate an EJB Session Bean. Unfortunately, we happened to have an entity bean named “Resource”. The generated session bean did not compile because javax.ejb.Resource is imported when you have “@Resource” in your code. We had to either refactor this domain class or use a fully qualified name cast every time we used this class. We tried to refactor the bean but had no success: renaming a EJB 3.0 entity bean does not work in this version of the IDE.<br />
We added some existing business methods of the original application to the session bean:</p>
<pre class="brush: java; title: ; notranslate">
public void addProject(Project newProject) {
  //do work
}
</pre>
<p>Now it was time to start with the interesting part: exposing the services to the presentation layer.</p>
<h4>Creating the Data Control</h4>
<p>Apart from using a new tool that was an early access release, building our domain and service layer was not too difficult. We created a Data Control for our service bean. This created xml files for the entity beans as well. Our custom methods were present in the xml file as you can see in the xml code snippet:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;MethodAccessor IsCollection=&quot;false&quot; Type=&quot;void&quot; id=&quot;addProject&quot; ReturnNodeName=&quot;Return&quot;&gt;
  &lt;ParameterInfo id=&quot;project&quot; Type=&quot;nl.inspiring.utees.blog.model.Project&quot; isStructured=&quot;true&quot;/&gt;
&lt;/MethodAccessor&gt;
</pre>
<p>We did notice some strange behavior: JDeveloper generated two xml files (ReadOnlyCollection.xml and ReadOnlySingleValue.xml) in the source directory of the project that were not based any class in our source code. They seem to represent some data type, but there is no documentation about these files.</p>
<h4>Building the Web Layer</h4>
<p>Now that we exposed our business layer, we were ready to use it in the front end of the application. Most of us decided to use ADF Faces. It soon became clear that using ADF Faces with data bindings is very complex. JDeveloper generates faces-config.xml, backing beans, page definitions, a binding context, iterators etc. Most of us managed to create a page that displayed a read only table with data from a database table. Adding a form to insert a row using one of our custom services proved to be a bigger problem. There are a lot of widgets you can use and the difference between controls like ADF Input Form and ADF Parameter Form are not very intuitive. We also learned that in the Data Control Palette a domain class used as a parameter is not exposed the same way a domain class used as a return type is. We had to rewrite our service methods using the fields as parameters to be able to use the drag and drop functionality. At the end of the day, nobody had built a fully functional web application and most of us had become frustrated with JDeveloper and ADF.</p>
<h4>Evaluation</h4>
<p>I got some valuable feedback building this application with my colleagues:</p>
<ul>
<li>I underestimated the productivity loss people experience when they are forced to use another IDE. To complicate matters we used the early access edition and ran into a couple of bugs. These two factors were a big turn off for a lot of us.</li>
<li>The current Data binding framework (JDeveloper 10.1.2) works great for ADF BC. For other frameworks like Oracle TopLink with EJB session beans or Spring it is not mature enough yet. Once domain classes can be exposed as parameters and all the Data Control implementations are finished, I expect it will be even better than the current version. Programmers are then no longer forced to use a proprietary framework like ADF BC to be productive.</li>
<li>Not everybody likes JSF. We had a rather long discussion about ADF Faces and JSF. Some of us fear it will be a monster like the EJB specification (used to be). Others think it is a specification that will give Java developers .NET-like productivity but with the open standards and open source that Java offers.</li>
<li>Because both the JSF and ADF Data bindings were new for most of us, the assignment became too complicated and we ended up being confused instead of productive.</li>
</ul>
<p>Personally, I am still very enthusiastic about the latest developments in EJB 3.0 persistence,Oracle ADF Data bindings and even JDeveloper. I’ll try to convince my colleagues again as soon as Oracle finishes the enhancements of the Data binding framework. To keep things simple, I won’t use the ADF Faces right away, but save those until JDeveloper 10.1.3 has become the production version. As far as I am concerned the verdict isn’t out yet….</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2006/01/10/jdeveloper1013-early-access-edition%e2%80%a6-mission-impossible/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2006%2F01%2F10%2Fjdeveloper1013-early-access-edition%25e2%2580%25a6-mission-impossible%2F&amp;title=JDeveloper%2010.13%20Early%20Access%20Edition%E2%80%A6%20Mission%20impossible%3F" id="wpa2a_8"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2006/01/10/jdeveloper1013-early-access-edition%e2%80%a6-mission-impossible/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.xebia.com/author/ldikmans/feed/ ) in 0.62924 seconds, on Feb 9th, 2012 at 4:20 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 9th, 2012 at 5:20 pm UTC -->
