Skip to content

change pom.xml to fix libpi4j.so #6

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cwinsor
Copy link
Contributor

@cwinsor cwinsor commented Mar 17, 2017

This pull request fixes the problem as described in
https://forum.predix.io/questions/20035/raspberry-pi-tutorial-libpi4jso-exception.html

A pull request is available.

The change adds an Include-Resource on the pi4j-core jarfile

                                <configuration>
                                        <instructions>
                                                <Include-Resource>
                                                  pi4j-core-1.1.jar
                                                </Include-Resource>

The signature is where Raspberry Pi throws the exception cannot find libpi4j.so

ESC[1mESC[36m2017-03-17 09:20:11,889[Component Resolve Thread (Bundle 38)]|ESC[44mERRORESC[49m|com.pi4j.util.NativeLibraryLoader|128-com.ge.predix.solsvc.predix-machine-template-adapte
r-pi-1.1.15|ESC[21mESC[mUnable to load [libpi4j.so] using path: [/lib/raspberrypi/static/libpi4j.so]
java.lang.SecurityException: Unable to create temporary file or directory

@turnerth
Copy link
Contributor

turnerth commented Mar 18, 2017

Given these other jars are in here. Would it stand to reason they should also be in Include-Resource?

<Bundle-Classpath>
						.,pi4j-core-1.1.jar,
						GrovePi-spec-0.1.0.jar,
						GrovePi-dio-0.1.0.jar,
						Pi-dio-0.1.0.jar,Pi-pi4j-0.1.0.jar,Pi-spec-0.1.0.jar,GrovePi-pi4j-0.1.0.jar
					</Bundle-Classpath>

@cwinsor
Copy link
Contributor Author

cwinsor commented Mar 18, 2017

Only that one is needed to get the native library /lib/raspberrypi/static/libpi4j.so no need for others.

@turnerth
Copy link
Contributor

merged to internal develop, will go out with next release

@turnerth turnerth closed this Mar 18, 2017
@turnerth turnerth reopened this Mar 20, 2017
@turnerth
Copy link
Contributor

The developer reports this

We don’t need Include Resource if we have Embed-Dependency

My thinking is that the term "resource" refers to things in src/main/resources. Like xml files, images, etc not to dependent jars.

That "dependencies" refer to jars resolved in the pom.

Could it be that this is not needed because it was part of some other fixes that might have solved the problem in a different way?

@cwinsor
Copy link
Contributor Author

cwinsor commented Mar 20, 2017

Not fixed. 3 complaints over a 6 week period, the most recent logged 3/7

I am not an expert - I am only following what was suggested by Anh Nguyen (reputation 275 and 75 posts) in the 18264 topic thread.

So ask "the developer" if they don't like Anh Nguyen's solution - then what is THEIR recommendation to solve this problem ?! Have "the developer" run it on their Raspberry PI !!!!

@turnerth
Copy link
Contributor

FYI, the developer is on paternity leave, hence the delay.

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

Successfully merging this pull request may close these issues.

2 participants