Just did some debugging, turns out it was due to running the code in an OSGi framework. Setting the correct classloader as context classloader before creating the builder solves it. This snipped works fine.
ClassLoader currentLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(User.class.getClassLoader()); Builder builder = User.newBuilder(user); Thread.currentThread().setContextClassLoader(currentLoader); User copy = builder.build(); Xander On Wed, Aug 6, 2014 at 8:23 PM, Lewis John Mcgibbney < lewis.mcgibb...@gmail.com> wrote: > Hi Xander, > > > On Wed, Aug 6, 2014 at 9:37 AM, Xander Uiterlinden <uiter...@gmail.com> > wrote: > >> Shall I create a JIRA issue for this ? >> >> Yeah I would. > I really don't know what is wrong here. > Lewis > >