Wednesday, June 18, 2014

Linux: view memory info

Use this command:

free -m (display in megabytes)
free -k (display in kilobytes)

or this command:
cat /proc/meminfo

Note: For Windows environment, msinfo32 is the equivalent.

Tuesday, June 17, 2014

JPA: Error loading the persistence descriptor WEB-INF/lib/_wl_cls_gen.jar!/META-INF/persistence.xml from the module

Root cause:
persistence.xml is located in src/main/resources/META-INF
Solution: 
move persistence.xml to src/main/java
That's it. Is that simple!?

Note: if you encounter an error, when trying to run a main (as Java application in Eclipse), then you need to move it back to src/main/resources/META-INF


Monday, June 16, 2014

Java JPA error: No Persistence provider for EntityManager named

While working on a JPA project, this type error keeps popping up despite that fact that the persistence unit name is correctly specified. At first, I thought I may miss some jar files or class path problem. However, it turned out that the persistence.xml need to be placed under src/main/resources/META-INF folder (if META-INF is not there, you need to create one).