Announcement Announcement Module
Collapse
No announcement yet.
Uncategorized SQLException for SQL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Uncategorized SQLException for SQL

    As per my requirement, I have to call two stored procedures simultaneously. Here is my code:
    HTML Code:
    <int:channel id="PQIssueHistory-Channel" />
        <int:chain input-channel="PQIssueHistory-Channel"  output-channel="test" >
            
            <int:service-activator ref="msgHandler" method="buildRequestBasedDataSource" />
            
            <int-jdbc:stored-proc-outbound-gateway
                            id="PQIssueHistory-StoredProcedure-PQCOMMENTLOOKUP"
                            auto-startup="true"
                            data-source="routingDataSource"
                            stored-procedure-name="${PQIssueHistory-StoredProcedure-PQCOMMENTLOOKUP}"
                            skip-undeclared-results="true"
                            ignore-column-meta-data="true"  
                            use-payload-as-parameter-source = "false"
                            expect-single-result="true" >
            
                                    <int-jdbc:sql-parameter-definition name="P_CRDATTIM" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_RECORDCD" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_CRNODE" direction="IN" type="VARCHAR" />
                                  
                                    <int-jdbc:parameter name="P_CRDATTIM" expression="#xpath(payload, '//CRDATTIM')" />
                                    <int-jdbc:parameter name="P_RECORDCD" expression="#xpath(payload, '//RECORDCD')" />
                                    <int-jdbc:parameter name="P_CRNODE" expression="#xpath(payload, '//CRNODE')" />
                                  
                    <int-jdbc:returning-resultset name="rowMapper" row-mapper="com.dsths.cs.awd.utils.ResultSetRowMapper"/>
                    
            </int-jdbc:stored-proc-outbound-gateway>
            
            <int:service-activator ref="msgHandler"  method="buildMessageFromExtSysResponseTestOne" />
            
            <int:header-enricher default-overwrite="true"  should-skip-nulls="true"  >
                <int:header name="${headerNames.originalPayload}" expression="payload" />  
            </int:header-enricher>    
            
            
        
        </int:chain>    
            
            <int:channel id="test" />
        <int:chain input-channel="test"  output-channel="PQIssueHistory-XsltTransformInputChannel" >
        
        <int-jdbc:stored-proc-outbound-gateway
                            id="PQIssueHistory-StoredProcedure-PQHISTORYLOOKUP"
                            auto-startup="true"
                            data-source="routingDataSource"
                            stored-procedure-name="${PQIssueHistory-StoredProcedure-PQHISTORYLOOKUP}"
                            skip-undeclared-results="true"
                            ignore-column-meta-data="true"  
                            use-payload-as-parameter-source = "false"
                            expect-single-result="true" >
            
                                    <int-jdbc:sql-parameter-definition name="P_CRDATTIM" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_RECORDCD" direction="IN" type="VARCHAR" />
                                    <int-jdbc:sql-parameter-definition name="P_CRNODE" direction="IN" type="VARCHAR" />
                                  
                                    <int-jdbc:parameter name="P_CRDATTIM" expression="#xpath(payload, '//CRDATTIM')" />
                                    <int-jdbc:parameter name="P_RECORDCD" expression="#xpath(payload, '//RECORDCD')" />
                                    <int-jdbc:parameter name="P_CRNODE" expression="#xpath(payload, '//CRNODE')" />
                                  
                    <int-jdbc:returning-resultset name="rowMapper" row-mapper="com.dsths.cs.awd.utils.ResultSetRowMapper"/>
                    
            </int-jdbc:stored-proc-outbound-gateway>
        
        <int:service-activator ref="msgHandler"  method="buildMessageFromExtSysResponseTestTwo" />
        
        </int:chain>
    I could able to hit the stored procedures without any issue when I execute the using junit test case.But, however, When I try to execute from GUI(i.e. after integrating with UI), I am getting the following error:
    HTML Code:
    org.springframework.integration.MessageHandlingException: error occurred in message handler [org.springframework.integration.handler.MessageHandlerChain#201$child.PQIssueHistory-StoredProcedure-PQHISTORYLOOKUP.handler]
        at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:79)
        at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:131)
       ................................
    ............................
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:662)
    Caused by: org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{call ZSPPQHISTORYLOOKUP(?, ?, ?)}]; SQL state [000RZ]; error code [930027]; No record found in the VOC file for "BP". ; nested exception is java.sql.SQLException: No record found in the VOC file for "BP".
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1036)
        at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1070)
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:387)
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:350)
        at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181)
        at org.springframework.integration.jdbc.StoredProcExecutor.executeStoredProcedure(StoredProcExecutor.java:335)
        at org.springframework.integration.jdbc.StoredProcExecutor.executeStoredProcedureInternal(StoredProcExecutor.java:325)
        at org.springframework.integration.jdbc.StoredProcExecutor.executeStoredProcedure(StoredProcExecutor.java:294)
        at org.springframework.integration.jdbc.StoredProcOutboundGateway.handleRequestMessage(StoredProcOutboundGateway.java:56)
        at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:142)
        at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)
        ... 146 more
    Caused by: java.sql.SQLException: No record found in the VOC file for "BP".
        at com.ibm.u2.jdbc.UniJDBCMsgFactory.createException(UniJDBCMsgFactory.java:101)
        at com.ibm.u2.jdbc.UniJDBCExceptionSupport.addException(UniJDBCExceptionSupport.java:87)
        at com.ibm.u2.jdbc.UniJDBCProtocolU2Impl.addServerError(UniJDBCProtocolU2Impl.java:2799)
        at com.ibm.u2.jdbc.UniJDBCProtocolU2Impl.serverExecuteSql(UniJDBCProtocolU2Impl.java:2130)
        at com.ibm.u2.jdbc.UniJDBCProtocolU2Impl.executeSql(UniJDBCProtocolU2Impl.java:2169)
        at com.ibm.u2.jdbc.UniJDBCProtocolU2Impl.doExecute(UniJDBCProtocolU2Impl.java:2208)
        at com.ibm.u2.jdbc.UniJDBCProtocolU2Impl.executeStatementQuery(UniJDBCProtocolU2Impl.java:606)
        at com.ibm.u2.jdbc.UniJDBCPreparedStatementImpl.execute(UniJDBCPreparedStatementImpl.java:407)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:299)
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1072)
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1070)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1020)
        ... 156 more
    12:26:25,972 INFO  [STDOUT] 12:26:25,971 DEBUG [org.springframework.integration.channel.DirectChannel.preSend] preSend on channel 'cs-exceptionHandlingChannel', message: [Payload=org.springframework.integration.MessageHandlingException: error occurred in message handler [org.springframework.integration.handler.MessageHandlerChain#201$child.PQIssueHistory-StoredProcedure-PQHISTORYLOOKUP.handler]][Headers={timestamp=1401778585971, id=60a1966f-e5ed-8bc0-d9d0-76ee7f6856d8, errorChannel=org.springfra[email protected]1c8968f, replyChannel=org.springfra[email protected]1c8968f}]
    From the above exception, it is clear that the control is going to the error channel. Here I just wanted to know the sql query which is causing the issue. I have turned on "DEBUG". It would be great if any one can share their ideas on how to proceed further to find/repair the problem.
    Last edited by Ashok.N; Jun 3rd, 2014, 06:14 AM. Reason: Added appropriate tag

  • #2
    Duplicated on Stack Overflow: http://stackoverflow.com/questions/2...eption-for-sql

    Comment

    Working...
    X