code: public static Reference getReference(Serializable object) throws NamingException
      {
          ByteArrayOutputStream outStream;
          try
          {
              outStream = new ByteArrayOutputStream();
              ObjectOutputStream out = new ObjectOutputStream(outStream);
              out.writeObject(object);
              out.close();
          }
          catch (IOException e)
          {
              throw new NamingException(e.getMessage());
          }
  
          BinaryRefAddr handle = new BinaryRefAddr("com.impetus.kundera.persistence.jta", outStream.toByteArray());
          Reference ret = new Reference(object.getClass().getName(), handle, UserTransactionFactory.class.getName(), null);
          return ret;
      }
docs: Method to return reference for serialized object.(i.e.
  KunderJTAUserTransaction)
  
  @param object
  serilized object.
  @return reference to that object.
  @throws NamingException
  naming exception.