[Seasar-user:12431] Teeda Ajax ajaxXxxxxメソッドでコンポーネントが登録されていない?
kiyoshi hosoda
[E-MAIL ADDRESS DELETED]
2008年 1月 10日 (木) 14:28:15 JST
細田です。こんにちは。
Teeda AjaxでPageクラスに作成したajaxXxxxxメソッドの中で、実行時に
NullPointerExceptionが発生します。発生している箇所は自動バインディング
されているはずのDaoを参照している箇所です。
同じDaoが同じPageクラスのdoXxxxメソッドでは自動バインディングされており、
NullPointerExceptionは発生しません。コンソールのログを見ても、コンポーネントの
登録を行っいるように見え、原因がわかりません。
原因究明のために調べるべきところ、対処方法などありましたら、教えていただけ
ないでしょうか?
環境は
・Seasar2.4.20
・teeda 1.0.11-SP3
です。
Pageクラス(抜粋)
----------
public TerminologicDictionaryDao terminologicDictionaryDao;
public Class doSearch() {
List<TerminologicDictionary> items =
terminologicDictionaryDao.getListByJapanesePrefix(condition);
japaneseItems = new ArrayList<Map<String, String>>();
for (TerminologicDictionary item: items) {
Map<String,String> option = new HashMap<String, String>();
option.put("label", item.japanese);
option.put("value", item.id.toString());
japaneseItems.add(option);
}
return null;
}
public Map<String, String> ajaxGetDetail() {
TerminologicDictionary entity =
terminologicDictionaryDao.getEntityByPrimaryKey(id); <= この行でぬるぽ発生
Map<String, String> result = new HashMap<String, String>();
result.put("japanese", entity.japanese);
result.put("summary", entity.summary);
return result;
}
* ちなみにidはnullではありません。
----------
コンソールログ(抜粋)
----------
2008-01-10 14:05:13,967 [http-8080-Processor24] DEBUG
org.seasar.framework.container.hotdeploy.HotdeployBehavior - HOT
deployを開始します
2008-01-10 14:05:14,138 [http-8080-Processor24] DEBUG
org.seasar.framework.container.util.S2ContainerUtil -
クラス(tools.web.dictionary.SearchWordPage[dictionary_searchWordPage])のコンポーネント定義を登録します
2008-01-10 14:05:14,239 [http-8080-Processor24] DEBUG
org.seasar.framework.container.util.S2ContainerUtil -
クラス(tools.dao.TerminologicDictionaryDao[terminologicDictionaryDao])のコンポーネント定義を登録します
2008-01-10 14:05:14,279 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - BEGIN
tools.web.dictionary.SearchWordPage#setTerminologicDictionaryDao(tools.dao.TerminologicDictionaryDao$$EnhancedByS2AOP$$[E-MAIL ADDRESS DELETED])
2008-01-10 14:05:14,279 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - END
tools.web.dictionary.SearchWordPage#setTerminologicDictionaryDao(tools.dao.TerminologicDictionaryDao$$EnhancedByS2AOP$$[E-MAIL ADDRESS DELETED])
: null
2008-01-10 14:05:14,289 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - BEGIN
tools.web.dictionary.SearchWordPage#doSearch()
2008-01-10 14:05:14,289 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - BEGIN
tools.dao.TerminologicDictionaryDao#getListByJapanesePrefix(こん)
2008-01-10 14:05:14,289 [http-8080-Processor24] DEBUG
org.seasar.extension.jdbc.query.AutoSelectImpl - select T1_.ID,
T1_.JAPANESE, T1_.ENGLISH, T1_.SUMMARY, T1_.DEPRECATED,
T1_.RECOMMENDED_JAPANESE, T1_.VERSION from TERMINOLOGIC_DICTIONARY T1_
where (T1_.JAPANESE LIKE 'こん%')
2008-01-10 14:05:14,289 [http-8080-Processor24] DEBUG
org.seasar.extension.dbcp.impl.ConnectionPoolImpl -
論理的なコネクションを取得しました。tx=null
2008-01-10 14:05:14,319 [http-8080-Processor24] DEBUG
org.seasar.extension.dbcp.impl.ConnectionWrapperImpl -
論理的なコネクションを閉じました。tx=null
2008-01-10 14:05:14,319 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - END
tools.dao.TerminologicDictionaryDao#getListByJapanesePrefix(こん) :
[[E-MAIL ADDRESS DELETED],
[E-MAIL ADDRESS DELETED],
[E-MAIL ADDRESS DELETED],
[E-MAIL ADDRESS DELETED],
[E-MAIL ADDRESS DELETED]]
2008-01-10 14:05:14,319 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - END
tools.web.dictionary.SearchWordPage#doSearch() : null
2008-01-10 14:05:14,329 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - BEGIN
tools.web.dictionary.SearchWordPage#prerender()
2008-01-10 14:05:14,329 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - END
tools.web.dictionary.SearchWordPage#prerender() : null
2008-01-10 14:05:14,439 [http-8080-Processor24] DEBUG
org.seasar.framework.container.hotdeploy.HotdeployBehavior - HOT
deployを終了しました
2008-01-10 14:05:14,781 [http-8080-Processor24] DEBUG
org.seasar.framework.container.hotdeploy.HotdeployBehavior - HOT
deployを開始します
2008-01-10 14:05:14,801 [http-8080-Processor24] DEBUG
org.seasar.framework.container.util.S2ContainerUtil -
クラス(tools.web.dictionary.SearchWordPage[dictionary_searchWordPage])のコンポーネント定義を登録します
2008-01-10 14:05:14,851 [http-8080-Processor24] DEBUG
org.seasar.framework.container.util.S2ContainerUtil -
クラス(tools.dao.TerminologicDictionaryDao[terminologicDictionaryDao])のコンポーネント定義を登録します
2008-01-10 14:05:14,901 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - BEGIN
tools.web.dictionary.SearchWordPage#setTerminologicDictionaryDao(tools.dao.TerminologicDictionaryDao$$EnhancedByS2AOP$$[E-MAIL ADDRESS DELETED])
2008-01-10 14:05:14,901 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - END
tools.web.dictionary.SearchWordPage#setTerminologicDictionaryDao(tools.dao.TerminologicDictionaryDao$$EnhancedByS2AOP$$[E-MAIL ADDRESS DELETED])
: null
2008-01-10 14:05:14,901 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - BEGIN
tools.web.dictionary.SearchWordPage#ajaxGetDetail()
2008-01-10 14:05:14,901 [http-8080-Processor24] DEBUG
org.seasar.framework.aop.interceptors.TraceInterceptor - END
tools.web.dictionary.SearchWordPage#ajaxGetDetail()
Throwable:java.lang.NullPointerException
2008-01-10 14:05:14,921 [http-8080-Processor24] DEBUG
org.seasar.framework.container.hotdeploy.HotdeployBehavior - HOT
deployを終了しました
2008-01-10 14:05:14,921 [http-8080-Processor24] ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/tools].[ajaxServlet]
- サーブレット ajaxServlet のServlet.service()が例外を投げました
java.lang.NullPointerException
at tools.web.dictionary.SearchWordPage.ajaxGetDetail(SearchWordPage.java:60)
at tools.web.dictionary.SearchWordPage$$EnhancedByS2AOP$$e03f50.$$ajaxGetDetail$$invokeSuperMethod$$(SearchWordPage$$EnhancedByS2AOP$$e03f50.java)
at tools.web.dictionary.SearchWordPage$$EnhancedByS2AOP$$e03f50$$MethodInvocation$$ajaxGetDetail3.proceed(MethodInvocationClassGenerator.java)
at org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:73)
--------------
Seasar-user メーリングリストの案内