createNativeQuery("select distinct name from table",Myclass);
states that you are trying to build an entity of Type Myclass for each returned row, but the SQL used is only returning a name. If all you want is the name field data, try:
getEntityManager().createNativeQuery("select distinct name from table").getResultList();
which will return a list containing arrays representing the data for each row - which will be just the name field data.
If you are still getting openJPA problems you might try posting on a openJPA forum, or try using TopLink/EclipseLink as the JPA provider and posting the exception here.