読者です 読者をやめる 読者になる 読者になる

BuriAutoSelectProcessorImplの判定ルールが?(続き)

uri-user.diconのBuriEngineConfigでParticipantProviderを書かなかったらSimpleになりますよ

だとは思ったんですが、以下のような感じです。


まずスタックトレース

java.lang.NullPointerException
	at org.seasar.buri.dao.util.impl.BuriUserUtilImpl.updateBuriParticipantContextUser(BuriUserUtilImpl.java:108) ←★Simpleのつもりなので当然ParticipantProviderは指定してないのでぬるぽ発生
	at org.seasar.buri.dao.util.impl.BuriUserUtilImpl.getTgtRoleInfoList(BuriUserUtilImpl.java:94)
	at org.seasar.buri.dao.util.impl.BuriUserUtilImpl$$EnhancedByS2AOP$$c943d1.$$getTgtRoleInfoList$$invokeSuperMethod$$(BuriUserUtilImpl$$EnhancedByS2AOP$$c943d1.java)
	at org.seasar.buri.dao.util.impl.BuriUserUtilImpl$$EnhancedByS2AOP$$c943d1$$MethodInvocation$$getTgtRoleInfoList1.proceed(MethodInvocationClassGenerator.java)
	at org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:45)
	at org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:59)
	at org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43)
	at org.seasar.framework.aop.interceptors.InterceptorChain.invoke(InterceptorChain.java:42)
	at org.seasar.buri.dao.util.impl.BuriUserUtilImpl$$EnhancedByS2AOP$$c943d1$$MethodInvocation$$getTgtRoleInfoList1.proceed(MethodInvocationClassGenerator.java)
	at org.seasar.buri.dao.util.impl.BuriUserUtilImpl$$EnhancedByS2AOP$$c943d1.getTgtRoleInfoList(BuriUserUtilImpl$$EnhancedByS2AOP$$c943d1.java)
	at org.seasar.buri.dao.util.impl.BuriStateUserUtilImpl.saveStatus(BuriStateUserUtilImpl.java:25)
	at org.seasar.buri.dao.util.impl.BuriStateUserUtilImpl$$EnhancedByS2AOP$$1581e80.$$saveStatus$$invokeSuperMethod$$(BuriStateUserUtilImpl$$EnhancedByS2AOP$$1581e80.java)
	at org.seasar.buri.dao.util.impl.BuriStateUserUtilImpl$$EnhancedByS2AOP$$1581e80$$MethodInvocation$$saveStatus0.proceed(MethodInvocationClassGenerator.java)
	at org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:45)
	at org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:59)
	at org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43)
	at org.seasar.framework.aop.interceptors.InterceptorChain.invoke(InterceptorChain.java:42)
	at org.seasar.buri.dao.util.impl.BuriStateUserUtilImpl$$EnhancedByS2AOP$$1581e80$$MethodInvocation$$saveStatus0.proceed(MethodInvocationClassGenerator.java)
	at org.seasar.buri.dao.util.impl.BuriStateUserUtilImpl$$EnhancedByS2AOP$$1581e80.saveStatus(BuriStateUserUtilImpl$$EnhancedByS2AOP$$1581e80.java)
	at org.seasar.buri.util.packages.abst.AbstBuriExeProcessDataAccess.exitFlow(AbstBuriExeProcessDataAccess.java:49)
	at sample.sample_flow1.sample_act2_process(ANONYMOUS.java:37)
	at sample.sample_flow1.sample_act2_start(ANONYMOUS.java:30)
	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:49)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:43)
	at org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:59)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:41)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.runThisMethodName(AbstBuriExecProcess.java:115)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.execActivity(AbstBuriExecProcess.java:108)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.startActivity(AbstBuriExecProcess.java:96)
	at sample.sample_flow1.sample_act5_next(ANONYMOUS.java:203)
	at sample.sample_flow1.sample_act5_process(ANONYMOUS.java:196)
	at sample.sample_flow1.sample_act5_start(ANONYMOUS.java:192)
	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:49)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:43)
	at org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:59)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:41)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.runThisMethodName(AbstBuriExecProcess.java:115)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.execActivity(AbstBuriExecProcess.java:108)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.entryActivity(AbstBuriExecProcess.java:88)
	at org.seasar.buri.engine.impl.WakanagoEngineImpl.execActivity(WakanagoEngineImpl.java:187)
	at org.seasar.buri.engine.impl.WakanagoEngineImpl.execute(WakanagoEngineImpl.java:130)
	at org.seasar.buri.engine.processor.impl.StandardBuriProcessorImpl.toNextStatusOne(StandardBuriProcessorImpl.java:59)
	at org.seasar.buri.engine.processor.impl.StandardBuriProcessorImpl.toNextStatus(StandardBuriProcessorImpl.java:49)  ←★ここでStandardが選択されてることがわかる
	at org.seasar.buri.engine.processor.impl.BuriAutoSelectProcessorImpl.toNextStatus(BuriAutoSelectProcessorImpl.java:49)
	at org.seasar.buri.bao.interceptor.BaoInvokerImpl.invoke(BaoInvokerImpl.java:48)
	at org.seasar.buri.bao.interceptor.BaoInterceptorImpl.invoke(BaoInterceptorImpl.java:35)
	at nobeans.HogeBao$$EnhancedByS2AOP$$1ae9aaa$$MethodInvocation$$enter5.proceed(MethodInvocationClassGenerator.java)
	at nobeans.HogeBao$$EnhancedByS2AOP$$1ae9aaa.enter(HogeBao$$EnhancedByS2AOP$$1ae9aaa.java)
	at nobeans.HogeBaoTest.testBao呼び出しTx(HogeBaoTest.java:25)
〜(省略)〜

次にburi-user.dicon。ParticipantProviderは指定していません。

<components>
	<!-- ぶり利用者編集必須のdicon -->
	
	<component name="BuriEngineConfig" class="org.seasar.buri.engine.impl.BuriEngineConfigImpl">
		<initMethod name="addResourceConfig">
			<arg>"nobeans/xpdl/フロー定義.xpdl"</arg>
			<arg>"サンプル"</arg>
		</initMethod>
	</component>
</components>

参考までにBaoとTest。

package nobeans;

import java.util.List;

import org.seasar.buri.bao.BuriConvert;

public interface HogeBao {

    public static final String PROCESS = "サンプル.サンプルのフロー1";
    public static final Class TARGETDTO = HogeDto.class;
    public static BuriConvert CONVERTER[] = {
        new BuriConvert(Long.class, "hogeDao.getById(#data)"),
    };

    public void enter(HogeDto hoge);

    public static final String goRoute1_ACTIVITY = "ストップ";
    public static final String goRoute1_ACTION = "route1";
    public void goRoute1(HogeDto hoge);

    public static final String goRoute2_ACTIVITY = "ストップ";
    public static final String goRoute2_ACTION = "route2";
    public void goRoute2(long hogeId);
    
    public static final String getHogesInStopping_ACTIVITY = "ストップ";
    public List<HogeDto> getHogesInStopping();
    
    public static final String getHogesInRoute1_ACTIVITY = "ルート1";
    public List<HogeDto> getHogesInRoute1();
    
    public static final String getHogesInRoute2_ACTIVITY = "ルート2";
    public List<HogeDto> getHogesInRoute2();
}
package nobeans;

import org.seasar.dao.unit.S2DaoTestCase;

public class HogeBaoTest extends S2DaoTestCase {

    private HogeBao bao;

    @Override
    protected void setUp() throws Exception {
        include("nobeans/dicon/allbao.dicon");
    }

    public void testBao呼び出しTx() throws Exception {

        HogeDto hoge = new HogeDto(0, "ほげ");

        assertEquals(0, bao.getHogesInStopping().size());
        assertEquals(0, bao.getHogesInRoute1().size());
        assertEquals(0, bao.getHogesInRoute2().size());

        bao.enter(hoge);

        assertEquals(1, bao.getHogesInStopping().size());
        assertEquals(0, bao.getHogesInRoute1().size());
        assertEquals(0, bao.getHogesInRoute2().size());
    }
}

後、自前Bao用のdicon。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN"
	"http://www.seasar.org/dtd/components21.dtd">
<components>
	<include path="buri/dicon/bao.dicon"/>
	<include path="nobeans/dicon/alldao.dicon"/>

	<component name="hogeBao" class="nobeans.HogeBao">
		<aspect>bao.interceptor</aspect>
	</component>
</components>