java.sql.SQLException: Bigger type length than Maximum

00:46:12,171 INFO  [STDOUT] java.sql.SQLException: Bigger type length than Maximum
00:46:12,203 INFO  [STDOUT]     at oracle.jdbc.driver.DatabaseError.throwSqlException(
00:46:12,234 INFO  [STDOUT]     at oracle.jdbc.driver.DatabaseError.throwSqlException(
00:46:12,265 INFO  [STDOUT]     at oracle.jdbc.driver.DatabaseError.check_error(
00:46:12,281 INFO  [STDOUT]     at oracle.jdbc.driver.T4CMAREngine.buffer2Value(
00:46:12,312 INFO  [STDOUT]     at oracle.jdbc.driver.T4CMAREngine.unmarshalUB2(
00:46:12,343 INFO  [STDOUT]     at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(
00:46:12,375 INFO  [STDOUT]     at oracle.jdbc.driver.T4CTTIdcb.receiveFromRefCursor(
00:46:12,390 INFO  [STDOUT]     at oracle.jdbc.driver.T4CResultSetAccessor.unmarshalOneRow(
00:46:12,421 INFO  [STDOUT]     at oracle.jdbc.driver.T4CTTIrxd.unmarshal(
00:46:12,453 INFO  [STDOUT]     at oracle.jdbc.driver.T4CTTIrxd.unmarshal(
00:46:12,484 INFO  [STDOUT]     at oracle.jdbc.driver.T4C8Oall.receive(
00:46:12,500 INFO  [STDOUT]     at oracle.jdbc.driver.T4CCallableStatement.doOall8(
00:46:12,531 INFO  [STDOUT]     at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(
00:46:12,562 INFO  [STDOUT]     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
00:46:12,593 INFO  [STDOUT]     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.j
00:46:12,625 INFO  [STDOUT]     at oracle.jdbc.driver.OraclePreparedStatement.execute(
00:46:12,640 INFO  [STDOUT]     at oracle.jdbc.driver.OracleCallableStatement.execute(
00:46:12,671 INFO  [STDOUT]     at com.mailamerica.wts.DAO.OracleLoginDAO.login(Unknown Source)
00:46:12,703 INFO  [STDOUT]     at com.mailamerica.wts.LoginAction.execute(Unknown Source)
00:46:12,734 INFO  [STDOUT]     at org.apache.struts.action.RequestProcessor.processActionPerform(
00:46:12,750 INFO  [STDOUT]     at org.apache.struts.action.RequestProcessor.process(
00:46:12,781 INFO  [STDOUT]     at org.apache.struts.action.ActionServlet.process(
00:46:12,812 INFO  [STDOUT]     at org.apache.struts.action.ActionServlet.doPost(
00:46:12,843 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(
00:46:12,859 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(
00:46:12,890 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh
00:46:12,921 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(
00:46:12,953 INFO  [STDOUT]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
00:46:12,968 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh
00:46:13,000 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(
00:46:13,031 INFO  [STDOUT]     at org.apache.catalina.core.StandardWrapperValve.invoke(
00:46:13,062 INFO  [STDOUT]     at org.apache.catalina.core.StandardContextValve.invoke(
00:46:13,078 INFO  [STDOUT]     at
00:46:13,109 INFO  [STDOUT]     at
00:46:13,140 INFO  [STDOUT]     at
00:46:13,171 INFO  [STDOUT]     at org.apache.catalina.core.StandardHostValve.invoke(
00:46:13,187 INFO  [STDOUT]     at org.apache.catalina.valves.ErrorReportValve.invoke(
00:46:13,218 INFO  [STDOUT]     at org.apache.catalina.core.StandardEngineValve.invoke(
00:46:13,250 INFO  [STDOUT]     at org.apache.catalina.connector.CoyoteAdapter.service(
00:46:13,281 INFO  [STDOUT]     at org.apache.jk.server.JkCoyoteHandler.invoke(
00:46:13,296 INFO  [STDOUT]     at org.apache.jk.common.HandlerRequest.invoke(
00:46:13,328 INFO  [STDOUT]     at org.apache.jk.common.ChannelSocket.invoke(
00:46:13,359 INFO  [STDOUT]     at org.apache.jk.common.ChannelSocket.processConnection(
00:46:13,390 INFO  [STDOUT]     at org.apache.jk.common.SocketConnection.runIt(
00:46:13,406 INFO  [STDOUT]     at org.apache.tomcat.util.threads.ThreadPool$
00:46:13,437 INFO  [STDOUT]     at

my DAO code is like below:

                      conn = OracleDAOFactory.createConnection();
                      String sql =
                      "{ ? = call validateUser( ? , ? ) }";

                      cstmt = conn.prepareCall(sql);
                      cstmt.registerOutParameter(1, OracleTypes.CURSOR);
                      cstmt.setString(2, username);
                      cstmt.setString(3, pswd);
                            rset = (ResultSet)cstmt.getObject(1);

and my validateUser code is like below:

create or replace package types as
type sqlcur is REF cursor;

create or replace function validateUser(
p_username               PRINCIPALS_TABLE.username%type,
p_password            PRINCIPALS_TABLE.password%type
)return types.sqlcur as
c1 types.sqlcur;

v_username               varchar2(64);
v_password            varchar2(64);


v_username  := p_username;
v_password  := p_password;


p.username ,
name_of_role       role ,
name_of_rolegroup  rolegroup ,
principals_table p ,
roles_table r,
rolegroup_info_table rgi,
role_info_table ri
    p.username = v_username
and p.password = v_password
and p.username = r.username
and r.id_of_rolegroup = rgi.id_of_rolegroup
and r.id_of_role  = ri.id_of_role


I don't see any problem here, can anybody help?

Arthur WangAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try using latest jdbc driver. this seems to be problem with driver and its a known bug.
Arthur WangAuthor Commented:
I did copy the ojdbc14.jar from the lib directory of my oracle 10gr2 rac and put it  into the classpath of the compile server. however, when I print out the version of the jdbc driver, it still shows the version of instead of 10.2. I don't know why! should i also need to include the classpath of ojdbc14.jar in the application server?machine used to compile the java source code is different from the applicaton server machine.
Arthur WangAuthor Commented:
in fact, I just migrated from 10gr1 single node database to 10gr2 rac with two node, and all datafiles are saved by ASM, someone said it's related to characterset of the ASM, not sure if it's the problem of ASM.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Arthur WangAuthor Commented:
I just tried to put the ojdbc14.jar into the classpath of the application server lib directory, then the error message disappear.  I guess that the jdbc driver is loaded dynamically , so it has to be in the classpath of application server, is this the right reason?
the server picks up the classes from the jar which is in classpath.
the jars from the classpath form the runtime environment.
so if u compile the code using new ojdbc14.jar ......then it doesnt work.
u will have to put it in runtime classpath.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Arthur WangAuthor Commented:
I just don't understand why some components needs to be in  the classpath of run time enviroment, and some don't . is there any way I can identify this?
Can I know where exactly is the classpath that is mentioned by avinthm ?
I am facing the same issue.
The classpath i am refering to is Runtime classpath. You can use -classpath option with java command to set runtime classpath.

java -classpath <path to jar files> <your class with main method>

documentation :
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.