Hi tapestrycn-

I don't see the problem from here, but some testing suggestions:
* take a look at hivemodule.xml:98
* make sure UploadConfiger gets created successfully - inject into a
test page and call a method on it to force it to instantiate
* add logging/breakpoint to your decoder implementation constructor and
setter

On an unrelated note, are you sure UploadConfiger should be a singleton
with that interface? If a thread's calling the setters while another's
parsing a multipart request, you might end up with strange combinations
of threshold/max size/repository

        -Yori


-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of tapestrycn
Sent: Sunday, July 24, 2005 4:05 AM
To: [email protected]
Subject: Re: MultipartDecoder implemention with ClassCastException


Hi Yori,
Thank you for your answer,however,it doesn't work by throwing following 
exception:
org.apache.hivemind.ApplicationRuntimeException: Unable to construct
service 
tapestry.multipart.MultipartDecoder: Parameter parameters must not be
null. 
[context:/WEB-INF/hivemodule.xml, line 98, column 25]
        at 
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.construct
NewServi
ceImplementation(AbstractServiceModelImpl.java:165)
        at 
org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.construct
ServiceI
mplementation(AbstractServiceModelImpl.java:139)
        at 
org.apache.hivemind.impl.servicemodel.SingletonServiceModel.getActualSer
viceImpl
ementation(SingletonServiceModel.java:68)
        at $MultipartDecoder_10547d99820._service
($MultipartDecoder_10547d99820.java)

----  In hivemind.xml I set following config:

 <service-point id="UploadConfiger" 
interface="com.test.services.IUploadConfiger">
        <create-instance class="com.test.services.UploadConfiger" 
model="singleton"/>
    </service-point>

    <implementation service-id="tapestry.multipart.MultipartDecoder">
        <invoke-factory>
            <construct class="com.test.services.MultipartDecoderImpl" 
model="threaded">
                <set-service property="uploadConfiger" service-
id="UploadConfiger"/>
            </construct>
        </invoke-factory>
    </implementation>

----  And the interface:

interface IUploadConfiger {

    int getMaxSize();

    void setMaxSize(int maxSize);

    String getRepositoryPath();

    void setRepositoryPath(String repositoryPath);

    int getThresholdSize();

    void setThresholdSize(int thresholdSize);
}

------ In MultipartDecoderImpl.decode(HttpServletRequest request) I do 
following change:
 List fileItems = upload.parseRequest(request, config.getThresholdSize
(),config.getMaxSize(), config.getRepositoryPath());


Thanks
tapestrycn


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to