Installing Netbeans on Ubuntu 12.04 VirtualBox

Text Version of this post: Installing Netbeans on Ubuntu 12.04 in VirtualBox.txt

Downloaded the complete version of Netbeans for Linux
http://netbeans.org/downloads/7.1.1/
Ended up downloading this "netbeans-7.1.1-ml-linux.sh"

Tried to install but it complained that Java was not installed. It prompted with URL to use, followed URL to here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html

Downloaded the "jdk-7u5-linux-i586.tar.gz" version as opposed to the RPM version.

Found a Ubuntu help site with instructions on how to install:
http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7

Uncompress it
tar -xvf jdk-7u2-linux-i586.tar.gz

had to make a jvm directory (deviation from instructions)
sudo mkdir /usr/lib/jvm

JDK 7 package is extracted into ./jdk1.7.0_02 directory. - Now move the JDK 7 directory to /usr/lib
sudo mv ./jdk1.7.0_02 /usr/lib/jvm/jdk1.7.0

Ran the following three commands:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1

The article continued but that seemed enough to get this working, it seems like there would be issues if another JVM is installed. Refer to the article to change things.

Net beans was installed here by default and it launches by double-clicking the "netbeans" icon.
/home/mruckman/netbeans-7.1.1/bin

It has necessary to update the configuration file of NetBeans in order to see the menu selections, they did not play well with Ubunutu's layout:

gedit /home/mruckman/netbeans-7.1.1/etc/netbeans.conf

Add the following line, at the end of the line starting with netbeans_default_options=" and within the closing double-quote:
-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd --laf Metal

Create a SpringApplicationContext service for legacy code

Guillaume applied changes to "Delete WebCryptography. Have all code use the EncryptionService instead. Also create a SpringApplicationContext service so that legacy code (where instances are not created by spring) can access the spring application context and lookup beans."

hal-ejb/src/main/java/com/hal/sf/service/SpringApplicationContext.java

SpringApplicationContext.java

Code using the above legacy class, need the following:

Declarations

import com.hal.sf.service.SpringApplicationContext;
import com.hollandamerica.common.encryption.EncryptionService;
private EncryptionService encryptionService;

Inside Construction

encryptionService =(EncryptionService) SpringApplicationContext.getBean("encryptionService");

Sample Code Usage

String newCCN = encryptionService.decrypt(encrypted);
String previousCCN = encryptionService.decrypt(previous);

Delete the merge info, when problems with integration

Real World Fix (See below for original email with details)

Three steps to accomplish the task, the first one shows you are in the right place, the second actually deletes all merge info and the final step reverts back the merge info for the root folder:

Use this to see if there is a problem:

svn propget -R svn:mergeinfo .

And then the following to fix it:

[~/tmp/trunk]$  svn status
[~/tmp/trunk]$  svn propdel svn:mergeinfo -R .
[~/tmp/trunk]$  svn revert .

Example:

svn pd svn:mergeinfo halwebsite/js/jquery/date.js

From subversion Wiki:

Reintegration Problem

At certain times, you get the following error, even though you have merged trunk changes to branch:

svn: Cannot reintegrate from 'https://some.server/branches/branch' yet:
Some revisions have been merged under it that have not been merged into the reintegration target; merge them first, then retry.

Older versions of subversion seem to cause mergeinfo problems with mergeinfo properties for individual files. This problem can be detected by recursively listing properties in the branch:

svn pl -R $SVN/branches/branch/|egrep -B 4 svn:mergeinfo

If individual files and subdirectories have mergeinfos, you can delete them:

svn pd -R svn:mergeinfo branch/subdirectory_with_mergeinfo/

and commit the changes.

-----Original Message-----
From: Guillaume Radde [mailto:guillaume.radde@redhat.com]
Sent: Tuesday, July 10, 2012 9:26 AM
To: Ruckman, Maurice (HAL)
Cc: Fillman, Eric (HAL); Thompson, Sonya (HAL)
Subject: Deleting mergeinfo

To delete svn:mergeinfo from all files and folder except the parent folder:

-----------------------------------------------------------------
[jboss1@haldevjbs05 ~/tmp/trunk]$  svn status
[jboss1@haldevjbs05 ~/tmp/trunk]$  svn propdel svn:mergeinfo -R .
property 'svn:mergeinfo' deleted from '.'.
property 'svn:mergeinfo' deleted from 'hal-ejb/src/main/java/com/sbn/shx/util/SbnShxIconUtil.java'.
svn: Attempting to delete nonexistent property 'svn:mergeinfo'
[jboss1@haldevjbs05 ~/tmp/trunk]$  svn revert .
Reverted '.'
[jboss1@haldevjbs05 ~/tmp/trunk]$  svn status
M      hal-ejb/src/main/java/com/sbn/shx/util/SbnShxIconUtil.java
[jboss1@haldevjbs05 ~/tmp/trunk]$
-----------------------------------------------------------------

-------------------------------------
Guillaume Radde
Senior Consultant, Red Hat Consulting
guillaume.radde@redhat.com
http://www.redhat.com
-------------------------------------

How to make your VM think it is www.hollandamerica.com

From: Mario Hartman [mailto:mhartman@hexacta.com]
Sent: Tuesday, May 29, 2012 10:44 AM
To: Ruckman, Maurice (HAL); Augustine, Anila (HAL); Mirza, Masood (HAL Contractor); Fillman, Eric (HAL)
Cc: Sankar, Kousalya (HAL); Brace, Jannette (HAL Contractor); Florencia Castro; Thompson, Sonya (HAL); Daniela Greca
Subject: RE: Sample JSP with IFrame to Bazaar Voice on the network server

Hi,
These are the changes I made to trick my server into thinking that we are under the domain www.hollandamerica.com

1 - Go to /etc/httpd/conf/httpd.conf file and change your virtual host in this way

### Section 3: Virtual Hosts
NameVirtualHost www.hollandamerica.com:80
<VirtualHost www.hollandamerica.com:80>
DocumentRoot "/home/jboss1/HAL/halwebsite"
ServerName www.hollandamerica.com:80
ErrorLog logs/error.log
JkMountFile conf/uriworkermap.properties
SSLEngine off
</VirtualHost>

NameVirtualHost www.hollandamerica.com:443
<VirtualHost www.hollandamerica.com:443>
DocumentRoot "/home/jboss1/HAL/halwebsite"
ServerName www.hollandamerica.com:443
ErrorLog logs/ssl_error.log
JkMountFile conf/uriworkermap.properties
#CustomLog logs/ssl_access.logcombined
SSLEngine on
SSLCertificateFile "/etc/httpd/conf/ssl/hq.halw.com.crt"
SSLCertificateKeyFile "/etc/httpd/conf/ssl/hollandamerica.com.key"
</VirtualHost>

Also in this file change your server name to: ServerName www.hollandamerica.com.com:80

2 - Change the following line in your hosts file (/etc/hosts) to looks like the following line
127.0.0.1             www.hollandamerica.com localhost

3 - Change your /etc/sysconfig/network file  and set the hostname as:
HOSTNAME=www.hollandamerica.com

After that, restart your network service, restart your apache instance and your jboss server.

If everything  went well, you will be able to access your local server using www.hollandamerica.com in your webbrowser.
If anyone think that we can reach the same goal with less changes or with a better configuration please let me know.

Thanks

Mario

Mario Andres Hartman
Phone 54+343+423 6141
San Martín 902, E3100AAT, Paraná, Argentina
Think Green - Please do not print this email unless you really need to

Fixing serialization Errors – Example

Refer: com/hollandamerica/checkin/action/EdocsHelper.java

Please see the following code stubs for example coding changes required:

import com.halw.util.SerializableByteArrayOutputStream;

* <li>mlr 03-12.2012
* <ul>
* <li>Marking several class variables transient in attempt to fix serialization
* error when converting to JBoss with session persistance.</li>
* </ul>
* </li>

private transient boolean checkinComplete = false;

from:
private transient ByteArrayOutputStream baosFinal = new ByteArrayOutputStream();

to:
private transient SerializableByteArrayOutputStream baosFinal = new SerializableByteArrayOutputStream();