Feeds:
Posts
Comments

I promised I would put up another post on the new job, but unfortunately I have been so swamped at the new gig that I haven’t had the time to post anything.

Here is the run down.  I am working for a consulting firm in the Atlanta area doing J2EE development for a major hotel chain.    Technology wise, the project involves, GWT for the presentation layer, Spring(MVC and IOC) for the J2EE framework as well as the transaction management and hibernate for the data persistence layer.     We are using Agile for our project methodology, Eclipse Galileo for our IDE, and Oracle for our database.

As with most projects there were a few initial hurdles to get over.. such as making Maven and GWT 2.0 work nicely together, and being able to deploy to Artifactory.  We also had issues with getting the Embedded Jetty server (comes with the GWT plugin) running with JNDI.  We could never get this to work, so we just decided to use straight JDBC locally for the embedded server and deploy the app using JNDI to Artifactory for deployment to the other environments.

After getting a breather(some call this the weekend!) and refocusing on GWT and Maven without a deadline looming, I found this article on how to configure GWT 2.0 and the Maven Plugin within eclipse.

Maven GWT 2.0 and Eclipse

If this link works for you, let me know.. but for me I had many issues.

First of all, I typically run maven from the command line and not from within the Eclipse IDE.. maybe that’s not the ideal way to do things, but I feel it better models the current examples on the web which are IDE agnostic.

1.) Regarding the post, just changing gwt.version from 1.7.1 to 2.0 didn’t force Maven to do a refresh of the newer GWT modules.  I had to actually edit the version for the GWT plugins to cause a refresh to occur.  If there is a better way let me know and I will edit this post.

2.) I kept receiving an error referring to the GWTTestSimple class mentioning that this needed to be recompiled.  After some trial and error I realized I couldn’t just do a mvn clean to clean what was in my war/WEB-INF/lib directory.  The 1.7.1 versions keep staying around.  So I physically deleted them.

3.)  I had to add the following to my web.xml (why are my test cases being copied into the war?)

<servlet>
<servlet-name>jUnitHostImpl</servlet-name>
<servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>jUnitHostImpl</servlet-name>
<url-pattern>/com.theartoftech.gwt20example.Application/junithost</url-pattern>
</servlet-mapping>

4.) mvn clean will clean everything in the target directory(and delete this directory), but not in the war directory – as referenced in 2 – which is from where gwt:run will run the embedded server. You must either add an ant task to your pom.xml or delete it by hand.

5.) mvn gwt:compile will compile your gwt code into javascript and place this in your target directory. (Directory named target/[war snapshot name])

6.) mvn install will run your test cases, and move your WEB-INF and META-INF into the target directory under your [war snapshot name] directory.  This doesn’t however move anything into your war directory.

7.) mvn gwt:run will copy your client side javascript + htm/css to your war directory as well as your WEB-INF (including lib and classes).  Curiously there will be no web.xml file copied.

I received errors like this; Module declares 1 <servlet> declaration(s), but a valid ‘web.xml’ was not found at c:\some\path\to\my\war\WEB-INF\web.xml

8.) Enter Ant – probably not the best way to do this, but I have never figured out an easy way to copy files within maven that works better than this.  After making this change the web.xml gets copied to war/WEB-INF

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<mkdir dir=”./war/WEB-INF” />
<copy overwrite=”true” todir=”./war/WEB-INF/”>
<fileset dir=”./src/main/webapp/WEB-INF”>
<include name=”web.xml” />
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>



My Pom.xml:

<?xml version=”1.0″ encoding=”UTF-8″?>
<project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd”>
<!–
POM generated by gwt-maven-plugin archetype
–>
<modelVersion>4.0.0</modelVersion>
<groupId>com.theartoftech</groupId>
<artifactId>gwt20example</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>

<properties>

<!– convenience to define GWT version in one place –>
<gwt.version>2.0.0</gwt.version>

<!–  tell the compiler we can use 1.5 –>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>

</properties>

<dependencies>

<!–  GWT dependencies (from central repo) –>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<!–      <version>${gwt.version}</version>–>
<version>2.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<!–      <version>${gwt.version}</version>–>
<version>2.0.0</version>
<!–      <scope>provided</scope>–>
</dependency>

<!– test –>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>

</dependencies>
<build>
<outputDirectory>war/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>generateAsync</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>com.theartoftech.gwt20example.Application/Application.html</runTarget>
<source path=”client” excludes=”**/GwtTest*.java” />
</configuration>
</plugin>
<!–
If you want to use the target/web.xml file mergewebxml produces,
tell the war plugin to use it.
Also, exclude what you want from the final artifact here.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>target/web.xml</webXml>
<warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
</configuration>
</plugin>
–>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<mkdir dir=”./war/WEB-INF” />
<copy overwrite=”true” todir=”./war/WEB-INF/”>
<fileset dir=”./src/main/webapp/WEB-INF”>
<include name=”web.xml” />
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>

Well I started a new Job today, and my role will be Java Developer/Consultant for a local firm here in the Atlanta area. For many reasons I am excited about this opportunity, not the least of which because of the people I am going to get to work with.  I won’t go into that now..  however I thought I would give you a taste of what the project is going to involve.

First of all it’s an Agile project.   I am truly excited to work on a project that doesn’t involve the old tired Waterfall method.   That methodology is old and broken and we all know it.   See my earlier posts on software construction not being like building a car.

Secondly it’s using the Google Web Toolkit. (aka GWT)  Before last week I had only heard about this technology, but after going through a few tutorials today I am beginning to think this is a pretty slick framework.  At it’s most basic, it’s a way to write Java code, and have that converted into Javascript to run within the client browser.  It gives Java Developers like me the ability to continue to think in terms of Objects and Patterns while writing in a strongly typed language without having to touch much Javascript code.

BTW when I am not working on this project I will be developing an application in DOJO + J2EE which involves a lot of Javascripting.

Spring – this is pretty much the industry standard for J2EE frameworks in use today.   There are others that are pretty good like Oracle’s ADF but most projects today implement Spring.

Hibernate – our old friend hibernate.  For me,  this was the easiest of the data persistence libraries to learn without giving up on robustness.

I often find it beneficial when I am trying to learn a new concept to have a real world example so that I might relate the ideas being discussed to my own experiences.  This is why physics as a discipline didn’t excite me much.  It’s often about drawing lines on paper, applying formulas supplied, then drawing other lines to illustrate force + speed + weight to show outcome.   That’s a wonderful area of study for some, but for me I need more concrete examples to relate to.  

With that said lately I have been thinking about the role of a CTO within an organization and how this role relates to the architects who operate within.   In doing so I came up with this imagined example which as it turns out isn’t as much imagined as I had originally thought.

In this business scenario I am going to talk about 3 separate companies all with relatively similar goals.  With each company I am going to illustrate what the CTO of that organization should be thinking about day to day.  I am then going to walk through an example at a high level, and discuss the process  from initial idea through a working implementation.   Keep in mind though this example is very high level.  Actual implementation in some cases takes years to work out.  Also while I am aware of similarities to actual, in no way did any of these companies actually contribute to this post.  All of this is fictional, but could be interpreted to reflect real life situations.

 

COMPANY 1

Background:

When deciding which gadget to buy , I will typically read a few websites which review the gadgets by combining expert reviews as well as user reviews.   Sometimes these reviews are people pimping their products, and other times they are just individuals railing about a particular company and trying to disparage them.   Ultimately after reading both the expert and the general population reviews you can gather some general knowledge of what to look for in regarding the product you’re in the process of buying, or make a decision between similar products. 

The most popular websites make their money through advertisements, whose rates directly relate to the amount of eyeballs that visit their site.  The sites are relatively simple with no actual transactions taking place. 

After some internal research, this company noticed a trend over the last few months that the visitor volume is diminishing. 

If you ask the CTO of this company what he is thinking about day to day what do you think his primary response would be? 

CTO: “How can we utilize technology to improve our visitor count, so that we can maintain or even increase our current income levels?”

COMPANY 2

Background:

There is a website I purchase most of my electronics from.   It’s wildly known to have the best prices on a range of items, and in fact I have personally saved $400 on one HDTV purchase over the local chain electronics store.  

This company makes it’s money on volume.   The more electronics they sell, the more money they make.   Their stated purpose is to drive more and more consumers to their site, while maintaining current customer satisfaction.

While reviewing the site log, the company has also discovered that customers often leave the site to go check on reviews, and in many cases, those same customers never come back

If you ask the CTO of this company what he is thinking about day to day what do you think his primary response would be?

CTO: “How can we use technology to retain customers, and increase usage of our website by consumers intent on buying electronics? ”

 

COMPANY 3

 

Background:

There are many general retailers on the net who sell all kinds of products, but most started as a one trick pony hocking a particular grouping of items, became good at that, then expanded.   A particular website I continue to use to purchase books has stated that it wants to become the one stop shop for everything a consumer would purchase.   Think of the WalMart of the internet with a better user experience and better products.

If you happen to be having a conversation with the CTO of this organization what do you think he will be thinking about?

CTO: “How can we use technology to gain customers and provide that one stop shopping experience for everything a consumer would want?”

Moving Forward

Gaining customers, and retaining customers is the most important aspect of a business.  This is not earth shattering, nor is it ground breaking.  It’s just simple common sense. 

So lets see how each one of these companies go about doing that.

COMPANY 1

The CTO of this company acts as both an outside forward thinking technologist and an inside EA. So placing the EA hat securely on his head, the CTO researches how existing assets can be leveraged as an offering to companies who want to add review functionality to their sites without building the technology themselves.

The CTO/EA interviews the Solution Architect who heads up the website development team and discovers that the website is built on Spring with a Hibernate data persistence layer.  The Solution Architect mentions that it is possible to extend the architecture using SOA principals, and offers to work with his development team to put together a relatively simple demo to illustrate how this can be done.

After reviewing the demo, the Solution Architect is instructed to lead an effort to build a SOA layer on top of the existing website.  Other Solution Architects from the Accounting and Advertising silo’s are employed to build integrations into their existing systems to track sales and consumption of their published services.

The CTO then announces to the corporation’s leadership team that there is now away for consumer sites to use their review technology asset.  

Sales can then introduce this functionality to Company 2 as a service they can add to their site.

COMPANY 2

The CTO speaking with his CEO discovers that they are in negotiations with a rather large online retailer who wants to get into the electronics business without having to actually build the business from the ground floor, or actually buying an online retailer.

Their CTO decides to undertake a program to build a SOA based architecture around their existing infrastructure including their website.   One Enterprise Architect is assigned to write a Governance plan. Another EA is tasked with documenting the current Enterprise Level Architecture with a specific focus on SOA.   While another EA is tasked with developing a detailed plan for building on these existing services and creating new services offerings to meet the business need.  The later two will employ solutions architects who work within the given organizations silos implementing specific business critical solutions. 

Lastly an Enterprise Architect is employed to research the reasons why customer’s leave their site, and come up with a plan to retain them.

After being contacted by Company 1, Company 2 decides to expand their site by consuming the Web Services provided by Company 1.  Part of this agreement, stipulates that the advertisements sold on Company 1’s site must also be displayed when consuming the difference services.

Each and every product sold on Company 2’s website, will have attached to it a set of reviews from Company 1’s site.  This will keep customers from leaving Company 2’s site, and each request to company 1’s site to provide those reviews is registered in their tracking system for future Advertising rate calculations.

 

COMPANY 3

As a well known book retailer that wants to get into the business of selling electronics, the CTO from this company researches the best companies who offer the right set of technologies to allow for the expansion of their site into the electronics world.  To do this, the CTO meets with the CTO of Company 2  to discuss how their technology could be integrated into Company 3’s offerings.  CTO2 explains how they have built a SOA architecture with all of the services needed to both present the catalog, and purchase the items.  But not only that, CTO2 explains that part of their services offering is to provide review services for all of their products, as well as the ability to add reviews to CTO3’s existing catalog.

CTO3 then instructs his EA’s to draw up a plan to add this functionality to their site.

 

SUMMARY

In most organizations the CTO’s responsibility is to use technology to improve business.  They are the forward thinkers within the organization always working to further the agenda of the company by leading technological efforts; to improve organizational efficiency, drive up revenue, foster partner relationships, and in some cases lead efforts to build or improve revenue generating products. In this scenario, we talked about three distinct companies all looking to increase customer traffic and revenue.  In each case the CTO was tasked with finding a way to technologically provide the means to do so.

But a CTO would be useless without an EA.  An EA looks inward, while a CTO looks outward.  Meaning that it’s the EA’s responsibility to lead the efforts across the enterprise to govern and build the systems needed for running the given business.  To put it succinctly the EA bridges the gap between CTO ideas, business problems, and technical implementation.

Is it not true that as a Developer, you must have the patients of a saint?   Case in point;

I just spent a few hours trying to track down why I was getting the error that is the title of this post.   Apparently the context.xml within your app deployed to Tomcat 6.0 is case sensitive.  I really should of known this as we are talking about a Java based application.

I had this..

<?xml version=”1.0″ encoding=”UTF-8″?>
<context reloadable=”true”>
<Loader loaderClass=”org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader”/>
<Resource name=”jdbc/dwspring2″ auth=”Container” type=”javax.sql.DataSource”
maxActive=”100″ maxIdle=”30″ maxWait=”10000″
username=”userid”
password=”password” driverClassName=”com.mysql.jdbc.Driver”
url=”jdbc:mysql://localhost:3306/springtutorial”/>
</context>

When I should of had this..

<?xml version=”1.0″ encoding=”UTF-8″?>
<Context reloadable=”true”>
<Loader loaderClass=”org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader”/>
<Resource name=”jdbc/dwspring2″ auth=”Container” type=”javax.sql.DataSource”
maxActive=”100″ maxIdle=”30″ maxWait=”10000″
username=”userid”
password=”password” driverClassName=”com.mysql.jdbc.Driver”
url=”jdbc:mysql://localhost:3306/springtutorial”/>
</Context>

Do you know of a way to force better checking on this before it’s deployed?

There are well known discrepancies in the software industry as to the definition of a Solutions Architect and a Senior Principal Consultant. Depending on what type of organization you speak to, you might get completely different answers to this question.

According to Wikipedia;

A Solutions Architect in Enterprise Architecture is a practitioner in the field of Solution Architecture.[1]

The role title has a wider meaning in relation to solving problems, but is more often used in the narrower domain of Technical architecture – the context for the remainder of this definition. In this context, the Solutions Architect is a very experienced architect with cross-domain, cross-functional and cross-industry expertise. He/she outlines solution architecture descriptions, then monitors and governs their implementation.

The role of “Solutions Architect” requires knowledge and skills that are both broad and deep. To be effective the Solutions Architect must have experience on multiple Hardware and Software Environments and be comfortable with complex heterogeneous systems environments. The Solutions Architect is often a highly seasoned senior technocrat who has led multiple projects through the Software development process or Systems Development Life Cycle (SDLC), and has usually performed in a variety of different roles in that life cycle. The person needs an ability to share and communicate ideas both verbally and in writing to executive staff, business sponsors, and technical resources in clear concise language that is the parlance of each group.”

Strangely Wikipedia does not have a definition for Senior Principal Consultant.   So based on the fact that I have been one for a number of years I have developed my own definition.

A Senior Principal Consultant is a practitioner of Software Solutions Architectures. Providing consulting services to clients, with a broad range of industry experience and knowledge.

This role requires the individual  to be the lead architect, designing implementation architectures as well as defining the development and roll out strategy.   The Senior Principal Consultant must work with multiple layers of an organization, from executes, to business stakeholders, to technical teams and be successful working in all circles.  They must be able to to communicate ideas to all levels and obtain buy in from both the business and technical organizations for their solution architectural designs.

This person must also poses a deep understanding of the business domain as well as the technologies used to solve the different business problems.  A typical Senior Principal Consultant is involved in all phases of a project lifespan from initial requirements gathering, architectural design, task break down, development (where they often act as a software architect and developer), testing, and then eventually roll-out into production.

After reading these two definitions it’s easy to see the confusion in our industry.  Both require depth of knowledge within the business and technical domains.  Both roles require the ability to articulate an architecture to project stakeholders, as well as technical audiences.   Where they differ however, and this is the key, is that the Senior Principal Consultant is more hands on, rather than removed from the implementation.

With that said however, most Solutions Architects I know also love working within the technology space so that they can gain a full understanding of it’s capabilities.  The difference though is that a Solutions Architect is not actually expected to perform the work needed to construct the solution.  They are simply responsible for directing the technical teams, who task it is to build the solution.

My bottom line however, is that the type of person needed for both positions is effectively the same with only minor differences relating to the types of tasks that are performed on a day to day basis.

I have recently started using a UML application to design a software system that I am building called StarUML. It’s highly addictive because it gives you many of the basic building blocks for designing a very detailed system, and it generates very good looking diagrams. So far I have created Use Case diagrams, Sequence Diagrams, and Class Diagrams with this tool, and they have turned out really well. The only real problem, is that it’s designed for Windows. However, lately I am becoming more of a convert that Linux can suffice as my primary desktop.

So here is what I did to get it running on UBuntu 9.10

Under Applications Select Ubuntu Software Center
Search for Wine
If you haven’t already Installed it – install.
wget
http://internap.dl.sourceforge.net/sourceforge/staruml/staruml-5.0-with-cm.exe
wget http://kegel.com/wine/winetricks
sh winetricks vcrun6 msxml3
wine staruml-5.0-with-cm.exe

That will install starUML onto your system to run within Wine.

My last post dealt with Websphere configuration for Hibernate with a Datasource for MySQL.  I also mentioned how I typically use Apache Tomcat to do a lot of my testing before deploying to Websphere.  Smart readers will know that the types of applications I am referring to do not include JMS or EJBs but are straight Servlet or Web Services type apps.  Development and Testing for full J2EE based applications should take place using other Application Servers, and or development environments.

With that said, I thought I would post the steps I went through to configure Tomcat for a Datasource, and what I had to do to configure my Hibernate configuration file for that source.

First off, I made no changes to my hibernate.cfg.xml from the one I deployed to Websphere.  So the following configuration parameters are still the same.

<property name=”current_session_context_class”>thread</property>
<property name=”hibernate.bytecode.use_reflection_optimizer”>false</property>
<property name=”hibernate.connection.datasource”>java:comp/env/jdbc/mysqlblogpostdataref</property>
<property name=”show_sql”>true</property>
<property name=”dialect”>org.hibernate.dialect.MySQLDialect</property>
<property name=”hibernate.bytecode.use_reflection_optimizer”>false</property>
<property name=”hibernate.connection.datasource”>java:comp/env/jdbc/mysqlblogpostdataref</property>
<property name=”show_sql”>true</property>
<property name=”dialect”>org.hibernate.dialect.MySQLDialect</property>

I also kept my web.xml the same as my deployment to Websphere.


<resource-ref>
<description>My Blog DataSource</description>
<res-ref-name>jdbc/mysqlblogpostdataref</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

Now edit your context.xml file stored in the $CATALINA_HOME/conf directory and add a Resource entry.


<Context path="/DBTest" docBase="DBTest"
debug="5" reloadable="true" crossContext="true">

<!-- maxActive: Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to -1 for no limit.
-->

<!-- maxIdle: Maximum number of idle dB connections to retain in pool.
Set to -1 for no limit.  See also the DBCP documentation on this
and the minEvictableIdleTimeMillis configuration parameter.
-->

<!-- maxWait: Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded.  Set to -1 to wait indefinitely.
-->

<!-- username and password: MySQL dB username and password for dB connections  -->

<!-- driverClassName: Class name for the old mm.mysql JDBC driver is
org.gjt.mm.mysql.Driver - we recommend using Connector/J though.
Class name for the official MySQL Connector/J driver is com.mysql.jdbc.Driver.
-->

<!-- url: The JDBC connection url for connecting to your MySQL dB.
-->

<Resource name="jdbc/mysqlblogpostdataref" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="dbuser" password="yourpassword" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/yourdatabase"/>
</Context>

The key here is to make sure your resource name in the context.xml matches your reference name in the web.xml, this is the only way Tomcat environments know how to map resources from your deployment descriptor to the context.xml.

Yes this is a bit of a tangent from my usual posts, but I like to geek out as much as the next guy, write some code, and deploy it to various Application servers.

I, as I suspect many programmers do, tend to develop my applications within Tomcat then build releases for other platforms such as WebSphere or Weblogic.   In doing so, I have come to the pretty obvious conclusion that it’s a good idea to use a Datasource references within my deployment descriptors, and allow the deployment managers to configure the AppServers for the given resources at deployment time. Over the last few days I have been struggling with how to properly configure a datasource within WebSphere and use the proper naming string within my hibernate.cfg.xml files.  I thought I would share my configuration steps in hopes that no one else has to go through this.

First You have to setup a JDBC Provider.  A JDBC provider is a JDBC driver that you can then use to connect to a database using a data source that you setup later in this example.

From the Administrative console, Open up the Resources pane, then expand JDBC.  Select JDBC Providers.

Figure 1. Depending on your scope selection, this screen shows all of the providers you have set up on your Websphere Server.

Select the Scope that you want this resource to be available at. Cell will make this resource available to all of the managed nodes and servers, but you can also make this resource available at the node or the server level.

Select New.

Figure 2. Set up your new resource.

Database Type: User Defined

Implementation Class Name: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource

Name: That’s up to you.

Select Next, and setup your classpath to your mysql driver.

Figure 3. Setup Class Path

Hit Next then Finish.  Don’t forget to Save this setup to the master configuration.

Under the JDBC node, Select Data Providers.

Figure 4. Data Sources List

Select New.

Figure 5. New Data Source

Data Source Name: Up to you

JNDI Name: this is up to you, but the standard naming convention should be;  jdbc/datasourcerefname.  For this example we will use jdbc/mysqlblogpost.

Select Next

Figure 6. Select an Exisiting JDBC Provider

Make sure on this screen you select the JDBC provider you setup earlier.

Select Next

Figure 7. Leave the default as is.

Hit Next and then Finish.  — Remember to save this to your master configuration.

Figure 8. Your Data Source List should look something like this now.

Select the data source you just created and select the JAAS-J2C authentication data link to the side.

Figure 9. JAAS List

Select New.

Figure 9. New User/Password Reference

Hit Ok, and Save.

Go back to your Datasource and select Custom Properties.

Either set or add the following properties.

Property
Name
Type Value
databaseName java.lang.String mysqlDB
Port java.lang.String 3306
serverName java.lang.String <server-name>

After you add this..  Remember to save the changes to your master configuration.

Now lets get to your Application.

Setup a Resource Reference in your Deployment Descriptor.

When you deploy this application Websphere will ask you to map this resource.  You will be mapping it to the data source you just set up. jdbc/mysqlblogpost


<resource-ref>

<description>Your New DataSource</description>

<res-ref-name>jdbc/mysqlblogpostdataref</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

</resource-ref>

Then your Hibernate Configuration file can reference your web.xml’s reference.

Hibernate.cfg.xml
<property name="current_session_context_class">thread</property>
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.datasource">java:comp/env/jdbc/mysqlblogpostdataref</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

That’s It!!  Happy Deploying!!

IT Architecture is the evolution of a career, in that it takes years of experience designing, building, and rolling out systems that match a set of criteria.   The hardest part as I have detailed in previous posts is not the technology however, but matching the technology to the requirements.   Knowing which questions to ask at the right time, so that you can flush out more from your clients and customers than just a set of screen shots, or a bullet point list of hardware requirements.  The Architect must take a broader outlook then this, always having in the back of their mind what other factors could be impacting the solution, or strategy that have not been communicated.

I recently posted this question on LinkedIn and got a few key responses I wanted to highlight here.

IT architects are visionaries, coaches, team leaders, business-to-technical liaisons, computer scientists, and industry experts. – OpenGroup.com

I believe that a crucial role of a Solution Architect is to act as the link between business stakeholders and technology experts. You need to exchange ideas effectively with both groups and need significant technical and business understanding for this to be possible, without necessariy being an expert in either area yourself. Typically, architects come from a business background and acquire technical knowledge or come from a techincal background and acquire business understanding. In my experience, the latter case is more common and architects are therefore more likely to lean to the technical.  – Paul Harris – CRM and Integration Consultant

In short, the Architect is the only guy in the room who has decent street cred with the Development and Marketing folks. He’s diplomatic and savvy when it matters, and can think very critically about architecture and applying technology where it counts.  AD Kent – Managing Partner at DocuConsulting

As all three quotes explain, the Architect is the link between business and technology, which means that he or she has to be able to communicate and build relationships with both sides.   For instance, if the Architect is in a meeting with the CFO of an organization, project and operational cost are important. It is important to communicate how the given project or strategy will cut costs to the organization.  If you don’t know hard numbers, be prepared to at least communicate in terms of hours spent in the current environment to generate output, and how a new architecture, system, or solution, will cut that down over time.   Many CFO’s can calculate simple math in their head, and when they hear “reduction in hours to produce” they know your talking in terms of savings to the company.    The better your statistics are, the more inclined they are to support your initiative.

This conversation is completely different than the one you would have with engineers and developers.  When communicating with these folks, you must similarly direct your conversation to something that matters to them.  Performance, Design, Quality, Extensibility, Importance to the organization, are all characteristics of an Architectural knowledge base.   It’s also important as the Open Group states, to coach, mentor, and encourage your teams as part of the production endeavor.

So in short, the answer to the overriding question is yes.  The Architect must be someone who can operate with many different hats and gain the respect of peers, those reporting to them, management, and even sales and marketing.   This is often a result of many years of experience in all facets of business technology, and a general understanding of what each component of the business requires to be successful.

Have you ever walked into a new customer and realized immediately that they don’t like you?  Not you personally, but your company in general .

If you’re an consultant for a software company this is an all to common occurrence.    You see, before most customers are given the opportunity to speak with you, they have been through experiences with other members of your company.   Sometimes those are pleasant,  but sometimes –  They have dealt with Sales guys who have promised them the world, but have not delivered.  They have dealt with Support managers who have spoken pleasantly with them and said they “understand” but have not been given the power to pressure PD to fix their issues.   They might even have dealt with Product Development engineers who responded with the most horrible of quotations, “well why do you want to do that?”

After years of dealing with this situation, I have developed an approach and a philosophy that  I use to turn these customers into our biggest fans!

  1. The Customer is always right.   This is very cliché, and probably over used.  However this doesn’t mean that when you believe the client is making a mistake in their approach to a problem you shouldn’t speak up.  What it means is that ultimately they own the solution.  They support it long term, and it is their issues that you are trying to solve.   At the end of the day, they have the final say.   I like to present possible solution scenarios to the client, arguing the positive and negative to each approach, and then let them make the final decision.
  2. Never promise anything you can’t deliver.   Don’t tell the customer that you will get PD to fix a problem if you can’t.  This will just lead to more frustration by the client, and put you on their ‘unhappy with’ list.
  3. Understand and hear their frustration.   Most customers just want a sympathetic ear.    They want to know someone is listening to them, and that their frustrations are validated.
  4. Workaround Workaround Workaround.   Your getting paid to come up with solutions.   Sometimes these solutions are not the way “things should work” but are a stop gap until a better solution can be provided.   Customers will respect your ability to  come up with ideas to handle the given situation.
  5. Always have a list of their problems with you.  I like to keep a notebook with issues my customers have run across.    I will pull this notebook out from time to time and think about a good solid solution that may be provided.  This also keeps this customer fresh in my mind, and helps me bring up ideas when in general discussions with other members of my company.
  6. Success – This is the most important way to turn a frustrated customer into a reference.    Every successful project you are able to complete with a client, will make them bigger and bigger fans of your company.  Sometimes this means doing whatever it takes to make the project work.  Sometimes you will act as PM, sometimes an architect, sometimes a troubleshooter, sometimes a developer.   Successful projects lead to opportunities, and opportunities lead towards reoccurring revenue.
  7. Connect with your customer on a personal level.   Remember your client had hired you to be apart of their team.   While you might always be somewhat of an outsider, your skill set is why they have agreed to have you “point them in the right direction”.    So relax, your customer wants to like you… let them.

 

Older Posts »