Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04E779898 for ; Mon, 6 Feb 2012 23:13:20 +0000 (UTC) Received: (qmail 51314 invoked by uid 500); 6 Feb 2012 23:13:19 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 51297 invoked by uid 500); 6 Feb 2012 23:13:19 -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 51289 invoked by uid 99); 6 Feb 2012 23:13:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 23:13:18 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.86.89.65] (HELO elasmtp-kukur.atl.sa.earthlink.net) (209.86.89.65) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 23:13:12 +0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=Aes4RXhim8D6OtDHhuW0AKD3CgRF98SM84HjZLcANGr5nVna7r/AnBxUNbojUXZC; h=Received:From:Mime-Version:Content-Type:Subject:Date:In-Reply-To:To:References:Message-Id:X-Mailer:X-ELNK-Trace:X-Originating-IP; Received: from [64.134.69.18] (helo=[192.168.5.5]) by elasmtp-kukur.atl.sa.earthlink.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.67) (envelope-from ) id 1RuXjv-0005H5-0Q for user@cayenne.apache.org; Mon, 06 Feb 2012 18:12:51 -0500 From: Joe Baldwin Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: multipart/alternative; boundary="Apple-Mail=_CCC0AAF2-A85A-4482-8944-881A84CA8F9A" Subject: Re: Odd error Date: Mon, 6 Feb 2012 18:12:49 -0500 In-Reply-To: To: user@cayenne.apache.org References: <1CAF0260-43A3-409E-9833-3A551EC5208A@earthlink.net> <605526E6-72CF-4B2D-97A7-76766A951E74@earthlink.net> Message-Id: <4078C07B-35FE-4C96-BF8D-88CE3CE1EC12@earthlink.net> X-Mailer: Apple Mail (2.1257) X-ELNK-Trace: 74aacf41df18ac9f85338a7d01cb3b6a7e972de0d01da940f77850fbcbcdfda3f0b0484f00e876d1350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 64.134.69.18 --Apple-Mail=_CCC0AAF2-A85A-4482-8944-881A84CA8F9A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Andrus, I think that issue was due to a possible problem with the server.xml = file and the webhost's unique dir structure (and the fact that they = don't communicate very well). But, I went ahead and moved the files as = you suggested. There is no change (i.e. it works on my dev server) and = not on the webhost. This is getting pretty serious, as I have the tech support basically = telling me that it is my code. The argument that it is working on my = dev server does not seem to have any weight, and thus they are not doing = much of anything. They have an apache http front end server that I = cannot modify or even inspect the config files. I am limited to the = Tomcat server.xml, but I am just hacking because I have yet to see a = proper installation. Here is the major problem = com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException= : Cannot add or update a child row: a foreign key constraint fails = (`eagle1_om28`.`product`, CONSTRAINT `product_ibfk_2` FOREIGN KEY = (`packageTypeOid`) REFERENCES `packagetype` (`oid`)) This occurs whenever I try to insert a new "Product". The Product = requires a "PackageType", which is provided to it using a Cayenne query = to the PackageType table for the first entry in the list of = package-types (essentially a default packagetype is provided at build = time to Product). While this *appears* to be a logical problem and a cogent error message, = I am not convinced. First, this has been working fine on another = project (which I copied and modified to create this project). Second, = when I try to commit a new Vendor entity, I get the *exact* same error = i.e. it is the Product error, *NOT* a similar Vendor error. This = suggests that something is *really* messed up. I am confused, so I am investigating low-probability theories: 1. Is it possible that I have a mistake in one of my cayenne config = files that I copied to create this project? a. here are the two map defs for product & pa 1. 2. = b. what is the "catalog"? Why is it not associated with = packageType? Does catalog need to be unique if I have two cayenne = webapps running on the same tomcat server? 2. Is it possible that there is some cached MySQL INSERT that has not = been purged? =20 Thanks in advance for your help. I am getting very frustrated because I = have absolutely no idea how to debug this. Select Queries run fine, but = INSERT seems to cause this problem. Joe On Feb 6, 2012, at 2:13 AM, Andrus Adamchik wrote: > Is this error still an issue:=20 >=20 >>>> Caused by: org.apache.cayenne.ConfigurationException: [v.3.0.1 Aug = 25 2010 19:42:04] Can't open config file URL: = jndi:/om28.com/store/WEB-INF/config/cayenne-files/cayenne.xml >=20 > ?=20 >=20 > If so, please follow my advise about the location of Cayenne files and = then your Tomcat settings should not matter anymore. >=20 > Andrus >=20 > On Feb 6, 2012, at 2:48 AM, Joe Baldwin wrote: >=20 >> Andrus, >>=20 >> Is there a webhost server setting that might account for this? (I = googled this problem and the first results appears to point to webhost = settings. I, presumably, set account privileges for the user, but this = was through a 3rd party manager interface - which is always a bit = unsettling because you can't verify it.) >>=20 >> Here is the current error (which is really odd because it is working = just fine on my dev server) >>=20 >> = com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException= : Cannot add or update a child row: a foreign key constraint fails = (`eagle1_om28`.`product`, CONSTRAINT `product_ibfk_2` FOREIGN KEY = (`packageTypeOid`) REFERENCES `packagetype` (`oid`)) >>=20 >> Thanks >> Joe >>=20 >>=20 >>=20 >> On Feb 5, 2012, at 2:29 AM, Andrus Adamchik wrote: >>=20 >>> While I don't know what the cause of the error is, my recommendation = would be to put all Cayenne files in CLASSPATH (e.g. WEB-INF/classes or = in a jar under WEB-INF/lib). This is much more portable across any Java = environments. >>>=20 >>> Andrus >>>=20 >>> On Feb 4, 2012, at 7:40 PM, Joe Baldwin wrote: >>>=20 >>>> Here is more research on my "odd error". =20 >>>>=20 >>>> Production Server Env >>>> Tomcat, linux, MySQL 5.1, Java 1.6 >>>> I only have control of tomcat config files & start/stop = operations >>>> **** I am using a *temp* configuration for installation and only = have an IP which I aliased to "om28.com" in my hosts file (a standard = trick) >>>>=20 >>>> Symptoms & Research: >>>> It appears that tomcat has logged a Cayenne configuration exception >>>>=20 >>>> Caused by: org.apache.cayenne.ConfigurationException: [v.3.0.1 = Aug 25 2010 19:42:04] Can't open config file URL: = jndi:/om28.com/store/WEB-INF/config/cayenne-files/cayenne.xml >>>>=20 >>>> Which seems to be accurate because that is not were I put the = cayenne.xml file. Here is my web.xml entry for the app >>>>=20 >>>> >>>> >>>> cayenne.configuration.path >>>> /WEB-INF/config/cayenne-files >>>> >>>> >>>> CayenneFilter >>>> = org.apache.cayenne.conf.WebApplicationContextFilter >>>> >>>> >>>> CayenneFilter >>>> /* >>>> >>>>=20 >>>> Questions: >>>> 1. I have no understanding of why Cayenne would be looking for the = xml file in a path that included "store". Could this be a result of it = getting confused by the alias "om28.com"? >>>> 2. I have a demo working on the same webhost, but as a subdomain. = It is using, I believe, the identical web.xml excerpt. This same = web.xml file is working on my development server. Is there a way to = configure cayenne or the temp installation to make this work correctly >>>> 3. Or, am I completely on the wrong track? :) >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> On Feb 3, 2012, at 2:35 PM, Joe Baldwin wrote: >>>>=20 >>>>> I am manually mirroring a test app (successfully tested on my dev = tomcat), onto a remote server. I am getting an odd error and am having = trouble tracking it down. (an excerpt is listed below) >>>>> While it is possible that I have made a mistake in my coding, it = is not likely since the associated code has been working for a while. I = have also been fighting some tomcat caching problems, which I have = resolved by deleting the tomcat cache for this app each time I reload = it. >>>>> I have tried standard debugging on my dev server, but the error is = not showing up. Also, it this error shows up mostly when I am adding = the parent to which it is referring, however, it also has just shown up = at random when I make a simple query via cayenne. >>>>> Is it possible that I have missed some configuration parameter in = loading my cayenne map? It is acting so odd that I am fairly convinced = that this error message may not be pointing to the actual error. =20 >>>>> Totally confused. :) >>>>> Thanks, >>>>> Joe >>>>>=20 >>>>>=20 >>>>> = com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException= : Cannot add or update a child row: a foreign key constraint fails=20 >>>>>=20 >>>>>=20 >>>>=20 >>>=20 >>=20 >=20 --Apple-Mail=_CCC0AAF2-A85A-4482-8944-881A84CA8F9A--