Java failed to install

335 views
Skip to first unread message

Cory Nguyen

unread,
Aug 21, 2013, 11:23:19 PM8/21/13
to automat...@googlegroups.com
Hello all,

I followed the instruction and install libs as below (/usr/lib). But when I do a "mvn install", it failed. Please see error below. "mvn compile" was successful. Please help. I'm using v1.1.0.

Regards,

Cory

alsa java-1.6.0 libopendnp3java.so.1.0.1 python3.3
binfmt.d java-1.7.0 libopendnp3.la rpm
cpp java-ext libopendnp3.so sendmail
crda jvm libopendnp3.so.1 sendmail.sendmail
cups jvm-commmon libopendnp3.so.1.0.1 sse2
debug jvm-exports locale sysctl.d
dracut jvm-private lsb systemd
firewalld kbd modprobe.d tmpfiles.d
firmware kernel modules udev
games libopendnp3.a modules-load.d udisks2
gcc libopendnp3java.a mozilla yum-plugins
grub libopendnp3java.la nfs-utils
java libopendnp3java.so polkit-1
java-1.5.0 libopendnp3java.so.1 python2.7

.................... mvn install ---------------------

-------------------------------------------------------
T E S T S
-------------------------------------------------------
org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NoClassDefFoundError: org/scalatest/FunSuite
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.maven.surefire.util.DefaultScanResult.loadClass(DefaultScanResult.java:131)
at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:95)
at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:194)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:92)
... 9 more
Caused by: java.lang.ClassNotFoundException: org.scalatest.FunSuite
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 25 more

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] opendnp3 .......................................... SUCCESS [3.457s]
[INFO] opendnp3-api ...................................... SUCCESS [9.154s]
[INFO] opendnp3-bindings ................................. FAILURE [0.995s]
[INFO] opendnp3-example .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.323s
[INFO] Finished at: Wed Aug 21 23:18:10 EDT 2013
[INFO] Final Memory: 27M/299M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project opendnp3-bindings: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :opendnp3-bindings

J Adam Crain

unread,
Aug 22, 2013, 9:58:15 AM8/22/13
to automat...@googlegroups.com
That's a new one. It appears to be a class-loader problem finding the scalatest library.

1) Can you try a "mvn clean; mvn test"?

2) What verison of the JVM are you using?

-Adam

Cory Nguyen

unread,
Aug 22, 2013, 11:32:29 PM8/22/13
to automat...@googlegroups.com
Hi, thanks for quick response.  I tried "mvn clean; mvn test" and got the same error message.  I'm running Java version 1.7.0_25.

Different issue.... I managed to compile and run a test master on Android, but I received CommandStatus == CS_HARDWARE_ERROR and the Client State is constantly changing from OPENING, OPEN, CLOSED, that causes "JNI ERROR (app bug): local reference table overflow (max=512)".  Could you shed some light on what might cause CS_HARDWARE_ERROR?  As far as I know, Boost library works fine on Android.

Thanks a lot for your help.  Great work!

Best Regards,

Cory

J Adam Crain

unread,
Aug 23, 2013, 3:48:55 PM8/23/13
to automat...@googlegroups.com
Hi Cory,

Well, you're on a good JVM version.... This error is weird. It's like the classloader isn't finding the scalatest classes.

Try this for me:

Wipe the org.scalatest directory of your Maven repository ("~/.m2/repository").  It's possible that there was a partial download of the dependencies. I've had my maven repo corrupted in the past and reseting it like this was the only solutuion.

If the master isn't connected to an outstation, you'll get CS_HARDWARE_ERROR back as a return code. This bad on my part. I need to differentiate a "not connected" failure from the DNP specific return codes. I'll add this to the TODO list for the 1.2.x series.

As far as Android goes, you're charting new territory. I have a Galaxy S4, but I haven't tried to do any development yet, let alone trying to get JNI to work on it. I'll support you however I can, but I haven't had any instability reports of the Java bindings on platforms that I can debug (Win/Linux).

I'd start googling and talking to Android developers that also work with JNI.

-Adam

Cory Nguyen

unread,
Aug 24, 2013, 12:51:04 AM8/24/13
to automat...@googlegroups.com
Hi Adam,

That was it.  Delete the repository and re-install Maven did it.  Thanks a lot.

Regarding opendnp3 on Android, I ran some gdb debugging and it seems that boost asio failed to open socket.  Not sure what it was.  I'll let you know how it goes.

Best Regards,

Cory

J Adam Crain

unread,
Aug 24, 2013, 1:04:56 PM8/24/13
to automat...@googlegroups.com
Wow, that was a wild shot in the dark on my part... I got lucky!

What's your test setup on Android. Are you running the test cases or making the master/outstation demos talk to eachother?

-Adam

Cory Nguyen

unread,
Aug 26, 2013, 9:28:55 AM8/26/13
to automat...@googlegroups.com
I'm trying to make a master (running on Android) talking to an outstation (running on my laptop).  I'm using Android NDK to build opendnp3 and wondering if there is any special compiler flags (especially Boost related) that I need to set?

Appreciate your help.

Best Regards,

Cory

J Adam Crain

unread,
Aug 26, 2013, 2:42:47 PM8/26/13
to automat...@googlegroups.com
Hey Cory,

What kernel version does Android use? I assume android NDK is nothing other than a GNU cross compile toolchain, right (ARM?)?

I would first try the C++ test sets on Android, before shooting for the Java bindings. Who knows what kind of issues there are with Dalvik. Try doing:

make check

Build and run the test cases first.

-Adam

Christopher Verges

unread,
Aug 26, 2013, 2:54:24 PM8/26/13
to Cory Nguyen, automat...@googlegroups.com
Cory,

I'm just curious ... why are you looking to add DNP capabilities to Android?  What's the use case here?  This is really fascinating from a technical perspective, and understanding more about the drivers here could help to guide OpenDNP3 in the future.

Thanks,
Chris

Srikanth Mangayyagari

unread,
Apr 12, 2015, 9:45:14 AM4/12/15
to automat...@googlegroups.com
Hi Cory,

I am attempting to do the same. Building a DNP master running on Android. I am using OpenDNP3 V1.1.1-RC5, android studio 1.1.0 and android NDK r10d, on windows 7. It would be a great help if you could post a walk through of porting openDNP3 to android. I am getting the following error during compilation, and any advice or help will be very much appreciated.

#define MACRO_THROW_EXCEPTION(msg) { \
^
In file included from C:\DroidDNP\app\src\main\jni\JNIHelpers.cpp:22:0:
C:\DroidDNP\app\src\main\jni/opendnp3/Location.h:42:0: note: this is the location of the previous definition
#define MACRO_THROW_EXCEPTION(type, message) { throw type(LOCATION, message); }
^
C:\DroidDNP\app\src\main\jni\JNIHelpers.cpp: In static member function 'static void JNIHelpers::AttachThread(JavaVM*)':
C:\DroidDNP\app\src\main\jni\JNIHelpers.cpp:48:63: error: invalid conversion from 'void**' to 'JNIEnv** {aka _JNIEnv**}' [-fpermissive]
jint res = apJVM->AttachCurrentThread((void **)&pEnv, nullptr);
^
In file included from C:\DroidDNP\app\src\main\jni\JNIHelpers.hpp:22:0,
from C:\DroidDNP\app\src\main\jni\JNIHelpers.cpp:19:
C:/Users/Srikanth.Mangayyagar/ndk/platforms/android-21/arch-arm64/usr/include/jni.h:1090:10: note: initializing argument 1 of 'jint _JavaVM::AttachCurrentThread(JNIEnv**, void*)'
jint AttachCurrentThread(JNIEnv** p_env, void* thr_args)
^
make.exe: *** [C:\DroidDNP\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/SeePlusPlus/C_\DroidDNP\app\src\main\jni\JNIHelpers.o] Error 1
Error:Execution failed for task ':app:compileDebugNdk'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Srikanth.Mangayyagar\ndk\ndk-build.cmd'' finished with non-zero exit value 2
Information:BUILD FAILED

Thanks,
Sri

J Adam Crain

unread,
Apr 15, 2015, 9:54:05 AM4/15/15
to automat...@googlegroups.com
Java is unsupported at this point, but if I were in your situation I'd compare the JNI API signatures in 1.6 to whatever JDK version you're using.

The java bindings in 1.1.x were written against the Java 6 JNI API, so I could imagine that shifting a bit in Java 7 or 8.

-Adam

AboAhmedAh

unread,
May 15, 2015, 1:53:26 PM5/15/15
to automat...@googlegroups.com

Greetings,

I need to set up dnp3 mater and outstation for testing purposes on my laptop. I have Apache 2 installed as the localhost. I would appreciate if you can share with me a link for details information how to setup and run opendnp3.

 

Thanks. Abdullah

Reply all
Reply to author
Forward
0 new messages