On 6/12/07, George Harley <[EMAIL PROTECTED]> wrote:
Hi,Please help. I am trying to run some unit tests of JSF classes using AbstractJsfTestCase as my test case superclass. When I try and run the tests there is a NPE from inside the AbstractJsfTestCase setUp() method. Trace is as follows... java.lang.NoClassDefFoundError: javax.el.ELContext at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:59) at java.lang.J9VMInternals.initialize(J9VMInternals.java:120) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:521) at org.apache.shale.test.mock.MockFacesContextFactory.getFacesContext(MockFacesContextFactory.java:164) at org.apache.shale.test.base.AbstractJsfTestCase.setUp(AbstractJsfTestCase.java:131) ........ I have spent at least an hour trying to locate a JAR containing the javax.el.ELContext class to put on the runtime classpath but with no luck. This is the first time I have tried using the Shale test framework. Please can someone help put me out ? This must be something obvious.
Are you building a JSF 1.2 based application? If so, you'll need to make sure you include the JSF api and implementation JARs, *and* all of their dependencies (which will include the EL implementation referenced by the error you are getting. One simple way to do this is download Glassfish (https://glassfish.dev.java.net) and put the javaee.jar library from it into your classpath -- that includes the JSF 1.2 reference implementation and the associated EL machinery. On the other hand, if you're trying to build a JSF 1.1 application (javax.el.* did not exist then), be sure you are including a 1.1 runtime instead of a 1.2 runtime.
Best regards, George
Craig
