[Seasar-user:20215] UnitTestでOgnlRuntimeException

takechi take [E-MAIL ADDRESS DELETED]
2010年 10月 5日 (火) 18:11:02 JST


初めまして。初心者takechiと申します。
jdbcmanagerをプロパティに持つserviceを作成してUnitTestを行おうとしたところ
以下のエラーが出ました。
org.seasar.framework.exception.OgnlRuntimeException:
[ESSR0073]OGNLで例外が発生しました。
理由は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 file:
・・・・・・・/workspace3.3Europa/training/jta-wls.dicon(20)
 at org.seasar.framework.util.OgnlUtil.getValue(OgnlUtil.java:103)
 at
org.seasar.framework.container.ognl.OgnlExpression.evaluate(OgnlExpression.java:64)
 at
org.seasar.framework.container.assembler.AbstractConstructorAssembler.assembleExpression(AbstractConstructorAssembler.java:76)
 at
org.seasar.framework.container.assembler.AbstractConstructorAssembler.assemble(AbstractConstructorAssembler.java:50)
 at
org.seasar.framework.container.deployer.SingletonComponentDeployer.assemble(SingletonComponentDeployer.java:64)
 at
org.seasar.framework.container.deployer.SingletonComponentDeployer.deploy(SingletonComponentDeployer.java:48)
 at
org.seasar.framework.container.deployer.SingletonComponentDeployer.init(SingletonComponentDeployer.java:76)
 at
org.seasar.framework.container.impl.ComponentDefImpl.init(ComponentDefImpl.java:236)
 at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.java:563)
 at
org.seasar.framework.container.impl.ThreadSafeS2ContainerImpl.init(ThreadSafeS2ContainerImpl.java:172)
 at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.java:560)
 at
org.seasar.framework.container.impl.ThreadSafeS2ContainerImpl.init(ThreadSafeS2ContainerImpl.java:172)
 at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.java:560)
 at
org.seasar.framework.container.impl.ThreadSafeS2ContainerImpl.init(ThreadSafeS2ContainerImpl.java:172)
 at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.java:560)
 at
org.seasar.framework.container.impl.ThreadSafeS2ContainerImpl.init(ThreadSafeS2ContainerImpl.java:172)
 at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.java:560)
 at
org.seasar.framework.unit.S2FrameworkTestCase.runBare(S2FrameworkTestCase.java:300)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:120)
 at junit.framework.TestSuite.runTest(TestSuite.java:230)
 at junit.framework.TestSuite.run(TestSuite.java:225)
 at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
 at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: 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(NamingManager.java:645)
 at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
 at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
 at javax.naming.InitialContext.lookup(InitialContext.java:351)
 at
org.seasar.extension.j2ee.JndiResourceLocator.lookup(JndiResourceLocator.java:80)
 at
org.seasar.extension.j2ee.JndiResourceLocator.lookup(JndiResourceLocator.java:62)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:584)
 at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:890)
 at ognl.ObjectMethodAccessor.callStaticMethod(ObjectMethodAccessor.java:48)
 at ognl.OgnlRuntime.callStaticMethod(OgnlRuntime.java:911)
 at ognl.ASTStaticMethod.getValueBody(ASTStaticMethod.java:65)
 at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:171)
 at ognl.SimpleNode.getValue(SimpleNode.java:211)
 at ognl.Ognl.getValue(Ognl.java:333)
 at ognl.Ognl.getValue(Ognl.java:310)
 at org.seasar.framework.util.OgnlUtil.getValue(OgnlUtil.java:98)
 ... 29 more

diconファイルの書き方が悪いのか、はたまた、jarが足りないのか・・・・
diconファイルはこんな感じです。
<components>
 <include path="app.dicon"/>
 <component class="training.service.crudService"/>
</components>

すみません。。。。よろしくお願いします。
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://ml.seasar.org/archives/seasar-user/attachments/20101005/96297b12/attachment.html>


Seasar-user メーリングリストの案内