I am using javax.persistence.QueryTimeoutException in my unit tests successfully with OpenJPA 2.1 to test my code. I am using Java 1.6 and I am not pointing to any JavaEE libs in my ant build script.
However, my customer says he can’t compile because QueryTimeoutException is JavaEE 6.
How can this work for me without pointing to JavaEE.jar and not work for him? How do I separate JavaSE 1.6 from JavaEE 1.6 so I can reproduce this issue?
My customer didn’t provide additional detail. In my unit tests, I am doing:
import javax.persistence.QueryTimeoutException;
and then using EasyMock like:
EasyMock.expect(query.getResultList()).andThrow(new QueryTimeoutException("expected"));
My java/javac version is 1.6.0_29-b11
What are you using for the OpenJPA lib? If you use the openjpa-all-2.1.1.jar, that has the javax.persistence.* APIs.