Arthur Wang
asked on
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.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:125)
00:46:12,234 INFO [STDOUT] at oracle.jdbc.driver.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:162)
00:46:12,265 INFO [STDOUT] at oracle.jdbc.driver.Databas eError.che ck_error(D atabaseErr or.java:88 5)
00:46:12,281 INFO [STDOUT] at oracle.jdbc.driver.T4CMARE ngine.buff er2Value(T 4CMAREngin e.java:223 1)
00:46:12,312 INFO [STDOUT] at oracle.jdbc.driver.T4CMARE ngine.unma rshalUB2(T 4CMAREngin e.java:104 8)
00:46:12,343 INFO [STDOUT] at oracle.jdbc.driver.T4CTTId cb.receive Common(T4C TTIdcb.jav a:112)
00:46:12,375 INFO [STDOUT] at oracle.jdbc.driver.T4CTTId cb.receive FromRefCur sor(T4CTTI dcb.java:1 04)
00:46:12,390 INFO [STDOUT] at oracle.jdbc.driver.T4CResu ltSetAcces sor.unmars halOneRow( T4CResultS etAccessor .java:16
00:46:12,421 INFO [STDOUT] at oracle.jdbc.driver.T4CTTIr xd.unmarsh al(T4CTTIr xd.java:78 8)
00:46:12,453 INFO [STDOUT] at oracle.jdbc.driver.T4CTTIr xd.unmarsh al(T4CTTIr xd.java:70 5)
00:46:12,484 INFO [STDOUT] at oracle.jdbc.driver.T4C8Oal l.receive( T4C8Oall.j ava:527)
00:46:12,500 INFO [STDOUT] at oracle.jdbc.driver.T4CCall ableStatem ent.doOall 8(T4CCalla bleStateme nt.java:18 0)
00:46:12,531 INFO [STDOUT] at oracle.jdbc.driver.T4CCall ableStatem ent.execut e_for_rows (T4CCallab leStatemen t.java:7
00:46:12,562 INFO [STDOUT] at oracle.jdbc.driver.OracleS tatement.d oExecuteWi thTimeout( OracleStat ement.java :1028)
00:46:12,593 INFO [STDOUT] at oracle.jdbc.driver.OracleP reparedSta tement.exe cuteIntern al(OracleP reparedSta tement.j
00:46:12,625 INFO [STDOUT] at oracle.jdbc.driver.OracleP reparedSta tement.exe cute(Oracl ePreparedS tatement.j ava:2979
00:46:12,640 INFO [STDOUT] at oracle.jdbc.driver.OracleC allableSta tement.exe cute(Oracl eCallableS tatement.j ava:4103
00:46:12,671 INFO [STDOUT] at com.mailamerica.wts.DAO.Or acleLoginD AO.login(U nknown Source)
00:46:12,703 INFO [STDOUT] at com.mailamerica.wts.LoginA ction.exec ute(Unknow n Source)
00:46:12,734 INFO [STDOUT] at org.apache.struts.action.R equestProc essor.proc essActionP erform(Req uestProces sor.java
00:46:12,750 INFO [STDOUT] at org.apache.struts.action.R equestProc essor.proc ess(Reques tProcessor .java:226)
00:46:12,781 INFO [STDOUT] at org.apache.struts.action.A ctionServl et.process (ActionSer vlet.java: 1164)
00:46:12,812 INFO [STDOUT] at org.apache.struts.action.A ctionServl et.doPost( ActionServ let.java:4 15)
00:46:12,843 INFO [STDOUT] at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 717)
00:46:12,859 INFO [STDOUT] at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 810)
00:46:12,890 INFO [STDOUT] at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterCh
00:46:12,921 INFO [STDOUT] at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java
00:46:12,953 INFO [STDOUT] at org.jboss.web.tomcat.filte rs.ReplyHe aderFilter .doFilter( ReplyHeade rFilter.ja va:75)
00:46:12,968 INFO [STDOUT] at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterCh
00:46:13,000 INFO [STDOUT] at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java
00:46:13,031 INFO [STDOUT] at org.apache.catalina.core.S tandardWra pperValve. invoke(Sta ndardWrapp erValve.ja va:213)
00:46:13,062 INFO [STDOUT] at org.apache.catalina.core.S tandardCon textValve. invoke(Sta ndardConte xtValve.ja va:178)
00:46:13,078 INFO [STDOUT] at org.jboss.web.tomcat.secur ity.Custom PrincipalV alve.invok e(CustomPr incipalVal ve.java:
00:46:13,109 INFO [STDOUT] at org.jboss.web.tomcat.secur ity.Securi tyAssociat ionValve.i nvoke(Secu rityAssoci ationVal
00:46:13,140 INFO [STDOUT] at org.jboss.web.tomcat.secur ity.JaccCo ntextValve .invoke(Ja ccContextV alve.java: 53)
00:46:13,171 INFO [STDOUT] at org.apache.catalina.core.S tandardHos tValve.inv oke(Standa rdHostValv e.java:126 )
00:46:13,187 INFO [STDOUT] at org.apache.catalina.valves .ErrorRepo rtValve.in voke(Error ReportValv e.java:105 )
00:46:13,218 INFO [STDOUT] at org.apache.catalina.core.S tandardEng ineValve.i nvoke(Stan dardEngine Valve.java :107)
00:46:13,250 INFO [STDOUT] at org.apache.catalina.connec tor.Coyote Adapter.se rvice(Coyo teAdapter. java:148)
00:46:13,281 INFO [STDOUT] at org.apache.jk.server.JkCoy oteHandler .invoke(Jk CoyoteHand ler.java:3 07)
00:46:13,296 INFO [STDOUT] at org.apache.jk.common.Handl erRequest. invoke(Han dlerReques t.java:385 )
00:46:13,328 INFO [STDOUT] at org.apache.jk.common.Chann elSocket.i nvoke(Chan nelSocket. java:748)
00:46:13,359 INFO [STDOUT] at org.apache.jk.common.Chann elSocket.p rocessConn ection(Cha nnelSocket .java:678)
00:46:13,390 INFO [STDOUT] at org.apache.jk.common.Socke tConnectio n.runIt(Ch annelSocke t.java:871 )
00:46:13,406 INFO [STDOUT] at org.apache.tomcat.util.thr eads.Threa dPool$Cont rolRunnabl e.run(Thre adPool.jav a:684)
00:46:13,437 INFO [STDOUT] at java.lang.Thread.run(Threa d.java:595 )
my DAO code is like below:
try{
conn = OracleDAOFactory.createCon nection();
String sql =
"{ ? = call validateUser( ? , ? ) }";
cstmt = conn.prepareCall(sql);
cstmt.registerOutParameter (1, OracleTypes.CURSOR);
cstmt.setString(2, username);
cstmt.setString(3, pswd);
cstmt.execute();
rset = (ResultSet)cstmt.getObject (1);
and my validateUser code is like below:
create or replace package types as
type sqlcur is REF cursor;
end;
/
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);
begin
v_username := p_username;
v_password := p_password;
OPEN c1 FOR
select
p.username ,
name_of_role role ,
name_of_rolegroup rolegroup ,
id_of_user
from
principals_table p ,
roles_table r,
rolegroup_info_table rgi,
role_info_table ri
where
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
;
RETURN c1;
I don't see any problem here, can anybody help?
thanks
00:46:12,203 INFO [STDOUT] at oracle.jdbc.driver.Databas
00:46:12,234 INFO [STDOUT] at oracle.jdbc.driver.Databas
00:46:12,265 INFO [STDOUT] at oracle.jdbc.driver.Databas
00:46:12,281 INFO [STDOUT] at oracle.jdbc.driver.T4CMARE
00:46:12,312 INFO [STDOUT] at oracle.jdbc.driver.T4CMARE
00:46:12,343 INFO [STDOUT] at oracle.jdbc.driver.T4CTTId
00:46:12,375 INFO [STDOUT] at oracle.jdbc.driver.T4CTTId
00:46:12,390 INFO [STDOUT] at oracle.jdbc.driver.T4CResu
00:46:12,421 INFO [STDOUT] at oracle.jdbc.driver.T4CTTIr
00:46:12,453 INFO [STDOUT] at oracle.jdbc.driver.T4CTTIr
00:46:12,484 INFO [STDOUT] at oracle.jdbc.driver.T4C8Oal
00:46:12,500 INFO [STDOUT] at oracle.jdbc.driver.T4CCall
00:46:12,531 INFO [STDOUT] at oracle.jdbc.driver.T4CCall
00:46:12,562 INFO [STDOUT] at oracle.jdbc.driver.OracleS
00:46:12,593 INFO [STDOUT] at oracle.jdbc.driver.OracleP
00:46:12,625 INFO [STDOUT] at oracle.jdbc.driver.OracleP
00:46:12,640 INFO [STDOUT] at oracle.jdbc.driver.OracleC
00:46:12,671 INFO [STDOUT] at com.mailamerica.wts.DAO.Or
00:46:12,703 INFO [STDOUT] at com.mailamerica.wts.LoginA
00:46:12,734 INFO [STDOUT] at org.apache.struts.action.R
00:46:12,750 INFO [STDOUT] at org.apache.struts.action.R
00:46:12,781 INFO [STDOUT] at org.apache.struts.action.A
00:46:12,812 INFO [STDOUT] at org.apache.struts.action.A
00:46:12,843 INFO [STDOUT] at javax.servlet.http.HttpSer
00:46:12,859 INFO [STDOUT] at javax.servlet.http.HttpSer
00:46:12,890 INFO [STDOUT] at org.apache.catalina.core.A
00:46:12,921 INFO [STDOUT] at org.apache.catalina.core.A
00:46:12,953 INFO [STDOUT] at org.jboss.web.tomcat.filte
00:46:12,968 INFO [STDOUT] at org.apache.catalina.core.A
00:46:13,000 INFO [STDOUT] at org.apache.catalina.core.A
00:46:13,031 INFO [STDOUT] at org.apache.catalina.core.S
00:46:13,062 INFO [STDOUT] at org.apache.catalina.core.S
00:46:13,078 INFO [STDOUT] at org.jboss.web.tomcat.secur
00:46:13,109 INFO [STDOUT] at org.jboss.web.tomcat.secur
00:46:13,140 INFO [STDOUT] at org.jboss.web.tomcat.secur
00:46:13,171 INFO [STDOUT] at org.apache.catalina.core.S
00:46:13,187 INFO [STDOUT] at org.apache.catalina.valves
00:46:13,218 INFO [STDOUT] at org.apache.catalina.core.S
00:46:13,250 INFO [STDOUT] at org.apache.catalina.connec
00:46:13,281 INFO [STDOUT] at org.apache.jk.server.JkCoy
00:46:13,296 INFO [STDOUT] at org.apache.jk.common.Handl
00:46:13,328 INFO [STDOUT] at org.apache.jk.common.Chann
00:46:13,359 INFO [STDOUT] at org.apache.jk.common.Chann
00:46:13,390 INFO [STDOUT] at org.apache.jk.common.Socke
00:46:13,406 INFO [STDOUT] at org.apache.tomcat.util.thr
00:46:13,437 INFO [STDOUT] at java.lang.Thread.run(Threa
my DAO code is like below:
try{
conn = OracleDAOFactory.createCon
String sql =
"{ ? = call validateUser( ? , ? ) }";
cstmt = conn.prepareCall(sql);
cstmt.registerOutParameter
cstmt.setString(2, username);
cstmt.setString(3, pswd);
cstmt.execute();
rset = (ResultSet)cstmt.getObject
and my validateUser code is like below:
create or replace package types as
type sqlcur is REF cursor;
end;
/
create or replace function validateUser(
p_username PRINCIPALS_TABLE.username%
p_password PRINCIPALS_TABLE.password%
)return types.sqlcur as
c1 types.sqlcur;
v_username varchar2(64);
v_password varchar2(64);
begin
v_username := p_username;
v_password := p_password;
OPEN c1 FOR
select
p.username ,
name_of_role role ,
name_of_rolegroup rolegroup ,
id_of_user
from
principals_table p ,
roles_table r,
rolegroup_info_table rgi,
role_info_table ri
where
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
;
RETURN c1;
I don't see any problem here, can anybody help?
thanks
try using latest jdbc driver. this seems to be problem with driver and its a known bug.
ASKER
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 10.1.0.2 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.
ASKER
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.
ASKER
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
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 : http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/classpath.html
java -classpath <path to jar files> <your class with main method>
documentation : http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/classpath.html