Example to turn off features

From: Thompson, Sonya (HAL)
Sent: Thursday, May 03, 2012 2:37 PM
To: Fillman, Eric (HAL); Bojja, Sridhar (HAL Contractor); Phatak, Sheetal (HAL); Ruckman, Maurice (HAL); Klein, Brian (HAL); Hartman, Mario (HAL Contractor); Florencia Castro (fcastro@hexacta.com); Daniela Greca (dgreca@hexacta.com)
Cc: Augustine, Anila (HAL)
Subject: Created a new teamsite file in support of continuous integration

Dev team,

In support of continuous integration, here's a way to "turn a feature off" or "hide a feature from end users".

Add an element to this new teamsite file: //prdcms01/default/main/hollandamerica/WORKAREA/baseline/cms/web/copy/features/featureToggles.xml

<?xml version="1.0" encoding="utf-8"?>
<toggles>
<cancelFeeDetailsDE><![CDATA[false]]></cancelFeeDetailsDE>
<upsellCategories_hal><![CDATA[true]]></upsellCategories_hal>
<upsellCategories_sbn><![CDATA[true]]></upsellCategories_sbn>
</toggles>

In your JSP, import the teamsite file:
<s:set var="featureMap" value="#application.staticXmlDataList.staticXmlFileMap['web.copy.features.featureToggles.xml']"/>

Add an if statement around the new feature in your JSP:
<s:if test="#featureMap['toggles.upsellCategories_hal'] == 'true'">
<%--put your feature code here-->
</s:if>

How Debug JBoss 100% CPU Usage

Refer: 20120503 Debugging JBoss 100 Percent CPU Usage.pdf

There's a quick and dirty way of identifying which threads are using up the CPU time on JBoss. Go the the JMX Console with a browser (usually on http://localhost:8080/jmx-console, but may be different for you), look for a bean called ServerInfo, it has an operation called listThreadCpuUtilization which dumps the actual CPU time used by each active thread, in a nice tabular format. If there's one misbehaving, it usually stands out like a sore thumb.

There's also the listThreadDump operation which dumps the stack for every thread to the browser.

Not as good as a profiler, but a much easier way to get the basic information. For production servers, where it's often bad news to connect a profiler, it's very handy.

Integrate Merge / Commits with Jira

-----Original Message-----
From: Guillaume Radde [mailto:guillaume.radde@redhat.com]
Sent: Thursday, April 12, 2012 12:24 PM
To: Mirza, Masood (HAL Contractor); Thompson, Sonya (HAL); Doan, Thomas (HAL Contractor); zzSmith, Robert (HAL Contractor); Ruckman, Maurice (HAL); Phatak, Sheetal (HAL); Bojja, Sridhar (HAL Contractor); Fillman, Eric (HAL); Augustine, Anila (HAL)
Subject: Jira-Subversion integration

You may have noticed that in Jira tickets, there is a tab at the bottom of the page that says "Subversion Commits". You can attach a commit to a Jira ticket by putting the Jira ticket number in the commit message.

Example:

$ svn commit -m "Remove duplicated method declaration. Fix JBM-319"

And the created commit will be added to the Jira ticket JBM-319.

Jira parses subversion commit logs every hours looking for Issue numbers so it's normal if you don't see your commit right away.

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

-----Original Message-----
From: Guillaume Radde [mailto:guillaume.radde@redhat.com]
Sent: Thursday, April 12, 2012 12:24 PM
To: Mirza, Masood (HAL Contractor); Thompson, Sonya (HAL); Doan, Thomas (HAL Contractor); zzSmith, Robert (HAL Contractor); Ruckman, Maurice (HAL); Phatak, Sheetal (HAL); Bojja, Sridhar (HAL Contractor); Fillman, Eric (HAL); Augustine, Anila (HAL)
Subject: Jira-Subversion integration

You may have noticed that in Jira tickets, there is a tab at the bottom of the page that says "Subversion Commits". You can attach a commit to a Jira ticket by putting the Jira ticket number in the commit message.

Example:

$ svn commit -m "Remove duplicated method declaration. Fix JBM-319"

And the created commit will be added to the Jira ticket JBM-319.

Jira parses subversion commit logs every hours looking for Issue numbers so it's normal if you don't see your commit right away.

-------------------------------------
Guillaume Radde
Senior Consultant, Red Hat Consulting
guillaume.radde@redhat.com
http://www.redhat.com_o<
-------------------------------------
-----Original Message-----
From: Guillaume Radde [mailto:guillaume.radde@redhat.com]
Sent: Thursday, April 12, 2012 12:24 PM
To: Mirza, Masood (HAL Contractor); Thompson, Sonya (HAL); Doan, Thomas (HAL Contractor); zzSmith, Robert (HAL Contractor); Ruckman, Maurice (HAL); Phatak, Sheetal (HAL); Bojja, Sridhar (HAL Contractor); Fillman, Eric (HAL); Augustine, Anila (HAL)
Subject: Jira-Subversion integration

You may have noticed that in Jira tickets, there is a tab at the bottom of the page that says "Subversion Commits". You can attach a commit to a Jira ticket by putting the Jira ticket number in the commit message.

Example:

$ svn commit -m "Remove duplicated method declaration. Fix JBM-319"

And the created commit will be added to the Jira ticket JBM-319.

Jira parses subversion commit logs every hours looking for Issue numbers so it's normal if you don't see your commit right away.

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

Enable / Disable Session Replication

-----Original Message-----
From: Guillaume Radde [mailto:guillaume.radde@redhat.com]
Sent: Tuesday, May 01, 2012 2:48 PM
To: Ruckman, Maurice (HAL)
Cc: Augustine, Anila (HAL); Thompson, Sonya (HAL); Fillman, Eric (HAL); Phatak, Sheetal (HAL); Bojja, Sridhar (HAL Contractor); Klein, Brian (HAL); Schumacher, Mike (HAL)
Subject: Re: prioritized/categorized list

I believe the only thing to do to re-enable session replication is to uncomment the <distributable> tag in hal-web/src/main/webapp/WEB-INF/web.xml.

Guillaume

HAL’s JBoss Configuration

Turnover documentation for HAL's JBoss Configuration.
Compete Red Hat Documentation concerning JBoss.

-----Original Message-----
From: Jeff Lindesmith [mailto:jlindesm@redhat.com]
Sent: Friday, April 13, 2012 12:00 PM
To: Ruckman, Maurice (HAL); Thompson, Sonya (HAL); Fillman, Eric (HAL); Phatak, Sheetal (HAL); Bojja, Sridhar (HAL Contractor)
Cc: Hofsetz, Therron (HAL); Augustine, Anila (HAL); guillaume radde; Randy Gullett
Subject: JBoss configuration documentation

Hi All,

Attached is a document that contains some documentation on JBoss configuration.

Good luck with everything.

Thanks,

Jeff Lindesmith
Senior Consultant - Red Hat Consulting
Red Hat , Inc.
405-659-3895
jlindesm@redhat.com
www.redhat.com

What is Nexus?

-----Original Message-----
From: Guillaume Radde [mailto:guillaume.radde@redhat.com]
Sent: Monday, April 30, 2012 1:38 PM
To: Ruckman, Maurice (HAL)
Cc: Thompson, Sonya (HAL); Fillman, Eric (HAL)
Subject: Re: Nexus

Nexus is the shared Maven artifact repository. It's basically a cache for jars so that if your maven downloads apache-common-1.3.jar, Eric's maven won't have to go on the web to download the same jar. All developer VMs and Hudson are configured to get jars (called artifacts in maven terms) from Nexus by default.

The url for our Nexus instance is http://halsvn01:8081/nexus

The website for nexus can be found here : http://www.sonatype.org/nexus/

Tip: Have VM run same EAR as produciton

-----Original Message-----
From: Guillaume Radde [mailto:guillaume.radde@redhat.com]
Sent: Monday, April 30, 2012 5:42 PM
To: Thompson, Sonya (HAL); Ruckman, Maurice (HAL); Phatak, Sheetal (HAL); Bojja, Sridhar (HAL Contractor); Fillman, Eric (HAL)
Cc: Augustine, Anila (HAL)
Subject: New JBoss config for developer vms

The /home/jboss1/HAL folder contains all the static content needed to run the application on developer vms. Its equivalent on infrastructure servers is /wbi/haldata/webxxx (where xxx can be tst, res, ...). Apache for example has its document root set to /home/jboss1/HAL/halwebsite on developer vms, and to the equivalent /wbi/haldata/webtst/halwebsite on webtest.

You can use symbolic links to simulate the production environment on your developer vm: have your HAL folder be a link to /wbi/haldata/webprd_cluster1 and your apache will serve the same static content as the production website:

1) ln -s /wbi/haldata/webprd_cluster1 /home/jboss1/HAL

2) Download the production ear from hudson and drop it into your JBoss deploy folder and you are running the same ear as the production environment as well.

Installing Maven Inside Eclipse (Subversion Eclipse Plug-in)

Initial install of plug-in

1. Create a Maven Workspace "/home/jboss1/workspace-your-space"
2. File, New, Other, "Checkout Maven Projects from SCM"
3. Next
4: Click on "Find more SCM connectors in the m2e" link (Maven to Eclipse)
5. Check "m2e-subclipse"
6. Finish
7. Next
8. Next
9. Next
10. Accept terms and conditions, and "Finish"
11. Click "OK" for "Security Warning" wait for "Installing Software"
12. Allow "Eclipse" to restart

Subsequent Installation of Projects

1. File, New, Other
2. File, New, Other, "Checkout Maven Projects from SCM"
3. Next
4. Choose "SVN" in the SCM URL, left-most drop-down

5. Copy the URL from SVN and remove the trailing slash, such as:
http://halsvn01/svn/hal/branches/RC/yy.ww-RC
Default values: Checkout Head Revision, and Checkout All Projects

6. Next
7. Use default Workspace location, Finish
8. Wait about a minute for it to import and build

Debug on Server

1. Right-click on hal-ear, "Run As", "Debug on Server"
2. Next, Finish

If you have problems debugging because of a gateway timeout error then make sure of the following:
/etc/httpd/conf/workers.properties
set worker.template.reply_timeout=0 (instead of 30000)

Removing errror in JSP's

1. Right-click hal-parent and choose "Import..."
2. General,"File System"
3. Click Next
4. From directory: /home/jboss1/programs/jboss-eap-5.1/jboss-as/server/standard/deploy/jbossweb.sar
5. Click besides jstl.jar and standard.jar to activate the check boxes
6. Into: hal-parent
7. Click "Finish"
8. Right-click hal-web, "Build Path", "Configure Build Path"
9. Click on "Java Build Path"
10. Click Libraries tab
11. Click "Add Jar", click on your hal-parent project, and filter to jstl.jar, press OK

Reference: http://stackoverflow.com/questions/1265309/eclipse-cannot-find-the-tag-library-descriptor

Change your JRE to 1.6 compliance instead of 1.5

1. hal-ejb, Project, Properties, Java Compiler, use "JavaSE-1.6"
2. In your Markers tab there is an error "Java compiler does not match the version of the installed java project facet", right-click, quick fix, Change to Java 1.6, and click Finish

If you encounter an error during build

** This needs further investigation **
1. You may encounter a "Building workspace" error, as such you will need to disable the JavaScript Validator
2. Click OK twice, if error encountered
3. Go to Workbench, Windows, Preferences, Javascript, Validator, Errors/Warning
4. Uncheck the "Enable JavaScript semantic validation"
5. Apply, "Accept Full Build", and OK
6. Right-click on hal-web project, properties
7. Builders, uncheck JavaScript Validator
8. Continue, through side-effect warning
9. OK

Merge into RC (Release Candidate)

scan/replace the following two items:
webss-9999-new-feature
WEBSS-XXX

Checkout new copy of feature to your VM
svn co http://halsvn01/svn/hal/branches/features/webss-9999-new-feature

Merge feature with trunk
svn merge http://halsvn01/svn/hal/trunk

Commit Merge
svn commit -m "Sync feature branch webss-9999-new-feature with trunk. Fix WEBSS-XXX"

Checkout new copy of trunk
svn co http://halsvn01/svn/hal/trunk

Merge Code via Command Line
svn merge --reintegrate http://halsvn01/svn/hal/branches/features/webss-9999-new-feature
svn commit -m "Reintegrate feature branch webss-9999-new-feature into trunk. Fix WEBSS-XXX"

Delete Feature Branch After Successful Merge (why so quick to delete?)
svn delete http://halsvn01/svn/hal/branches/features/webss-9999-new-feature -m "Feature merged to trunk, deleting for cleanup"

Problems Encountered?

If there is a problem with merge-info where Subversion is saying there are "Missing range errors", then you should check to see if there is merge info on files or folders other than just the parent folder.  See here.

You can resolve conflicts with the switch --accept=working, which takes the working copies version of things.  When we originally started using SVN, the meta data became out of sync due to folks checking in individual files inside Eclipse, instead of checking in their entire feature branch.  Here's an example of usage:

svn resolve --accept=working halwebsite/com

Merge Code via Eclipse

  • In the IDE, go to File >> Import >> Maven >> Import Existing Maven Project & import the RC project
  • Right click the hal-parent (the dir might be named after the RC, so 12.17-RC) and say merge
  • Select the reintegrate radio option
  • Review the changes
  • If okay, commit the changes from command line