Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 23312 invoked from network); 1 Jul 2008 16:05:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jul 2008 16:05:35 -0000 Received: (qmail 30153 invoked by uid 500); 1 Jul 2008 16:05:36 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 29903 invoked by uid 500); 1 Jul 2008 16:05:35 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 29891 invoked by uid 99); 1 Jul 2008 16:05:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2008 09:05:35 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 01 Jul 2008 16:04:45 +0000 Received: (qmail 31788 invoked from network); 1 Jul 2008 16:05:04 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 1 Jul 2008 16:05:04 -0000 Message-Id: <9FD73886-4802-437A-A97F-2793BA2989BB@objectstyle.org> From: Andrus Adamchik To: user@cayenne.apache.org In-Reply-To: <8F798BFDA851B943B3A1B2510E92878508BA21C6@airmail.wirelessworld.airvananet.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: Exception in SAXParserFactory.newInstance with 3.0M4 Date: Tue, 1 Jul 2008 19:05:03 +0300 References: <4101BB0A-0662-4C62-931B-5E70FCEB9F1F@mrk.com> <3F044A97-B866-4ED4-B1F5-66C6E358CAFC@mrk.com> <8F798BFDA851B943B3A1B2510E92878508BA21C6@airmail.wirelessworld.airvananet.com> X-Mailer: Apple Mail (2.924) X-Virus-Checked: Checked by ClamAV on apache.org Hmmm... I vaguely remember fixing that in M4 (i.e. making "encoderClass", "passwordLocation", "passwordSource" attributes optional). There was indeed a version of Cayenne that absolutely required those attributes (M3?). Now I think it shouldn't. Can you doublecheck the runtime version of cayenne-server.jar that causes the NPE? Andrus On Jul 1, 2008, at 6:57 PM, Scott Anderson wrote: > To summarize, a NullPointerException in > DataSourceInfo.getPasswordEncoder() is presumably caused by a missing > encoderClass attribute in the driver.xml file, despite this field > being > specified with the modeler. > > Sounds to me like a candidate for a JIRA against the modeler. > > -----Original Message----- > From: Jerald Dawson [mailto:jdawson@mrk.com] > Sent: Tuesday, July 01, 2008 11:52 AM > To: user@cayenne.apache.org > Subject: Fwd: Exception in SAXParserFactory.newInstance with 3.0M4 > > Moving this to the list: > > > Begin forwarded message: > >> From: Jerald Dawson >> Date: July 1, 2008 10:49:20 AM CDT >> To: "Scott Anderson" >> Cc: "Andrus Adamchik" >> Subject: Re: Exception in SAXParserFactory.newInstance with 3.0M4 >> >> Thats interesting. Here is my drive.xml file: >> >> >> >> >> >> >> >> >> As you can see, I do not have the encoderClass, passwordLocation and >> passwordSource attributes in the login item. I'm going to try adding >> those manually and see what happens. Again, this file was created >> with Modeler. >> >> -j >> >> On Jul 1, 2008, at 10:30 AM, Scott Anderson wrote: >> >>> Judging from the stack trace, I'd guess that the encoderClass >>> attribute >>> of the login entity is invalid in the .driver.xml file. I'm not >>> sure how >>> that could happen if you created the file using the modeler. I'm >>> copying >>> Andrus on this, since he'll probably have a better understand of >>> what's >>> going on. >>> >>> Here's what my working driver.xml file looks like, for comparison: >>> >>> >>> >>> >>> >>> >> encoderClass="org.apache.cayenne.conf.PlainTextPasswordEncoder" >>> passwordLocation="model" passwordSource="Not Applicable"/> >>> >>> >>> -----Original Message----- >>> From: Jerald Dawson [mailto:jdawson@mrk.com] >>> Sent: Tuesday, July 01, 2008 10:41 AM >>> To: Scott Anderson >>> Subject: Re: Exception in SAXParserFactory.newInstance with 3.0M4 >>> >>> Ok, I removed all the jars from my classpath except for the ones >>> specifically needed for cayenne and that seemed to fix my class >>> problem. I've not dug into it yet to see what jar was specifically >>> causing it but now when I run my app, it attempts to load the >>> cayenne.xml file. However, its throwing an exception when it tries >>> to >>> load the user name and password thats stored in the xml files for >>> access the mysql database. The exception is: >>> >>> ... >>> Jul 1, 2008 9:32:24 AM >>> org.apache.cayenne.conf.DriverDataSourceFactory >>> $LoginHandler init >>> INFO: loading user name and password. >>> Jul 1, 2008 9:32:24 AM org.apache.cayenne.conf.RuntimeLoadDelegate >>> shouldLoadDataNode >>> INFO: Error: DataSource load failed >>> java.lang.NullPointerException >>> at >>> org >>> .apache >>> .cayenne.conn.DataSourceInfo.getPasswordEncoder(DataSourceInfo.java: >>> 207) >>> at org.apache.cayenne.conf.DriverDataSourceFactory >>> $LoginHandler.init(DriverDataSourceFactory.java:324) >>> ... >>> >>> I've checked the xml files and the username and password are stored >>> in >>> the files. The model's password encoder is set to >>> org.apache.cayenne.conf.PlainTextPasswordEncoder, >>> >>> Any help would be greatly appreciated. I feel like a newbie >>> again. :-) >>> >>> -j >>> >>> On Jul 1, 2008, at 7:45 AM, Scott Anderson wrote: >>> >>>> You sure you have all of them? Ashwood, collections, lang, logging, >>>> and >>>> velocity, in addition to the server jar and your mysql/j driver? >>>> In my >>>> experience, Cayenne generally fail how you describe when one of the >>>> non-server jars is missing. >>>> >>>> -----Original Message----- >>>> From: Jerald Dawson [mailto:jdawson@mrk.com] >>>> Sent: Monday, June 30, 2008 4:36 PM >>>> To: user@cayenne.apache.org >>>> Subject: Re: Exception in SAXParserFactory.newInstance with 3.0M4 >>>> >>>> Hi Andrus >>>> >>>> I'm using Eclipse 3.4 for development. I've added the cayenne jars >>>> to >>>> my classpath and I'm running my app inside eclipse. >>>> >>>> -j >>>> >>>> On Jun 30, 2008, at 3:07 PM, Andrus Adamchik wrote: >>>> >>>>>> Seems to be throwing a class not found exception but I can't be >>>>>> sure since it just ungracefully terminates the app with not stack >>>>>> dump. >>>>> >>>>> This is unusual for a Java application. What type of application >>>>> is >>>>> that and how do you compile and run it? >>>>> >>>>> (and yes - SAX parser is part of JDK, and .. well, it just works). >>>>> >>>>> Andrus >>>>> >>>>> >>>>> On Jun 30, 2008, at 10:55 PM, Jerald Dawson wrote: >>>>>> Hello >>>>>> >>>>>> I'm new to cayenne (actually a webobjects guy) and I'm trying to >>>>>> get it working. I'm was able able to get modeler working and I >>>>>> created a model for accessing a mysql database. Everything seemed >>>>>> pretty simple but now when I try to run my app that uses the >>>>>> model, >>>>>> when I call DataContext.createDataContext(), it terminates my >>>>>> app. >>>>>> I've poked around a bit and the crash is actually happening in >>>>>> the >>>>>> SAXParserFactory.newInstance method that is called during the >>>>>> ConfigLoader initialization, specifically during the "parser = >>>>>> Util.createXmlReader();" call. Seems to be throwing a class not >>>>>> found exception but I can't be sure since it just ungracefully >>>>>> terminates the app with not stack dump. Anyway, that kind of >>>>>> puzzles me since my understanding was the all the SAX parser >>>>>> stuff >>>>>> came with java (I'm using 1.5 on Mac OS X 10.5). I thought it >>>>>> might >>>>>> be that it could be that it can't find my xml files but I tried >>>>>> just hard coding the path to the cayanne.xml file and it still >>>>>> does >>>>>> not work. Any help would be appreciated. >>>>>> >>>>>> jerald dawson >>>>>> >>>>>> >>>> >>> >> > >