[Seasar-user:18548] s2junit4のNoClassDefFoundError
秋山 俊郎
[E-MAIL ADDRESS DELETED]
2009年 9月 30日 (水) 18:37:32 JST
秋山です。
s2junit4を使用していてNoClassDefFoundErrorが発生します。
s2は2.4.39、junitは4.4を使用しています。
servlet-apiをクラスパスにいれれば動作するので回避はできるのですが、
バッチプログラム環境ですので気になりました。
servlet-apiに依存するのは仕方ないでしょうか?
java.lang.NoClassDefFoundError: javax/servlet/ServletContext
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.seasar.framework.util.ClassUtil.forName(ClassUtil.java:98)
at
org.seasar.framework.container.factory.ComponentTagHandler.start(ComponentTagHandler.java:43)
at org.seasar.framework.xml.SaxHandler.start(SaxHandler.java:183)
at org.seasar.framework.xml.SaxHandler.start(SaxHandler.java:177)
at org.seasar.framework.xml.SaxHandler.startElement(SaxHandler.java:79)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.seasar.framework.util.SAXParserUtil.parse(SAXParserUtil.java:55)
at
org.seasar.framework.xml.SaxHandlerParser.parse(SaxHandlerParser.java:117)
at
org.seasar.framework.xml.SaxHandlerParser.parse(SaxHandlerParser.java:107)
at
org.seasar.framework.container.factory.XmlS2ContainerBuilder.parse(XmlS2ContainerBuilder.java:170)
at
org.seasar.framework.container.factory.XmlS2ContainerBuilder.build(XmlS2ContainerBuilder.java:148)
at
org.seasar.framework.container.factory.AbstractS2ContainerBuilder.build(AbstractS2ContainerBuilder.java:65)
at
org.seasar.framework.container.factory.S2ContainerFactory$DefaultProvider.build(S2ContainerFactory.java:634)
at
org.seasar.framework.container.factory.S2ContainerFactory$DefaultProvider.create(S2ContainerFactory.java:558)
at
org.seasar.framework.container.factory.S2ContainerFactory.create(S2ContainerFactory.java:144)
at
org.seasar.framework.unit.S2TestMethodRunner.createRootContainer(S2TestMethodRunner.java:357)
at
org.seasar.framework.unit.S2TestMethodRunner.setUpTestContext(S2TestMethodRunner.java:299)
at
org.seasar.framework.unit.S2TestMethodRunner.runMethod(S2TestMethodRunner.java:241)
at
org.seasar.framework.unit.S2TestMethodRunner.run(S2TestMethodRunner.java:172)
at
org.seasar.framework.unit.S2TestClassMethodsRunner.invokeTestMethod(S2TestClassMethodsRunner.java:227)
at
org.seasar.framework.unit.S2TestClassMethodsRunner.run(S2TestClassMethodsRunner.java:89)
at
org.seasar.framework.unit.S2TestClassRunner.run(S2TestClassRunner.java:67)
at org.seasar.framework.unit.Seasar2.run(Seasar2.java:168)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
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: java.lang.ClassNotFoundException: javax.servlet.ServletContext
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 53 more
以上よろしくお願いします。
Seasar-user メーリングリストの案内