Results 1 to 11 of 11
  1. #1
    kai555 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default NullPointerException

    Hi

    has anybody seen this before, or know how to deal with this?

    java.lang.NullPointerException
    at oracle.jdbc.driver.T4CResultSetAccessor.getCursor( T4CResultSetAccessor.java:331)
    at oracle.jdbc.driver.OracleCallableStatement.getCurs or(OracleCallableStatement.java:2190)
    at oracle.jdbc.driver.OracleCallableStatementWrapper. getCursor(OracleCallableStatementWrapper.java:959)


    Could this be caused by not enough table space?

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,424
    Rep Power
    25

    Default

    Where in your program did this occur? Was there more to the error message that you have left off?

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    I doubt it's anything to do with table spaces.
    What were you doing for that call?
    What's the function/procedure being called?

  4. #4
    kai555 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default

    Hi

    Thank you for replying

    Unfortunately I'm not allowed to post the rest of the stack trace since it contains the class names and packages of the company i work for

    The code works fine except for on this one environment, so I'm guessing it's a database issue.

    Basically the code is uploading a spreadsheet full of data line by line into the database. But it gets the data already there to compare to to prevent duplicates, and prevents violation of some other business rules. Of course this is where the problem comes in.

    It creates a connection, and then calles a stored proc like this
    CallableStatement cstmt = conn.getCallableStatement("{call ... }");

    It passes in some parameters
    cstmt.setString( ...

    Then it places an out parameter:
    cstmt.registerOutParameter(11, OracleTypes.CURSOR);

    and then it gets the result by calling
    java.sql.ResultSet cursor = ocs.getCursor(11);

    And that's where the exception occurs.

    I've tried to replicate this issue on another environment with exactly the same data, and on the same type of operating system. But it runs fine.

    So could it be the database that causes this issue? Some setting maybe?

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    Database version against driver version maybe?

    Have you called the procedure from within the oracle db causing trouble (say via SQLPlus) to see whether it's a problem there?

  6. #6
    kai555 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default

    The database version is 11.0.1.0 and the driver is the latest.

    I haven't ran the stored proc yet since I don't have access to the problem database but I will request to run it now.

    I have requested a copy of the stored proc s source, to see if it maybe somehow changed, but I have to wait for a reply

    Thanks for the replies so far.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    If there were space problems on the db then I would hope the DBA responsible for that system would have noticed.

  8. #8
    kai555 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default

    True, but Im seriously questioning that DBA's ability since she didn't know what the table space is when I asked her to increase it.

    I will have to wait to see what she sends me from the questions I've asked.

    Thanks for giving me some suggestions.

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    Ah.
    I wonder if the procedure is simply returning a null cursor...which would tie up with your initial thoughts that there's space problems.

    If whatever is going on in there doesn't happen for whatever reason (exceptions? I know not), but the code is allowed to merrily go on its way, then I wonder if a null returned cursor is happening?

    The driver will then attempt to prepare the cursor as a resultset, but there isn't actually anything there to prepare (which is a Bad Thing), and *bang*...NPE.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    I don't have Oracle here, but you could try and recreate it by writing a simple procedure that returns a cursor, but ends up returning a null cursor?
    Something like that?

  11. #11
    kai555 is offline Member
    Join Date
    Aug 2011
    Posts
    5
    Rep Power
    0

    Default

    That's a great suggestion, I'm definitely going to try that now. I will let you know how it turns out.

    Thanks a mill for the idea.

Similar Threads

  1. NullPointerException
    By Diz in forum New To Java
    Replies: 10
    Last Post: 05-13-2011, 02:58 AM
  2. NullPointerException
    By jayragz in forum NetBeans
    Replies: 5
    Last Post: 05-12-2011, 05:19 PM
  3. NullPointerException
    By maxspyderweb in forum New To Java
    Replies: 5
    Last Post: 03-02-2011, 10:42 AM
  4. Nullpointerexception?
    By Pulgo in forum New To Java
    Replies: 5
    Last Post: 01-05-2011, 04:05 PM
  5. NullPointerException
    By JohnST in forum New To Java
    Replies: 13
    Last Post: 01-06-2010, 12:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •