Hi Gian,
Interesting. I've now tried the following piece of PL/SQL code, which
resembles what you did:
CREATE OR REPLACE PACKAGE setup$m AS
TYPE CUSTOM_REF_CURSOR IS REF CURSOR;
PROCEDURE search_public
( i_comref_id IN VARCHAR2
,i_free_text IN VARCHAR2
,i_is_manager IN VARCHAR2
,i_current_user_login IN VARCHAR2
,o_ref_list OUT setup$m.CUSTOM_REF_CURSOR
,i_orderby IN VARCHAR2
,i_order IN VARCHAR2
,o_result OUT VARCHAR2);
END setup$m;
/
CREATE OR REPLACE PACKAGE BODY setup$m AS
PROCEDURE search_public
( i_comref_id IN VARCHAR2
,i_free_text IN VARCHAR2
,i_is_manager IN VARCHAR2
,i_current_user_login IN VARCHAR2
,o_ref_list OUT setup$m.CUSTOM_REF_CURSOR
,i_orderby IN VARCHAR2
,i_order IN VARCHAR2
,o_result OUT VARCHAR2) IS
BEGIN
OPEN o_ref_list FOR SELECT 1 a FROM DUAL;
END search_public;
END setup$m;
/
I then called the above procedure like this, without any issues:
SearchPublic result = Setup$m.searchPublic(configuration, null, null, null,
null, null, null);
System.out.println(result.getORefList());
The output I got was:
+----+
| A|
+----+
| 1|
+----+
I've reviewed the exception that you've posted:
java.lang.NullPointerException
at org.jooq.impl.DefaultDataType.getSQLType(DefaultDataType.java:510)
at org.jooq.impl.DefaultBinding.register(DefaultBinding.java:766)
at org.jooq.impl.AbstractRoutine.registerOutParameter(
AbstractRoutine.java:622)
at org.jooq.impl.AbstractRoutine.registerOutParameters(
AbstractRoutine.java:616)
at org.jooq.impl.AbstractRoutine.executeCallableStatement(
AbstractRoutine.java:339)
at org.jooq.impl.AbstractRoutine.execute(AbstractRoutine.java:270)
at org.jooq.impl.AbstractRoutine.execute(AbstractRoutine.java:256)
It points to the following line of code:
else if (Result.class.isAssignableFrom(type)) {
switch (dialect.family()) { /* [pro] */
case ORACLE: /* [/pro] */ case H2:
return -10; // OracleTypes.CURSOR; case
POSTGRES: default: return
Types.OTHER; } }
But I don't see any way how this dialect could be null, normally... How did
you create the configuration object you're using to call the stored
procedure?
Another possible source of error: The jOOQ Open Source Edition is
distributed to Maven Central and it doesn't contain the SQLDialect.ORACLE.
Perhaps, your tests somehow pulled in the Open Source Edition runtime,
instead of the trial / commercial edition? Could that be possible?
Best Regards,
Lukas
2015-03-25 9:10 GMT+01:00 <[email protected]>:
> Good morning Lukas,
>
> Please see in attachment the setup$m.pks file containing the declaration
> and definition fo the cursor.
>
> Thank you, kind regards,
>
> On Tuesday, March 24, 2015 at 11:56:30 PM UTC+1, Lukas Eder wrote:
>
>> Hmm, interesting. This is clearly a bug - either in the code generator,
>> or in the way jOOQ handles the CUSTOM_REF_CURSOR type at runtime.
>> Can you provide us with the PL/SQL declaration of setup$m, including
>> setup$m.CUSTOM_REF_CURSOR?
>>
>> Best Regards,
>> Lukas
>>
>> 2015-03-24 14:38 GMT+01:00 <[email protected]>:
>>
>>> Good afternoon all,
>>>
>>> I have generated jOOQ classes for database objects in a Oracle 11g
>>> database: the generation was successful.
>>>
>>> One of the database objects is a PL/SQL procedure with the following
>>> signature:
>>>
>>> PROCEDURE search_public
>>>
>>> ( i_comref_id IN VARCHAR2
>>> ,i_free_text IN VARCHAR2
>>> ,i_is_manager IN VARCHAR2
>>> ,i_current_user_login IN t$users.user_login%TYPE
>>> ,o_ref_list OUT setup$m.CUSTOM_REF_CURSOR
>>> ,i_orderby IN VARCHAR2
>>> ,i_order IN VARCHAR2
>>> ,o_result OUT VARCHAR2)
>>>
>>> My jUnit test of the corresponding class SearchPublic() fails with the
>>> following stacktrace:
>>>
>>> java.lang.NullPointerException
>>> at org.jooq.impl.DefaultDataType.getSQLType(DefaultDataType.java:510)
>>> at org.jooq.impl.DefaultBinding.register(DefaultBinding.java:766)
>>> at org.jooq.impl.AbstractRoutine.registerOutParameter(
>>> AbstractRoutine.java:622)
>>> at org.jooq.impl.AbstractRoutine.registerOutParameters(
>>> AbstractRoutine.java:616)
>>> at org.jooq.impl.AbstractRoutine.executeCallableStatement(
>>> AbstractRoutine.java:339)
>>> at org.jooq.impl.AbstractRoutine.execute(AbstractRoutine.java:270)
>>> at org.jooq.impl.AbstractRoutine.execute(AbstractRoutine.java:256)
>>>
>>> The problems seem to originate in the instantiation
>>> SearchPublic searchPublic = new SearchPublic();
>>> and are described as follows by IntelliJ:
>>> Method threw 'java.lang.NullPointerException' exception. Cannot
>>> evaluate domain.framew.packages.user$o.SearchPublic.toString()
>>>
>>> Do you know what might be going wrong?
>>>
>>> Thank you, kind regards,
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "jOOQ User Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.