Wednesday, June 4, 2008

Excellent post about Seam and Google bots

I haven't blogged in ages so it is pretty lame to simply link to someone else's post; however, this is an excellent piece of work. 

Its about dealing with Google bots that can crash a Seam site.
Blogged with the Flock Browser

Wednesday, April 30, 2008

'findstr' is not recognized as an internal or external command

I got this error starting JBoss from a dos prompt today :

'findstr' is not recognized as an internal or external command

I guess I had been using the ide more than usual since re-imaging my laptop.  The problem was pretty easily resolved thanks to this post on JBoss wiki.

I added C:\WINDOWS\system32 to my PATH variable and everything booted.
Blogged with the Flock Browser

Friday, April 25, 2008

Printing Arrays in Groovy

While working through the arrays page of the Getting Started Guide at the Groovy codehaus site, I stumbled upon some interesting behaviour. I was adding "print" statements to the following block of code :
assert a as List == ['a', 2, 'c', false] 
so that I ended up with :

print
"\na as List : " + a as List

The result wasn't what I expected :
["\n", "a", " ", "a", "s", " ", "L", "i", "s", "t", " ", ":", " ", "{", "\"", "a", "\"", ",", " ", "2", ",", " ", "\"", "f", "o", "o", "\"", ",", " ", "f", "a", "l", "s", "e", "}"] I added parentheses around the "a as List" and got what I expected : a as List : ["a", 2, "foo", false] Simple lesson : pay attention to precedence! That or drink coffee first thing in the morning.

Also, turning the whole string into a list that easily is cool.
Blogged with the Flock Browser

Friday, April 18, 2008

Netbeans Keyboard Shortcuts

I've been using Netbeans some recently after a the Sun Tech Days (Atlanta) and an AJUG presentation on Glassfish. Barry Hawkins' announcement at last night's (April) AJUG meeting about upcoming Python support really piqued my interest and made me decide to get comfortable using it.

My biggest annoyance when switching IDEs is not knowing the keyboard shortcuts. I despise the mouse and keep it on the left side of my desk (I'm right handed) - a Neal Ford suggestion. There is a pdf of shortcuts accessible from Netbeans' help menu, but there is a more complete list available on their wiki.
Blogged with the Flock Browser

Tuesday, April 8, 2008

Google AppEngine

New Google AppEngine!

Sweet, couldn't wait to use it. I started the tutorial during lunch. I downloaded and installed Python and the AppEngine. Then I created a work directory, "C:\google_workspace" and a helloworld folder, "C:\google_workspace\helloworld" just like the tutorial said to do, created the files "helloworld.py" and "app.yaml" just like in the tutorial, and fired up the dev_appserver with, "C:\google_workspace\helloworld>dev_appserver.py helloworld\". Instead of "Hello, world!" I got :

C:\google_workspace\helloworld>dev_appserver.py helloworld/
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\dev_appserver.py", line 50, in
<module>
execfile(script_path, globals())
File "C:\Program Files\Google\google_appengine\google/appengine/tools/dev_apps
erver_main.py", line 338, in <module>
sys.exit(main(sys.argv))
File "C:\Program Files\Google\google_appengine\google/appengine/tools/dev_apps
erver_main.py", line 287, in main
config, matcher = dev_appserver.LoadAppConfig(root_path, {})
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_apps
erver.py", line 2415, in LoadAppConfig
raise AppConfigNotFoundError
google.appengine.tools.dev_appserver.AppConfigNotFoundError

Hmm. I ran through a mental checklist before diving into the code (I knew I was being lazy. I was also really looking forward to diving into the code, but I wanted to at least get the thing running first.)
  • Perhaps I should've installed somewhere other than "C:\Program Files" I don't usually put anything in there.
  • Apparently I had Tomcat running which would be blocking 80 (I usually set Tomcat to 80 and JBoss to 8080).
Neither of those made a difference. "I, d, ten, t" error - I was running the wrong file.

Running, "C:\google_workspace\helloworld>dev_appserver.py ./" started the server.

The first line was a prompt, "Allow dev_appserver to check for updates on startup? (Y/n):"
Naturally I said "Y", and I liked name of the config file which was conveniently printed out on the next line, "dev_appserver will check for updates on startup. To change this setting, edit C
:\Documents and Settings\jdavis/.appcfg_nag"

I saw "Hello, world!"

I can't wait to start using this. Now I can finally build a completely scalable side project to make myself rich without spending any money out of pocket! Actually, I can finally stop putting off learning Python.
Blogged with the Flock Browser

Thursday, February 28, 2008

Hibernate reverse engineering and "yes_no" columns

Since attending JBossWorld Orlando, I've been playing with the JBoss Developer Studio. I've had some problems with reverse generation of my entities, and so I thought I'd post some of the solutions.

My database uses logical deletes ("Y" and "N".) The generated entities, which were typed as Boolean's choked on insert.

I haven't had much luck yet customizing the generation from the JBoss Developer Studio menu , and so I've been using the Hibernate Tools for Eclipse to generate my entities into a separate project, ModelProject, and then copying them into a seam project.

My plan was to use Seam tools to generate the crud ui from the project. However, right clicking the project and choosing "New -> Seam Generate Entities" and then selecting "Use existing entities" didn't do anything.

I started over and did the following :
ran seam-gen from the command line and created a new project, SeamProject
imported the resulting project into Eclipse
copied the reverse-engineered entities from ModelProject into SeamProject
ran "seam generate-ui" from the command line

This worked beautifully. The only hitch was I kept getting a vague error from DB2/400 when I tried to create a new entity, "[SQL0545] INSERT or UPDATE not allowed by CHECK constraint."

I checked all the constraints and after a few failed attempts determined that I wasn't violating any foreign keys. There were only a couple of not null fields one of which was the logical delete column. I had entered the translation I wanted into the hibernate.reveng.xml file (or at least I thought I had), but there was no annotation for "yes_no." I simply added @Type(type="yes_no") to the field, and everything worked.

Blogged with Flock

Friday, February 15, 2008

JBoss World Orlando - Friday

EJB3, Seam, JSF, and RichFaces on JBoss 4.2.0 was the first session I attended. It was a case study of easycredit a German loan system. I've found the case studies useful.

The second session I attended was a 90 minute JBoss Developer Studio workshop. I had already installed the JBoss Tools project into Eclipse so I was glancingly familiar with it; however, I've used seam-gen for the projects I've been working on and hadn't made use of the Developer Studio tooling. Reverse engineering a domain model is stupidly simple.

Agile Development Using JBoss Seam was the third session I attended. Daniel Hinojosa was the speaker, and he had some cool tips on using Groovy for unit testing that I want to check out. He also showed off some stuff that I didn't know Hudson could do.

Testing JSF Applications which was an intro to JSFUnit by Stan Silvert was another session that I really liked, meaning I will start using JSFUnit next week. The executive summary is that resulting from his hatred of Mock objects, Stan created a JSF testing framework that works inside the the container without all the overhead of Cactus.