[Seasar-user:10403] S2DxoのConversionRule指定でIllegalArgumentException

出羽 健一 [E-MAIL ADDRESS DELETED]
2007年 9月 8日 (土) 14:27:35 JST


出羽です。

S2Dxoのnull対策のための三項演算子を使っていて、不具合かも知れない(私の勘違い?)現象を発見したので、報告します。

■ケース1:通常のマッピング
 @ConversionRule("empName : name")	
 public EmpDto[] convert(List<Emp> emp);
 ⇒ 正常に動きます。

■ケース2:null対策用に三項演算子を使ったマッピング
 @ConversionRule("'deptName' : dept != null ? dept.name : null")
 public EmpDto[] convert(List<Emp> emp);
 ⇒ 正常に動きます。

■ケース3:ケース1とケース2を組み合わせたケース
 @ConversionRule("empName : name, 'deptName' : dept != null ? dept.name : null")
 public EmpDto[] convert(List<Emp> emp);
 ⇒ 例外が発生します。

プロダクトのバージョン情報:
 S2-Container: 2.4.17
 Teeda: 1.0.11-RC1

以上、宜しくお願いします。

********** ケース3のスタックトレース **********
    * empName : name, 'deptName' : dept != null ? dept.name : null(-3)

java.lang.IllegalArgumentException: empName : name, 'deptName' : dept != null ? dept.name : null(-3)
  at org.seasar.extension.dxo.util.DxoUtil#addQuote (DxoUtil.java#158)
  at org.seasar.extension.dxo.util.DxoUtil#parseMap (DxoUtil.java#102)
  at org.seasar.extension.dxo.converter.impl.ConversionContextImpl#createContextInfo (ConversionContextImpl.java#330)
  at org.seasar.extension.dxo.converter.impl.ConversionContextImpl#getContextInfo (ConversionContextImpl.java#302)
  at org.seasar.extension.dxo.converter.impl.ConversionContextImpl# (ConversionContextImpl.java#169)
  at org.seasar.extension.dxo.command.impl.AbstractDxoCommand#createContext (AbstractDxoCommand.java#125)
  at org.seasar.extension.dxo.command.impl.BeanToBeanDxoCommand#convertScalar (BeanToBeanDxoCommand.java#58)
  at org.seasar.extension.dxo.command.impl.AbstractDxoCommand$ListToArrayConversionHelper#convert (AbstractDxoCommand.java#239)
  at org.seasar.extension.dxo.command.impl.AbstractDxoCommand#execute (AbstractDxoCommand.java#77)
  at org.seasar.extension.dxo.DxoInterceptor#invoke (DxoInterceptor.java#57)
  at sample.web.emp2.Emp2Dxo$$EnhancedByS2AOP$$a0eb2a$$MethodInvocation$$convert0#proceed (MethodInvocationClassGenerator.java)
  at org.seasar.framework.aop.interceptors.TraceInterceptor#invoke (TraceInterceptor.java#73)
  at sample.web.emp2.Emp2Dxo$$EnhancedByS2AOP$$a0eb2a$$MethodInvocation$$convert0#proceed (MethodInvocationClassGenerator.java)
  at sample.web.emp2.Emp2Dxo$$EnhancedByS2AOP$$a0eb2a#convert (Emp2Dxo$$EnhancedByS2AOP$$a0eb2a.java)
  at sample.web.emp2.EmpListPage#prerender (EmpListPage.java#33)
  at sample.web.emp2.EmpListPage$$EnhancedByS2AOP$$d1a34a#$$prerender$$invokeSuperMethod$$ (EmpListPage$$EnhancedByS2AOP$$d1a34a.java)
  at sample.web.emp2.EmpListPage$$EnhancedByS2AOP$$d1a34a$$MethodInvocation$$prerender1#proceed (MethodInvocationClassGenerator.java)
  at org.seasar.extension.tx.RequiredInterceptor#invoke (RequiredInterceptor.java#48)
  at sample.web.emp2.EmpListPage$$EnhancedByS2AOP$$d1a34a$$MethodInvocation$$prerender1#proceed (MethodInvocationClassGenerator.java)
  at org.seasar.framework.aop.interceptors.ThrowsInterceptor#invoke (ThrowsInterceptor.java#73)
  at sample.web.emp2.EmpListPage$$EnhancedByS2AOP$$d1a34a$$MethodInvocation$$prerender1#proceed (MethodInvocationClassGenerator.java)
  at sample.web.emp2.EmpListPage$$EnhancedByS2AOP$$d1a34a#prerender (EmpListPage$$EnhancedByS2AOP$$d1a34a.java)
  at sun.reflect.NativeMethodAccessorImpl#invoke0 (NativeMethodAccessorImpl.java)
  at sun.reflect.NativeMethodAccessorImpl#invoke (NativeMethodAccessorImpl.java#39)
  at sun.reflect.DelegatingMethodAccessorImpl#invoke (DelegatingMethodAccessorImpl.java#25)
  at java.lang.reflect.Method#invoke (Method.java#585)
  at org.seasar.framework.util.MethodUtil#invoke (MethodUtil.java#73)
  at org.seasar.framework.beans.impl.BeanDescImpl#invoke (BeanDescImpl.java#213)
  at org.seasar.teeda.extension.html.impl.HtmlComponentInvokerImpl#invoke (HtmlComponentInvokerImpl.java#159)
  at org.seasar.teeda.extension.html.impl.HtmlComponentInvokerImpl#invokePrerender (HtmlComponentInvokerImpl.java#134)
  at org.seasar.teeda.extension.render.TViewRootRenderer#invoke (TViewRootRenderer.java#312)
  at org.seasar.teeda.extension.render.TViewRootRenderer#encodeBegin (TViewRootRenderer.java#140)
  at javax.faces.component.UIComponentBase#encodeBegin (UIComponentBase.java#330)
  at javax.faces.component.UIViewRoot#encodeBegin (UIViewRoot.java#100)
  at javax.faces.webapp.UIComponentTag#encodeBegin (UIComponentTag.java#240)
  at javax.faces.webapp.UIComponentTag#doStartTag (UIComponentTag.java#177)
  at org.seasar.teeda.extension.taglib.TViewTag#doStartTag (TViewTag.java#100)
  at org.seasar.teeda.extension.html.processor.ElementProcessorImpl#processTag (ElementProcessorImpl.java#145)
  at org.seasar.teeda.extension.html.processor.ElementProcessorImpl#process (ElementProcessorImpl.java#138)
  at org.seasar.teeda.extension.html.processor.ElementProcessorImpl#process (ElementProcessorImpl.java#119)
  at org.seasar.teeda.extension.html.impl.HtmlViewHandler#renderView (HtmlViewHandler.java#160)
  at org.seasar.teeda.extension.html.impl.HtmlViewHandler#renderView (HtmlViewHandler.java#141)
  at org.seasar.teeda.core.lifecycle.impl.RenderResponsePhase#executePhase (RenderResponsePhase.java#38)
  at org.seasar.teeda.core.lifecycle.AbstractPhase#execute (AbstractPhase.java#57)
  at org.seasar.teeda.core.lifecycle.LifecycleImpl#render (LifecycleImpl.java#131)





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