You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Al Byers <by...@automationgroups.com> on 2008/03/20 22:08:14 UTC

"Data too long for column" in mysql

I am muddling thru this and thought I would throw it out to see if anyone
has some experience with it.

I am using mysql 5.0.37
I have set the character set type in entityengine.xml to "utf8", dropped the
db and ran run-install

First I got a "max_allowed_packet" error when trying to upload an image
file. I fixed by changing my.cnf. to allow up to 2M.

Now I get a "Data too long for column" on a blob field. The file size is
700KB.

Right before the error in console.log, there are these warnings:

2008-03-20 14:32:49,741 (http-0.0.0.0-8443-Processor2) [
ObjectType.java:949:INFO ] No type conversion available for
java.nio.HeapByteBuffer to java.nio.ByteBuffer, returning original object.
2008-03-20 14:32:49,743 (http-0.0.0.0-8443-Processor2) [
GenericEntity.java:408:WARN ] In entity field [ImageDataResource.imageData]
set the value passed in [java.nio.HeapByteBuffer] is not compatible with the
Java type of the field [java.sql.Blob]


Thanks for any insight.
I am going to take a nap now. Please have your answers ready for when I wake
up.

Thanks,
-Al

Re: "Data too long for column" in mysql

Posted by Wai <bz...@gmail.com>.
Hello byersa,

This is a rather late comment for this post.  Did you by any chance find a
solution to this problem?

Thanks,
Wai

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Data-too-long-for-column-in-mysql-tp152173p4170898.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: "Data too long for column" in mysql

Posted by Al Byers <by...@automationgroups.com>.
Pranay,

I found that HeapByteBuffer is a private subclass of ByteBuffer, which is
why you don't see it in the apis. I don't think it is the problem. When I
get around to it, I am going to upgrade my version of MySQL and try
Postgres, as well.

-Al

On Tue, Mar 25, 2008 at 12:18 AM, Pranay Pandey <pa...@gmail.com>
wrote:

> Hello Al,
>
> Yes I also agree to that we are not having the class HeapByteBuffer in
> java.nio package in Java APIs. I have also gone through
> ServiceEventHandler
> and found that we are just wrapping up the byte array into a ByteBuffer.
> When i applied a search for HeapByteBuffer in *.* got one result which is
> in
> SqlJdbcUtil.java.
> Also tried to find out the documentation for this class and found a
> relevant
> link for this, may be this link can be of help.
> http://dmi.ensica.fr/doc/Java/j2sdk-1_4_2-doc/docs/j2h/java.nio.index.html
> .
>
> --
> Thanks & Regards
> --
> Pranay Pandey
> Inodre, India
>
> On Tue, Mar 25, 2008 at 12:55 AM, Al Byers <by...@automationgroups.com>
> wrote:
>
> > Thanks Pranay,
> >
> > This was helpful, but I am chasing my tail trying to find out where
> > java.nio.HeapByteBuffer is loaded. That is what is returned in
> > ServiceEventHandler at line 217. I find that HeapBuffer.allocate returns
> > an
> > object of HeapByteBuffer type, but can't find that in Java APIs for ver.
> > 1.42, 1.5 or 6.0. Is that what the current version of Tomcat is using?
> >
> > Any help here would be appreciated.
> >
> > Thanks again,
> > -Al
> >
> > On 3/20/08, Pranay Pandey <pa...@gmail.com> wrote:
> > >
> > > Hello Al,
> > >
> > > I think you can make some changes to the type of the data of the image
> > > file
> > > which you are uploding.
> > > The type of the image data which is saved in ImageDataResource is
> > "blob".
> > > So
> > > i think you need to convert the data to ByteBuffter then you can save
> > data
> > > in the ImageDataResource Entity, also where you are uploading it in
> the
> > > service the type of attribute can be "java.nio.ByteBuffer".
> > >
> > > On Fri, Mar 21, 2008 at 2:38 AM, Al Byers <byersa@automationgroups.com
> >
> > > wrote:
> > >
> > >
> > > > I am muddling thru this and thought I would throw it out to see if
> > > anyone
> > > > has some experience with it.
> > > >
> > > > I am using mysql 5.0.37
> > > > I have set the character set type in entityengine.xml to "utf8",
> > dropped
> > > > the
> > > > db and ran run-install
> > > >
> > > > First I got a "max_allowed_packet" error when trying to upload an
> > image
> > > > file. I fixed by changing my.cnf. to allow up to 2M.
> > > >
> > > > Now I get a "Data too long for column" on a blob field. The file
> size
> > is
> > > > 700KB.
> > > >
> > > > Right before the error in console.log, there are these warnings:
> > > >
> > > > 2008-03-20 14:32:49,741 (http-0.0.0.0-8443-Processor2) [
> > > > ObjectType.java:949:INFO ] No type conversion available for
> > > > java.nio.HeapByteBuffer to java.nio.ByteBuffer, returning original
> > > object.
> > > > 2008-03-20 14:32:49,743 (http-0.0.0.0-8443-Processor2) [
> > > > GenericEntity.java:408:WARN ] In entity field [
> > > ImageDataResource.imageData
> > > > ]
> > > > set the value passed in [java.nio.HeapByteBuffer] is not compatible
> > with
> > > > the
> > > > Java type of the field [java.sql.Blob]
> > >
> > >
> > >
> > > For this i think you should also read the file back from
> > ImageDataResource
> > > to check whether the data uploaded.
> > >
> > >
> > > >
> > > >
> > > >
> > > > Thanks for any insight.
> > > > I am going to take a nap now. Please have your answers ready for
> when
> > I
> > > > wake
> > > > up.
> > > >
> > > > Thanks,
> > > > -Al
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > Thanks & Regards
> > >
> > > --
> > > Pranay Pandey
> > > Inodre, India
> > >
> >
>

Re: "Data too long for column" in mysql

Posted by Pranay Pandey <pa...@gmail.com>.
Hello Al,

Yes I also agree to that we are not having the class HeapByteBuffer in
java.nio package in Java APIs. I have also gone through ServiceEventHandler
and found that we are just wrapping up the byte array into a ByteBuffer.
When i applied a search for HeapByteBuffer in *.* got one result which is in
SqlJdbcUtil.java.
Also tried to find out the documentation for this class and found a relevant
link for this, may be this link can be of help.
http://dmi.ensica.fr/doc/Java/j2sdk-1_4_2-doc/docs/j2h/java.nio.index.html.

-- 
Thanks & Regards
--
Pranay Pandey
Inodre, India

On Tue, Mar 25, 2008 at 12:55 AM, Al Byers <by...@automationgroups.com>
wrote:

> Thanks Pranay,
>
> This was helpful, but I am chasing my tail trying to find out where
> java.nio.HeapByteBuffer is loaded. That is what is returned in
> ServiceEventHandler at line 217. I find that HeapBuffer.allocate returns
> an
> object of HeapByteBuffer type, but can't find that in Java APIs for ver.
> 1.42, 1.5 or 6.0. Is that what the current version of Tomcat is using?
>
> Any help here would be appreciated.
>
> Thanks again,
> -Al
>
> On 3/20/08, Pranay Pandey <pa...@gmail.com> wrote:
> >
> > Hello Al,
> >
> > I think you can make some changes to the type of the data of the image
> > file
> > which you are uploding.
> > The type of the image data which is saved in ImageDataResource is
> "blob".
> > So
> > i think you need to convert the data to ByteBuffter then you can save
> data
> > in the ImageDataResource Entity, also where you are uploading it in the
> > service the type of attribute can be "java.nio.ByteBuffer".
> >
> > On Fri, Mar 21, 2008 at 2:38 AM, Al Byers <by...@automationgroups.com>
> > wrote:
> >
> >
> > > I am muddling thru this and thought I would throw it out to see if
> > anyone
> > > has some experience with it.
> > >
> > > I am using mysql 5.0.37
> > > I have set the character set type in entityengine.xml to "utf8",
> dropped
> > > the
> > > db and ran run-install
> > >
> > > First I got a "max_allowed_packet" error when trying to upload an
> image
> > > file. I fixed by changing my.cnf. to allow up to 2M.
> > >
> > > Now I get a "Data too long for column" on a blob field. The file size
> is
> > > 700KB.
> > >
> > > Right before the error in console.log, there are these warnings:
> > >
> > > 2008-03-20 14:32:49,741 (http-0.0.0.0-8443-Processor2) [
> > > ObjectType.java:949:INFO ] No type conversion available for
> > > java.nio.HeapByteBuffer to java.nio.ByteBuffer, returning original
> > object.
> > > 2008-03-20 14:32:49,743 (http-0.0.0.0-8443-Processor2) [
> > > GenericEntity.java:408:WARN ] In entity field [
> > ImageDataResource.imageData
> > > ]
> > > set the value passed in [java.nio.HeapByteBuffer] is not compatible
> with
> > > the
> > > Java type of the field [java.sql.Blob]
> >
> >
> >
> > For this i think you should also read the file back from
> ImageDataResource
> > to check whether the data uploaded.
> >
> >
> > >
> > >
> > >
> > > Thanks for any insight.
> > > I am going to take a nap now. Please have your answers ready for when
> I
> > > wake
> > > up.
> > >
> > > Thanks,
> > > -Al
> > >
> >
> >
> >
> >
> > --
> > Thanks & Regards
> >
> > --
> > Pranay Pandey
> > Inodre, India
> >
>

Re: "Data too long for column" in mysql

Posted by Al Byers <by...@automationgroups.com>.
Thanks Pranay,

This was helpful, but I am chasing my tail trying to find out where
java.nio.HeapByteBuffer is loaded. That is what is returned in
ServiceEventHandler at line 217. I find that HeapBuffer.allocate returns an
object of HeapByteBuffer type, but can't find that in Java APIs for ver.
1.42, 1.5 or 6.0. Is that what the current version of Tomcat is using?

Any help here would be appreciated.

Thanks again,
-Al

On 3/20/08, Pranay Pandey <pa...@gmail.com> wrote:
>
> Hello Al,
>
> I think you can make some changes to the type of the data of the image
> file
> which you are uploding.
> The type of the image data which is saved in ImageDataResource is "blob".
> So
> i think you need to convert the data to ByteBuffter then you can save data
> in the ImageDataResource Entity, also where you are uploading it in the
> service the type of attribute can be "java.nio.ByteBuffer".
>
> On Fri, Mar 21, 2008 at 2:38 AM, Al Byers <by...@automationgroups.com>
> wrote:
>
>
> > I am muddling thru this and thought I would throw it out to see if
> anyone
> > has some experience with it.
> >
> > I am using mysql 5.0.37
> > I have set the character set type in entityengine.xml to "utf8", dropped
> > the
> > db and ran run-install
> >
> > First I got a "max_allowed_packet" error when trying to upload an image
> > file. I fixed by changing my.cnf. to allow up to 2M.
> >
> > Now I get a "Data too long for column" on a blob field. The file size is
> > 700KB.
> >
> > Right before the error in console.log, there are these warnings:
> >
> > 2008-03-20 14:32:49,741 (http-0.0.0.0-8443-Processor2) [
> > ObjectType.java:949:INFO ] No type conversion available for
> > java.nio.HeapByteBuffer to java.nio.ByteBuffer, returning original
> object.
> > 2008-03-20 14:32:49,743 (http-0.0.0.0-8443-Processor2) [
> > GenericEntity.java:408:WARN ] In entity field [
> ImageDataResource.imageData
> > ]
> > set the value passed in [java.nio.HeapByteBuffer] is not compatible with
> > the
> > Java type of the field [java.sql.Blob]
>
>
>
> For this i think you should also read the file back from ImageDataResource
> to check whether the data uploaded.
>
>
> >
> >
> >
> > Thanks for any insight.
> > I am going to take a nap now. Please have your answers ready for when I
> > wake
> > up.
> >
> > Thanks,
> > -Al
> >
>
>
>
>
> --
> Thanks & Regards
>
> --
> Pranay Pandey
> Inodre, India
>

Re: "Data too long for column" in mysql

Posted by Pranay Pandey <pa...@gmail.com>.
Hello Al,

I think you can make some changes to the type of the data of the image file
which you are uploding.
The type of the image data which is saved in ImageDataResource is "blob". So
i think you need to convert the data to ByteBuffter then you can save data
in the ImageDataResource Entity, also where you are uploading it in the
service the type of attribute can be "java.nio.ByteBuffer".

On Fri, Mar 21, 2008 at 2:38 AM, Al Byers <by...@automationgroups.com>
wrote:

> I am muddling thru this and thought I would throw it out to see if anyone
> has some experience with it.
>
> I am using mysql 5.0.37
> I have set the character set type in entityengine.xml to "utf8", dropped
> the
> db and ran run-install
>
> First I got a "max_allowed_packet" error when trying to upload an image
> file. I fixed by changing my.cnf. to allow up to 2M.
>
> Now I get a "Data too long for column" on a blob field. The file size is
> 700KB.
>
> Right before the error in console.log, there are these warnings:
>
> 2008-03-20 14:32:49,741 (http-0.0.0.0-8443-Processor2) [
> ObjectType.java:949:INFO ] No type conversion available for
> java.nio.HeapByteBuffer to java.nio.ByteBuffer, returning original object.
> 2008-03-20 14:32:49,743 (http-0.0.0.0-8443-Processor2) [
> GenericEntity.java:408:WARN ] In entity field [ImageDataResource.imageData
> ]
> set the value passed in [java.nio.HeapByteBuffer] is not compatible with
> the
> Java type of the field [java.sql.Blob]


For this i think you should also read the file back from ImageDataResource
to check whether the data uploaded.

>
>
>
> Thanks for any insight.
> I am going to take a nap now. Please have your answers ready for when I
> wake
> up.
>
> Thanks,
> -Al
>



-- 
Thanks & Regards
--
Pranay Pandey
Inodre, India