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 2DC0CD238 for ; Thu, 23 Aug 2012 15:18:41 +0000 (UTC) Received: (qmail 86062 invoked by uid 500); 23 Aug 2012 15:18:41 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 86020 invoked by uid 500); 23 Aug 2012 15:18:40 -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 86002 invoked by uid 99); 23 Aug 2012 15:18:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Aug 2012 15:18:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.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; Thu, 23 Aug 2012 15:18:31 +0000 Received: (qmail 21587 invoked from network); 23 Aug 2012 15:18:54 -0000 Received: from unknown (HELO ?192.168.1.37?) (194.158.197.10) by vorsha.objectstyle.org with SMTP; 23 Aug 2012 15:18:54 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: null from CayenneRuntime.getThreadInjector() From: Andrus Adamchik In-Reply-To: Date: Thu, 23 Aug 2012 18:18:08 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <4648613B-456C-4778-AEF1-F9678A2FFC65@objectstyle.org> References: To: user@cayenne.apache.org X-Mailer: Apple Mail (2.1084) Hi Tore, Injector is encapsulated in CayenneRuntime, so...=20 ServerRuntime runtime =3D // assume you have that, since you started = Cayenne somehow.. Injector i =3D runtime.getInjector(); Andrus On Aug 23, 2012, at 12:22 PM, Tore Halset wrote: > Hello. >=20 > I am playing with serialization of cayenne objects in trunk. This is = the first time I do (java) serialization of cayenne stuff. On = deserialize I get the following. >=20 > org.apache.cayenne.CayenneRuntimeException: [v.3.2M1-SNAPSHOT Aug 23 = 2012 08:32:28] Can't attach to Cayenne runtime. Null injector returned = from CayenneRuntime.getThreadInjector() > at = org.apache.cayenne.BaseContext.attachToRuntimeIfNeeded(BaseContext.java:14= 1) > at = org.apache.cayenne.BaseContext.getEntityResolver(BaseContext.java:197) > at org.apache.cayenne.Cayenne.buildId(Cayenne.java:529) > at org.apache.cayenne.Cayenne.objectForPK(Cayenne.java:383) >=20 > It looks like I should do a = CayenneRuntime.bindThreadInjector(Injector), but how should I create the = Injector? >=20 > Regards, > Tore Halset.