I get an error from eclipse when I try to call 100% working code. This, for example, works in my netbeans, but not in this eclipse project. The error is absurd, and I'm pretty sure that it is caused by some Maven dependency on the OPEN JPA that I use. Any pointers?
Map<String,String> properties = new HashMap<String,String>();
properties.put(PersistenceUnitProperties.JDBC_PASSWORD, "");
properties.put(PersistenceUnitProperties.JDBC_USER, "root");
properties.put(PersistenceUnitProperties.JDBC_URL, "jdbc:mysql://localhost:3306/mydb");
properties.put(PersistenceUnitProperties.JDBC_DRIVER, "com.mysql.jdbc.Driver");
emf = Persistence.createEntityManagerFactory("Persistentunitname", properties);
The error is in the last line, and the error is:
ClassFormat error "Missing code attribute in a method that is not native or abstract in the javax / persistence / Persistence class file"
source
share