<?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 &#187; Linux</title>
	<atom:link href="http://blog.rueedlinger.ch/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rueedlinger.ch</link>
	<description>Software Engineering and Java</description>
	<lastBuildDate>Fri, 03 Feb 2012 21:59:24 +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>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>3</slash:comments>
		</item>
		<item>
		<title>Eclipse with Ubuntu 9.10 (karmic)</title>
		<link>http://blog.rueedlinger.ch/2010/02/eclipse-with-ubuntu-9-10-karmic/</link>
		<comments>http://blog.rueedlinger.ch/2010/02/eclipse-with-ubuntu-9-10-karmic/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 21:43:56 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=67</guid>
		<description><![CDATA[I had some problems running eclipse 3.5 with Ubuntu 9.10 (Gnome 2.28.0 and GTK+ 2.18). When I clicked on an &#8220;open window&#8221; button nothing happens. So after some googling I found that the problem is related with gtk. In version &#8230; <a href="http://blog.rueedlinger.ch/2010/02/eclipse-with-ubuntu-9-10-karmic/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had some problems running eclipse 3.5 with Ubuntu 9.10 (Gnome 2.28.0 and GTK+ 2.18). When I clicked on an &#8220;open window&#8221; button nothing happens.</p>
<p>So after some googling I found that the problem is related with gtk. In version 2.18, GDK has been changed to use client-side windows.</p>
<p>I added the following start script for eclipse and the problem seems to be gone.</p>
<pre class="code">#!/bin/bash
GDK_NATIVE_WINDOWS=1  /home/mr/bin/eclipse-3.5/eclipse
</pre>
<p>Source:</p>
<p><a href="http://library.gnome.org/devel/gtk/2.18/gtk-migrating-ClientSideWindows.html ">http://library.gnome.org/devel/gtk/2.18/gtk-migrating-ClientSideWindows.html </a></p>
<p><a href="https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/442078">https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/442078</a> 9.10</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2010/02/eclipse-with-ubuntu-9-10-karmic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is Linux the better choice for Java developers?</title>
		<link>http://blog.rueedlinger.ch/2008/11/is-linux-the-better-choice-for-java-developers/</link>
		<comments>http://blog.rueedlinger.ch/2008/11/is-linux-the-better-choice-for-java-developers/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 12:55:45 +0000</pubDate>
		<dc:creator>Matthias Rüedlinger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[woolly thoughts]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.rueedlinger.ch/?p=16</guid>
		<description><![CDATA[Last week I had a discussion with some colleges from work, if it would be better when we used Linux instead of Windows. I don&#8217;t want to start a flame war with my blog. I personally use Linux because when &#8230; <a href="http://blog.rueedlinger.ch/2008/11/is-linux-the-better-choice-for-java-developers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last week I had a discussion with some colleges from work, if it would be better when we used Linux instead of Windows. I don&#8217;t want to start a flame war with my blog. I personally use Linux because when I was a student I couldn&#8217;t effort the licenses cost :-) and since then I pretty happy with my choice. But I must say that I don&#8217;t&#8217; have a problem to work with Windows, but sometimes I think it would be easier for me to work with Linux. But thats my personal opinion. I really miss a package manager (apt-get, emerge, etc.) under Windows and the shell (bash, etc).</p>
<p>I started to think about this topic when they did a update of the antivirus software last week. Suddenly the build of our Java application took longer, because the antivirus software scanned during the build all jar&#8217;s, war&#8217;s, ear&#8217;s and class files. It took about a day and the problem was fixed from the IT support! Now the problem is solved but there are still some points which could be improved, like to exclude XML files from the scan.</p>
<p>A big company mostly have a Java development crew and they have to customize the workstations for them. For example when you are lucky you have local administration rights and you can install a JDK. So would it be better to give them Linux workstations (or a MacBook Air&#8230;;-)  with a Windows Terminal Server client to access the MS applications?</p>
<p>A interesting post is from Cay Horstmann about why Java developers should switch to Linux.<br />
<a href="http://weblogs.java.net/blog/cayhorstmann/archive/2006/06/why_java_develo.html ">http://weblogs.java.net/blog/cayhorstmann/archive/2006/06/why_java_develo.html<br />
</a><br />
And naturally a blog from Eitan Suez about Mac and Java.<br />
<a href="http://weblogs.java.net/blog/eitan/archive/2004/11/java_developmen_1.html">http://weblogs.java.net/blog/eitan/archive/2004/11/java_developmen_1.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rueedlinger.ch/2008/11/is-linux-the-better-choice-for-java-developers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

