<?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>Matt's Blog</title>
	<atom:link href="http://blog.rueedlinger.ch/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rueedlinger.ch</link>
	<description>Software Engineering and Java</description>
	<lastBuildDate>Sun, 15 Apr 2012 18:37:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>ipod shuffle and Ubuntu (11.10)</title>
		<link>http://blog.rueedlinger.ch/2012/04/ipod-shuffle-and-ubuntu-11-10/</link>
		<comments>http://blog.rueedlinger.ch/2012/04/ipod-shuffle-and-ubuntu-11-10/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 18:34:19 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=676</guid>
		<description><![CDATA[Sports make a lot more fun with some good music. So I decided to buy one of this ipod shuffle. In the store the clerk ask me if I have a mac or pc. So I told im I have &#8230; <a href="http://blog.rueedlinger.ch/2012/04/ipod-shuffle-and-ubuntu-11-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sports make a lot more fun with some good music. So I decided to buy one of this ipod shuffle.</p>
<p>In the store the clerk ask me if I have a mac or pc. So I told im I have a pc. The next question was which windows I use and I told him linux. He replied that he is not sure if this will work.</p>
<p>For the rest out there it will work, probably not as good when you have itunes, but you can upload your music and thats all I care about.</p>
<p>First install the <a href="http://www.gnu.org/software/gnupod/gnupod.html">gnupod</a>, which is a command line tool for managing your ipod. Ubuntu has already a package for gnupod.</p>
<pre>sudo apt-get install gnupod-tools</pre>
<p>Plug in the ipod shuffle and it should be automatically mounted at<br />
/media/IPOD/.</p>
<p>After that we have to initialize the ipod file system.</p>
<pre>gnupod_INIT -m /media/IPOD/</pre>
<p>All you need now is a tool to sync your music with the ipod shuffle. I use <a href="http://www.gtkpod.org/">gtkpod</a> and it works fine for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2012/04/ipod-shuffle-and-ubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESE Conference 2012</title>
		<link>http://blog.rueedlinger.ch/2012/02/ese-conference-2012/</link>
		<comments>http://blog.rueedlinger.ch/2012/02/ese-conference-2012/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 15:23:16 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[woolly thoughts]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=645</guid>
		<description><![CDATA[This year&#8217;s ESE Conference has three tracks Agile, Mobile and Cloud Computing. The conference will take place on 24-25 April in Schlieren close to Zürich (Switzerland). The keynote speakers are Michael Crandell (RightScale), Elizabeth Woodward (IBM) and Jürgen Höller (SpringSource).]]></description>
			<content:encoded><![CDATA[<p>This year&#8217;s <a href="http://www.eseconf.com/">ESE Conference</a> has three tracks Agile, Mobile and Cloud Computing. The conference will take place on 24-25 April in Schlieren close to Zürich (Switzerland).</p>
<p>
The keynote speakers are Michael Crandell (RightScale),  Elizabeth Woodward (IBM) and Jürgen Höller (SpringSource).</p>
<p><a href="http://www.eseconf.com/"><img src="http://blog.rueedlinger.ch/wp-content/uploads/2012/02/ese2012_logo.jpg" alt="" title="ese2012_logo" width="500" height="354" class="alignnone size-full wp-image-646" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2012/02/ese-conference-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GlassFish 3.1 and MySQL 5.1 on Ubuntu Server 11.10</title>
		<link>http://blog.rueedlinger.ch/2012/02/glassfish-3-1-and-mysql-5-1-on-ubuntu-server-11-10/</link>
		<comments>http://blog.rueedlinger.ch/2012/02/glassfish-3-1-and-mysql-5-1-on-ubuntu-server-11-10/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 18:26:28 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=469</guid>
		<description><![CDATA[In a previous post I have explained how to setup Oracle XE and GlassFish. This time we will install and configure GlassFish 3.1 and MySQL 5.1 on an Ubuntu Server 11.10. For this example I have used VirtualBox 4.1 as &#8230; <a href="http://blog.rueedlinger.ch/2012/02/glassfish-3-1-and-mysql-5-1-on-ubuntu-server-11-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
In a previous post I have explained how to setup <a href="http://blog.rueedlinger.ch/2011/03/oracel-10g-xe-on-ubuntu-10-10-64bit/" title="Oracel 10g XE on Ubuntu 10.10 (64bit)">Oracle XE and GlassFish</a>. This time we will install and configure GlassFish 3.1 and MySQL 5.1 on an Ubuntu Server 11.10.</p>
<p>
For this example I have used <a href="https://www.virtualbox.org/">VirtualBox</a> 4.1 as virtualization tool. I can recommend you VirtualBox when you want to try out some examples and you do not want to screw up your setup.
</p>
<h2>GlassFish 3.1 Installation</h2>
<p>First we have to install Java. Ubuntu does not longer have the sun-jdk in their repository. (see <a href="https://lists.ubuntu.com/archives/ubuntu-security-announce/2011-December/001528.html">https://lists.ubuntu.com/archives/ubuntu-security-announce/2011-December/001528.html</a>)</p>
<p>So for this example we are going to use OpenJDK 7 which is available in Ubuntu and is also the <a href="http://jdk7.java.net/java-se-7-ri/">Java 7</a> reference implementation.</p>
<pre>
sudo apt-get install openjdk-7-jdk
</pre>
<p>After a new installation of the Ubuntu server unzip is not yet installed, so you have to apt-get it. Later we need unzip to unpack some archives.</p>
<pre>
sudo apt-get install unzip
</pre>
<p>
There ist no Ubuntu package for GlassFish, but the installation is quite simple. I recommand you the to download the <a href="http://glassfish.java.net/">GlassFish Server Open Source Edition 3.1.1</a> (Zip archive) and unzip it to /opt/glassfish.
</p>
<pre>
wget&nbsp;http://download.java.net/glassfish/3.1.1/release/glassfish-3.1.1.zip
sudo unzip glassfish-3.1.1.zip -d /opt
</pre>
<p>For an automatically start up of GlassFish we need to create a <a href="https://help.ubuntu.com/community/UbuntuBootupHowto">traditional sysvinit script</a>.</p>
<pre>
sudo vim /etc/init.d/glassfish
</pre>
<p>The content of the start script should look as follows.</p>
<pre>
#!/bin/bash

GLASSFISH_HOME=/opt/glassfish3
case "$1" in
start)
    ${GLASSFISH_HOME}/bin/asadmin start-domain domain1
    ;;
stop)
    ${GLASSFISH_HOME}/bin/asadmin stop-domain domain1
    ;;
restart)
    ${GLASSFISH_HOME}/bin/asadmin stop-domain domain1
    ${GLASSFISH_HOME}/bin/asadmin start-domain domain1
    ;;
*)
    echo "usage: $0 {start|stop|restart}"
    ;;

esac

exit 0
</pre>
<p>The last step is to make the script executable and to install our script as System-V style script with update-rc.d.</p>
<pre>
sudo chmod 755 /etc/init.d/glassfish
sudo update-rc.d /etc/init.d/glassfish defaults
</pre>
<p>Now we can start glassfish with our start script.</p>
<pre>
sudo /etc/init.d/glassfish start
</pre>
<p>After GlassFish is started you can access the admin console on http://localhost:4848.</p>
<h2>MySQL 5.1 Installation</h2>
<p>We use the MySQL version which is already packged with the Ubuntu server.</p>
<pre>
sudo apt-get install mysql-server-5.1
</pre>
<p>Out of the box MySQL allowes only connections from localhost. To change that we have to edit <em>/etc/mysql/my.cnf</em>. Open the MySQL configuration file and comment out the following line.</p>
<pre>
#bind-address = 127.0.0.1
</pre>
<p>After the restart of MySQL we cann now connect from our network to the MySQL server.</p>
<pre>
sudo /etc/init.d/mysql restart
</pre>
<p>It&#8217;s time to create a MySQL database and user which we can use from glassfish as DataSource. To create a MySQL database and user you have to login to the mysql server as root.</p>
<pre>
mysql -u root -p
</pre>
<p>The following SQL commands create the database <em>glassfish_db</em> and the mysql user <em>glassfish</em> which is allowed to access the database form the external network.</p>
<pre>
create database glassfish_db;
grant usage on *.* to 'glassfish'@'%' identified by 'glassfish';
grant all privileges on glassfish_db.* to 'glassfish'@'%';
</pre>
<p>You should now be able to connect as user <em>glassfish</em> to the MySQL database <em>glassfish_db</em>. When you don&#8217;t want to work with the console I would suggest you the <a href="http://www.mysql.com/products/workbench/">MySQL Workbench</a>.</p>
<pre>
mysql -u glassfish -p
</pre>
<h2>GlassFish DataSource configuartion for MySql</h2>
<p>To use MySQL with GlassFish we need the <a href="http://dev.mysql.com/downloads/connector/j/">MySQL Connector/J</a> which is the official JDBC driver for MySQL. Copy the JDBC driver to the GlassFish lib directory.</p>
<pre>
unzip mysql-connector-java-5.1.18.zip
sudo cp mysql-connector-java-5.1.18/mysql-connector-java-5.1.18-bin.jar \
  /opt/glassfish3/glassfish/lib/
</pre>
<p>The next thing we have to do is to restart GlassFish and configure our DataSource.</p>
<pre>
sudo /etc/init.d/glassfish restart
</pre>
<p>Login to the GlassFish admin console and create two JDBC Connection Pools one of them as XA DataSource.</p>
<ul>
<li>MySqlDataSource</li>
<li>MySqlDataSourceXA</li>
</ul>
<p>The two DataSources should have the following settings:</p>
<p><b>DataSource</b></p>
<ul>
<li>Pool Name: MySqlDataSource</li>
<li>Resource Type: javax.sql.DataSource</li>
<li>Database Driver Vendor: MySQL</li>
<li>Datasource Classname: com.mysql.jdbc.jdbc2.optional.MysqlDataSource</li>
</ul>
<p><b>XA DataSource</b></p>
<ul>
<li>Pool Name: MySqlDataSourceXA</li>
<li>Resource Type: javax.sql.XADataSource</li>
<li>Database Driver Vendor: MySQL</li>
<li>Datasource Classname: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</li>
</ul>
<p>Both DataSources need at least the following additional properties. Which are required to connect to the MySQL Database.</p>
<p><b>Additional Properties:</b></p>
<ul>
<li>ServerName:  localhost</li>
<li>Port: 3306</li>
<li>User: glassfish</li>
<li>Password: glassfish</li>
<li>DatabaseName: glassfish_db</li>
</ul>
<p>In the GlassFish admin console you can check if both DataSources are properly configured. When you click on the ping button you should receive a <em>ping succeeded</em>.</p>
<p><a href="http://blog.rueedlinger.ch/wp-content/uploads/2012/02/glassfish_mysql.png"><img src="http://blog.rueedlinger.ch/wp-content/uploads/2012/02/glassfish_mysql-300x190.png" alt="" title="glassfish_mysql" width="300" height="190" class="alignnone size-medium wp-image-497" /></a></p>
<p><b>JDBC Resources:</b></p>
<p>For both DataSources we create now a JDBC resource with a JNDI name.</p>
<ul>
<li>JNDI Name: jdbc/MySqlDataSource</li>
<li>Pool Name: MySqlDataSource</li>
</ul>
<ul>
<li>JNDI Name: jdbc/MySqlDataSourceXA</li>
<li>Pool Name: MySqlDataSourceXA</li>
</ul>
<p><a href="http://blog.rueedlinger.ch/wp-content/uploads/2012/02/glassfish_mysql_jdbc.png"><img src="http://blog.rueedlinger.ch/wp-content/uploads/2012/02/glassfish_mysql_jdbc-300x165.png" alt="" title="glassfish_mysql_jdbc" width="300" height="165" class="alignnone size-medium wp-image-499" /></a></p>
<h2>Finally</h2>
<p>
After that we can now use the two DataSources in our Java EE application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2012/02/glassfish-3-1-and-mysql-5-1-on-ubuntu-server-11-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL Workbench Visual C++ 2010 redistributable package not found</title>
		<link>http://blog.rueedlinger.ch/2012/02/mysql-workbench-visual-c-2010-redistributable-package-not-found/</link>
		<comments>http://blog.rueedlinger.ch/2012/02/mysql-workbench-visual-c-2010-redistributable-package-not-found/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 05:00:52 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=447</guid>
		<description><![CDATA[I tried to start the MySQL Workbench ZIP (Archive) version on Windows and run I some trouble. The MySQL Workbench did not start up correctly and I got a message from windows that the program crashed. I also tried to &#8230; <a href="http://blog.rueedlinger.ch/2012/02/mysql-workbench-visual-c-2010-redistributable-package-not-found/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I tried to start the MySQL Workbench ZIP (Archive) version on Windows and run I some trouble.</p>
<p>The MySQL Workbench did not start up correctly and I got a<br />
message from windows that the program crashed.</p>
<p>I also tried to install the MySQL Workbench as MSI package but I got<br />
an error message that the <strong>Visual C++ 2010 redistributable package</strong> was not found.</p>
<p>To solve the problem you can download the Visual C++ 2010 redistributable package at<br />
<a href="http://www.microsoft.com/download/en/details.aspx?id=5555">http://www.microsoft.com/download/en/details.aspx?id=5555</a></p>
<p>After you have installed the Visual C++ 2010 redistributable package, the MySQL Workbench ZIP (Archive) version will start up correctly on Windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2012/02/mysql-workbench-visual-c-2010-redistributable-package-not-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reviewing Apache Maven Cookbook</title>
		<link>http://blog.rueedlinger.ch/2011/11/reviewing-apache-maven-cookbook/</link>
		<comments>http://blog.rueedlinger.ch/2011/11/reviewing-apache-maven-cookbook/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 17:09:49 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=409</guid>
		<description><![CDATA[Packt publishing was so kind to give me an e-book version of their book Apache Maven Cookbook. The book has 9 Chapters and over 200 pages. As the name suggest, there some receipt for some common problems. For example when &#8230; <a href="http://blog.rueedlinger.ch/2011/11/reviewing-apache-maven-cookbook/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Packt publishing was so kind to give me an e-book version of their book <a href="http://www.packtpub.com/apache-maven-3-0-cookbook/book">Apache Maven Cookbook</a>. The book has 9 Chapters and  over 200 pages.<br />
As the name suggest, there some receipt for some common problems. For example when you want to start a new maven project with flex, hibernate, integrate hudson or create your own maven remote repository. </p>
<p><a href="http://www.packtpub.com/apache-maven-3-0-cookbook/book"><img src="http://blog.rueedlinger.ch/wp-content/uploads/2011/10/Apache-Maven-3-Cookbook.png" alt="" title="Apache Maven 3 Cookbook" width="125" height="152" class="alignnone size-full wp-image-412" /></a></p>
<p>When you are new to maven and want a broad overview how you can use maven in different setups then this book is just right for you.  This book is ideal addition for beginners which want to get started with maven very quickly. But when you want a detailed overview about the internals of maven this is not the right book for you. </p>
<p>Personally for me the interesting part was the chapter Extending Apache Maven. In this chapter it&#8217;s explained how you can easily write a apache maven plugin (MOJO). </p>
<h2>Conclusion</h2>
<p>So if you are new to maven and want a broad overview then this book is just right for you. It will give you in a quick way answers to common problems and  how to solve them. </p>
<p>If you have already experience with maven and use it with a SCM and CI server like Hudson, then this book is definitively not for you. </p>
<h2>Should I buy the book?</h2>
<p>It depends how experienced you are with maven?  But to be honestly some years earlier this book would be great to save us some time for our project setup.  It&#8217;s also a good addition to the other packt publishing book Apache Maven 2 Effective Implementation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2011/11/reviewing-apache-maven-cookbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to pass Professional Scrum Master I (PSM I)</title>
		<link>http://blog.rueedlinger.ch/2011/04/how-to-pass-professional-scrum-master-i-psm-i/</link>
		<comments>http://blog.rueedlinger.ch/2011/04/how-to-pass-professional-scrum-master-i-psm-i/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 18:49:52 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[woolly thoughts]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=392</guid>
		<description><![CDATA[Few weeks ago I took a course for the Professional Scrum Master I (PSM I) in Zürich. It was a very good course which gives you some useful tips and a fundamental understating for the role as scrum master. After &#8230; <a href="http://blog.rueedlinger.ch/2011/04/how-to-pass-professional-scrum-master-i-psm-i/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Few weeks ago I took a course for the <a href="http://www.scrum.org/psmoverview/">Professional Scrum Master I (PSM I)</a> in Zürich. It was a very good course which gives you some useful tips and a fundamental understating for the role as scrum master.</p>
<p>After the two day course you can take the online assessment to receive the PSM I certificate. You can also take the online assessment without the two day course but I would not recommend it, because you changes to succeed will not as good when you take the course.</p>
<p>This was not my first assessment in English for a certificate, but honestly I was not so easy as I tough to pass.</p>
<p>For someone which English is a foreign language there are some tough and complex questions.     </p>
<p>When you take the course, read and and understand the <a href="http://www.scrum.org/scrumguides/">scrum guide</a>, have some experience with scrum and prepare yourself with the <a href="http://www.scrum.org/assessments/">open assessment</a> then you have a good change to pass the exam. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2011/04/how-to-pass-professional-scrum-master-i-psm-i/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Oracel 10g XE on Ubuntu 10.10 (64bit)</title>
		<link>http://blog.rueedlinger.ch/2011/03/oracel-10g-xe-on-ubuntu-10-10-64bit/</link>
		<comments>http://blog.rueedlinger.ch/2011/03/oracel-10g-xe-on-ubuntu-10-10-64bit/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 11:17:03 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=366</guid>
		<description><![CDATA[So this post is based on the article form the following site http://littlebrain.org/2008/05/12/how-to-install-oracle-xe-in-ubuntu-64-bit/ and an addition to my previous blog how to install Oracle XE and GlassFish on an Ubuntu Linux. When you have a Ubuntu 64bit system you probably &#8230; <a href="http://blog.rueedlinger.ch/2011/03/oracel-10g-xe-on-ubuntu-10-10-64bit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So this post is based on the article form the following site<br />
<a href="http://littlebrain.org/2008/05/12/how-to-install-oracle-xe-in-ubuntu-64-bit/">http://littlebrain.org/2008/05/12/how-to-install-oracle-xe-in-ubuntu-64-bit/</a> and an addition to my previous blog how to install <a href="http://blog.rueedlinger.ch/2010/09/glassfish-3-and-oracle-10g-xe-on-ubuntu-linux-9-10/">Oracle XE and GlassFish on an Ubuntu Linux</a>. </p>
<p>
When you have a Ubuntu 64bit system you probably get the following error during the installation which was base on my previous post during an <strong>apt-get update</strong>.
</p>
<pre>
W: Failed to fetch http://oss.oracle.com/debian/dists/unstable/Release
Unable to find expected entry  main/binary-amd64/Packages in
Meta-index file (malformed Release file?)

E: Some index files failed to download, they have been
ignored, or old ones used instead.
</pre>
<p>Or when you install the packages manually you would get the following error:</p>
<pre>
dpkg: error processing libaio_0.3.104-1_i386.deb (--install):
 package architecture (i386) does not match system (amd64)
Errors were encountered while processing:
 libaio_0.3.104-1_i386.deb
</pre>
<p>So you have the download the packages <strong>libaio_0.3.104-1_i386.deb</strong> and <strong>oracle-xe-universal_10.2.0.1-1.1_i386.deb</strong>.</p>
<ul>
<li><a href="http://oss.oracle.com/debian/dists/unstable/main/binary-i386/libaio_0.3.104-1_i386.deb">http://oss.oracle.com/debian/dists/unstable/main/binary-i386/libaio_0.3.104-1_i386.deb</a></li>
<li><a href="http://oss.oracle.com/debian/dists/unstable/non-free/binary-i386/oracle-xe-universal_10.2.0.1-1.1_i386.deb">http://oss.oracle.com/debian/dists/unstable/non-free/binary-i386/oracle-xe-universal_10.2.0.1-1.1_i386.deb</a></li>
</ul>
<p>After that we must force the installation with option &#8211;force-architecture.</p>
<pre>
sudo dpkg -i --force-architecture libaio_0.3.104-1_i386.deb
sudo dpkg -i --force-architecture oracle-xe-universal_10.2.0.1-1.1_i386.deb
</pre>
<p>Now we can configure the Oracle XE. </p>
<pre>
sudo /etc/init.d/oracle-xe configure
</pre>
<p>In this configuration we change the apex default port from 8080 to 8081 because when you want to install GlassFish later there will be no conflict. GlassFish use 8080 as the default port an we want to keep it that way.</p>
<pre>
Specify the HTTP port that will be used for
Oracle Application Express = 8081

Specify a port that will be used for the
database listener = 1521

Specify a password to be used for database
accounts (SYS and SYSTEM) = system

Do you want Oracle Database 10g Express
Edition to be started on boot  = yes
</pre>
<p>After that we only must add the <strong>ORACLE_HOME</strong> and modify the <strong>PATH</strong> variable in our <strong>bashrc </strong>file.</p>
<pre>
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME
export ORACLE_SID=XE

export PATH
</pre>
<p>To install GlassFish an use with a Orcle XE Database go back to my previous post:<br />
<a href="http://blog.rueedlinger.ch/2010/09/glassfish-3-and-oracle-10g-xe-on-ubuntu-linux-9-10/">http://blog.rueedlinger.ch/2010/09/glassfish-3-and-oracle-10g-xe-on-ubuntu-linux-9-10/</a></p>
<p><strong>Reference:</strong><br />
How To Install Oracle XE in Ubuntu 64 Bit, Aldiantoro Nugroho, 2008,  <a href="http://littlebrain.org/2008/05/12/how-to-install-oracle-xe-in-ubuntu-64-bit/">http://littlebrain.org/2008/05/12/how-to-install-oracle-xe-in-ubuntu-64-bit/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2011/03/oracel-10g-xe-on-ubuntu-10-10-64bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GlassFish 3 and Oracle 10g XE on Ubuntu Linux 9.10</title>
		<link>http://blog.rueedlinger.ch/2010/09/glassfish-3-and-oracle-10g-xe-on-ubuntu-linux-9-10/</link>
		<comments>http://blog.rueedlinger.ch/2010/09/glassfish-3-and-oracle-10g-xe-on-ubuntu-linux-9-10/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 13:43:48 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=192</guid>
		<description><![CDATA[This is an example infrastructure setup for a development environment which uses Oracle database 10g XE and GlassFish 3 as application server on an Ubuntu Linux 9.10. I wrote this blog post because I wanted to use GlassFish and Oracle &#8230; <a href="http://blog.rueedlinger.ch/2010/09/glassfish-3-and-oracle-10g-xe-on-ubuntu-linux-9-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is an example infrastructure setup for a development environment which uses Oracle database 10g XE and GlassFish 3 as application server on an Ubuntu Linux 9.10. </p>
<p>I wrote this blog post because I wanted to use GlassFish and Oracle XE on my laptop to test some examples and I thought maybe someone else could find this step by step guide useful.  </p>
<h2>Oracle 10g XE installation</h2>
<p><strong>Note</strong>: Some of the explanation how to install Oracle on ubuntu is based on the wiki entry from the ubuntu site. See <a href="https://help.ubuntu.com/community/Oracle10g">https://help.ubuntu.com/community/Oracle10g</a>.</p>
<p><b>Ubuntu 64bit</b></p>
<p>
If you try to follow this tutorial with an Ubuntu 64 bit check out the following site post <a href="http://blog.rueedlinger.ch/2011/03/oracel-10g-xe-on-ubuntu-10-10-64bit/">Oracel 10g XE on Ubuntu 10.10 (64bit)</a>.
</p>
<p>Before we install Oracle XE with apt-get we need to download and add the Oracle public key as trusted key.</p>
<pre>
wget&nbsp;http://oss.oracle.com/el4/RPM-GPG-KEY-oracle
sudo apt-key add RPM-GPG-KEY-oracle
</pre>
<p>Add the Oracle sources to <strong>/etc/apt/sources.list</strong> file.</p>
<pre>
deb http://oss.oracle.com/debian unstable main non-free
</pre>
<p>Update the sources and install Oracle XE.</p>
<pre>sudo apt-get update
sudo apt-get install oracle-xe-universal</pre>
<p>After the installation we can configure our Oracle XE installation with the following command.</p>
<pre>
sudo /etc/init.d/oracle-xe configure
</pre>
<p>The script asks for some configurations settings. It is important that you set the port for Oracle Application Express not to 8080, because GlassFish will use this port for the web applications. So we use instead the port 8081 for the Oracle Application Express (APEX).</p>
<pre>
Specify the HTTP port that will be used for
Oracle Application Express = <strong>8081</strong>

Specify a port that will be used for the
database listener = <strong>1521</strong>

Specify a password to be used for database
accounts (SYS and SYSTEM) = <strong>system</strong>

Do you want Oracle Database 10g Express
Edition to be started on boot  = <strong>yes</strong>
</pre>
<p><strong>Note</strong>: When the option startup on boot is set to NO then you will have problems to start and stop Oracle XE with the <strong>/etc/init.d/oracle-xe</strong> script. See <a href="http://forums.oracle.com/forums/thread.jspa?threadID=944382">http://forums.oracle.com/forums/thread.jspa?threadID=944382</a> for more details.</p>
<p>When you have problems (set started on boot = NO) this workaround could help. Start Oracle XE with</p>
<pre>
sudo /etc/init.d/oracle-xe enabled
sudo /etc/init.d/oracle-xe start
</pre>
<p>and stop it with</p>
<pre>
sudo /etc/init.d/oracle-xe stop
sudo /etc/init.d/oracle-xe disabled
</pre>
<p><strong>Note</strong>: With the script argument <strong>enabled</strong> / <strong>disabled</strong> you specifies if Oracle XE should automatically start when the system starts up.</p>
<p>The next step is to adjust the PATH settings, so that we can use sqlplus on our command line. The PATH variable is set in the <strong>.bashrc</strong> file.</p>
<p><strong>.bashrc</strong></p>
<pre>
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME
export ORACLE_SID=XE

export PATH
</pre>
<p>After the installation there are some shortcuts (Start Database, Run SQL Command Line, etc.) in our start menu so we need to add our system user to the <strong>dba</strong> group so that we are allowed to use them.</p>
<pre>
sudo usermod -g dba <em>my_user</em>
</pre>
<p>We create a directory where Oracle can store our tablespaces and give the system user <strong>oracle</strong> the rights to this directory.</p>
<pre>
sudo mkdir /var/local/oracle
sudo chown oracle /var/local/oracle/
</pre>
<h2>Setup the database</h2>
<p>To create a tablespace and database user we start sqlplus as database user system. </p>
<pre>
sqlplus system/my_password
</pre>
<p>For our example we create a tablespace glassfish_app and a database user. I created just a simple tablespace with the size of 10M and a maximum size of 200M. Be sure that your project have other requirements and adjust this settings to your need. See <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7003.htm">http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7003.htm</a> for more details.</p>
<pre>
CREATE TABLESPACE glassfish_app DATAFILE '/var/local/oracle/glassfish.dbf'
     SIZE 10M
     AUTOEXTEND ON NEXT 200K
     MAXSIZE 200M;
</pre>
<p>For the tablespace glassfish_app we create our user glassfish and give him all rights. In a more serious environment you have to specify the privileges a bit better than I did.</p>
<pre>
CREATE USER glassfish
    IDENTIFIED BY glassfish
    DEFAULT TABLESPACE glassfish_app;

GRANT ALL PRIVILEGES TO glassfish;
</pre>
<h2>GlassFish installation</h2>
<p>Download the Platform-independent GlassFish (Full Platform) 3.0.1 ZIP from the <a href="https://glassfish.dev.java.net/">GlassFish</a> homepage and unzip the file.</p>
<pre>
unzip glassfish-3.0.1.zip
</pre>
<p>There should now be the directory glassfishv3 with the follwing content. </p>
<pre>
glassfishv3
            |-- bin
            |-- glassfish (1)
            |-- javadb (2)
            |-- mq (3)
            '-- pkg
</pre>
<ol>
<li>GlassFish the application server</li>
<li>The Derby database</li>
<li>Open MQ the message broker</li>
</ol>
<p>Next we need to install Java SDK 6.</p>
<pre>
sudo apt-get install sun-java6-jdk
</pre>
<p><strong>Note</strong>: GlassFish Installations require JDK 6. The minimum and certified version required version is 1.6.0_20. This is not a problem with the newest update of Ubuntu Linux 9.10 (Karmic Koala).</p>
<p>Again we modify our <strong>.bashrc</strong> file and add the GlassFish directory to the PATH variable. Set the $GLASSFISH_DIR variable to the directory where you have unzipped your GlassFish installation.</p>
<p><strong>.bashrc</strong></p>
<pre>
GLASSFISH_DIR=/home/mr/bin/glassfishv3
GLASSFISH_HOME=$GLASSFISH_DIR/glassfish
DERBY_HOME=$GLASSFISH_DIR/javadb
OPEN_MQ_HOME=$GLASSFISH_DIR/mq

PATH=$PATH:$GLASSFISH_HOME/bin:$DERBY_HOME/bin:$OPEN_MQ_HOME/bin
export GLASSFISH_HOME
export DERBY_HOME
export OPEN_MQ_HOME

export PATH
</pre>
<p>To use the scripts from Open MQ and Derby we put their bin directories also into the PATH variable.</p>
<p>The next step is to add the Oracle JDBC driver to the GlassFish lib directory. You should find the Oracle JDBC driver <strong>ojdbc14.jar</strong> in $ORACLE_HOME/jdbc/lib. Copy the ojdbc14.jar in your GlassFish domain lib/ext directory. The default domain in GlassFish is named domain1, so when your domain has a different name you should replace domain1 with your GlassFish domain name.</p>
<pre>
cp $ORACLE_HOME/jdbc/lib/ojdbc14.jar \
    $GLASSFISH_HOME/domains/domain1/lib/ext
</pre>
<p><strong>Note</strong>: When you want to install GlassFish 3 as service then these blog entries could help you: </p>
<ul>
<li><a href="http://blogs.sun.com/foo/entry/how_to_run_glassfish_v3">http://blogs.sun.com/foo/entry/how_to_run_glassfish_v3</a></li>
<li><a href="http://blogs.sun.com/foo/entry/run_glassfish_v3_as_a">http://blogs.sun.com/foo/entry/run_glassfish_v3_as_a</a></li>
</ul>
<h2>GlassFish configuration</h2>
<p>Now we have to start GlassFish and go to the GlassFish admin console http://localhost:4848 </p>
<pre>
asadmin start-domain
</pre>
<p><strong>Note</strong>: By default there is no password set. A password can be set in the menu Enterprise Server > Administrator Password. </p>
<p>We create now our Connection Pool with the following settings.</p>
<pre>
Pool Name: OraclePool
Resource Type: javax.sql.DataSource
Datasource Classname: oracle.jdbc.pool.OracleDataSource
</pre>
<p><a href="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/oracle_pool.png"><img src="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/oracle_pool-300x119.png" alt="" title="oracle_pool" width="300" height="119" class="alignnone size-medium wp-image-275" /></a></p>
<p>In the additional properties  we have to set password, username and the connection url. </p>
<pre>
URL: jdbc:oracle:thin:@localhost:1521:xe
Password: glassfish
User: glassfish
</pre>
<p><a href="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/oracle_pool_properties.png"><img src="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/oracle_pool_properties-300x79.png" alt="" title="oracle_pool_properties" width="300" height="79" class="alignnone size-medium wp-image-276" /></a></p>
<p>To test the connection click on the <strong>ping</strong> button. When all settings are valid you should receive a <em>&#8220;ping succeeded&#8221;</em>.<br />
<a href="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/oracle_ping.png"><img src="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/oracle_ping.png" alt="" title="oracle_ping" width="209" height="42" class="alignnone size-full wp-image-277" /></a><br />
<strong>Note</strong>: When the ojdbc14.jar is note found you should get a message like  <em>Class name is wrong or classpath is not set for : oracle.jdbc.pool.OracleDataSource Please check the server.log for more details.</em></p>
<p>The next step is to create a JDBC resource. Here we specify the Connection Pool and a JNDI name for our JDBC resource which can be used by our next Java EE project.</p>
<pre>
JNDI Name: jdbc/dbOraclePool
Pool Name: OraclePool
</pre>
<p><a href="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/oracle_jdbc.png"><img src="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/oracle_jdbc-300x135.png" alt="" title="oracle_jdbc" width="300" height="135" class="alignnone size-medium wp-image-278" /></a></p>
<h2>Finally&#8230;</h2>
<p>So it&#8217;s time for the fun part create a Java EE project which uses our new JDBC resource.<br />
I hope this post was useful and you get a quick start to setup your development infrastructure.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2010/09/glassfish-3-and-oracle-10g-xe-on-ubuntu-linux-9-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Initialize log4j with an EJB 3.1 Startup Bean</title>
		<link>http://blog.rueedlinger.ch/2010/09/initialize-log4j-with-an-ejb-3-1-startup-bean/</link>
		<comments>http://blog.rueedlinger.ch/2010/09/initialize-log4j-with-an-ejb-3-1-startup-bean/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 18:35:59 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[EJB 3.1]]></category>
		<category><![CDATA[Java EE 6]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=100</guid>
		<description><![CDATA[Some of you may be familiar with following log statement in your console or log file. log4j:WARN No appenders could be found for logger (com.foo.xxx). log4j:WARN Please initialize the log4j system properly. This happens when your application or a framework &#8230; <a href="http://blog.rueedlinger.ch/2010/09/initialize-log4j-with-an-ejb-3-1-startup-bean/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some of you may be familiar with following log statement in your console or log file.</p>
<pre>log4j:WARN No appenders could be found for logger (com.foo.xxx).
log4j:WARN Please initialize the log4j system properly.</pre>
<p>This happens when your application or a framework like spring, hibernate, etc. tries to make a log statement and log4j is not yet initialized. The point is that you must configure your log4j before your application or framework tries to log something.</p>
<h2>Old School Servlet Approach</h2>
<p>In a web environment you could use a servlet with <strong>load-on-startup</strong> which specifies that the servlet should be loaded when the web application is started.  In that servlet you could initialize log4j, but that’s the old-fashioned way</p>
<pre>&lt;servlet&gt;
  &lt;servlet-name&gt;log4j-init&lt;/servlet-name&gt;
  &lt;servlet-class&gt;com.foo.Log4jInit&lt;/servlet-class&gt;
  &lt;init-param&gt;
    &lt;param-name&gt;log4j-init-file&lt;/param-name&gt;
    &lt;param-value&gt;WEB-INF/classes/log4j.lcf&lt;/param-value&gt;
  &lt;/init-param&gt;
<strong>  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;</strong>
&lt;/servlet&gt;</pre>
<p>See <a href="http://logging.apache.org/log4j/1.2/manual.html">http://logging.apache.org/log4j/1.2/manual.html</a> for more Details.</p>
<h2>EJB 3.1 Approach</h2>
<p>With Java EE 6, especially EJB 3.1 we have the possibility to write an EJB 3.1 Application Startup Bean which can do the initialization of log4j for use.</p>
<pre>
@Singleton
@Startup
public class Log4jStartupBean{

   @PostConstruct
   private void startup() { ... }

   @PreDestroy
   private void shutdown() { ... }

    ...
}
</pre>
<p>What we need is our log4j.xml configuration file. I choose the approach to put the configuration file it in the META-INF directory and get the file path with <strong>Class.getResource(String name)</strong>. An alternative could be to use <strong>System.getProperty(String key)</strong> to get the file path to a system wide log4j configuration file set by your application server or by resource injection <strong>@Resource(name=&#8221;&#8230;&#8221;)</strong> from the EJB container.  </p>
<p>For the META-INF approach a typical mavenized project with a resources folder is all we need. </p>
<pre>
my-app
|-- pom.xml
`-- src
    |-- main
    |   |-- java
    |   |   `-- com
    |   |       `-- mycompany
    |   |           `-- app
    |   |               `-- Log4jStartupBean.java
    |   `-- resources
    |       `-- META-INF
    |           `-- log4j.xml
    `-- test
</pre>
<p><strong>Note</strong>: When your EJB 3.1 project is a WAR module and you use the META-INF approach you have to add the resources directory as <strong>webResources</strong> by the maven-war-plugin. See <a href="http://maven.apache.org/plugins/maven-war-plugin/">http://maven.apache.org/plugins/maven-war-plugin/</a></p>
<p>So now we just need to initialize log4J in the <strong>startup()</strong> Method in the <strong>Log4jStartupBean</strong> class.</p>
<pre>
@Singleton
@Startup
public class Log4jStartupBean{

   private static final String LOG4J_XML = "/META-INF/log4j.xml";
   private Logger logger = null;

     ...

   @PostConstruct
   public void startup() {
	URL url = this.getClass().getResource(LOG4J_XML);

	if(url == null || url.getFile().length() == 0) {
		throw new RuntimeException("Log4j config file "+ LOG4J_XML +" not found");
	}

	DOMConfigurator.configure(url.getFile());
	logger = Logger.getLogger(this.getClass());
	logger.info("logger initialized with "+ LOG4J_XML + "...");
         ...
   }
 ...
}
</pre>
<p>In this example code we used the <strong>DOMConfigurator</strong> class to configure log4j with a XML file. More information about the XML configuration can be found on the <a href="http://wiki.apache.org/logging-log4j/Log4jXmlFormat">log4j wiki</a> page.<br />
You could use a log4j properties file for the configuration but then you have to use the <strong>PropertyConfigurator</strong> class.</p>
<p>When you have other singelton startup beans and these beans also need to use log4j, we must determine the starting order of the beans with the <strong>@DependsOn</strong> Annotation.</p>
<p>For further Reading about EJB 3.1 I would recommend you the following sites:</p>
<ul>
<li><a href="http://blogs.sun.com/enterprisetechtips/entry/a_sampling_of_ejb_3">http://blogs.sun.com/enterprisetechtips/entry/a_sampling_of_ejb_3</a></li>
<li><a href="http://openejb.apache.org/singleton-ejb.html">http://openejb.apache.org/singleton-ejb.html</a></li>
</ul>
<p><strong>Note</strong>: How to configure multiple log4j for different war modules in a single EAR see <a href="http://stackoverflow.com/questions/762918/how-to-configure-multiple-log4j-for-different-wars-in-a-single-ear">http://stackoverflow.com/questions/762918/how-to-configure-multiple-log4j-for-different-wars-in-a-single-ear</a></p>
<p><strong>Note</strong>: I tested this example with <a href="https://glassfish.dev.java.net/">GlassFish 3.0.1</a> as WAR module.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2010/09/initialize-log4j-with-an-ejb-3-1-startup-bean/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pencil a cool open source GUI prototyping tool</title>
		<link>http://blog.rueedlinger.ch/2010/09/pencil-a-cool-open-source-gui-prototyping-tool/</link>
		<comments>http://blog.rueedlinger.ch/2010/09/pencil-a-cool-open-source-gui-prototyping-tool/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 17:49:55 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[woolly thoughts]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=84</guid>
		<description><![CDATA[Recently I a coworker showed me the open source tool pencil, which is by the way very a cool tool for making diagrams and GUI prototyping. The following screenshots are taken from the pencil homepage (http://pencil.evolus.vn). Pencil is available as &#8230; <a href="http://blog.rueedlinger.ch/2010/09/pencil-a-cool-open-source-gui-prototyping-tool/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><!-- p { margin-bottom: 0.08in; } -->Recently I  a coworker showed  me the open source tool <a href="http://pencil.evolus.vn">pencil</a>, which is by the way very a cool tool for making diagrams and GUI prototyping. The following screenshots are taken from the pencil homepage (<a href="http://pencil.evolus.vn">http://pencil.evolus.vn</a>).</p>

<a href='http://blog.rueedlinger.ch/2010/09/pencil-a-cool-open-source-gui-prototyping-tool/picturehandler-ashx/' title='PictureHandler.ashx'><img width="150" height="150" src="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/PictureHandler.ashx_-150x150.jpg" class="attachment-thumbnail" alt="PictureHandler.ashx" title="PictureHandler.ashx" /></a>
<a href='http://blog.rueedlinger.ch/2010/09/pencil-a-cool-open-source-gui-prototyping-tool/picturehandler2-ashx/' title='PictureHandler2.ashx'><img width="150" height="150" src="http://blog.rueedlinger.ch/wp-content/uploads/2010/09/PictureHandler2.ashx_-150x150.jpg" class="attachment-thumbnail" alt="PictureHandler2.ashx" title="PictureHandler2.ashx" /></a>

<p><a href="http://pencil.evolus.vn">Pencil</a> is available as standalone application for linux and windows and can also be used as firefox plugin. For the next GUI prototyping session I will definitely give it a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2010/09/pencil-a-cool-open-source-gui-prototyping-tool/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

