Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to DescriptorExtractor.create("SURF") causes NPE #3

Closed
jpsacha opened this issue May 9, 2014 · 17 comments
Closed

Call to DescriptorExtractor.create("SURF") causes NPE #3

jpsacha opened this issue May 9, 2014 · 17 comments
Labels

Comments

@jpsacha
Copy link
Member

jpsacha commented May 9, 2014

Simple call to DescriptorExtractor.create("SURF") results in exception. Here is a sample code:

import org.bytedeco.javacpp.opencv_features2d.DescriptorExtractor;
new DescriptorExtractor().create("SURF");

Exception:

java.lang.NullPointerException: This pointer address is NULL.
    at org.bytedeco.javacpp.opencv_features2d$DescriptorExtractor.create(Native Method)
....
jpsacha added a commit to bytedeco/javacv-examples that referenced this issue May 9, 2014
@saudet saudet added the bug label May 9, 2014
@saudet
Copy link
Member

saudet commented May 10, 2014

@jpsacha
Copy link
Member Author

jpsacha commented May 10, 2014

I cannot use the snapshot due to missing dependency:

<parent>
    <groupId>org.bytedeco</groupId>
    <artifactId>javacpp-presets</artifactId>
    <version>0.8-2-SNAPSHOT</version>
</parent>

It is missing in the snapshot repo:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/

@saudet
Copy link
Member

saudet commented May 11, 2014

Right, the binaries haven't changed, so we can hack something that way. Do
you have a better idea than making a complete release for every little bug?
It seems we can use this SNAPSHOT system for that, but it's clear to me yet
how exactly. Suggestions?

@jpsacha
Copy link
Member Author

jpsacha commented May 11, 2014

I can deal with dependencies of different version. Not a pretty setup but doable.
https://github.com/bytedeco/javacv-examples/blob/52ff65a0b58889b623bab525268d593f2a4817be/OpenCV2_Cookbook/build.sbt#L50

Here it is a bit different due to parent declaration. When I am trying to use artifact opencv it requires its parent according to what is in POM (artifact javacpp-presets). It is treated different than just a dependency. My suggestion is to release parent when children are released.

@saudet
Copy link
Member

saudet commented May 11, 2014

I see, the parent pom.xml file is missing! Of course, that's easy to do.
It's strange that Maven doesn't deploy that by default when called from the
parent. I'll do that when I get back home tomorrow. BTW, it should work
locally after a “mvn install -N“, IIRC.

@saudet
Copy link
Member

saudet commented May 12, 2014

Ok, I've uploaded the parent pom.xml file for 0.8-2-SNAPSHOT, so everything should work now!

@jpsacha
Copy link
Member Author

jpsacha commented May 13, 2014

I am testing this on windows. I am getting a strange error. SBT attempts to download platform snapshot as:
opencv-2.4.9-0.8-2-20140510.032943-13-windows-x86_64.jar
I am not clear why the SNAPSHOT is expanded that way rather than:
opencv-2.4.9-0.8-2-20140510.024254-7-windows-x86_64.jar

So I rebuild locally. Now DescriptorExtractor.create("SURF") works in Scala example but not in Java test (returns null), within the same project, but this is not related to this issue, maybe some classloader peculiarity.

@saudet
Copy link
Member

saudet commented May 13, 2014

I guess we need to figure out how to make the SNAPSHOT system work a bit better across Maven, SBT, and Gradle, hey. Let me know if you figure out how to fix any of that.

As for SURF, that's pretty normal. We need to call opencv_nonfree.initModule_nonfree(), but it seems to get called on load on most platforms anyway.

jpsacha added a commit to bytedeco/javacv-examples that referenced this issue May 16, 2014
jpsacha added a commit to bytedeco/javacv-examples that referenced this issue May 16, 2014
@saudet
Copy link
Member

saudet commented May 17, 2014

Do you know if SBT is complaining only about the buildNumber? Or something else? If it's only the buildNumber, there should be a way to force it. I'll look into that.

@saudet
Copy link
Member

saudet commented May 31, 2014

Good news, I've figured out how to make better SNAPSHOT "releases". Using the nexus-staging-maven-plugin, it's possible to stage locally before deploying remotely:
http://books.sonatype.com/nexus-book/reference/staging-sect-deployment.html
This way, everything gets the same build number. Please let me know if this still does not work well with SBT, thanks!

@jpsacha
Copy link
Member Author

jpsacha commented Jun 1, 2014

Are you planing to release new version (0.8.1?) so the release can be tested with SBT?

@saudet
Copy link
Member

saudet commented Jun 1, 2014

Are you saying SBT doesn't support SNAPSHOT versions?

@saudet
Copy link
Member

saudet commented Jun 1, 2014

I'm also trying to figure out a good way to manage versions across the artifacts, and create a parent pom.xml somehow, and there's issues with Gradle as well... If you have good ideas, let me know. I'd like to patch this up a bit better before making another release.

@jpsacha
Copy link
Member Author

jpsacha commented Jun 1, 2014

SBT does support snapshots. It is just not clear how you are asking me to test it. Did you released a SNAPSHOT that you want me to test?

@saudet
Copy link
Member

saudet commented Jun 1, 2014

Oh, l've just fixed the 0.8-2-SNAPSHOT builds. So, does it work OK that way
now?

@jpsacha
Copy link
Member Author

jpsacha commented Jun 2, 2014

It seems to work now with SBT and Cookbook Examples, I was able to re-download dependencies without building javacv*.
To be clear, I removed local cashes in ~/.m2 and ~/.ivy2 (used by SBT). Then rebuild current version of Cookbook examples (javacpp and javacpp-resets v.0.8-2-SNAPSHOT and javacv v.0.8). It was able to download needed dependencies automatically through SBT.

@saudet
Copy link
Member

saudet commented Aug 4, 2014

Fixed in version 0.9. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants