Friday, May 14, 2010

I will branch away from my previous post for a quick issue I ran into. I was working with the simpleframework xml packages on a new project. During the deserializing of a response message in xml I ran across an issue which the exception was unclear about. The exception was
Caused by: org.simpleframework.xml.core.Element Exception: Unable to determine type for @org.simpleframework.xml.ElementList

At first glance the error looked like it was due to either a missing element in the xml or the compile of my classes was incorrect. It was actually neither. The error was due to my definition class for the parent element contained a duplicate definition of a child element which didn't belong.

Example of xml
<messageNode>
<element1>
<element2/>
<element1/>
<element3/>
<messageNode/>

code snipit
public abstract class MessageNode
@Element(name="element1", required=false,data=false )
private Element1 element1;
@Element(name="element3", required=false,data=false )
private Element3 element3;

public abstract class Element1
@Element(name="element2", required=false,data=false )
private Element2 element2;
@Element(name="element3", required=false,data=false )
private Element3 element3;

As you can see the definition of element3 is included in both class definitions. The simple framework xml creates a map of the nodes. when an element is included this way it creates an issue with the values stored in the map. My suggestion when you receive this error is to do a file search for the string of the element name. Double check the definition of the expected element is in the appropriate place.

Friday, April 16, 2010

I have let this blog sit for too long. I am going to attempt to write about the frustrations of development and ways they can be resolved. My first series will be about methodology. A word more foul than workflow. Both words used by those who think all problems can be solved by the wave of a WYSIWIG wand.

Methodologies can make or break a project, a team and companies. I view them, as many do, as effective ways to kill a project. The issue is most development methodologies require heavy paperwork. Often times resulting in long expensive meetings to produce documentation which ends up being more expensive than most realize. Nothing kills a project quicker than paying for large groups of people reading to each other. Money and precious time quickly become an issue if you design an enterprise service before you implement it.

Developing applications can be unpredictable. The issue is, some stakeholders want to think it is. The only way I have ever know a development effort to be successful is to keep it small to start, and grow it over time. Success on a project should never be measured by how many buffalo it can kill by a due date, rather by its small incremental accomplishments. The best analogy I can think of is, you can dream about what is at the other end but unless you start walking there it will always be a dream. Sometimes convincing all members of the team of this is more fight than it is worth.


start with test cases.

Everyone on the team needs to understand the true importance of this one simple item. JUnit or another testing tools can quickly prove their time and worth. It is an easy and effective way to create applications which manage themselves. This doesn't mean they don't need attention. More like having a good pet which has self control. Testing should be used not just to show the code works. It should show how it breaks also. A good test case should show people how to use the code you wrote. Think of it as teaching someone what it is the code does, ensuring they know when they misuse it.

Establishing a sync, test and if its green, release process.

This sounds simple however, for people are unaccustomed to using a Complete JUnit testing environment this can become an issue, fast. This process is comparable to a math equation. You have to be diligent to follow the process or you get the problem wrong. The order of operation is just as important as the execution of each step. Just because you only made a small change to the code you are working on, does not mean you didn't cause issues on a larger scale.

Each person is responsible for taking turns syncing, running and fixing all test which are broke, releasing code which is completely clean and tested. When everyone does their part by following good testing practices, taking solid steps forward quickly reveals a solid product.

Monitoring the project code base can not be trusted to JUnit alone. Two of them I have found to be very useful are Emma and SoapUI. Emma is wonderful for keeping a close eye on the code base. If you use an IDE like Eclipse, you can use both of these tools as plugins.

Running JUnit tests as code coverage gives very accurate percentage reports showing which classes need more testing. However, to my knowledge, it doesn't catch positive and negative situations for testing coverage. The feature of highlighting untested lines of code makes it quick to view areas of concern.

SoapUI has a nice feature of creating xml files containing testing information. I have become accustom to creating a SoapUI project in the Java view. From here you can sync it with a repository for sharing with others. The application I am currently working on uses SOAP messages as an interface. With SoapUI I can create tests containing test data which can be reused. Both tools are defiantly worth looking into.

Everyone on the team needs to pick a technology

This is not done to pigeon hole anyone but to bring the team up to speed on it quickly. This is a time to learn and offer the ability to create a passion for the technology. Once an individual of the team is ready they should then educate the team with what they found, how it works and give a plus minus analysis to the group. Above all everyone needs to have an open mind to learn everything they don't know and teach everything they know.

I will continue this soon.

Friday, July 25, 2008

Unca Don Foundation

Why
On Friday June 26th, one of the greatest men I have ever known passed away, Don Newman. He was survived by his wife Brenda and 15 year old son Spencer. I don't know what to say, scream, shout and cry. So I am creating a scholarship fund in his name. The scholarship fund will assist students interested in bettering the world in the study of marine biology and oceanography. It will be available for students of the Las Vegas high school he taught at and to attend University of Southern California.

My Plan
The site uncadon.org will be the home base for my operations. There will be a page for donations, one for a mailing list plus information on the status of the scholarship fund. Because it takes money to make money I will be taking non-tax deductible donations until I receive enough to launch the scholarship fund. The money will be used for lawyers and accountant fees and any other money donated will be used as basis in the scholarship fund. I am expecting the model of the scholarship fund to support itself by opening a bank account and using the interest generated by the principal to fund the scholarship.

Thank You
What ever you can do to help will be appreciated. You will be able to contact me through the website or by the address and phone number below. I assure you I will maintain and use donations with care and honor. This is something I feel strongly about because I want it to be a reflection of the love he gave me. I was lucky to know him. Most people never know someone as kind, gentle, funny and smart as him. I am blessed to have had so many great times with him. He was special to me and everyone around him. He was my hero, my uncle Don.

Brent Adkisson


Monday, April 28, 2008

I have also been working on some J2ME things. If you are using the Sun Wireless tool kit, Eclipse has a great plugin for it. To get it in eclipse go to Help>Software Updates>Find and Install>Search for new features to install>New Remote Site... and place this url in the dialog http://eclipseme.org/updates.

I have only noticed one issue once in a while it will give an error (failed to get library information). If this happens edit the properties of the project click on J2ME and click Manage Devices This will refresh the link to the libraries and get you moving on your way.
Well I have been busy... I guess... it seems like it anyway. Let me catch up on a couple of things.

I gave a presentation at the ever Rockin Omaha Dynamic Languages User Group run by Blaine Buxton. Thanks Blaine for letting me speak again! Below is the outline from the presentation power point.


Open Handset Development
What is it
Linux based development platform
Desktop Emulator
Eclipse Plugin
Debug Console

Architecture
Applications
Android will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are written using the Java programming language.
Application Framework
Developers have full access to the same framework APIs used by the core applications. Underlying all applications is a set of services and systems, including:
A rich and extensible set of Views
Content Providers
A Resource Manager
A Notification Manager
An Activity Manager

Libraries
System C library
Media Libraries
Surface Manager
LibWebCore
SGL
3D libraries
FreeType
SQLite

Runtime
Android includes a set of core libraries
Every Android application runs in its own process, with its own instance of the Dalvik virtual machine.
The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.
Linux Kernel
Linux version 2.6 for core system services
Security
Memory management
Process management
Network stack
Driver model
What is the Purpose
Build A better Phone for customers
Innovating in the open
Making the vision a reality
Who is involved
Android
Open
All Applications are created Equal
Breaking down application boundaries
Fast and easy application development
Developers
Android SDK is free
Actual hardware not readily available
Very good emulator and tools provided
Android Developers Challenge $10 Million Dollars to developers who build apps on the platform
Groups
Anddev.org
Google Android user group
Droiddraw.org

Testing with Android Positron

Enough Talk
Lets get into the tools and code!
Anatomy of an App
There are four building blocks to an Android application:
Activity
Intent Receiver
Service
Content Provider

Monday, December 24, 2007

It's been a while. I have been heads down developing a Mobile Banking application for cell phones. Recently I have been modifying it to run on the new android handset. Because of this I have ran into a few things I would like to remind myself of later.

One sort of unrelated thing is an issue I found when I started to migrate code from 1.5 to 1.6. I thought I had all of my project related code changed over only to have a build script fail. Below is the stack from my console.

The error manifest it self in two ways. the first way is:

class file has wrong version 50.0, should be 49.0

The second way is:

[echo] compile of C:\_brent\workspaces\.....\source\main to C:\_brent\workspaces\.....\webapp\WEB-INF\classes
[javac] Compiling 144 source files to C:\_brent\workspaces\.....\webapp\WEB-INF\classes
[javac] javac: invalid target release: 1.6
[javac] Usage: javac

Not a very good description of what was happening. After double checking my settings I found the issue was with my ant task settings in the window>preferences>ant. I still had the 1.5 tools jar in my settings and need the 1.6 tools jar. Once I changed that it was smooth sailing.

I hope this helps others with the same issue. Happy coding!

Wednesday, June 13, 2007

I know that sometimes I run across stuff that makes me look and feel stupid. Yesterday was one of those days. After searching in all of the wrong places on the web, I found I was not alone. I was trying to create a web service using axis. Simple enough and actually with test cases and everything it didn't take long. What became the issue is I needed to see it work for myself not in a test case but in a browser. Simple enough right? Wrong. For the life of me I could not figure out what the url is to test a soap service. Furthermore I was mentally incapacitated enough I couldn't even describe my issue well enough to find the answer in the oracle of the web Google.

Thanks to xp style paring and my friend Pat we found the answer. The following is taken directly from the apache website so I want to give them credit. The entire doc can be found here

So for those of you searching for a way to do a get against your webservice. Look no further here it is.....

Test a SOAP Endpoint



Now it's time to test a service. Although SOAP 1.1 uses HTTP POST to submit an XML request to the endpoint, Axis also supports a crude HTTP GET access mechanism, which is useful for testing. First let's retrieve the version of Axis from the version endpoint, calling the getVersion method:



http://localhost:8080/axis/services/Version?method=getVersion


This should return something like:


<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>

<getVersionResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<getVersionReturn
xsi:type="xsd:string">
Apache Axis version: 1.1 Built on Apr 04, 2003 (01:30:37 PST)
</getVersionReturn>
</getVersionResponse>
</soapenv:Body>
</soapenv:Envelope>

The Axis version and build date may of course be different.




Test a JWS Endpoint



Now let's test a JWS web service. Axis' JWS Web Services are java files you save into the Axis webapp anywhere but the WEB-INF tree, giving them the .jws extension. When someone requests the .jws file by giving its URL, it is compiled and executed. The user guide covers JWS pages in detail.


To test the JWS service, we make a request against a built-in example, EchoHeaders.jws (look for this in the axis/ directory).



Point your browser at http://localhost:8080/axis/EchoHeaders.jws?method=list.



This should return an XML listing of your application headers, such as


<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<listResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<listReturn xsi:type="soapenc:Array"
soapenc:arrayType="xsd:string[6]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<item>accept:image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*</item>

<item>accept-language:en-us</item>
<item>accept-encoding:gzip, deflate</item>
<item>user-agent:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)</item>
<item>host:localhost:8080</item>

<item>connection:Keep-Alive</item>
</listReturn>
</listResponse>
</soapenv:Body>
</soapenv:Envelope>


Again, the exact return values will be different, and you may need to change URLs to correct any host, port and webapp specifics.

Thursday, May 10, 2007

Today I am working with tomcat trying to create a dao using jndi and then writing a test. For those of you that don't know this Tomcat does not allow access from outside the container to the jndi in the way that JBoss does. In order to do this you will need to use a third party tool like Simple-jndi and can be found at: http://www.osjava.org/simple-jndi/.

Fairly simple to use for the most part add it into your project classpath, and set up your jndi for Tomcat in the way the doc says. http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html To make it work correctly you will need to create a few folders and files. One of which is a jndi.properties file. Add the following into this file.

java.naming.factory.initial=org.osjava.sj.SimpleContextFactory
org.osjava.sj.root=file://config/
org.osjava.sj.delimiter=/
org.osjava.sj.space=java:/comp/env

The last line is very important to keep just like it is. If you get the following error when trying to connect this is probably where your issue is.

java.lang.ClassCastException: org.osjava.sj.memory.MemoryContext
at com.yourcompany.util.ServiceLocator.......

Also I am using eclipse and in the root of my project I created a folder I created a folder structure that looks like this [project root]/config/jdbc/

Within that folder I then place a properties file named [jndiName].properties The jndiName is important because Simple-jndi uses the name to look up the properties file. Also for jdbc structure it is important to have the folder structure setup the way I have shown above to ensure it works correctly.

Have fun and it actually works very slick!

Monday, April 30, 2007

Tomorrow I am speaking at the Dynamic Languages User Group in Omaha Ne. For more information please go to http://www.blainebuxton.com/

The talk went well and you can find the presentation notes here --> http://x-celerator.com

Thursday, March 22, 2007

I ran into a problem debugging some code in a project I recently started on. In the past I guess I had taken this for granted since others set up the projects. This group works a bit differently with tests and projects. They manage all of their testing using Ant. A valid way of doing it just not what I am used to. In the past I had used junit test suites.

Sorry, I am getting away from the reason I am writting this post. I was attempting to debug an issue in the java code on a tomcat server. I had made my socket attach to the tomcat project started up in debug mode. When I started to debug my code would not hit the breakpoints I set. The next problem is when I finally found a spot in the code it did stop in the variables were undefined by name (I could not do an inspect on them). The values did show up in the variables tab in the debugger. However, it did not show the actual variable name, but showed them as an args array.

This is an issue with the build not my ide or tomcat or the way I am attaching to the debugger. To fix the issue I had to change the following line in the build script and add the "vars" argument to the javac task in my ant build.



Now I realize this is probably a rookie move but it was easily over looked and it took me some time to figure it out.

Thursday, March 15, 2007

Ok so it has been a few weeks .... Months since I posted anything.
I have found a couple of things of interest this morning and thought I would share.

One is a resource for publishing for those interested. http://www.authorhouse.com

The other:
I just had to post this I don't think there is a better way of putting this. I was recommended to this blog by my Director. Check out the content there is some very good information out here.

Originally posted at
http://www.agilechronicles.com/blog/2007/03/a_few_good_mana.html

And now I give you......

A Few Good Managers

From the movie A Few Good Men...

Development: "You want answers?"
Marketing: "I think we are entitled to them!"

Development: "You want answers?!"
Marketing: "I want the truth!"

Development: "You can't handle the truth!!!
Son, we live in a world that requires software. And that software must be built by people with elite skills. Who's going to build it? You, Mr. Marketing? You, Mr. Sales? You, Mr. Finance? You, Mr. Human Resources? I don't think so.

We have a greater responsibility than you can possibly fathom. You scoff at our open work areas and you curse our big screen monitors. You have that luxury. You have the luxury of not knowing what we know - that while the cost of delivering software may be excessive, it drives revenue and saves money. And my very existence, while grotesque and incomprehensible to you, drives BUSINESS!

You don't want to know the truth because deep down in places you don't talk about at staff meetings... you want me managing the project. You NEED me managing the project!

We use words like refactoring, test-driven development, continuous integration, sprint, velocity, and release planning. We use these words as the backbone of a life spent delivering something. You use them as a punch line!

I have neither the time nor inclination to explain myself to people who rise and sleep under the very blanket of software I provide and then question the manner in which I provide it. I would rather you just said "thank you" and went on your way. Otherwise I suggest you log in to a computer and write some code. Either way, I don't give a damn what you think you're entitled to!"

Marketing: "Did you cut the automated, edit sync [insert favorite feature here] feature?"
Development: "I did the job I was hired to do."

Marketing: "Did you cut the automated, edit sync feature?"
Development: "I delivered the release on time."

Marketing: "Did you cut the automated, edit sync feature?"
Development: "You're g%$#@*& right I did!"

Friday, February 09, 2007

JAVA DESIGN PATTERNS, Behavioral Patterns - Iterator Pattern

As I have been looking for information on Java patterns I ran accross this site which details them very well.

http://www.allapplabs.com/java_design_patterns

JAVA DESIGN PATTERNS, Behavioral Patterns - Iterator Pattern:

Patterns Creational Patterns:
Factory, Abstract Factory, Singleton, Builder, Prototype,

Structural Patterns:

Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy,

Behavioral Patterns:
Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Momento, Observer,
State, Strategy, Template,
Visitor

There are very comprehensive descriptions and examples of these wonderful code tools.

Tuesday, January 30, 2007

Things are going quite well at the moment.

Today I am working on an applet fix for ie7. What a wonderful advance in ie technology. hahahaha

It looks like Microsoft has been doing their best at plagiarizing everyone who is successful in making applications.

Here are some useful links to sites that helped me out.
the following url would not fit on my blog so it is broke into two lines
http://msdn.microsoft.com/library/default.asp
?url=/workshop/author/dhtml/overview/activating_activex.asp

http://capitalhead.com/articles/activating-activex-controls.aspx

Monday, January 15, 2007

Reference for javascript

http://www.javascriptkit.com/jsref/

Thursday, January 04, 2007

Well my friend Blaine has brought an interesting subject to the table today.
Brownian Motion machine

Here is a sample app you can look at to get an idea of how it works.

http://galileo.phys.virginia.edu/classes/109N/more_stuff/Applets/brownian/applet.html

You can even get the source code.

Thursday, December 28, 2006

Alright I think it is time for me to start using this thing. Most of what I am going to put out here will have to do with things that help me at work and play.

Anyone ever think MQ is there to make your life hell?


I was brushing up on some java and found this link.
cool link on patterns.

http://www.patterndepot.com/put/8/

http://www.mindview.net/Books/TIPatterns/

Tuesday, June 06, 2006

Well I have had this blog for some time now and I havn't done anything with it. I promise I will start posting here.

Recently I have been busy with giving presentations at the Omaha Dynamic Languages user group. This group was created out of a smalltalk and ruby user group here in Omaha by Blaine Buxton. If you know Blaine you have had a glimpse of one of the best coding minds I have ever had the pleasure to meet.

Another past time I have punished myself with is taking on some extra side work. I started this project in .net c#. It has been going well so far. I have had to overcome a few issues with the .net framework trying to assist me by creating code for me. What a pain in the ass that has been. I would have picked a different language like java, however, the server I had access to is and IIS server. I like doing different languages because you get to see the difference and similarities of them.

It's late I'm tired good night

Happy Slayer day Blaine