Hi Tore,

Injector is encapsulated in CayenneRuntime, so... 

ServerRuntime runtime = // assume you have that, since you started Cayenne 
somehow..
Injector i = runtime.getInjector();

Andrus

On Aug 23, 2012, at 12:22 PM, Tore Halset wrote:

> Hello.
> 
> 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.
> 
> 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:141)
>       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)
> 
> It looks like I should do a CayenneRuntime.bindThreadInjector(Injector), but 
> how should I create the Injector?
> 
> Regards,
> Tore Halset.

Reply via email to