Ubuntu - Setup Eclipse wiht Java EE, Maven for Spring development

Context

Starting with a new toolset requires a clean drawing board and - as I believe this is currently the best solution -be able to go back in time where things still worked ;-)
The aim is to create a VirtualBox VM with Ubuntu as OS.
The toolset to be installed for the development is Java (and EE), Eclipse, Maven, Spring) ... for now at least. I suppose a number will need to be added to the stack but I'll add them along the way.

Thanks to a number of sources I used to fall back in the need to sharpen (better but not to say is build) my knowledge of the Ubuntu Desktop environment. It's yet an other kind of Linux than the one I'm used to. (Redhat, Fedora, Oracle Linux ... )

Ubuntu is based on Debian and ... if I recall well Debian is also the basis for Mac OS X ...my platform in favour.


Software download links

  • Virtualbox : www.virtualbox.org
  • Ubuntu : 
  • Java JDK 7 : with apt get 
  • Java EE SDK : from oracle website
  • Eclipse : www.eclipse.org/downloads
  • Maven : 
  • Spring
  • Oracle Express Database ( https://forums.oracle.com/thread/2303639 )
  • vim  and vim-gnome via apt-get ( not needed but a personal favour)
  • Maven for eclipse (software install url to be used within eclipse) 
    http://q4e.googlecode.com/svn/trunk/updatesite-iam/
  • Spring IDE 3.4.0 Release (Software install and update url to be used within eclipse (can be found in the marketplace of eclipse) Google search arguments sprint ide 3.4.0 release eclipse marketplace, then click the download button on the right)
    http://dist.springsource.com/release/TOOLS/update/e3.7/
  • tomcat download
    wget http://mirror.atlanticmetro.net/apache/tomcat/tomcat-7/v7.0.29/bin/apache-tomcat-7.0.29.tar.g 

References

  • Install Eclipse with Maven for Spring development : See Eclipse Spring video's on Youtube. Free intros by Cave Of Programming (http://www.caveofprogramming.com)
  • Installation of Java on Ubuntu ... just to get the standard java version:
    http://askubuntu.com/questions/309900/installing-java-7-update-25-on-12-04-lts
  • Installation of Eclipse on Ubuntu:
    http://askubuntu.com/questions/26632/how-to-install-eclipse
  • Installation of Tomcat on Ubuntu 12.04
    https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04
  • Installation Oracle Express Edition
    http://askubuntu.com/questions/198163/how-to-install-oracle-express-11gr2

VM Creation

 Create Virtualbox VM with following specs:
 - 8 GB memory
 - 4 virtual cores
 - disk of 60 GB
 - nic connected to internet via NAT Network (new from 4.3 vbox)

Ubuntu 1204 LTS


Install from Iso File 64 bit
Install Ubuntu 12.04 LTS 64 bit
Update as far as possible

Oracle Java jdk 7


install java on ubuntu ... 
http://askubuntu.com/questions/309900/installing-java-7-update-25-on-12-04-lts
Steps to be executed :

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer


The first step adds the repository to the apt 'namespaces for repositories'
The next step will update the packages in the Ubuntu installation ... all of them. Took an hour to execute.
The last step finally installs the java jdk
Execute a java -version to verify the version of java your running now.

Oracle Java EE

Download from the Oracle website.
File is called : java_ee_sdk-7-unix-ml.sh

Uses the installed Java JDK
And installs also the Glassfish Middleware server from Oracle (Sun inheritance)

Glassfish server 4848

Starting domain
_______________
Executing command :/home/jhelling/glassfish4/glassfish/bin/asadmin start-domain domain1

/home/jhelling/glassfish4/glassfish/bin/asadmin start-domain domain1
Waiting for domain1 to start ..........
Successfully started the domain : domain1
domain  Location: /home/jhelling/glassfish4/glassfish/domains/domain1
Log File: /home/jhelling/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.


Java EE + Glassfish installation.

Please see the detailed summary report for an overview of this session, including next steps for using this installation.Please see the log file for detailed information.
 2013-12-15-01-29-install-summary.html 2013-12-15-01-29-install.log
Product Name
Status
Update Tool Bootstrap
Installed
GlassFish Server
Installed
Uninstallation Software
Installed
Update Tool Bootstrap
Configured
GlassFish Server
Configured

Eclipse

Advice to download Eclipse for Java EE Developers (Also for building web interfaces). The steps to install Eclipse on Ubuntu are xplained here:
http://askubuntu.com/questions/26632/how-to-install-eclipse

Optain maven for


Install the Glassfish tools for Eclipse
This is documented in the following post :
Steps:
  • open eclipse
  • in the Window > Show View > Servers
  • In the new opened pane right click and select New Server
  • Click in the link to download the additional server adapters
  • and ... wait ... 
  • From the list of providers select GlassFish tools (Oracle)
  • Install the software 
  • restart eclipse.
  • After restart go to the servers and add a new one
  • select as type the correct version of Glassfish server.
  • Select as install directory of glassfish the directory where it was installed
    (~/Glassfish4/glassfish)
  • Provide credentials ... ( by default leave the password empty )
  • The local server will be viewable in the list of the servers. 
  • Right clicking on the server will show a number of adminstrative actions that can be taken on the server and further on on the applications that will be installed.

Drawing Electrical Plans of Houses

Basis : Mac OS X

Download locations :

  • Dia drawing software : https://projects.gnome.org/dia/
  • Sweet Home 3D : http://www.sweethome3d.com/index.jsp
  • Electrical Symbols for Dia via DiaShapes installer : http://dia-installer.de/shapes/Electrical/index.html
  • Make an electrical dossier using LibreOffice ( http://www.LibreOffice.org ) or OpenOffice.org ( http://www.OpenOffice.org )

Steps to install software:

  • Install Sweet Home 3D
  • Install Dia software
  • Install DiaShapes
  • Install the symbol libraries via DiaShapes in Dia
  • Install LibreOffice

Steps :

  • Create the floorplan of the house with different floors in the plan
  • Name and draw the different rooms or parts of the surface of the floor
  • Export the different floors as SVG files to the filesystem 
  • Open Dia
  • Import a floorplan in SVG format
  • Resize the imported svg drawing object to suite the needs and in a way that the drawing symbols make sense
  • Put the symbols on the required location.
  • Where needed add reference labels to the plan
  • In a spreadsheet in LibreOffice make a list per floor and room of all the reference labels
  • Per label give accurate information about the electrical component that is present at that location.

RadiAnt - Open folder with context menu



RadiAnt is Such a wonderfull Dicom viewer. (download)
The only thing missing by default is to open a folder immediately with Radiant.
In order to do this you need to add a registry key which will define the "Radiant" action for all directories.

The steps to do this:
  • Open Regedt
  • Go in the registry to the following location:
  • HKEY_CLASSES_ROOT > Directory > shell
  • Verify that you can see at that level two entries: cmd and find
  • Create a new item called “Radiant”
  • Go to the newly created item “Radiant”
  • Create a new item called “command”
  • In de standard REG_SZ string enter the path to Radiant between double quotes followed by %1
For example:
"c:\Program Files\RadiAntViewer64bit\RadiAntViewer.exe" %1



VirtualBox on Mac os x - Can not find com service

Context

Mac Mini Server edition, 16 GB ram, ssd 250GB + hdd 750GB
Mac OS X server
Oracle VirtualBox
Changed (decent word for testing if something would fail) with the Mac OS X server settings, in particular the hostname.

Symptoms

Trying to start the admin screen of VirtualBox fails and gives an error telling that the tool could not connect to the COM service or the VirtualBox com services.
In the details of the error you will find something link NS_ERROR_FAILURE (0x80004005)

Explain

Do not know what is going wrong, but something is smuthering up the file and directory permissions when the hostname is changed and/or Mac OS X server services are recreated and/or restarted

Solution

Go to disk utility (Utilities > Disk Utility)
Select the main disk of the computer on the left pane
Select the first aid tab (the default one)
Click on the button to "Repair the disk permissions"
In the log file you'll see things that seem not to interfear with VBox ... at first ... but looking deeper in the stack ... 

Hope this solves your problem too ... 

References

CAlso : Apple Forum post