[Seasar-user:9504] Re: [Teeda]ファイルアップロードのサンプル
fujihara
[E-MAIL ADDRESS DELETED]
2007年 7月 27日 (金) 13:07:44 JST
お世話になりますfujiharaです。
Churaプロジェクト(Teeda1.07+S2DAO1.0.43)で社内システムを
構築しています。
ファイルアップロードの試験をしていますがうまくいきません。
以下の様なエラーが出てしまいます。
DEBUG 2007-07-27 12:53:33,531 [http-8080-Processor24] HOT deployを開始します
DEBUG 2007-07-27 12:53:33,875 [http-8080-Processor24] クラス(jp.roaso.web.upload.UploadPage[upload_uploadPage])のコンポーネント定義を登録します
DEBUG 2007-07-27 12:53:35,281 [http-8080-Processor24] [HtmlMessage]
forComponent [all] is null. [id=allMessage]
WARN 2007-07-27 12:53:35,328 [http-8080-Processor24]
jp.roaso.web.upload.UploadPage$$EnhancedByS2AOP$$2646f7のプロパティ(uploadedFile)が見つからないので設定をスキップします
2007-07-27 12:53:35,359 [http-8080-Processor24] INFO
org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - No context init
parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
2007-07-27 12:53:35,359 [http-8080-Processor24] INFO
org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - No context init
parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value
true
2007-07-27 12:53:35,359 [http-8080-Processor24] INFO
org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - No context init
parameter 'org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS' found, using
default value true
2007-07-27 12:53:35,359 [http-8080-Processor24] INFO
org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - No context init
parameter 'org.apache.myfaces.DETECT_JAVASCRIPT' found, using default value
false
2007-07-27 12:53:35,359 [http-8080-Processor24] INFO
org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - No context init
parameter 'org.apache.myfaces.AUTO_SCROLL' found, using default value false
2007-07-27 12:53:35,359 [http-8080-Processor24] INFO
org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - No context init
parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value
org.apache.myfaces.renderkit.html.util.DefaultAddResource
2007-07-27 12:53:35,359 [http-8080-Processor24] INFO
org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - No context init
parameter 'org.apache.myfaces.RESOURCE_VIRTUAL_PATH' found, using default
value /faces/myFacesExtensionResource
2007-07-27 12:53:35,359 [http-8080-Processor24] INFO
org.apache.myfaces.shared_tomahawk.config.MyfacesConfig - No context init
parameter 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' found, using default
value true
DEBUG 2007-07-27 12:53:35,359 [http-8080-Processor24] HOT deployを終了しました
DEBUG 2007-07-27 12:53:43,234 [http-8080-Processor24] HOT deployを開始します
DEBUG 2007-07-27 12:53:45,015 [http-8080-Processor24]
java.lang.NullPointerException
at
org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:35)
at
org.seasar.teeda.core.lifecycle.AbstractPhase.postPhase(AbstractPhase.java:71)
at
org.seasar.teeda.core.lifecycle.AbstractPhase.execute(AbstractPhase.java:57)
at
org.seasar.teeda.core.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:68)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:92)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.seasar.framework.container.hotdeploy.HotdeployFilter.doFilter(HotdeployFilter.java:63)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.seasar.framework.container.filter.S2ContainerFilter.doFilter(S2ContainerFilter.java:63)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.seasar.extension.filter.EncodingFilter.doFilter(EncodingFilter.java:62)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Unknown Source)
commons-fileupload-1.2.jar
tomahawk-1.1.6.jar
と
commons-fileupload-1.0.jar
tomahawk-1.1.1.jar
でも同じ結果でした。
------------------------Pageクラス-------------------------
package jp.roaso.web.upload;
import java.io.Serializable;
import org.apache.myfaces.custom.fileupload.UploadedFile;
public class UploadPage implements Serializable {
private static final long serialVersionUID = 1L;
private UploadedFile uploadedFile;
private long fileSize;
private String fileName;
public long getFileSize() {
return this.fileSize;
}
public String getFileName() {
return this.fileName;
}
public UploadedFile getUploadedFile() {
return this.uploadedFile;
}
public void setUploadedFile(UploadedFile uploadedFile) {
this.uploadedFile = uploadedFile;
}
public String doUpload() {
if (uploadedFile != null) {
this.fileSize = uploadedFile.getSize();
this.fileName = uploadedFile.getName();
}
return null;
}
}
----------------------------------------------------------
--------------------------HTML---------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:x="http://myfaces.apache.org/tomahawk">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>FileUpload</title>
</head>
<body>
<form id="form" enctype="multipart/form-data">
<span id="allMessage"/>
<x:inputFileUpload id="uploadedFile"
value="#{tomahawk_uploadPage.uploadedFile}"/>
<input type="submit" id="doUpload" value="FileUpload"/>
<br/>
upload File Size : <span id="fileSize"/><br/>
upload File Name : <span id="fileName"/>
</form>
</body>
</html>
----------------------------------------------------------
--------------------------web.xml--------------------------
<filter>
<filter-name>tomahawkFilter</filter-name>
<!--
<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>-->
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
<description>Set the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>100m</param-value>
<description>Set the threshold size - files
below this limit are stored in memory, files above
this limit are stored on disk.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
</init-param>
<init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>/temp</param-value>
<description>Set the path where the intermediary files will be
stored.
</description>
</init-param>
</filter>
<filter-mapping>
<filter-name>tomahawkFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
----------------------------------------------------------
ログにuploadedFileが見つかりませんって出てるのが気になりますが...でも
Pageクラスには宣言してあるし???
大変申し訳ありませんがどなたかご教授願えないでしょうか?
Seasar-user メーリングリストの案内