It is not possible to create entities and attributes from java actions.
Java actions are runtime components that can’t influence the model of your app, this has to be done with the Mndix SDK, maybe in combination with some java code, but not from a java action.