You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Joan Carles N��ez <jo...@indibil.com> on 2001/02/15 14:10:52 UTC

Mysql problem with attached files: Interbase?

Hi List,

   I encountered the following problem with the mm JDBC driver for Mysql:

java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at org.gjt.mm.mysql.Buffer.writeBytesNoNull(Buffer.java:352)
	at org.gjt.mm.mysql.PreparedStatement.executeUpdate(PreparedStatement.java:291)
	at com.workingdogs.town.Record.saveWithInsert(Record.java:1727)
	at com.workingdogs.town.Record.save(Record.java:1612)
	at com.workingdogs.town.Record.save(Record.java:1456)
	at com.workingdogs.town.Record.save(Record.java:1419)
	at org.apache.james.mailrepository.TownSpoolRepository.store(TownSpoolRepository.java:188)
	at org.apache.james.James.sendMail(James.java:298)
	at org.apache.james.smtpserver.SMTPHandler.parseCommand(SMTPHandler.java:317)
	at org.apache.james.smtpserver.SMTPHandler.run(SMTPHandler.java:121)
	at org.apache.avalon.utils.recycle.pool.Worker.run(Worker.java:113)

This implies that I either tinker with the JDBC driver to deal with large blobs or
use some other database (I didn't try www.caucho.com's JDBC driver...). 
I am considering the use of Interbase Super Server. Before I set myself to do 
this, does anyone know a workaround the Mysql JDBC limitation? 
Using a database with transaction support like interbase would add extra overhead 
to the machine that hosts James... 
Is migrating database a matter of finding the right column types for the 'Message' table?

Thanks,

         Joan Carles Núñez

EBS S.L.
Spain

Re: Mysql problem with attached files: Interbase?

Posted by Joan Carles N��ez <jo...@indibil.com>.
Ok Serge, 

   Thanks for the error_message tip. The case is that I want to use 
the mailet API to actually allow some users to send attach files bigger
than 1Mb. I am about to try it with Interbase and I will post in the
list my results.

Thanks,
          J. Carles

On Thu, 15 Feb 2001 08:36:55 -0500
"Serge Knystautas" <se...@lokitech.com> wrote:

> J. Carles,
> 
> That Messages structure should generally work, but I've changed the
> error_message field to be text instead of varchar in mine since error
> messages can get quite large sometimes.  As for the 1Mb driver limit, I
> wasn't aware of this, but someone else at my company actually recently
> submitted a patch to put a cap on the messagesize of servers.  With this,
> James would reject messages larger than X kb (or mb), so perhaps with this
> patch you could still use mysql (assuming you didn't mind receiving only < 1
> meg messages).
> 
> Serge Knystautas
> Loki Technologies
> http://www.lokitech.com/
> ----- Original Message -----
> From: "Joan Carles Núñez" <jo...@indibil.com>
> To: <ja...@jakarta.apache.org>
> Sent: Thursday, February 15, 2001 8:30 AM
> Subject: Re: Mysql problem with attached files: Interbase?
> 
> 
> > Hi Serge,
> >
> >    That was quick! I have been reading thru the mm JDBC driver mailing
> > lists and it looks like a known problem with this driver (currently the
> limit
> > for a Blob is 1 Mb so this exception appears with attach files bigger than
> 1Mb).
> > Take a look at this message where this is discussed:
> >
> > http://db.geocrawler.com/mail/msg.php3?msg_id=4746024&list=193
> >
> > By the way, the www.caucho.com driver is experimental, so not an option.
> >
> > Thanks,
> >
> >         J. Carles
> >
> > ------------------------------------------------------------------------
> > DROP DATABASE James;
> >
> > CREATE DATABASE James;
> >
> > use James;
> >
> > CREATE TABLE Message (
> > message_name varchar (200) NOT NULL PRIMARY KEY,
> > repository_name varchar (200) NOT NULL ,
> > message_state varchar (30) NOT NULL ,
> > error_message varchar (200) NULL ,
> > sender varchar (100) NOT NULL ,
> > recipients text NOT NULL ,
> > remote_host varchar (100) NOT NULL ,
> > remote_addr varchar (20) NOT NULL ,
> > message_body longblob NOT NULL ,
> > last_updated datetime NOT NULL
> > );
> > -------------------------------------------------------------------------
> >
> > On Thu, 15 Feb 2001 08:17:34 -0500
> > "Serge Knystautas" <se...@lokitech.com> wrote:
> >
> > > Can you send me a structure of your tables?  I know at one point the
> mysql
> > > script had one column type that was off, and while I thought it was
> > > corrected, I wouldn't be surprised if the incorrect version is still out
> > > there.  Thanks.
> > >
> > > Serge Knystautas
> > > Loki Technologies
> > > http://www.lokitech.com/
> > > ----- Original Message -----
> > > From: "Joan Carles Núñez" <jo...@indibil.com>
> > > To: <ja...@jakarta.apache.org>
> > > Sent: Thursday, February 15, 2001 8:10 AM
> > > Subject: Mysql problem with attached files: Interbase?
> > >
> > >
> > > > Hi List,
> > > >
> > > >    I encountered the following problem with the mm JDBC driver for
> Mysql:
> > > >
> > > > java.lang.ArrayIndexOutOfBoundsException
> > > > at java.lang.System.arraycopy(Native Method)
> > > > at org.gjt.mm.mysql.Buffer.writeBytesNoNull(Buffer.java:352)
> > > > at
> > >
> org.gjt.mm.mysql.PreparedStatement.executeUpdate(PreparedStatement.java:291)
> > > > at com.workingdogs.town.Record.saveWithInsert(Record.java:1727)
> > > > at com.workingdogs.town.Record.save(Record.java:1612)
> > > > at com.workingdogs.town.Record.save(Record.java:1456)
> > > > at com.workingdogs.town.Record.save(Record.java:1419)
> > > > at
> > >
> org.apache.james.mailrepository.TownSpoolRepository.store(TownSpoolRepositor
> > > y.java:188)
> > > > at org.apache.james.James.sendMail(James.java:298)
> > > > at
> > >
> org.apache.james.smtpserver.SMTPHandler.parseCommand(SMTPHandler.java:317)
> > > > at org.apache.james.smtpserver.SMTPHandler.run(SMTPHandler.java:121)
> > > > at org.apache.avalon.utils.recycle.pool.Worker.run(Worker.java:113)
> > > >
> > > > This implies that I either tinker with the JDBC driver to deal with
> large
> > > blobs or
> > > > use some other database (I didn't try www.caucho.com's JDBC
> driver...).
> > > > I am considering the use of Interbase Super Server. Before I set
> myself to
> > > do
> > > > this, does anyone know a workaround the Mysql JDBC limitation?
> > > > Using a database with transaction support like interbase would add
> extra
> > > overhead
> > > > to the machine that hosts James...
> > > > Is migrating database a matter of finding the right column types for
> the
> > > 'Message' table?
> > > >
> > > > Thanks,
> > > >
> > > >          Joan Carles Núñez
> > > >
> > > > EBS S.L.
> > > > Spain
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: james-dev-help@jakarta.apache.org
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: james-dev-help@jakarta.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-dev-help@jakarta.apache.org
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org

Re: Mysql problem with attached files: Interbase?

Posted by Serge Knystautas <se...@lokitech.com>.
J. Carles,

That Messages structure should generally work, but I've changed the
error_message field to be text instead of varchar in mine since error
messages can get quite large sometimes.  As for the 1Mb driver limit, I
wasn't aware of this, but someone else at my company actually recently
submitted a patch to put a cap on the messagesize of servers.  With this,
James would reject messages larger than X kb (or mb), so perhaps with this
patch you could still use mysql (assuming you didn't mind receiving only < 1
meg messages).

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Joan Carles Núñez" <jo...@indibil.com>
To: <ja...@jakarta.apache.org>
Sent: Thursday, February 15, 2001 8:30 AM
Subject: Re: Mysql problem with attached files: Interbase?


> Hi Serge,
>
>    That was quick! I have been reading thru the mm JDBC driver mailing
> lists and it looks like a known problem with this driver (currently the
limit
> for a Blob is 1 Mb so this exception appears with attach files bigger than
1Mb).
> Take a look at this message where this is discussed:
>
> http://db.geocrawler.com/mail/msg.php3?msg_id=4746024&list=193
>
> By the way, the www.caucho.com driver is experimental, so not an option.
>
> Thanks,
>
>         J. Carles
>
> ------------------------------------------------------------------------
> DROP DATABASE James;
>
> CREATE DATABASE James;
>
> use James;
>
> CREATE TABLE Message (
> message_name varchar (200) NOT NULL PRIMARY KEY,
> repository_name varchar (200) NOT NULL ,
> message_state varchar (30) NOT NULL ,
> error_message varchar (200) NULL ,
> sender varchar (100) NOT NULL ,
> recipients text NOT NULL ,
> remote_host varchar (100) NOT NULL ,
> remote_addr varchar (20) NOT NULL ,
> message_body longblob NOT NULL ,
> last_updated datetime NOT NULL
> );
> -------------------------------------------------------------------------
>
> On Thu, 15 Feb 2001 08:17:34 -0500
> "Serge Knystautas" <se...@lokitech.com> wrote:
>
> > Can you send me a structure of your tables?  I know at one point the
mysql
> > script had one column type that was off, and while I thought it was
> > corrected, I wouldn't be surprised if the incorrect version is still out
> > there.  Thanks.
> >
> > Serge Knystautas
> > Loki Technologies
> > http://www.lokitech.com/
> > ----- Original Message -----
> > From: "Joan Carles Núñez" <jo...@indibil.com>
> > To: <ja...@jakarta.apache.org>
> > Sent: Thursday, February 15, 2001 8:10 AM
> > Subject: Mysql problem with attached files: Interbase?
> >
> >
> > > Hi List,
> > >
> > >    I encountered the following problem with the mm JDBC driver for
Mysql:
> > >
> > > java.lang.ArrayIndexOutOfBoundsException
> > > at java.lang.System.arraycopy(Native Method)
> > > at org.gjt.mm.mysql.Buffer.writeBytesNoNull(Buffer.java:352)
> > > at
> >
org.gjt.mm.mysql.PreparedStatement.executeUpdate(PreparedStatement.java:291)
> > > at com.workingdogs.town.Record.saveWithInsert(Record.java:1727)
> > > at com.workingdogs.town.Record.save(Record.java:1612)
> > > at com.workingdogs.town.Record.save(Record.java:1456)
> > > at com.workingdogs.town.Record.save(Record.java:1419)
> > > at
> >
org.apache.james.mailrepository.TownSpoolRepository.store(TownSpoolRepositor
> > y.java:188)
> > > at org.apache.james.James.sendMail(James.java:298)
> > > at
> >
org.apache.james.smtpserver.SMTPHandler.parseCommand(SMTPHandler.java:317)
> > > at org.apache.james.smtpserver.SMTPHandler.run(SMTPHandler.java:121)
> > > at org.apache.avalon.utils.recycle.pool.Worker.run(Worker.java:113)
> > >
> > > This implies that I either tinker with the JDBC driver to deal with
large
> > blobs or
> > > use some other database (I didn't try www.caucho.com's JDBC
driver...).
> > > I am considering the use of Interbase Super Server. Before I set
myself to
> > do
> > > this, does anyone know a workaround the Mysql JDBC limitation?
> > > Using a database with transaction support like interbase would add
extra
> > overhead
> > > to the machine that hosts James...
> > > Is migrating database a matter of finding the right column types for
the
> > 'Message' table?
> > >
> > > Thanks,
> > >
> > >          Joan Carles Núñez
> > >
> > > EBS S.L.
> > > Spain
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: james-dev-help@jakarta.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>


Re: Mysql problem with attached files: Interbase?

Posted by Joan Carles N��ez <jo...@indibil.com>.
Hi Serge,

   That was quick! I have been reading thru the mm JDBC driver mailing 
lists and it looks like a known problem with this driver (currently the limit 
for a Blob is 1 Mb so this exception appears with attach files bigger than 1Mb).
Take a look at this message where this is discussed: 

http://db.geocrawler.com/mail/msg.php3?msg_id=4746024&list=193

By the way, the www.caucho.com driver is experimental, so not an option.

Thanks,

        J. Carles

------------------------------------------------------------------------
DROP DATABASE James;

CREATE DATABASE James;

use James;

CREATE TABLE Message (
	message_name varchar (200) NOT NULL PRIMARY KEY,
	repository_name varchar (200) NOT NULL ,
	message_state varchar (30) NOT NULL ,
	error_message varchar (200) NULL ,
	sender varchar (100) NOT NULL ,
	recipients text NOT NULL ,
	remote_host varchar (100) NOT NULL ,
	remote_addr varchar (20) NOT NULL ,
	message_body longblob NOT NULL ,
	last_updated datetime NOT NULL 
);
-------------------------------------------------------------------------

On Thu, 15 Feb 2001 08:17:34 -0500
"Serge Knystautas" <se...@lokitech.com> wrote:

> Can you send me a structure of your tables?  I know at one point the mysql
> script had one column type that was off, and while I thought it was
> corrected, I wouldn't be surprised if the incorrect version is still out
> there.  Thanks.
> 
> Serge Knystautas
> Loki Technologies
> http://www.lokitech.com/
> ----- Original Message -----
> From: "Joan Carles Núñez" <jo...@indibil.com>
> To: <ja...@jakarta.apache.org>
> Sent: Thursday, February 15, 2001 8:10 AM
> Subject: Mysql problem with attached files: Interbase?
> 
> 
> > Hi List,
> >
> >    I encountered the following problem with the mm JDBC driver for Mysql:
> >
> > java.lang.ArrayIndexOutOfBoundsException
> > at java.lang.System.arraycopy(Native Method)
> > at org.gjt.mm.mysql.Buffer.writeBytesNoNull(Buffer.java:352)
> > at
> org.gjt.mm.mysql.PreparedStatement.executeUpdate(PreparedStatement.java:291)
> > at com.workingdogs.town.Record.saveWithInsert(Record.java:1727)
> > at com.workingdogs.town.Record.save(Record.java:1612)
> > at com.workingdogs.town.Record.save(Record.java:1456)
> > at com.workingdogs.town.Record.save(Record.java:1419)
> > at
> org.apache.james.mailrepository.TownSpoolRepository.store(TownSpoolRepositor
> y.java:188)
> > at org.apache.james.James.sendMail(James.java:298)
> > at
> org.apache.james.smtpserver.SMTPHandler.parseCommand(SMTPHandler.java:317)
> > at org.apache.james.smtpserver.SMTPHandler.run(SMTPHandler.java:121)
> > at org.apache.avalon.utils.recycle.pool.Worker.run(Worker.java:113)
> >
> > This implies that I either tinker with the JDBC driver to deal with large
> blobs or
> > use some other database (I didn't try www.caucho.com's JDBC driver...).
> > I am considering the use of Interbase Super Server. Before I set myself to
> do
> > this, does anyone know a workaround the Mysql JDBC limitation?
> > Using a database with transaction support like interbase would add extra
> overhead
> > to the machine that hosts James...
> > Is migrating database a matter of finding the right column types for the
> 'Message' table?
> >
> > Thanks,
> >
> >          Joan Carles Núñez
> >
> > EBS S.L.
> > Spain
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-dev-help@jakarta.apache.org
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org

Re: Mysql problem with attached files: Interbase?

Posted by Serge Knystautas <se...@lokitech.com>.
Can you send me a structure of your tables?  I know at one point the mysql
script had one column type that was off, and while I thought it was
corrected, I wouldn't be surprised if the incorrect version is still out
there.  Thanks.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Joan Carles Núñez" <jo...@indibil.com>
To: <ja...@jakarta.apache.org>
Sent: Thursday, February 15, 2001 8:10 AM
Subject: Mysql problem with attached files: Interbase?


> Hi List,
>
>    I encountered the following problem with the mm JDBC driver for Mysql:
>
> java.lang.ArrayIndexOutOfBoundsException
> at java.lang.System.arraycopy(Native Method)
> at org.gjt.mm.mysql.Buffer.writeBytesNoNull(Buffer.java:352)
> at
org.gjt.mm.mysql.PreparedStatement.executeUpdate(PreparedStatement.java:291)
> at com.workingdogs.town.Record.saveWithInsert(Record.java:1727)
> at com.workingdogs.town.Record.save(Record.java:1612)
> at com.workingdogs.town.Record.save(Record.java:1456)
> at com.workingdogs.town.Record.save(Record.java:1419)
> at
org.apache.james.mailrepository.TownSpoolRepository.store(TownSpoolRepositor
y.java:188)
> at org.apache.james.James.sendMail(James.java:298)
> at
org.apache.james.smtpserver.SMTPHandler.parseCommand(SMTPHandler.java:317)
> at org.apache.james.smtpserver.SMTPHandler.run(SMTPHandler.java:121)
> at org.apache.avalon.utils.recycle.pool.Worker.run(Worker.java:113)
>
> This implies that I either tinker with the JDBC driver to deal with large
blobs or
> use some other database (I didn't try www.caucho.com's JDBC driver...).
> I am considering the use of Interbase Super Server. Before I set myself to
do
> this, does anyone know a workaround the Mysql JDBC limitation?
> Using a database with transaction support like interbase would add extra
overhead
> to the machine that hosts James...
> Is migrating database a matter of finding the right column types for the
'Message' table?
>
> Thanks,
>
>          Joan Carles Núñez
>
> EBS S.L.
> Spain
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
>