[Seasar-user:14598] バッチアプリでjavax.servlet.http.HttpServletRequestは必要?

もんきち [E-MAIL ADDRESS DELETED]
2008年 6月 9日 (月) 07:26:54 JST


もんきちです。

現在、学習も兼ねてバッチアプリを作成しております。
mainメソッド内で、SingletonS2ContainerFactory.init();を実行した際に以下のような
Exceptionが発生しております。HttpServletRequestが見つからないと怒られれているよ
うですが、そもそもTOMCAT等のAPサーバ配下にアプリを配置せず、javaコマンドを使って
単体実行するバッチを開発する場合、S2の仕様上servlet-api等のjarをクラスパスに含め
る必要はあるのでしょうか?

以上、ご教示の程よろしくお願いいたします。

Exception in thread "main" java.lang.NoClassDefFoundError: javax.servlet.http.HttpServletRequest
    at org.seasar.framework.container.impl.RequestComponentDef.class$(RequestComponentDef.java:31)
    at org.seasar.framework.container.impl.RequestComponentDef.<init>(RequestComponentDef.java:31)
    at org.seasar.framework.container.impl.S2ContainerImpl.<init>(S2ContainerImpl.java:95)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at java.lang.Class.newInstance0(Class.java:350)
    at java.lang.Class.newInstance(Class.java:303)
    at org.seasar.framework.util.ClassUtil.newInstance(ClassUtil.java:82)
    at org.seasar.framework.container.factory.ComponentsTagHandler.createContainer(ComponentsTagHandler.java:64)
    at org.seasar.framework.container.factory.ComponentsTagHandler.start(ComponentsTagHandler.java:48)
    at org.seasar.framework.xml.SaxHandler.start(SaxHandler.java:121)
    at org.seasar.framework.xml.SaxHandler.start(SaxHandler.java:113)
    at org.seasar.framework.xml.SaxHandler.startElement(SaxHandler.java:49)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(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 org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    at org.seasar.framework.util.SAXParserUtil.parse(SAXParserUtil.java:41)
    at org.seasar.framework.xml.SaxHandlerParser.parse(SaxHandlerParser.java:59)
    at org.seasar.framework.xml.SaxHandlerParser.parse(SaxHandlerParser.java:55)
    at org.seasar.framework.container.factory.XmlS2ContainerBuilder.parse(XmlS2ContainerBuilder.java:71)
    at org.seasar.framework.container.factory.XmlS2ContainerBuilder.build(XmlS2ContainerBuilder.java:58)
    at org.seasar.framework.container.factory.S2ContainerFactory$DefaultProvider.create(S2ContainerFactory.java:200)
    at org.seasar.framework.container.factory.S2ContainerFactory.create(S2ContainerFactory.java:66)
    at org.seasar.framework.container.factory.SingletonS2ContainerFactory.init(SingletonS2ContainerFactory.java:52)
    at org.xyz.active.rss.SampleClass.main(ClXYZ.java:30)
    


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