Comments (4)
I can't seem to reproduce this issue. I have a single-file project with the following code:
#include <iostream>
#include <jnipp.h>
int main()
{
jni::Vm vm;
try {
jni::Class ctx("android/content/Context1");
}
catch (jni::NameResolutionException& e) {
std::cout << "the exception " << e.what() << std::endl;
}
std::cin.get();
return 0;
}
It is producing the following output, as expected:
the exception android/content/Context1
Can you give a more comprehensive example?
Note that the internal handleJavaExceptions()
function in the source code is for raising InvocationException
to indicate that an exeption was thrown in the Java stack that propagated up to the C++ code.
from jnipp.
maybe i tested it on Android?
from jnipp.
I changed findclass method like this
Class xx = env->FindClass(xxxx)
if(xx==nullptr){
jthrowable exception = env->ExceptionOccurred();
if (exception != nullptr) {
env->ExceptionClear();
throw NameResolutionException();
}
}
it works well
from jnipp.
Aha, right you are. FindClass() raises a Java exception if it fails. I'll do a clear if this happens. Thanks for raising!
from jnipp.
Related Issues (20)
- Object return types and parameters
- Pass strings as UTF-16 internally
- Single parameter name/signature parsing
- Call constructors with specific signatures
- Array-typed fields and arguments
- hello, give me a smaple,thx HOT 1
- Implement array handling HOT 1
- Bulk array actions
- ByteBuffer and byte array support HOT 1
- Native support for "byte" data type HOT 1
- multiple definitions HOT 2
- GetStringUTFChars convert utf-16 to utf-8 may cause error HOT 1
- add CallxxxxMethod support
- method call does not support null arg HOT 1
- use Get<PrimitiveType>ArrayElements and Release<PrimitiveType>ArrayElements
- Returning new objects from C++ to Java
- Are you aware of JNI Bind?
- 0xC0000005 anomaly HOT 1
- Support for loading custom jars/classes and/or setting additional JVM options HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jnipp.