[Seasar-user:19432] Re: dataSourceNameはnullあるいは空であってはいけません
吉村 実
[E-MAIL ADDRESS DELETED]
2010年 3月 2日 (火) 19:33:09 JST
小林様
お世話になっております。
> 試しに,jdbc.dicon から ForOp の方の
> DataSource 定義をコメントアウトして実行して
> みてください.
Tomcat起動時にエラーとなりました。
(下記「ログ」参照)
また、参考になるか分かりませんが、
「jdbc.dicon」を以下3パターン変更して実行した場合は
どれもプログラムの条件分岐にかかわらず、
OPUSERの方へアクセスしにいきます。
1
========================================================================
<component name="xaDataSource"
class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
<property name="driverClassName">
"oracle.jdbc.OracleDriver"
</property>
<property name="URL">
"jdbc:oracle:oci:@ttdb"
</property>
<property name="user">"OPUSER"</property>
<property name="password">"OPPASSWORD"</property>
</component>
<component name="statementFactory"
class="org.seasar.extension.jdbc.impl.BasicStatementFactory"/>
<component name="xaDataSourceForOp"
class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
<property name="driverClassName">
"oracle.jdbc.OracleDriver"
</property>
<property name="URL">
"jdbc:oracle:oci:@ttdb"
</property>
<property name="user">"COUSER"</property>
<property name="password">"COPASSWORD"</property>
</component>
<component name="statementFactoryForOp"
class="org.seasar.extension.jdbc.impl.BasicStatementFactory"/>
========================================================================
2
========================================================================
<component name="xaDataSource"
class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
<property name="driverClassName">
"oracle.jdbc.OracleDriver"
</property>
<property name="URL">
"jdbc:oracle:oci:@ttdb"
</property>
<property name="user">"OPUSER"</property>
<property name="password">"OPPASSWORD"</property>
</component>
<component name="statementFactory"
class="org.seasar.extension.jdbc.impl.BasicStatementFactory"/>
<component name="xaDataSourceForOp"
class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
<property name="driverClassName">
"oracle.jdbc.OracleDriver"
</property>
<property name="URL">
"jdbc:oracle:oci:@ttdb"
</property>
<property name="user">"OPUSER"</property>
<property name="password">"OPPASSWORD"</property>
</component>
<component name="statementFactoryForOp"
class="org.seasar.extension.jdbc.impl.BasicStatementFactory"/>
========================================================================
3
========================================================================
<component name="dataSourceForOp"
class="org.seasar.extension.dbcp.impl.DataSourceImpl">
<arg>connectionPool</arg>
</component>
‥‥‥
<component name="dataSource"
class="org.seasar.extension.dbcp.impl.DataSourceImpl">
<arg>connectionPoolForOp</arg>
</component>
========================================================================
「ログ」
DEBUG 2010-03-02 18:57:14,578 [main] S2Containerを作成しました。
path=allservice.dicon
DEBUG 2010-03-02 18:57:14,578 [main] S2Containerを作成しました。
path=app.dicon
ERROR 2010-03-02 18:57:15,046 [main] StandardWrapper.Throwable
org.seasar.framework.exception.OgnlRuntimeException: [ESSR0073]OGNLで例外が
発生しました。理由は[ESSR0046]コンポーネント(dataSourceForOp)が見つかりませ
ん at file:///C:/eclipse/tomcat5.5/dao_tt.dicon(74)
at org.seasar.framework.util.OgnlUtil.getValue(OgnlUtil.java:106)
at
org.seasar.framework.container.ognl.OgnlExpression.evaluate(OgnlExpression.j
ava:64)
at
org.seasar.framework.container.impl.ArgDefImpl.getValue(ArgDefImpl.java:60)
at
org.seasar.framework.container.assembler.AbstractConstructorAssembler.assemb
leManual(AbstractConstructorAssembler.java:96)
at
org.seasar.framework.container.assembler.AbstractConstructorAssembler.assemb
le(AbstractConstructorAssembler.java:53)
at
org.seasar.framework.container.deployer.SingletonComponentDeployer.assemble(
SingletonComponentDeployer.java:64)
at
org.seasar.framework.container.deployer.SingletonComponentDeployer.deploy(Si
ngletonComponentDeployer.java:48)
at
org.seasar.framework.container.deployer.SingletonComponentDeployer.init(Sing
letonComponentDeployer.java:76)
at
org.seasar.framework.container.impl.ComponentDefImpl.init(ComponentDefImpl.j
ava:236)
at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.jav
a:563)
at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.jav
a:560)
at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.jav
a:560)
at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.jav
a:560)
at
org.seasar.framework.container.impl.S2ContainerImpl.init(S2ContainerImpl.jav
a:560)
at
org.seasar.framework.container.factory.SingletonS2ContainerFactory.init(Sing
letonS2ContainerFactory.java:150)
at
org.seasar.framework.container.servlet.SingletonS2ContainerInitializer.initi
alize(SingletonS2ContainerInitializer.java:55)
at
org.seasar.framework.container.servlet.S2ContainerServlet.initializeContaine
r(S2ContainerServlet.java:139)
at
org.seasar.framework.container.servlet.S2ContainerServlet.init(S2ContainerSe
rvlet.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:11
39)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3996)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:448)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:592)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.seasar.framework.container.ComponentNotFoundRuntimeException:
[ESSR0046]コンポーネント(dataSourceForOp)が見つかりません
at
org.seasar.framework.container.impl.S2ContainerBehavior$DefaultProvider.acqu
ireFromGetComponentDef(S2ContainerBehavior.java:165)
at
org.seasar.framework.container.impl.S2ContainerBehavior$DefaultProvider.acqu
ireFromGetComponent(S2ContainerBehavior.java:158)
at
org.seasar.framework.container.impl.S2ContainerBehavior.acquireFromGetCompon
ent(S2ContainerBehavior.java:62)
at
org.seasar.framework.container.impl.S2ContainerImpl.getComponent(S2Container
Impl.java:124)
at
org.seasar.framework.container.ognl.S2ContainerPropertyAccessor.getProperty(
S2ContainerPropertyAccessor.java:36)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1758)
at ognl.ASTProperty.getValueBody(ASTProperty.java:92)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:171)
at ognl.SimpleNode.getValue(SimpleNode.java:211)
at ognl.ASTChain.getValueBody(ASTChain.java:109)
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)
... 35 more
以上、
御手数をお掛けしておりますが、
宜しくお願い致します。
Seasar-user メーリングリストの案内