trouble with create a JSFClientSession (NullPointerExceptio
peter196 Mar 30, 2008 4:49 AMhi,
I got NPC in the following code when I tried to inject the jsfunit test code to my jsf application .
JSFClientSession client = new JSFClientSession("/pages/testpage.faces");
the Exception is :
java.lang.NullPointerException 13:45:15,015 INFO [STDOUT] at org.jboss.jsfunit.framework.FacesContextBridge.getCurrentInstance(FacesContextBridge.java:54) 13:45:15,015 INFO [STDOUT] at org.jboss.jsfunit.facade.ClientIDs.<init>(ClientIDs.java:60) 13:45:15,015 INFO [STDOUT] at org.jboss.jsfunit.facade.JSFClientSession.doWebRequest(JSFClientSession.java:185) 13:45:15,015 INFO [STDOUT] at org.jboss.jsfunit.facade.JSFClientSession.doInitialRequest(JSFClientSession.java:122) 13:45:15,015 INFO [STDOUT] at org.jboss.jsfunit.facade.JSFClientSession.<init>(JSFClientSession.java:75) 13:45:15,015 INFO [STDOUT] at com.forallsoft.common.TestParentTable.testInitialPage(TestParentTable.java:40) 13:45:15,015 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 13:45:15,015 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 13:45:15,015 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 13:45:15,015 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585) 13:45:15,015 INFO [STDOUT] at junit.framework.TestCase.runTest(TestCase.java:154) 13:45:15,015 INFO [STDOUT] at junit.framework.TestCase.runBare(TestCase.java:127) 13:45:15,015 INFO [STDOUT] at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153) 13:45:15,015 INFO [STDOUT] at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119) 13:45:15,015 INFO [STDOUT] at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93) .......
I opened file WebConversationFactory.class with decompiler tool jode, show this :
/*jode*/ /***** DECOMPILATION REPORT ***** LOCATION: E:\rwy_wkspace2.0\forallsoft_mis3t\forallsoft_web\WEB-INF\lib\jboss-jsfunit-core-1.0-beta-1.jar!org.jboss.jsfunit.framework.WebConversationFactory TOTAL TIME: 0 ms CAUGHT EXCEPTIONS: java.lang.NoClassDefFoundError: org.jboss.jsfunit.framework.WebConversationFactory at jode.bytecode.ClassInfo.loadInfo(ClassInfo.java:631) at jode.decompiler.ClassAnalyzer.<init>(ClassAnalyzer.java:86) at jode.decompiler.ClassAnalyzer.<init>(ClassAnalyzer.java:123) at jode.decompiler.ClassAnalyzer.<init>(ClassAnalyzer.java:128) at net.sourceforge.jode.JodeDecompiler.decompile(JodeDecompiler.java:72) at net.sourceforge.jode.JodeSourceMapper.findSource(JodeSourceMapper.java:82) at net.sourceforge.jode.JodeSourceMapper.findSource(JodeSourceMapper.java:65) at net.sourceforge.jode.JodeClassFileEditor.doOpenBuffer(JodeClassFileEditor.java:104) at net.sourceforge.jode.JodeClassFileEditor.init(JodeClassFileEditor.java:70) at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:778) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:384) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552) at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:223) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2362) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2295) at org.eclipse.ui.internal.WorkbenchPage.access$9(WorkbenchPage.java:2287) at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2273) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2268) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2249) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:263) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:140) at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:169) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:141) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:226) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run ...... ********************************/
JSFTimer.class and JSFUnitFilter.class are also like this .
Could you tell me why? thanks!