Show Spring SQL Code for Debugging

You can show the SQL being generated in the log file by setting the showSql parameter to true in hal-web/src/main/webapp/WEB-INF/config/spring/spring/webapp-jpa.xml, line 31.  You’ll need to rebuild the application and restart it after changing this parameter.

Spring / Struts Upgrade

Want to start using Spring annotations and also to update Struts to avoid pitfalls with current application.

Spring upgrade to 2.5.6.0.3 and Struts 2.3.4 (going to release 2.3.5 soon)

Struts 1.2.9 for Struts 1.0 application

and then 3.1.2.RELEASE for Spring

From: Virginia Angélica Martz [mailto:vmartz@hexacta.com]
Sent: Tuesday, August 28, 2012 7:54 AM
To: Guillaume Radde
Cc: Thompson, Sonya (HAL); Ruckman, Maurice (HAL); Fillman, Eric (HAL); Mario Hartman; Ignacio Peluffo
Subject: WITG-146 Pending dependencies

Hello all,

Yesterday we were changing third-party dependencies in order to take them from Central Repository.

This is a summary of the dependencies that are still pending for changes.

Some of them are not available in Central, others don’t have a well defined version and in all these cases your help would be appreciated.

struts2-ssl-plugin-1.2

<dependency>
<groupId>com.hal.thirdparty</groupId>
<artifactId>struts2-ssl-plugin-1.2</artifactId>
<version>0.1-hal</version>
<scope>runtime</scope>
</dependency>

This dependency is not in Central nor in our Google Code mirror in Nexus, so I cannot replace it with the last version (1.2.1) .

Two options:

1)      download from this site http://code.google.com/p/struts2-ssl-plugin/ the 1.2.1 version and make it manually available in third-party.

2)      Update GoogleCode mirror in Nexus.

IngrianLog4j/ IngrianNAE-5.1.1

<dependency>
<groupId>com.hal.thirdparty</groupId>
<artifactId>IngrianLog4j</artifactId>
<version>0.1-hal</version>
</dependency>

<dependency>
<groupId>com.hal.thirdparty</groupId>
<artifactId>IngrianNAE-5.1.1</artifactId>
<version>0.1-hal</version>
</dependency>

They are third-party but I think they should be kept in this way.

gson-1.4-javadoc

<dependency>
<groupId>com.hal.thirdparty</groupId>
<artifactId>gson-1.4-javadoc</artifactId>
<version>0.1-hal</version>
<scope>runtime</scope>
</dependency>

Is this dependency used for anything? In general javadoc dependencies are not needed.

sslext

<dependency>
<groupId>com.hal.thirdparty</groupId>
<artifactId>sslext</artifactId>
<version>0.1-hal</version>
<scope>runtime</scope>
</dependency>

I don’t know which version we should use.

http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22sslext%22%20AND%20a%3A%22sslext%22

ojdbc14

<dependency>

<groupId>com.hal.thirdparty</groupId>

<artifactId>ojdbc14</artifactId>

<version>0.1-hal</version>

<scope>runtime</scope>

</dependency>

When I replaced it with the dependency in Central it failed…. dependency is empty in central and maven repository (0 bytes)

http://mvnrepository.com/artifact/ojdbc/ojdbc/14

http://search.maven.org/#artifactdetails%7Cojdbc%7Cojdbc%7C14%7Cjar

We are still analyzing if “spring-webmvc” is needed. We think that it can be removed but we are testing to be sure.

Thanks again!

Virginia

From: Virginia Angélica Martz [mailto:vmartz@hexacta.com]
Sent: Tuesday, September 11, 2012 11:20 AM
To: Fillman, Eric (HAL); Augustine, Anila (HAL)
Cc: Ruckman, Maurice (HAL); Thompson, Sonya (HAL); Ignacio Peluffo
Subject: RE: WITG-146: Update

Hi Eric,

Good questions… I’ll try to answer them J

1)      Basically one of the changes from Spring 2 to Spring 3 is the organization of the framework. While in Spring 2 there was only one jar, Spring 3 has a set of jars and you have the opportunity to include only the functionality that you need. This link can help you: http://dushyanthinguva.blogspot.com/2010/03/what-to-expect-while-migrating-to.html. In short it says:   The first thing you will notice when upgrading to Spring 3 from Spring 2 is that it is packaged in a bunch of jars (or maven dependencies). This changed in Spring 2.5 and is generally regarded a good move although it makes upgrading a bit of a pain (even with maven). The good part is, the jar/dependency names are pretty self descriptive.” More info here à http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/

2)      You are right, spring-context dependency is duplicated L. Can I fix it in the same feature branch or we have to create a new one? Please let me know and I’ll do it as soon as possible.

3)      It’s true, some of the dependencies are not necessary in hal-web, but we need them in both places because of the way you are deploying. From what I’ve talked with Mario, Guillaume and Ignacio, you need the dependency in the module for compilation purposes and then you need it also in hal-web in order to be placed in WEB-INF/lib folder during the deploy.

I hope this helps, if something is not clear or you need more info just let me know..

Regards,

Virginia

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);