BaseValueParser does not support setting a byte[] type of attribute. Do
not use data.getParameters().setProperties(bean) or if there are several
other properties that would make you miss the functionality, just rename
the fileupload key so that it does not match a bean property.
Then extract the byte[] yourself and set the property individually.
john mcnally
Xavier Michel wrote:
>
> Hi,
>
> I tried ti insert blob in mysql using the object generated by:
> <table name="ARTISTE" idMethod="autoincrement">
>
> <column name="ID" type="INTEGER" required="true"
> autoIncrement="true"
> primaryKey="true" />
>
> <column name="NOM" type="VARCHAR" required="true" size="50"/>
> <column name="TROMBINE" type="BLOB" />
> </table>
>
> In my action I have:
> -------------------
> ....
> FileItem trombine = data.getParameters().getFileItem("trombine");
> if (trombine!=null)
> aArtiste.setOeuvre(trombine.get());
> ...
>
> And I got:
> Exception: java.lang.reflect.InvocationTargetException
> Stack Trace follows:
> java.lang.reflect.InvocationTargetException: java.lang.Exception: property
> trombine is of unsupported type class [B
> at
> org.apache.turbine.util.parser.BaseValueParser.setProperty(BaseValueParser.j
> ava:1366)
> at
> org.apache.turbine.util.parser.BaseValueParser.setProperties(BaseValueParser
> .java:1220)
> at pf.cs.gtr.modules.actions.ArtisteAction.doInsert(ArtisteAction.java:49)
> at java.lang.reflect.Method.invoke(Native Method)
> at
> org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityA
> ctionEvent.java:166)...
>
> Where I'm wrong? It's possible to store image in mySQL using Turbine and get
> it back or should store it in the file system?
>
> Thanks for your help.
>
> Xa.
>
> Central Services Tahiti
> Xavier Michel
> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> 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]