Topic
5 replies Latest Post - ‏2012-04-03T08:33:59Z by nchieffo
SystemAdmin
SystemAdmin
532 Posts
ACCEPTED ANSWER

Pinned topic SqlStatementHelper$OutputDefinition incompatible with InputDefinition error

‏2009-09-04T19:00:15Z |
Hello,

I am calling an Oracle stored procedure from a SQL Call Builder that requiresv an integer parameter and returns a Ref Cursor.

The output parameter is being cast to a Ref Cursor type via the method "castRefCursor" specified in the "Value or Set/Cast Method" field.

There are no design time errors in Designer, however, when I run the model it gives the following error(DBTest is the name of the builder and model):

Exception Error in method main. Error in method DBTest_ShowResults. Error in method DBTestInvoke. Error in method DBTestInvokeBase. Error in method DBTestTransform.executeForCaching. com.bowstreet.builders.webapp.methods.SqlStatementHelper$OutputDefinition incompatible with com.bowstreet.builders.webapp.methods.SqlStatementHelper$InputDefinition
Stack Trace
java.lang.ClassCastException: com.bowstreet.builders.webapp.methods.SqlStatementHelper$OutputDefinition incompatible with com.bowstreet.builders.webapp.methods.SqlStatementHelper$InputDefinition
at com.bowstreet.builders.webapp.methods.SqlStatementHelper.addDynamicInClauseInputs(SqlStatementHelper.java:987)
at com.bowstreet.builders.webapp.methods.SqlStatementHelper.createStatement(SqlStatementHelper.java:832)
Here is the body of the castRefCursor method:

{
try
{
// Code is specific to a CallableStatement. Cast will throw an exception
// if the caller tries to pass anyother type of object into the method.
final CallableStatement cs = (CallableStatement) statement;
if( cs != null && "cast".equals( action ) )
{
// Cast and register the output parameter at position "position" to be an
// Oracle CURSOR type. If the Oracle JDBC driver ZIP / JAR file is not
// in the method compiler's classpath, then this will cause an error.
cs.registerOutParameter( position, OracleTypes.CURSOR );
}
else if( cs != null && "set".equals( action ) )
{
// The "set" action is not supported for result sets so throw an
// exception to alert the caller to the problem.
throw new Exception( "Cannot set the value of a ResultSet" );
}
}
catch( Throwable t )
{
// If anything goes wrong, then log an error to the Bowstreet Event log
// and rethrow the exception for handling by the model.
throw new WebAppRuntimeException( t );
}

return null;
}
Could you please advise why this error occurs?

Thanks,
Mike
Updated on 2012-04-03T08:33:59Z at 2012-04-03T08:33:59Z by nchieffo
  • DGawron
    DGawron
    250 Posts
    ACCEPTED ANSWER

    Re: SqlStatementHelper$OutputDefinition incompatible with InputDefinition error

    ‏2009-09-10T18:27:28Z  in response to SystemAdmin
    It sounds like a bug in SQL Call. Can you post a sample model that causes the error in your environment so that we can test the model in the lab?
    • SystemAdmin
      SystemAdmin
      532 Posts
      ACCEPTED ANSWER

      Re: SqlStatementHelper$OutputDefinition incompatible with InputDefinition error

      ‏2009-09-15T13:59:40Z  in response to DGawron
      It looks like there is indeed a bug in the SQL Call Builder in version 7.0.0 of the Portlet Factory.

      I reverted back to PF 6.1.2 and everything is working fine.

      Thanks,
      Mike
      • DGawron
        DGawron
        250 Posts
        ACCEPTED ANSWER

        Re: SqlStatementHelper$OutputDefinition incompatible with InputDefinition error

        ‏2009-10-03T19:30:12Z  in response to SystemAdmin
        This is scheduled to be fixed in the next WPF release.
  • nchieffo
    nchieffo
    2 Posts
    ACCEPTED ANSWER

    Re: SqlStatementHelper$OutputDefinition incompatible with InputDefinition error

    ‏2012-04-02T14:41:46Z  in response to SystemAdmin
    I've got this same error when I try to execute a SQL call builder configured with this statement

    call ComDocDwnl(?, ?, ?, ?, ?)

    the last argument an input-output of type char.
    There's no way of executing that call, even when using the Service Definition testing support.

    I'm using portelt factory 7.0.1.2 within websphere portal 7.0.0.2
    • nchieffo
      nchieffo
      2 Posts
      ACCEPTED ANSWER

      Re: SqlStatementHelper$OutputDefinition incompatible with InputDefinition error

      ‏2012-04-03T08:33:59Z  in response to nchieffo
      never mind, my call required to be encapsulated with { }