[Seasar-user:17536] [SAStruts] S2ContainerListenerを登録すると起動時に

徳永 広樹 [E-MAIL ADDRESS DELETED]
2009年 5月 27日 (水) 15:41:10 JST


徳永です。お世話になります。

SAStrutsにS2ContainerListenerを登録し、production(COOL deployモード)で
起動を行った場合以下のエラーが発生します。
(ct、utの環境では発生しません)

java.lang.NullPointerException
	at org.seasar.struts.customizer.ActionCustomizer.customize(ActionCustomizer.java:81)
	at org.seasar.framework.container.customizer.CustomizerChain.doCustomize(CustomizerChain.java:140)
	at org.seasar.framework.container.customizer.AbstractCustomizer.customize(AbstractCustomizer.java:145)
	at org.seasar.framework.container.creator.ComponentCreatorImpl.customize(ComponentCreatorImpl.java:309)
	at org.seasar.framework.container.creator.ComponentCreatorImpl.createComponentDef(ComponentCreatorImpl.java:269)
	at org.seasar.framework.container.cooldeploy.CoolComponentAutoRegister.createComponentDef(CoolComponentAutoRegister.java:177)
	at org.seasar.framework.container.cooldeploy.CoolComponentAutoRegister.processClass(CoolComponentAutoRegister.java:156)
	at org.seasar.framework.util.ClassTraversal.traverseFileSystem(ClassTraversal.java:124)
	at org.seasar.framework.util.ClassTraversal.traverseFileSystem(ClassTraversal.java:118)
	at org.seasar.framework.util.ClassTraversal.forEach(ClassTraversal.java:76)
	at org.seasar.framework.util.ResourcesUtil$FileSystemResources.forEach(ResourcesUtil.java:351)
	at org.seasar.framework.container.cooldeploy.CoolComponentAutoRegister.registerAll(CoolComponentAutoRegister.java:128)
	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:597)
	at org.seasar.framework.util.MethodUtil.invoke(MethodUtil.java:96)
	at org.seasar.framework.container.assembler.AbstractMethodAssembler.invoke(AbstractMethodAssembler.java:94)
	at org.seasar.framework.container.assembler.DefaultInitMethodAssembler.assemble(DefaultInitMethodAssembler.java:49)
	at org.seasar.framework.container.deployer.SingletonComponentDeployer.assemble(SingletonComponentDeployer.java:69)
	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.S2ContainerImpl.init(S2ContainerImpl.java:560)
	at org.seasar.framework.container.factory.SingletonS2ContainerFactory.init(SingletonS2ContainerFactory.java:150)
	at org.seasar.framework.container.servlet.SingletonS2ContainerInitializer.initialize(SingletonS2ContainerInitializer.java:55)
	at org.seasar.framework.container.servlet.S2ContainerListener.initializeContainer(S2ContainerListener.java:50)
	at org.seasar.framework.container.servlet.S2ContainerListener.contextInitialized(S2ContainerListener.java:57)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
	at java.lang.Thread.run(Thread.java:637)


実際にやりたいこととしては、
「ServletContextListenerにてComponentを取得したい」
と考えております。

ここで質問なのですが
1.ServletContextListenerにてComponentを取得するという考え方自体が
あまりよくないのでしょうか?

2.SAStrutsではS2ContainerListenerを使用するべきではないのでしょうか?

3.使用すべきでない場合代替手段などありますでしょうか?

以上、ご教授よろしくお願い致します。



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