Hello Lukas,
Maybe the following might give an indication...
At a certain point the code lands in the following class DefaultDataType
and more specifically in...
if (dialect != null) {
result = TYPES_BY_TYPE[dialect.ordinal()].get(type);
}
in this snippet the result evaluates to null
dialect.ordinal() evaluates to 20
dialect evaluates to ORACLE11G
type evaluates to org.jooq.Result.class
Best regards,
Gian
On Thursday, March 26, 2015 at 9:13:10 AM UTC+1, Gian wrote:
> Good morning Lukas,
>
> I create the DSLContext in the method as follows:
>
>
> private DSLContext getDslContext() throws SQLException {
> Connection conn = DriverManager.getConnection(url, userName, password);
> return DSL.using(conn, SQLDialect.ORACLE11G);
> }
>
>
> In the mean time I'm stepping in through the breakpoints as we speak ;-)
>
> Thank you, kind regards,
>
> Gian
>
> On Thursday, March 26, 2015 at 9:03:36 AM UTC+1, Lukas Eder wrote:
>
>> Hi Gian,
>>
>> That is an alternative way to call the stored procedure. I've tried it as
>> well and it works just fine for me. Perhaps the issue is related to how you
>> produce that DSLContext instance in getDslContext()...?
>>
>> Best Regards,
>> Lukas
>>
>> 2015-03-25 14:15 GMT+01:00 <[email protected]>:
>>
>>> Hi Lukas,
>>>
>>> Thank you for having a look.
>>>
>>> As a rudimentary first test, with the configuration object, I wrote the
>>> following:
>>>
>>>
>>> public void testSearchPublic() {
>>> try {
>>> DSLContext context = getDslContext();
>>>
>>> SearchPublic searchPublic = new SearchPublic();
>>>
>>> searchPublic.setIComrefId("");
>>> searchPublic.setIFreeText("");
>>> searchPublic.setIIsManager("");
>>> searchPublic.setICurrentUserLogin("");
>>> searchPublic.setIOrderby("");
>>> searchPublic.setIOrder("");
>>>
>>> searchPublic.execute(context.configuration());
>>>
>>> Result<Record> oRefList = searchPublic.getORefList();
>>> String oResult = searchPublic.getOResult();
>>>
>>> } catch (Exception e) {
>>> e.printStackTrace();
>>> }
>>> }
>>>
>>>
>>> The jOOQ edition has been downloaded from the web site and not obtained
>>> through Maven Central.
>>> At run time it mentions '...the 30 day free jOOQ 3.5.3 trial edition'.
>>>
>>> Kind regards,
>>>
>>> Gian
>>>
>>>
>>> On Wednesday, March 25, 2015 at 2:03:54 PM UTC+1, Lukas Eder wrote:
>>>
>>>> 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(AbstractR
>>>> outine.java:622)
>>>> at org.jooq.impl.AbstractRoutine.registerOutParameters(Abstract
>>>> Routine.java:616)
>>>> at org.jooq.impl.AbstractRoutine.executeCallableStatement(Abstr
>>>> actRoutine.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.jav
>>>>>>> a:510)
>>>>>>> at org.jooq.impl.DefaultBinding.register(DefaultBinding.java:766)
>>>>>>> at org.jooq.impl.AbstractRoutine.registerOutParameter(AbstractR
>>>>>>> outine.java:622)
>>>>>>> at org.jooq.impl.AbstractRoutine.registerOutParameters(Abstract
>>>>>>> Routine.java:616)
>>>>>>> at org.jooq.impl.AbstractRoutine.executeCallableStatement(Abstr
>>>>>>> actRoutine.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.
>>>
>>
>>
--
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.