Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8380857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:33:49+00:00 2026-06-09T16:33:49+00:00

I am seeing this warning in my JNI code: JNI WARNING: 0x44be7258 is not

  • 0

I am seeing this warning in my JNI code:

JNI WARNING: 0x44be7258 is not a valid JNI reference

I am assigning a LocalReference returned by FindClass method in JNI to my class member variable within the constructor:

Header:

...
jclass m_class;

Cpp:

m_class = env->FindClass( classSignature );

Does FindClass return a LocalReference and storing it in my class member variable is invalid?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:33:50+00:00Added an answer on June 9, 2026 at 4:33 pm

    From the Liang book, chapter 5.1.1 “Local References”

    Most JNI functions create local references … A local reference is valid only within the dynamic context of the native method that creates it, and only within that one invocation of the native method. All local references created during the execution of a native method will be freed once the native method returns.

    Followed by an illegal code example which uses exactly your method FindClass. In other words, yes, FindClass returns a local reference. In the following chapter is an example of creating a global reference which is usable in the way you wanted. Don’t forget to DeleteGlobalRef when you don’t need it anymore. Otherwise JVM cannot GC it and your program will leak.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Kept on seeing this pattern in code, but couldn't find any reference to it
I'm seeing this code in a project and I wonder if it is safe
after update to tycho 0.14.0, i'm seeing this warning: [WARNING] Entry: germantechEcfNfe/plugins/org.eclipse.ui.intro.universal_3.2.500.v20110510/themes/slate/graphics/standby/fs_standbyhov.gif longer than
We're seeing the above warning on a View's form post... <form action=../ControllerName/ActionMethodName method=post> Technically
Some code style tools recommend this and I remember seeing some unix command line
Since upgrading to Rails 3.1 I'm seeing this warning message in my development log:
I keep seeing List derived classes that look something like this class MyClassList :
I have been seeing this a lot lately and I am unable to find
I remember seeing this on Ajaxian and a couple other sites but I never
I've been seeing this in my Visual C# 2008 RSS Feed forever now: http://lincolnfair.net/oldLincolnFair/mad.jpg

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.