You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Samuel Sadek <sa...@hotmail.com> on 2002/02/23 02:19:55 UTC

Message Attachments problem

I have JAMES installed with Oracle 8.1.7 where the setup for the 
repositories are db configured as opposed to file-system based i.e. lists, 
users, inbox, message tables are held within Oracle db.

The problem I have is whenever I send a multipart message with a normal 
plain text/plain content type message for the text content and attachments 
for files to the message and send it to a localhost user within JAMES mail 
server domain, I get the following message exception from JAMES:


java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into 
a L
ONG column

        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
        at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
        at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
        at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
        at 
oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822
)
        at 
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja
va:1446)
        at 
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
a:1371)
        at 
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1900)
        at 
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
edStatement.java:363)
        at 
oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat
ement.java:407)
        at 
org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepo
sitory.java:423)
        at org.apache.james.James.sendMail(James.java:261)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.apache.avalon.phoenix.components.application.BlockInvocationHandl
er.invoke(BlockInvocationHandler.java:88)
        at $Proxy9.sendMail(Unknown Source)
        at 
org.apache.james.smtpserver.SMTPHandler.doDATA(SMTPHandler.java:599)
        at 
org.apache.james.smtpserver.SMTPHandler.parseCommand(SMTPHandler.java
:248)
        at 
org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.
java:163)
        at 
org.apache.avalon.cornerstone.blocks.connection.ConnectionRunner.run(
Connection.java:163)
        at 
org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(Ex
ecutableRunnable.java:47)
        at 
org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread
.java:80)


which seems to me that with this is a known jdbc driver problem whereby big 
oracle data types such "long" are concerned which is this case, you can only 
send a separate SQL statement to insert or update into this field data type. 
In sqlResources.xml file, the mentioned exception is generated with the 
following SQL statement:

<sql name="insertMessageSQL">INSERT INTO ${table} (message_name, 
repository_name, message_state, error_message, sender, recipients, 
remote_host, remote_addr, last_updated, message_body) VALUES (?, ?, ?, ?, ?, 
?, ?, ?, ?, ?)</sql>

where message_body is of type LONG bearing in mind of the following oracle 
create clause for the inbox table:

<sql name="createTable" db="oracle">
        CREATE TABLE ${table} (
        	message_name varchar2 (200) NOT NULL,
        	repository_name varchar2 (200) NOT NULL,
        	message_state varchar2 (30) NOT NULL ,
        	error_message varchar2 (200) NULL ,
        	sender varchar2 (200) ,
        	recipients varchar2 (1000) NOT NULL ,
        	remote_host varchar2 (100) NOT NULL ,
        	remote_addr varchar2 (20) NOT NULL ,
        	message_body long NOT NULL ,
        	last_updated date NOT NULL ,
        	PRIMARY KEY (message_name, repository_name)
        )
        TABLESPACE system
    </sql>

Is this is a bug with JAMES SQL handling via jdbc pool connections? Is there 
a workaround for this problem?

Subsequently, this exception is not thrown when I send a normal pure 
text-based message to JAMES internal store.

Appreciate some comments on this...

Rgds,

Sam.



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>