$B?";3$G$9!#(B<br>$B$^$?<ALd$5$;$F$/$@$5$$!#:#EY$O(BS2Container.PHP5$B$K$D$$$F$G$9!#(B<br clear="all"><br>s2container.php5$B$N(Bexample/dicon/autobinding/$BG[2<$N%U%!%$%k$r=$@5$7$F!"(B<br>FileSystemComponentAutoRegister$B$r;HMQ$9$k%5%s%W%k$r:n$C$F$_$^$7$?!#(B<br>$B$G!"2<5-$N$h$&$K%U%!%$%k$N8!:wBP>]%G%#%l%/%H%j$r#2$D(B(test1,test2)$B@_Dj(B<br>
$B$7$?$H$3$m!"%(%i!<$,H/@8$7$^$7$?!#(B<br><br>$B%a%C%;!<%8FbMF$+$i;!$9$k$K!"(BHashMapImpl$B%/%i%9$r#2EYEPO?$7$F(BMap<br>$B%$%s%?!<%U%'!<%9$r%-!<$H$7$F(BgetComponent()$B$,<B9T$5$l$?$?$a$K%(%i!<(B<br>$B$H$J$C$?LOMM$G$9!#(B<br><br>$B;d$N(Bdicon$B%U%!%$%k5-=RFbMF$K8m$j$,$"$j$^$9$G$7$g$&$+!)(B<br>FileSystemComponentAutoRegister$B$r;HMQ$9$k:]$K2?$i$+$N@)Ls;v9`$,$"$k$N(B<br>$B$G$7$g$&$+!)(B
<br><br>$B65$($F$/$@$5$$!#$h$m$7$/$*4j$$$7$^$9!#(B<br><br>$B0J>e$G$9!#(B<br><br>---------$B!Z0J2<!";29M![(B------<br><br>----[$B%U%!%$%k$N9=@.(B]----<br>helloworlderror/<br>&nbsp;&nbsp;&nbsp; index.php<br>&nbsp;&nbsp;&nbsp; xxxxx.dicon<br>&nbsp;&nbsp;&nbsp; components21.dtd<br>&nbsp;&nbsp;&nbsp; ($BN,!K(B<br>&nbsp;&nbsp;&nbsp; test1/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Map.class.php
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HashMapImpl.class.php<br>&nbsp;&nbsp;&nbsp; test2/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ($B%U%!%$%k$J$7!K(B<br><br>-------[$B;HMQ$7$?(Bdicon$B%U%!%$%k(B]---------<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;Shift_JIS&quot;?&gt;<br>&lt;!DOCTYPE components PUBLIC &quot;-//SEASAR//DTD S2Container//EN&quot;
<br>&quot;components21.dtd&quot;&gt;<br>&lt;components&gt;<br>&nbsp;&nbsp;&nbsp; &lt;component class=&quot;S2Container_FileSystemComponentAutoRegister&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name=&quot;instanceMode&quot;&gt;&quot;singleton&quot;&lt;/property&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;initMethod name=&quot;addClassPattern&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg&gt;&quot;%APP_BASE_PATH%/test1&quot;&lt;/arg&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg&gt;&quot;.+Impl&quot;&lt;/arg&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/initMethod&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;initMethod name=&quot;addClassPattern&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg&gt;&quot;%APP_BASE_PATH%/test2&quot;&lt;/arg&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg&gt;&quot;.+Impl&quot;&lt;/arg&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/initMethod&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;initMethod name=&quot;registerAll&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/component&gt;<br>&nbsp;&nbsp;&nbsp; &lt;component autoBinding=&quot;auto&quot; class=&quot;AutoHelloSetterInjection&quot;/&gt;<br>&lt;/components&gt;<br><br>-----[$B<B9T$7$?%3!<%I(B]-----
<br>($BN,!K(B<br>require_once('Hello.class.php');<br>require_once('test1/Map.class.php');<br>require_once('test1/HashMapImpl.class.php');<br>require_once('AutoHelloSetterInjection.class.php');<br><br>$PATH = APP_BASE_PATH . &quot;/AutoHelloSetterInjectionError.dicon&quot;;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>$container = S2ContainerFactory::create($PATH);<br>$container-&gt;init();<br>$hello = $container-&gt;getComponent('Hello');<br>$hello-&gt;showMessage();<br><br>----[$B=PNO$5$l$?%(%i!<%a%C%;!<%8(B]----<br><br><b>Fatal error
</b>: Uncaught exception
'S2Container_TooManyRegistrationRuntimeException' with message 'Two or
more components&lt;HashMapImpl, HashMapImpl&gt; are registered in Map'
in
/home/ueyama/lib/s2container.php5/build/s2container.php5/S2Container/S2Container_TooManyRegistrationComponentDefImpl.class.php:64
Stack trace:
#0
/home/ueyama/lib/s2container.php5/build/s2container.php5/s2container.core.classes.php(119):
S2Container_TooManyRegistrationComponentDefImpl-&gt;getComponent()
#1
/home/ueyama/lib/s2container.php5/build/s2container.php5/s2container.core.classes.php(2004):
S2ContainerImpl-&gt;getComponent('Map')
#2
/home/ueyama/lib/s2container.php5/build/s2container.php5/s2container.core.classes.php(1624):
S2Container_AutoPropertyAssembler-&gt;assemble(Object(AutoHelloSetterInjection))
#3
/home/ueyama/lib/s2container.php5/build/s2container.php5/s2container.core.classes.php(1607):
S2Container_SingletonComponentDeployer-&gt;_assemble()
#4
/home/ueyama/lib/s2container.php5/build/s2container.php5/s2container.core.classes.php(1629):
S2Container_S in <b>/home/ueyama/lib/s2container.php5/build/s2container.php5/S2Container/S2Container_TooManyRegistrationComponentDefImpl.class.php</b> on line <b>64<br><br><span style="font-weight: bold;"><span style="font-weight: bold;">
</span></span></b><br>-- <br>------------------------------------------------------------------<br>&nbsp;&nbsp;$B?";3!!G=@.(B@$BJ!2,(B<br>$B!!(Bmailto:<a href="mailto:ueyama@gmail.com">ueyama@gmail.com</a><br>------------------------------------------------------------------
<br>