You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Rohit Mathur <Ro...@rave-tech.com> on 2004/10/18 16:06:06 UTC

Character Set problem when using Cocoon

Hi all
 
I'm using cocoon 2.1 on resin 2.1.11 on windows XP with Oracle 9.2 and jdk1.4.0beta3
 
I'm having trouble inserting special characters like the £ sign into Oracle when using cocoon.
 
I'm able to accept the data from the browser, play around with it in my app, but when I try to store it to the DB
It gives me a 
 
java.sql.SQLException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:963)
at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
at oracle.jdbc.ttc7.Ocommoncall.receive(Ocommoncall.java:104)
at oracle.jdbc.ttc7.TTC7Protocol.rollback(TTC7Protocol.java:487)
at oracle.jdbc.driver.OracleConnection.rollback(OracleConnection.java:1376)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
at java.lang.reflect.Method.invoke(Method.java:327)
at org.apache.avalon.excalibur.datasource.AbstractJdbcConnection.invoke(AbstractJdbcConnection.java:353)
at $Proxy19.rollback(Unknown Source)
 
I'm using the thin driver with the correct classes12.jar (from the ora92/jdbc/lib folder)
 
The confusing part is that when I try to do the same thing outside of cocoon, it works fine i.e.
 
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
 
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.176:1521:DEV","u","p");
 
java.sql.Statement stmt = conn.createStatement();
 
stmt.executeQuery("INSERT INTO test (id, name) VALUES (1, '££££' ) ");
 
THIS WORKS!!
 
But the same thing does not work with cocoon
 
I initially thought it may be because of DataSourceComponent getting the connection, so instead of using DataSourceComponent, I used the first two lines of the above code to create the connection in Cocoon, but I still face the same error.
 
If I plug the same code into an action class, it does not work!
 
I have surmised
 
Its not the driver version
Its not the oracle client I'm using
Its not the way cocoon is getting the connection.
Its not the database encoding/charset (since it works with the above code)
 
Cocoon.xconf
 
      <jdbc logger="core.datasources.db" name="db">
         <pool-controller min="5" max="10" keep-alive="true" />
         <pool-controller max="10" min="5" />
         <auto-commit>false</auto-commit>
         <dburl>jdbc:oracle:thin:@192.168.1.176:1521:DEV</dburl>
         <user>u</user>
         <password>p</password>
      </jdbc>
 
Its been working fine so far, almost at the end of development when we discovered this.
 
Any thoughts, suggestion, pointers, experiments???
 
Thanks much
 
Rohit