Subject Re: [Firebird-Java] Re: Insert ... returning ...
Author Adilson Ricardo Fernandes
Roman,

I suspect that, in the fixing the "insert...returning..." problem, was
introduced a new problem.
The query below works properly in ISQL and in version 2.1 of JayBird,
but in version on the CVS causes the exception "GDS Exception.
335544583. SQLDA missing or incorrect version, or incorrect number/type
of variables"...

01 select
02 id.id id_id,
03 cd.id cd_id,
04 cd.codigo cd_codigo,
05 cd.descricao cd_descricao,
06 ce.id ce_id,
07 ce.codigo ce_codigo,
08 ce.descricao ce_descricao,
09 idsaii.id idsaii_id,
10 idsaii.codigo idsaii_codigo,
11 idsaii.descricao idsaii_descricao,
12 idsaii.idClassificacaoEvento idsaii_idClassificacaoEvento,
13 idsaiii.id idsaiii_id,
14 idsaiii.codigo idsaiii_codigo,
15 idsaiii.descricao idsaiii_descricao,
16 idsaiii.idClassificacaoEvento idsaiii_idClassificacaoEvento
17 from ItemDespesa id
18 inner join ClassificacaoDespesa cd on (cd.id =
id.idClassificacaoDespesa)
19 inner join ClassificacaoEvento ce on (ce.id = id.idClassificacaoEvento)
20 inner join ItemDespesaSIPAnexoII idsaii on (idsaii.id =
id.idItemDespesaSIPAnexoII)
21 left join ItemDespesaSIPAnexoIII idsaiii on (idsaiii.id =
id.idItemDespesaSIPAnexoIII)
22 where id.id = 1


And the more strange is that, if remove the lines '04' and '05', the
exception changes:

java.lang.reflect.UndeclaredThrowableException
.
.
Caused by: java.lang.NullPointerException
.
.


Thanks,

Adilson.


Complete stack traces:


org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544583. SQLDA
missing or incorrect version, or incorrect number/type of variables
at
org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:119)
at
org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:90)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:873)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:828)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:821)
at
org.firebirdsql.pool.PingablePooledConnection.prepareStatement(PingablePooledConnection.java:431)
at
org.firebirdsql.pool.XPreparedStatementCache.take(XPreparedStatementCache.java:117)
at
org.firebirdsql.pool.PingablePooledConnection.getPreparedStatement(PingablePooledConnection.java:408)
at
org.firebirdsql.pool.PooledConnectionHandler.handlePrepareStatement(PooledConnectionHandler.java:312)
at
org.firebirdsql.pool.PooledConnectionHandler.invoke(PooledConnectionHandler.java:240)
at $Proxy0.prepareStatement(Unknown Source)
at
arf.same.planosaude.dao.FirebirdItemDespesaDAO.findById(FirebirdItemDespesaDAO.java:217)
at arf.same.planosaude.mtw.action.LoginAction.execute(LoginAction.java:56)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:112)
at org.mentawai.filter.OutputFilter.filter(OutputFilter.java:58)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.InjectionFilter.filter(InjectionFilter.java:260)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at
org.mentawai.filter.RedirectAfterLoginFilter.filter(RedirectAfterLoginFilter.java:52)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ExceptionFilter.filter(ExceptionFilter.java:81)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ConverterFilter.filter(ConverterFilter.java:81)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ValidatorFilter.filter(ValidatorFilter.java:154)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at
org.mentawai.filter.AuthenticationFilter.filter(AuthenticationFilter.java:61)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.core.Controller.invokeAction(Controller.java:583)
at org.mentawai.core.Controller.service(Controller.java:469)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
at java.lang.Thread.run(Thread.java:595)
at org.firebirdsql.gds.GDSException: SQLDA missing or incorrect version,
or incorrect number/type of variables
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseTruncSqlInfo(AbstractJavaGDSImpl.java:2459)
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseSqlInfo(AbstractJavaGDSImpl.java:2315)
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlPrepare(AbstractJavaGDSImpl.java:1499)
at org.firebirdsql.gds.impl.GDSHelper.prepareStatement(GDSHelper.java:196)
at
org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1129)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.prepareFixedStatement(AbstractPreparedStatement.java:1157)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:116)
at
org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:90)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:873)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:828)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:821)
at
org.firebirdsql.pool.PingablePooledConnection.prepareStatement(PingablePooledConnection.java:431)
at
org.firebirdsql.pool.XPreparedStatementCache.take(XPreparedStatementCache.java:117)
at
org.firebirdsql.pool.PingablePooledConnection.getPreparedStatement(PingablePooledConnection.java:408)
at
org.firebirdsql.pool.PooledConnectionHandler.handlePrepareStatement(PooledConnectionHandler.java:312)
at
org.firebirdsql.pool.PooledConnectionHandler.invoke(PooledConnectionHandler.java:240)
at $Proxy0.prepareStatement(Unknown Source)
at
arf.same.planosaude.dao.FirebirdItemDespesaDAO.findById(FirebirdItemDespesaDAO.java:217)
at arf.same.planosaude.mtw.action.LoginAction.execute(LoginAction.java:56)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:112)
at org.mentawai.filter.OutputFilter.filter(OutputFilter.java:58)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.InjectionFilter.filter(InjectionFilter.java:260)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at
org.mentawai.filter.RedirectAfterLoginFilter.filter(RedirectAfterLoginFilter.java:52)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ExceptionFilter.filter(ExceptionFilter.java:81)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ConverterFilter.filter(ConverterFilter.java:81)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ValidatorFilter.filter(ValidatorFilter.java:154)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at
org.mentawai.filter.AuthenticationFilter.filter(AuthenticationFilter.java:61)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.core.Controller.invokeAction(Controller.java:583)
at org.mentawai.core.Controller.service(Controller.java:469)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
at java.lang.Thread.run(Thread.java:595)


-----------------



java.lang.reflect.UndeclaredThrowableException
at
org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:101)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:873)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:828)
at
org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:821)
at
org.firebirdsql.pool.PingablePooledConnection.prepareStatement(PingablePooledConnection.java:431)
at
org.firebirdsql.pool.XPreparedStatementCache.take(XPreparedStatementCache.java:117)
at
org.firebirdsql.pool.PingablePooledConnection.getPreparedStatement(PingablePooledConnection.java:408)
at
org.firebirdsql.pool.PooledConnectionHandler.handlePrepareStatement(PooledConnectionHandler.java:312)
at
org.firebirdsql.pool.PooledConnectionHandler.invoke(PooledConnectionHandler.java:240)
at $Proxy0.prepareStatement(Unknown Source)
at
arf.same.planosaude.dao.FirebirdItemDespesaDAO.findById(FirebirdItemDespesaDAO.java:215)
at
arf.same.planosaude.mtw.action.LoginAction.execute(LoginAction.java:56)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:112)
at org.mentawai.filter.OutputFilter.filter(OutputFilter.java:58)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.InjectionFilter.filter(InjectionFilter.java:260)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at
org.mentawai.filter.RedirectAfterLoginFilter.filter(RedirectAfterLoginFilter.java:52)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ExceptionFilter.filter(ExceptionFilter.java:81)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ConverterFilter.filter(ConverterFilter.java:81)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.filter.ValidatorFilter.filter(ValidatorFilter.java:154)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at
org.mentawai.filter.AuthenticationFilter.filter(AuthenticationFilter.java:61)
at org.mentawai.core.InvocationChain.invoke(InvocationChain.java:87)
at org.mentawai.core.Controller.invokeAction(Controller.java:583)
at org.mentawai.core.Controller.service(Controller.java:469)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.calculateBLR(AbstractJavaGDSImpl.java:2209)
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseSqlInfo(AbstractJavaGDSImpl.java:2337)
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlPrepare(AbstractJavaGDSImpl.java:1499)
at
org.firebirdsql.gds.impl.GDSHelper.prepareStatement(GDSHelper.java:196)
at
org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1129)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.prepareFixedStatement(AbstractPreparedStatement.java:1157)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:116)
at
org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:90)
... 41 more