Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
TinyDaddy
Posts: 30
Registered: ‎05-18-2013
My Device: Non-BlackBerry user
Accepted Solution

Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

Hi all,

 

i met a problem when i tried run a WebWork app with my own native extension.

Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

it seems that many people met this problem. but i didn't find any idea from that.

i downloade the templateJNext example from GIT. it's ok to run on my simulator.

so i coded a my own native extension based on the example.

in my extension, i used Qt components.

i compiled, and it succeed. i got a .so file which is for simulator-debug.

after that, i edited javascript part.

with not too many changes, i just removed the "utils" of dependencies in mainfest.json since i don't need it.

and i changed the require to my .so name in templateJNEXT.js.

that's all i did.

 

and i checked the path: /usr/lib/webplatform/plugins/jnext/, there is no my .so file indeed.

i think there must be some problem with my javascript part of my native extension.

i am sure that dependencies is need when i was using Qt component in my native code.

 

anyone can give me some help?

thanks.

 

Contributor
TinyDaddy
Posts: 30
Registered: ‎05-18-2013
My Device: Non-BlackBerry user

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

BTW, the following are my mainfest.json and templateJNEXT.js

 

//mainifest.json

{
    "global": false,
    "namespace": "community.templateExt",
    "dependencies": ["utils"]
}

 //templateJNEXT.js

var template,
	_event = require("../../lib/event");

JNEXT.Template= function () {
	var self = this,
		hasInstance = false;

	self.getId = function () {
		return self.m_id;
	};

	self.init = function () {
		if (!JNEXT.require("libTemplate")) {
			return false;
		}

		self.m_id = JNEXT.createObject("example.templateJS");

		if (self.m_id === "") {
			return false;
		}

		JNEXT.registerEvents(self);
	};

	// ************************
	// Enter your methods here
	// ************************

	// calls into InvokeMethod(string command) in template_js.cpp
	self.test= function (input) {
		return JNEXT.invoke(self.m_id, "test" + input);
	}

	// ************************
	// End of methods to edit
	// ************************
	self.m_id = "";

	self.getInstance = function () {
		if (!hasInstance) {
			hasInstance = true;
			self.init();
		}
		return self;
	};

};

template= new JNEXT.Template();

module.exports = {
	template: template
};

 

Contributor
TinyDaddy
Posts: 30
Registered: ‎05-18-2013
My Device: Non-BlackBerry user

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

hi all,

 

it seems that it will cause the error if i add a Qt lib into the native extension project.

so, i think that there must be some dependencies i must add in the manifest.json.

any guy know how to add dependency in a native extension?

Contributor
TinyDaddy
Posts: 30
Registered: ‎05-18-2013
My Device: Non-BlackBerry user

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

new start point!

i get the error when i used macro "Q_OBJECT".

if i remove the macro, everything is ok.

but i don't know why.

can anybody give me a hand?

Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

I just had the same problem but not using any of the QT libraries (I got rid of LUA and things worked in my case - nothing to do with QT there)

 

With the QT libraries you can only use limited, non-visual ones ATM

 

I've got an Extention in GitHub called ScreenDisplay and that has some non-visual QT dependencies

 

I eventually tracked this down to needing to add....

 

${QNX_TARGET}/usr/include/qt4/QtCore

${QNX_TARGET}/usr/include/qt4

 

to the GNU C section of Project -> Properties -> C/C++ General -> Paths and Symbols -> Includes [Tab] for the desired build configurations

 




Click the like button if you find my posts useful!
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

A quote from a PM...

 

That message generally means that there's a problem with linking. It could be a small error in the code, but mostly I see these because there is a missing library or import. Depending on how you added your imports, it may not have propagated to all build configurations as well.

 

This appears to be the issue in your case as you've already implied linking errors




Click the like button if you find my posts useful!
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

As this is the only topic on this one I'm going to expand a little over linkage

 

This almost entirely applies to wrapping existing code someone else wrote

 

Start simple - get an extension that just works then add it is slowly

 

If / When you get the library missing thing (it's there alright) it means that the library didn't load properly (a few clues from a BB mate helped me here)

 

Some independent research today helps you track down an un-trackable bug

 

1) What did you just add? Remove it - does it work again?

2) Put it back and add returns at various points thru your code - when does it fall over?

3) grep out your code-tree for whatever stopped it working

4) You've probably got the solution

 

I had this experience today when I moved a variable to the header - broke everything (the library I'm wrapping don't like sharing)

 

Soon as this is known everything becomes obvious (hindsight...)

 

It is extremely useful to also return a JSON structure and possibly some ad-hoc hack variables for debugging then just alert() the result

 

In my situation a silly code bug was killing the library - but it was trackable via this method

 

It's not pretty but it works, just remember to remove the junk you degigged with afterwards :smileyhappy:

 

 

 




Click the like button if you find my posts useful!
Contributor
TinyDaddy
Posts: 30
Registered: ‎05-18-2013
My Device: Non-BlackBerry user

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

Hi peardox,

Thanks for you intense reply.
at last, i found it caused by a little link error, which will not be prompted for a lib.
i think most of these error are caused by this.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

Doing ext can be a thankless job (and there's no debug)

 

It can be frustrating but there is no thrill like it when you finally get it working

 

Hang in there




Click the like button if you find my posts useful!
Contributor
TinyDaddy
Posts: 30
Registered: ‎05-18-2013
My Device: Non-BlackBerry user

Re: Require Error "/usr/lib/webplatform/plugins/jnext/***.so" can not be found

yes, exactly.

currently for me, i just create a new project with Qt in Linux for essential part, then develop and debug it in Qt.

it saves a lot of time.

 

actually, i thought that maybe i can implement a debug class in extension by callback, but i am not familiar with callback in extension.

if you are familiar with that, i think maybe you can try to implement it. if you success, it will be a great work!