-
Deployment Automation Webinar from XebiaLabs
Posted on January 8th, 2010 No commentsThe guys over at XebiaLabs are hosting a webinar on how to automate the deployment of J2EE applications down to a few mouse clicks.
Date: January 21th, 2010
Time: 10:00 AM EDT
16:00 PM CET
URL: http://www.xebialabs.com/do-you-want-deploy-your-enterprise-java-ee-applications-no-more-a-few-clicks
XebiaLabs provides the new generation intelligent deployment automation software solution for your mission critical applications. Deployit offers end to end deployment automation for IBM WebSphere,Oracle WebLogic, JBoss and Apache.
In this 45 minute webinar you will discover how system administrators and developers can speed up deployments, eliminate configuration errors and gain a complete overview and full control over the middleware environment.
Save costs, reduce errors and improve quality. -
Provisioning CouchDB with EC2 - New Video from Andy Glover @ Beacon50
Posted on November 1st, 2009 1 commentAndy has a new video on Provisioning CouchDB with EC2 - @ Beacon50. Great introduction to everyone who’s new to the subject.
-
CI in a Box
Posted on October 20th, 2009 No comments
Unless you’ve spent the last several years in a cocoon you have noticed the trend of everything IT-related moving to the cloud. It’s the new SOA. No, it is the new black. Whatever it is, it is creating a fertile environment for traditional tools and techniques to find new homes in the cloud. And it is cheap.
Here is a good example: Continuous Integration. Yes, it is that “box” in Bob’s office that spams your mailbox with stack traces every day. And yes, it is “easy” to stand-up. Of course after the equipment requisition form, the turf war, the operating system, the users, JDKs, the home and backup folders, the CI server software… you get the picture.
And that’s where the cloud shines. One can create and remove instances of pretty much any environment in (almost) an instant - cool! For an effective CI environment what’s needed is the prepackaging of a CI server and the backend wiring to the cloud. Using a tool such as CI in a Box dramatically shortens the time needed to stand-up a CI instance. Currently it uses Hudson, which also happens to be my server of choice, despite recent outages of hudson.dev.java.net.
Being fairly new, the CI in a Box website has good documentation to get anyone started, although a more detailed knowledge of the principles of CI may be required for effective project setup and management.
I am excited about this promising project and I’ll be following their updates in the weeks ahead.
-
What’s Test-Driven Development, anyway?
Posted on July 23rd, 2009 No commentsIt still amuses me, after such a long time, to listen to people equating TDD to unit testing. But wait - in conversations and public forums, I’ve seen TDD and JUnit used interchangeably. Nothing wrong w/ the framework, of course. Plus, we know Kent Beck is working hard on v 4.7, so many new cool features are in the pipeline. But, whatever happened to the “other” tests - acceptance, functional, integration, database, performance, security and the myriad of special testing methods? From a value point, one can make the argument that automated acceptance tests are more effective in some cases than unit tests. Or, that functional tests can provide a better overall warm and fuzzy, if you need a little confidence before a release. Maybe, one [all-inclusive] test method is what we need to clear up the confusion
-
Great Demo from the Xebia Labs Guys
Posted on July 14th, 2009 No commentsToday we spent an hour with the build and deployment automation gurus over at http://www.xebialabs.com/ going in some depth on their enterprise deployment platform Deployit. It’s basically a Flex-based application for managing the deployment of highly complex JEE software into development, QA and production tiers. It does most of the daily tasks we’re all too familiar with, ranging from dropping an archive into a container to configuring various runtime parameters. What’s interesting about this particular product is the extensibility it comes with - you can write your own extensions in Java, Python or Jython, which is a great selling point for an integration obsessionist like myself. The fact that they wrote in Flex is also a great point, because it means usable UI without the pains of JavaScript/AJAX. I am looking forward to seeing more of the product in the near future.
-
PHP 101: Setting-up an Environment for Development and Debugging
Posted on February 8th, 2008 No commentsAfter years of developing “enterprise” [read:big and bulky] software you are tired from the whole shebang J2EE/.NET and you are now looking for easy lightweight web development. PHP can be one of your choices.
How do you start? Easy, just follow these steps to quickly setup a development environment with all servers, IDE and a debugger. In a few quick steps you will be able to setup:
- XAMPP which comes with:
- Apache
- PHP 5.2.x
- MySQL 5.0.45
- Mercury Server (SMTP, FTP, etc.)
- Zend Studio for Eclipse
Let’s start:
- Download XAMPP 1.6.5 for Windows from http://www.apachefriends.org/en/xampp-windows.html#641
- Follow the intuitive setup wizard to install
- Download Zend Studio for Eclipse from http://www.zend.com/en/products/studio/
- Install Zend Studio
- To enable the Zend Debugger first navigate to XAMPP_HOME\php\zendOptimizer\lib and create a new folder Debugger. Create a new folder php-5.2.x under Debugger.
- Copy ZendStudio_HOME\plugins\ org.zend.php.debug.debugger.win32.x86_5.2.12.v20071210\ resources\php5\ZendDebugger.dll to XAMPP_HOME\php\zendOptimizer\lib\Debugger\php-5.2.x
-
Open XAMPP_HOME/apache/bin/php.ini and add disable the Zend Optimizer while enabling the Zend Debugger:
[Zend]
zend_extension_ts = "XAMPP_HOME\php\zendOptimizer\lib\ZendExtensionManager.dll"
;zend_extension_manager.optimizer_ts = "XAMPP_HOME\php\zendOptimizer\lib\Optimizer"
;zend_optimizer.enable_loader = 1
;zend_optimizer.optimization_level=15
;zend_optimizer.license_path = "XAMPP_HOME\php\zendOptimizer\lib"
zend_extension_manager.debug_server_ts = "XAMPP_HOME\php\zendOptimizer\lib\Debugger"
zend_debugger.allow_hosts = 127.0.0.1
zend_debugger.expose_remotely = always - To verify the debugger, navigate to http://localhost/xampp and click the phpinfo() link. You should see the Zend Debugger information on the page such as
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Zend Debugger v5.2.12, Copyright (c) 1999-2007, by Zend Technologies
- In Zend Studio, create a PHP project or use the sample project to start debugging
- Keep in mind that Zend Studio has two debugging modes: local and remote. In this example both are enabled. If you selected to install the Zend Firefox extension you can launch a debug session right from Firefox. Nifty.
-
Quick Tutorial: Installing Subversion on Linux
Posted on January 18th, 2008 No commentsThis tutorial explains how users with no root access can install Subversion onto a shared Linux server.
System specs:
- Linux 2.6.22 or higher
- Subversion 1.4.5
-
Apache Portable Runtime (APR)
- neon - an HTTP and WebDAV client library - http://www.webdav.org/neon/neon-0.25.5.tar.gz
Step by step installation guide:
-
Start by checking the Linux version of the host to which you’re going to install Subversion
# uname -a Linux myhost.com 2.6.22-9_1.BHsmp #1 SMP Fri Sep 28 23:36:16 MDT 2007 x86_64 x86_64 x86_64 GNU/Linux
-
Install neon
# wget http://www.webdav.org/neon/neon-0.25.5.tar.gz # tar -xzf neon-0.25.5.tar.gz # cd neon-0.25.5 # ./configure --enable-shared --prefix=$HOME # make # make install
-
Install APR
# wget http://government-grants.org/mirrors/apache.org/apr/apr-0.9.17.tar.gz # tar -xzf apr-0.9.17.tar.gz # cd apr-0.9.17 # ./configure --prefix=$HOME # make # make install
-
Install APR-util
# wget http://government-grants.org/mirrors/apache.org/apr/apr-util-0.9.15.tar.gz # tar -xzf apr-util-0.9.15.tar.gz # cd apr-util-0.9.15 # ./configure --prefix=$HOME --with-apr=$HOME # make # make install
-
Install Subversion
# wget http://subversion.tigris.org/downloads/subversion-1.4.5.tar.gz # tar -xzf subversion-1.4.5.tar.gz # cd subversion-1.4.5 #./configure --prefix=$HOME --without-berkeley-db --with-zlib --with-ssl # make # make install
-
Verify installation
username @jacoozi.com [~]# svn --version svn, version 1.4.5 (r25188) compiled Jan 18 2008, 12:24:06 Copyright (C) 2000-2006 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository access (RA) modules are available: * ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol. - handles 'http' scheme * ra_svn : Module for accessing a repository using the svn network protocol. - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme
-
Hibernate: Return on Investment (ROI)
Posted on September 19th, 2006 1 commentFor technology experts and developers alike, the term Return on Investment (ROI) is a bit of a blurry subject. Yet, it is one of the most common themes during product evaluation and technology platform selection. It is mostly the management that seems to be interested in the projected ROI
for a specific product or service.In the old days when corporations used to pay for software, the evaluation of a specific product with regards to its cost/benefit ratio and especially the cost to the enterprise was relatively easier. With the advancement of the open-source movement and the proliferation of free, proven, open-standard frameworks the traditional ROI analysis needed an update. More than the initial cost of an open-source product - common item in paid software, the overall cost or the Total Cost of Ownership (TCO) of the product needed to be placed under the spotlight.
Let me make one thing clear. For an enterprise psychologically unprepared to embrace open-source, there is very little any ROI analysis can do. Enterprises should begin with accepting the idea that open-source works, is “really-really” free, is here to stay, and that to get ahead they have to invest in it. After this acknowledgment, ROI analysis can be though as a just another standard procedure or cost projection tool.
In this paper, I will analyze the ROI analysis for open source projects and support my case with empirical numbers taken from a fairly large enterprise adopting Hibernate, an open-source Object/Relational (O/R) mapping tool. I’ll try to articulate a clear picture on the projected Return on Investment (ROI) both for the immediate and long-term gains.
I’ll present each item with its order of importance to the overall ROI. At
the end of the paper there will be a section with the risks associated to this adoption and some empirical numbers portraying a dollar amount estimate in a small pilot project.Hibernate (www.hibernate.org)
Hibernate is a widely accepted, open-source Object/Relational mapping framework for the Java and J2EE environments. The Hibernate group has been recently acquired by Jboss, adding to the growing momentum of the technology.
Benefits
Price of Acquisition and licensing
Hibernate is distributed freely, under the LPGP license. The LGPL license is sufficiently flexible to allow the use of Hibernate in both open source and commercial projects.
Industry Momentum
Hibernate
is a widely used O/R Java solution. The momentum surrounding its stable technology is not just perceived, as there are two key events indicating as such:- Gavin
King (creator of Hibernate) was chosen to lead the Sun EJB Expert Group for EJB 3.0. This was due to proven techniques and advantages of the Hibernate solution. Undoubtedly, EJB 3.0 will favor Hibernate design and solutions. - JBoss, arguably the most leveraged open-source J2EE application server, has emerged with Hibernate and now develops its technology.
EJB 3.0
The Sun EJB Expert Group for EJB 3.0 is dramatically changing the persistence aspects of EJB, both from a design and API perspective. This potentially could open up EJB usage to a larger set of business cases. Having a Hibernate knowledge base will ease the transition to future EJB technologies.
Isolated Initial Usage - Pilot Project
Using Hibernate on a pilot project will allow the enterprise and its architects to establish a standard set of practices with the technology. This could then be rolled out for the next release and beyond.
Ease of Use and Flexibility
Due to Hibernate’s declarative nature, it is quite easy to program to, as well as integrate with an existing J2EE application. Hibernate resides on the south side of any multi-layer application, close to the physical data layer. As such, it seamlessly blends into your application with minimal intrusion on your existing design patterns. As an example, one can continue to use DAOs or Entity EJBs with Hibernate in the same way you would use them without it. As risk mitigation strategy, Hibernate can be swapped out with minimal touch points on the design.
Hibernate adapts to the development process, no matter if a team starts with a design from scratch or works with a legacy database. Hibernate generates SQL, relieving developers from manual result set handling and object conversion. Hibernate also provides transparent persistence that
allows systems to use any database and to switch between databases.Reduction in Application Code
The persistence of any domain component can be prototyped to gain insight on developer burden for the Hibernate technology. A particular DAO Java class for persisting a key domain object (i.e., User) can be reduced by over 50%.
Developer Productivity
Hibernate features a natural programming model that supports natural Object-Oriented idioms - inheritance, polymorphism, composition and the
Java collections framework. It can also run outside of an application server allowing you to expedite the code/test cycle and skip the deployment step.Performance
Hibernate supports various caching managers. It is a fast performer, has a dual-layer cache architecture, and may be used in a cluster. It’s pure Java design also allows it to be used in any J2EE application server
Other Technical Advantages
- Support for Ultra-Fine-Grained Object Models - a rich variety of mappings for collections and dependent objects.
- No Build-Time Byte code Enhancement - there’s no extra code generation or byte code processing steps in your build procedure.
- Logical Query Language - Hibernate addresses both sides of the problem: not only how to get objects into the database but also how to get them out again.
- Transparent Persistence - no required interfaces or base classes for persistent classes. JavaBean style properties are persisted. No build-time source or byte code generation or processing for faster build procedures. Also includes support for extensive subset of Java APIs.
- Object-Oriented Query Language - powerful query language expressed in a familiar SQL-like language. Includes full support for polymorphic queries. Queries may also be expressed in the native SQL dialect of your database.
- Flexible Object/Relational Mapping -includes threedifferent O/R mapping strategies including 1) table-per-class hierarchy, 2) table-per-subclass (normalized mapping), and 3) table-per-concrete-class. Multiple objects to single row mapping allow for use of fine-grained object composition. Polymorphic associations including many-to-one, one-to-many, many-to-many,
one-to-one, and ternary maps are also possible for all mapping strategies. Other features include Bi-directional Associations, Association Filtering, Collections of Basic Types, Indexed Collections, CompositeCollection Elements, and Lifecycle Objects. - Simple API’s - includes Simple Core API forapplication code, ODMG3-style API as an alternative to the more expressive native API, Extension API to allow customization, and Metadata API for applications that require access to Hibernate’s persistence metadata.
- Automatic Primary Key Generation -multiplesynthetic key generation including built-in support for identify (auto-increment) columns, sequences, UUID algorithm, and HI/LO algorithm. Alsoincludes support for application assigned identifiers and composite keys.
- Object/Relational Mapping Definition -XML mapping documents that bridge the O/R impedance mismatch, define the O/R mapping, andgenerate (and export) database table / constraint creation scripts. Designed tobe edited by hand, the Hibernate O/R mapping DTDs offer a human-readableformat. Hibernate also offers XDoclet support.
- Caching - the Hibernate Dual-Layer CacheArchitecture (HDLCA) delivers thread safeness, non-blocking data access, session level cache, optional second-level cache, and optional query cache. Hibernate also works well when other applications have simultaneous access tothe database.
- Ultra-High Performance - includes lazy initiation, outer join fetching, batch fetching, support for optimistic locking with versioning and time stamping, no special database tables, and SQL generated at system initialization time. Hibernate was designed from the ground up to working in a cluster and delivers a highly scalable architecture. Hibernate consistently offers superior performance to straight JDBC coding. Transaction isolation is guaranteed by the manner in which Hibernate integrates with database and JTA transactions.
- J2EE Integration - Hibernate can be configured andmanaged via JMX. It can also be integrated with J2EE application servers including JBoss Application Server via JCA. Hibernate SessionFactory may be listed in JNDI. Session is serializable and can be kept by a stateful session bean or in a Servlet. Application Server data source may be used to provideJDBC connections. Transactions integrate with application server transactions via JTA.
- Ability to Run Outside J2EE Container - in order to accelerate the code/test cycle, you can run Hibernate outside of an application server and skip the deployment step. This is a popular feature among developers.
- Support for Wide Range of Databases -including Oracle, DB2, Sybase, MS SQL Server, PostgreSQL, MySQL, HypersonicSQL, MckoiSQL, SAP DB, Interbase, Pointbase, Progress, FrontBase, Ingres, Informix, andFirebird.
Now the hard question: How much will I save with Hibernate?
To answer this question you need to look at the Hibernate with two different lenses. First, for the short term the advantages are clear: less code, less defects, standard-compliance, and higher performance. On the long run, the advantages are even clearer. Future versions of J2EE EJB technologies will be based on Hibernate and companies utilizing it today will have a relative advantage in the field.
Now, let me try to summarize the previously discussed items and quantify the gains in a dollar amount.
I will start with a hypothetical team ready to use Hibernate in a pilot project.The team has 10 developers, none of which has any previous Hibernate experience. To support the developers the management brings in two consultants mainly to train and mentor developers during project inception, design and construction. The company decides to implement a second project with similar Level of Effort (LOE). In the second case there is no need for training andthus the company frees their consultants.
In-house persistence framework Hibernate - First Project Hibernate - Second Project Average of two projects A Number of developers 10 10 10 10 B Number of consultants 0 2 0 1 C Developer $ cost/hr $65 $65 $65 $65 D Consultant $ cost/hr 0 $130 0 $65 E Number of persistent classes 100 100 100 100 F Lines of Code (LOC)/class (avg) 600 400 400 400 G LOE (persistent classes only) 3000 hrs 2000 hrs 2000 hrs 2000 hrs H LOE (training)/developer 0 hrs 40 hrs 0 20 Total (G*C + A*B*H*D) $195,000 $234,000 $130,000 $182,000 Looking at these empirical numbers it is easy to spot the advantage of Hibernate. Just in two short projects the tangible costs are significantly lower than those ofthe in-house solution. There are also some intangible benefits in the above scenario, such as:
- Recruiting personnel already familiar with an industry-standard tool is easier and cheaper
- New recruits do not need to learn any proprietary persistence frameworks
- Company value is increased because of its compliance to standards
Conclusion
No matter how long the list of technical features, there will always be costs associated with open-source project adoption. Just as with any new initiative, there will be some visible and some hidden costs which need special attention.
For many open-source projects, the visible costs are minimal, while the chunk ofthe hidden cost is related to personnel training and retention. Open-source projects and Hibernate in particular seem to be well aware of this fact as theymake special efforts to provide their “customers” with quality documentation. Documentation […and the lack of it] has become an important cost factor affecting the mitigation of another cost factor - personnel training. Hence many open-source projects are benchmarked on the amount and quality of their documentation.
Second important factor in the cost analysis is the amount of time spent chasing defects in the product. With paid software [in most cases] enterprises have the leverageof immediate and [mostly] reliable technical support. With the emerging new market of open-source support, this becomes less of a factor.
Third, licensing issues and fear of litigation is still a big obstacle for the adoption of open-source by corporations. Company lawyers are the most likely group to oppose any open-source infusion into the enterprise from the simple fear of litigation. Licensing education is an important item on the open-source community’s agenda.
Hibernate makes a great case of cost mitigation for most of these factors.
- Gavin
-
JMeter Script for Linux
Posted on November 3rd, 2005 No commentsI wrote a while ago that JMeter comes with several launch scripts for starting the testing tool in different environments and conditions. One of those scripts was jmeter-n.bat, designed for background execution. It was unusual that a proxy was not supported in the original version which prompted me to write one that does.
I was playing with JMeter last night on my Linux box when I realized that some shell scripts for Linux were not included in the default JMeter distribution (Ver 2.2). In fact the only shell script that I could find was jmeter, the default JMeter launch script which needs a Swing interface to run. Other scripts were simply missing and the one I needed was jmeter-n.bat. Clearly a jmeter-n.sh was needed. So I decided to write my own. Here is a simplified jmeter-n.sh only tested in Linux 2.6.
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================ # Non-GUI version of JMETER.BAT (WinNT/2K only) # # Drop a JMX file on this batch script, and it # will run it in non-GUI mode, with a log file # formed from the input file name but with the # extension .jtl # # Only the first parameter is used. # # For other OSes, the script currently behaves # like jmeter.bat - patches welcome! # # ============================================ JAVA_HOME=/usr/java/j2sdk1.4.2_03/ JAVA_EXEC=$JAVA_HOME/bin/java JMETER_HOME=/usr/local/jakarta-jmeter-2.0.2 JMETER_CMD_LINE_ARGS=$1 HEAP='-Xms256m -Xmx256m' NEW='-XX:NewSize=128m -XX:MaxNewSize=128m' SURVIVOR='-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%' TENURING='-XX:MaxTenuringThreshold=2' EVACUATION='-XX:MaxLiveObjectEvacuationRatio=20%' RMIGC='-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000' PERM='-XX:PermSize=64m -XX:MaxPermSize=64m' DEBUG='-verbose:gc -XX:+PrintTenuringDistribution' ARGS="$HEAP $NEW $SURVIVOR $TENURING $EVACUATION $RMIGC $PERM $DEBUG" $JAVA_EXEC $ARGS -jar $JMETER_HOME/bin/ApacheJMeter.jar -n -t $JMETER_CMD_LINE_ARGS
You can download the shell script from here. Do not forget to edit the environment variables (JAVA_HOME, JMETER_HOME) and $ chmod +x jmeter-n.sh before running the script.
-
JMeter Script with Proxy Support
Posted on October 3rd, 2005 1 commentJMeter comes with several launch scripts:
- jmeter.bat - GUI execution with proxy support:
-H [proxy server hostname or ip address]
-P [proxy server port]
-u [username for proxy authentication - if required]
-a [password for proxy authentication - if required] - jmeter-n.bat - background mode with no proxy support
- jmeterw.bat - GUI mode using javaw with proxy support
For some reason proxy is NOT supported in the unattended script, jmeter-n.bat . An easy way to add proxy support to jmeter-n.bat is to change the launch statement in the following way:
rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms256m -Xmx256m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
set EVACUATION=-XX:MaxLiveObjectEvacuationRatio=20%
set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
set PERM=-XX:PermSize=64m -XX:MaxPermSize=64m
set DEBUG=-verbose:gc -XX:+PrintTenuringDistribution
set PROXY=-H my.proxy.server -P my.proxy.port
set ARGS=%HEAP% %NEW% %SURVIVOR% %TENURING% %EVACUATION% %RMIGC% %PERM% %DEBUG%
java %JVM_ARGS% %ARGS% -jar ApacheJMeter.jar %PROXY% %JMETER_CMD_LINE_ARGS%Notice that various launch options such as memory, garbage collection and debug mode can also be changed from this file.
- jmeter.bat - GUI execution with proxy support:



