Return-Path: Delivered-To: apmail-incubator-empire-db-user-archive@minotaur.apache.org Received: (qmail 76080 invoked from network); 13 Apr 2011 22:21:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Apr 2011 22:21:55 -0000 Received: (qmail 32409 invoked by uid 500); 13 Apr 2011 22:21:55 -0000 Delivered-To: apmail-incubator-empire-db-user-archive@incubator.apache.org Received: (qmail 32375 invoked by uid 500); 13 Apr 2011 22:21:54 -0000 Mailing-List: contact empire-db-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-user@incubator.apache.org Delivered-To: mailing list empire-db-user@incubator.apache.org Received: (qmail 32367 invoked by uid 99); 13 Apr 2011 22:21:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Apr 2011 22:21:54 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.136.44.59] (HELO smtp104.prem.mail.sp1.yahoo.com) (98.136.44.59) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 13 Apr 2011 22:21:48 +0000 Received: (qmail 87709 invoked from network); 13 Apr 2011 22:21:27 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:Content-Type:Subject:Date:Message-Id:To:Mime-Version:X-Mailer; b=wOeEYyToBy+9l4eYy9m9HEdvnynKmtIJqQbZ3t/uGxgZZC/wjexc8lQgT+Lk7GQZJ94JcIn0LxEoxksvdNVd4fgDFfcWFrEbifNOoB9eqpAbgZKeE0yxaZoZH/joOAKJwe2SSsspRvwfu3xXszZzIBkAc4rRZMpnYOERL0p4m6E= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1302733287; bh=y4kjpVHDlcIFbEN8WatDB1z/wLRefte7UKKUwmnsrdo=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:Content-Type:Subject:Date:Message-Id:To:Mime-Version:X-Mailer; b=cnsUicOPzQ4nPGNIEgHHM4rKMqCStepTI9nAlEwaUaQ0f7lUgSRFkd8HgehpFNJAFPAFdkkyHSP/CzrZ/dOCuwdDT8Yo2FpyphWx9tfgB4+kOJLjYS6yEoYwzBTvXsJmfE6qQXuTZEkuLBZHyZ9xdNqNJVxVC7Lnj5FAlBZXaNM= Received: from sjc-tcolson-8712.cisco.com (timcolson@128.107.239.233 with plain) by smtp104.prem.mail.sp1.yahoo.com with SMTP; 13 Apr 2011 15:21:27 -0700 PDT X-Yahoo-SMTP: rEp18YuswBBqMhaPSSDZPgNygjLaMA-- X-YMail-OSG: 4sb3qg8VM1nTlZR30.Z8XoACTy2wrX4P4TRtDh8B8B4rcLO 0sePs.dUe2I.9P8V4WNmay7535LLQnaO7qaVspOxCuPrcZsdxZQb5TVLnMeF 2SBgTTHKt18s8T5fBk3r7_.lh94MGK9oWOmtwHTB1jtnR3vJN5z.RASGfUSr Lxy2Oc8tfXChB2irDnxyoyIPm8cdDtReliGgaPAkpmtPNTutCmZKh_bHbmv. 9m4PX1WdtzV_3zd.M94jOSix2QyVKp_9hapNbHiqB6Q.oHKya7xTTwOXAKAw iUXhJE.SfAikAs2g.2LQe_dkz5jYhlKeNVzxjU3vn3c5qIfAz9puW0NMCT7P MJ7.9X5Fw4avFgZnCZY3ire9w6e0AaXjRWW8KX8jl X-Yahoo-Newman-Property: ymail-3 From: Tim Colson Content-Type: multipart/alternative; boundary=Apple-Mail-2-156055753 Subject: Problems in docs for running example-basic Date: Wed, 13 Apr 2011 15:21:26 -0700 Message-Id: <1EEB4BC1-713B-47DC-BEF6-0DD46D1A4E3C@yahoo.com> To: empire-db-user@incubator.apache.org Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) --Apple-Mail-2-156055753 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I managed to get the basic example to run in both Eclipse and Intellij = IDEA after some effort troubleshooting.=20 Here are observations on the docs/tutorial info that were confusing or = incorrect. I pulled down the distro and expanded into /appdev, cd = /appdev/apache-empire-db-2.1.0-incubating/src, and then ran mvn = idea:idea. The project opened in Intellij IDEA, ran SampleApp.java... = gives an error saying it cannot get the config value for = empireDBDriverClass which suggests config.xml file was found, but can't = load that node.=20 I switched to Eclipse since the docs mention it specifically.... The website Getting started and Tutorial instructions incorrectly say to = import empire-db-2.0.0/examples/DBSample which does not exist in the 2.1 = distro. The Tutorial PDF inside the distro is more accurate for the = path, but says to use mvn eclipse:eclipse, but the README.txt says "mvn = clean install" to build and "mvn clean eclipse:eclipse = -DdownloadSources=3Dtrue" - so I did both steps.=20 I imported the projects Eclipse, but it complained of a missing = "M2_REPO" variable. I googled and fixed and the sample ran! I went back to Intellij IDEA, and on a hunch checked the working = directory. It was set to the root of the src folder, so I set it to = empire-db-example-basic. The sample ran fine! :-) I guessed that the config.xml wasn't actually loading, but the error is = misleading. I reviewed XMLConfiguration.java, line 114, = FileNotFoundException, but since log4j reported a problem initializing, = I added a System.out.println() and re-ran - it printed that config.xml = was not found.=20 Suggestions:=20 * update the Tutorial and Getting Started docs to align with the current = release * maybe add a footnote for Intellij users to make sure to set the = working directory so the config.xml is loaded.=20 * Review logging setup - since until config is loaded, the log system = isn't init'd so the log message about not being able to load the file = fails. Cheers! -Tim Intellij IDEA -- error.... log4j:WARN No appenders could be found for logger = (org.apache.empire.commons.ErrorType). log4j:WARN Please initialize the log4j system properly. Running DB Sample... *** Step 1: getJDBCConnection() *** *** Step 2: getDatabaseProvider() *** java.lang.RuntimeException: Configuration error: Element = 'empireDBDriverClass' not found in node 'properties-hsqldb' at = org.apache.empire.samples.db.SampleApp.getDatabaseDriver(SampleApp.java:20= 1) at = org.apache.empire.samples.db.SampleApp.main(SampleApp.java:85) java.lang.RuntimeException: java.lang.RuntimeException: Configuration = error: Element 'empireDBDriverClass' not found in node = 'properties-hsqldb' java.lang.RuntimeException: java.lang.RuntimeException: Configuration = error: Element 'empireDBDriverClass' not found in node = 'properties-hsqldb' at = org.apache.empire.samples.db.SampleApp.getDatabaseDriver(SampleApp.java:22= 1) at = org.apache.empire.samples.db.SampleApp.main(SampleApp.java:85) Caused by: java.lang.RuntimeException: Configuration error: Element = 'empireDBDriverClass' not found in node 'properties-hsqldb' at = org.apache.empire.samples.db.SampleApp.getDatabaseDriver(SampleApp.java:20= 1) ... 1 more --Apple-Mail-2-156055753 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii empire-db-2.0.0/examples/DBSample which = does not exist in the 2.1 distro. The Tutorial PDF inside the = distro is more accurate for the path, but says to use mvn = eclipse:eclipse, but the README.txt says "mvn clean install" to build = and  "mvn clean eclipse:eclipse -DdownloadSources=3Dtrue" - so I = did both steps. 

I imported the projects = Eclipse, but it complained of a missing "M2_REPO" variable. I googled = and fixed and the sample ran!

I went back to = Intellij IDEA, and on a hunch checked the working directory. It was set = to the root of the src folder, so I set it to =  empire-db-example-basic. The sample ran fine! = :-)

I guessed that the config.xml wasn't = actually loading, but the error is misleading. I reviewed = XMLConfiguration.java, line 114, FileNotFoundException, but since log4j = reported a problem initializing, I added a System.out.println() and = re-ran - it printed that config.xml was not = found. 

Suggestions: 
* = update the Tutorial and Getting Started docs to align with the current = release
* maybe add a footnote for Intellij users to make sure = to set the working directory so the config.xml is = loaded. 
* Review logging setup - since until config is = loaded, the log system isn't init'd so the log message about not being = able to load the file = fails.

Cheers!
-Tim

Intellij IDEA -- error....

log4j:WARN No = appenders could be found for logger = (org.apache.empire.commons.ErrorType).
log4j:WARN Please = initialize the log4j system properly.
Running DB = Sample...
*** Step 1: getJDBCConnection() ***
*** = Step 2: getDatabaseProvider() ***
java.lang.RuntimeException: = Configuration error: Element 'empireDBDriverClass' not found in node = 'properties-hsqldb'
at = org.apache.empire.samples.db.SampleApp.getDatabaseDriver(SampleApp.java:20= 1)
= at = org.apache.empire.samples.db.SampleApp.main(SampleApp.java:85)
j= ava.lang.RuntimeException: java.lang.RuntimeException: Configuration = error: Element 'empireDBDriverClass' not found in node = 'properties-hsqldb'
java.lang.RuntimeException: = java.lang.RuntimeException: Configuration error: Element = 'empireDBDriverClass' not found in node = 'properties-hsqldb'
at = org.apache.empire.samples.db.SampleApp.getDatabaseDriver(SampleApp.java:22= 1)
= at = org.apache.empire.samples.db.SampleApp.main(SampleApp.java:85)
C= aused by: java.lang.RuntimeException: Configuration error: Element = 'empireDBDriverClass' not found in node = 'properties-hsqldb'
at = org.apache.empire.samples.db.SampleApp.getDatabaseDriver(SampleApp.java:20= 1)
= ... 1 more


= --Apple-Mail-2-156055753--