Dear All,
I'm using jdbforms 2.5- snapshot of 18 august.

Now I'm dealing with diskblobs and I wanna to upload a photo of a person:

this is the xml element in dbforms-config.xml:

<table name="person_photo"  blobHandling="classic">
                <field name="id_person" fieldType="int" isKey="true" />
                <field name="photo_filename"  fieldType="diskblob"
directory="/opt/tomcat/webapps/uwcad2/externalfiles/photo" encoding="true"/>
                <field name="updatedate" fieldType="int"/>
                <field name="lastusermod" fieldType="varchar" size="15"/>


        </table>


Now my form is very simple:


it's a subform... with a db:file field where to put the filename of the file to
upload..... I enclosed the piece of jsp code of that form...


This code was ok on dbforms 1.1.4pr2. I know that blob management has
drammaticaly changed in this version....



I debugged the application with dbform sources of 18 august.
Catalina gives me this error:


2004-09-20 16:41:52 StandardWrapperValve[control]: Servlet.service() for servlet
control threw exception
java.lang.NullPointerException
        at
org.dbforms.event.datalist.dao.DataSourceJDBC.fillWithData(DataSourceJDBC.java:600)
        at
org.dbforms.event.datalist.dao.DataSourceJDBC.doUpdate(DataSourceJDBC.java:270)
        at
org.dbforms.event.datalist.dao.DataSourceFactory.doUpdate(DataSourceFactory.java:278)
        at
org.dbforms.event.datalist.UpdateEvent.processEvent(UpdateEvent.java:165)
...........etc..........etc..........etc..........


with the debugger I discovered that in line 597 of the DataSourceJDBC.java it
exists an instruction like:


else if (fieldType == FieldTypes.DISKBLOB) {
               FileHolder fileHolder = fv.getFileHolder();


and in my case fileHorder is setted to null... so the next instruction

String fileName = fileHolder.getFileName();

throws the exception...

Is this a bug or a setting that I'm not able to set....

If it's a bug could I work-around the problem (or correct it=)?


Like all the other times... thanks
Ivan


---------- PIECE OF JSP CODE ----------





<db:dbform
                maxRows="1"
                multipart="true"
                followUp="<%=additional_Info.getTab6().getDbformFollowup() %>"
                tableName="person_photo"
                parentField="id_person"
                childField="id_person"
                captionResource="true"
                >
                        <db:header>
                        </db:header>
                        <db:body allowNew="true">
                                <!-- INSERISCO FILTRI FITTIZI PER POSIZIONAMENTO SU 
PERSONA e ANNO
ACCADEMICO, prima non avveniva -->
                                <input type="hidden" name='<%=(String)
searchFieldNames_person_photo.get("id_person") %>'
value="<%=additional_Info.getIdPerson() %>">

                                <tr>
                                        <td class="nfield">ID person</td>
                                        <td class="nfield">
                                                <db:label fieldName="id_person" 
nullFieldValue="" pattern="####"/>
                                                <db:textField fieldName="id_person"
overrideValue="<%=additional_Info.getIdPerson() %>" />
                                        </td>
                                </tr>
                                <tr>
                                        <td colspan="2" align="center">Photo filename: 
<db:file
fieldName="photo_filename"  /></td>
                                </tr>
                                <hr>
                                <!-- LAST_UPDATE -->
                                <%@ include 
file="/business_objects/__sys_includes/sys_lastupdate.jsp.inc"
%></db:body>
                        <db:footer>
                                <tr>
                                        <td>
                                        </td>
                                        <td>
                                                <db:insertButton showAlways="false"  
caption="button.save"
styleClass="button"/>
                                                <db:updateButton caption="button.save" 
styleClass="button"/>
                                                <db:deleteButton 
caption="button.delete" styleClass="button"
confirmMessage="alert.delete" />

                                        </td>
                                </tr>
                        </db:footer>
                </db:dbform>
        </gui:window>

-----------------------
    Ivan Codarin
-----------------------

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to