After debugging here is what I found!

FileServlet.java fails because it is not getting the namefield parameter
(nf).
It gets:
/servlet/file?tf=33_12&keyval=0:1:5
It should get for example:
/servlet/file?tf=33_12&keyval=0:1:5&nf=grower_picture_filename

After including the nameField parameter in the blobURL tag, the problem is
solved.

I have one question (just so that I don't look like total idiot ;) )
- If the nameField parameter is optional in the blobURL tag (for diskblob
purposes I imagine), then why doesn't the blobURL tag try to get the
nameField from the dbforms-config after identifying the field as being of
type blob?

Rgds,

Julio





-----Original Message-----
From: Dziugas Baltrunas [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 16, 2004 2:27 AM
To: Julio Ortuzar O.
Cc: [EMAIL PROTECTED]
Subject: Re: [dbforms] Blob Errpr MySQL

Hi,

I guess the problem is the name of the file. If you are using a "new" 
(contra to "classic") mode, you must define interceptors in the 
dbforms-config.xml like this:

  <interceptor className="org.dbforms.event.BlobInterceptor">
    <param name="blob-column" value="file"/>
    <param name="name-column" value="filename"/>
  </interceptor>

It's because of the code in FileServlet.java, which throws IOException 
if fileName is missing.

regards,
Dziugas Baltrunas

Julio Ortuzar O. wrote:

> Hello,
> 
>  
> 
> I'm trying to use blob field in MySQL and I can upload the image to the 
> database with no problem. But when I try to view the image I get the 
> error shown at the bottomb.
> 
>  
> 
> -The link to the image that gets generated seems to be correct:
> 
>      http://localhost:8080/erpfrux/servlet/file?tf=33_12&keyval=0:1:3
> 
>  
> 
> -he config file looks something like this:
> 
>           <table name="tbl_growers"
> 
>                       defaultVisibleFields="grower_id">
> 
> ..
> 
>                    <field name="grower_obs_pic" fieldType="blob" 
> size="65535"/>
> 
>  
> 
> -I know the image is stored correct, because when I look directly at the 
> database I can see the image through the MySQL client.
> 
>  
> 
> -Last but not least, if I use diskblob instead, everything works perfect.
> 
>  
> 
> Rgds,
> 
>  
> 
> Julio
> 
>  
> 
>  
> 
> ERROR MESSAGE:
> 
> java.io.StreamCorruptedException: invalid stream header
> 
>         at 
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737)
> 
>         at java.io.ObjectInputStream.(ObjectInputStream.java:253)
> 
>         at 
> org.dbforms.servlets.FileServlet.readDbFieldBlob(FileServlet.java:241)
> 
>         at org.dbforms.servlets.FileServlet.doGet(FileServlet.java:160)
> 
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 
>         at 
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
> 
>         at 
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
> 
>         at 
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 
>         at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 
>         at 
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 
>         at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 
>         at 
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
> 
>         at 
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
> 
>         at 
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
> 
>         at 
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 
>         at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 
>         at 
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
> 
>         at 
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 
>         at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 
>         at 
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> 
>         at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
> 
>         at 
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
> 
>         at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 
>         at 
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
> 
>             at java.lang.Thread.run(Thread.java:534)
> 
>  
> 
>  
> 
>  
> 



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
DbForms Mailing List

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

Reply via email to