标题: 第一次使用Junit 出现 connection create error [打印本页] 作者: For_Sale 时间: 2008-3-13 17:24 标题: 第一次使用Junit 出现 connection create error 错误Log
[C 2008.03.13 16:13:39]: connection create error
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Ljava.util.Hashtable;)Ljavax.naming.Context;(NamingManager.java:640)
at javax.naming.InitialContext.getDefaultInitCtx()Ljavax.naming.Context;(InitialContext.java:243)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Ljava.lang.String;)Ljavax.naming.Context;(InitialContext.java:280)
at javax.naming.InitialContext.lookup(Ljava.lang.String;)Ljava.lang.Object;(InitialContext.java:347)
at com.wss.util.DBUtil.getConnection(Ljava.lang.String;)Ljava.sql.Connection;(DBUtil.java:377)
at com.wss.util.SuInfoJspUtil.getA008Part()Ljava.util.Vector;(SuInfoJspUtil.java:409)
at com.wss.util.SuInfoJspUtilTest.testGetA008Part()V(SuInfoJspUtilTest.java:24)
at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
at junit.framework.TestCase.runTest()V(TestCase.java:154)
at junit.framework.TestCase.runBare()V(TestCase.java:127)
at junit.framework.TestResult$1.protect()V(TestResult.java:106)
at junit.framework.TestResult.runProtected(Ljunit.framework.Test;Ljunit.framework.Protectable;)V(TestResult.java:124)
at junit.framework.TestResult.run(Ljunit.framework.TestCase;)V(TestResult.java:109)
at junit.framework.TestCase.run(Ljunit.framework.TestResult;)V(TestCase.java:118)
at junit.framework.TestSuite.runTest(Ljunit.framework.Test;Ljunit.framework.TestResult;)V(TestSuite.java:208)
at junit.framework.TestSuite.run(Ljunit.framework.TestResult;)V(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(Lorg.eclipse.jdt.internal.junit.runner.TestExecution;)V(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run([Lorg.eclipse.jdt.internal.junit.runner.ITestReference;)V(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests([Ljava.lang.String;Ljava.lang.String;Lorg.eclipse.jdt.internal.junit.runner.TestExecution;)V(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Lorg.eclipse.jdt.internal.junit.runner.TestExecution;)V(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run()V(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main([Ljava.lang.String;)V(RemoteTestRunner.java:196)
java.lang.NullPointerException
at com.wss.util.SuInfoJspUtil.getA008Part()Ljava.util.Vector;(SuInfoJspUtil.java:410)
at com.wss.util.SuInfoJspUtilTest.testGetA008Part()V(SuInfoJspUtilTest.java:24)
at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
at junit.framework.TestCase.runTest()V(TestCase.java:154)
at junit.framework.TestCase.runBare()V(TestCase.java:127)
at junit.framework.TestResult$1.protect()V(TestResult.java:106)
at junit.framework.TestResult.runProtected(Ljunit.framework.Test;Ljunit.framework.Protectable;)V(TestResult.java:124)
at junit.framework.TestResult.run(Ljunit.framework.TestCase;)V(TestResult.java:109)
at junit.framework.TestCase.run(Ljunit.framework.TestResult;)V(TestCase.java:118)
at junit.framework.TestSuite.runTest(Ljunit.framework.Test;Ljunit.framework.TestResult;)V(TestSuite.java:208)
at junit.framework.TestSuite.run(Ljunit.framework.TestResult;)V(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(Lorg.eclipse.jdt.internal.junit.runner.TestExecution;)V(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run([Lorg.eclipse.jdt.internal.junit.runner.ITestReference;)V(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests([Ljava.lang.String;Ljava.lang.String;Lorg.eclipse.jdt.internal.junit.runner.TestExecution;)V(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Lorg.eclipse.jdt.internal.junit.runner.TestExecution;)V(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run()V(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main([Ljava.lang.String;)V(RemoteTestRunner.java:196)