IllegalAccessError - Tutorial for using bluecove on OSX?

16 views
Skip to first unread message

Jeremy Przasnyski

unread,
Apr 18, 2008, 3:08:59 PM4/18/08
to bluecove-users
Hi all,
I'm trying to use bluecove as the JSR 82 Implementation as depicted in
the diagram on this page:
http://motej.sourceforge.net/

I can't seem to find any documentation on how to properly install/use
bluecove on OSX 10.5 (Leopard). Here's what I've done so far:

1) Created a plain-vanilla eclipse project with referenced libraries:
motej-0.8.jar, commons-logging-1.1.jar, junit-4.4.jar jour-
instrument-2.0.2.jar, and bluecove-2.0.2.jar
2) Tossed in the unit tests from bluecove source (stuff in src/test/
java/ from the bluecove 2.0.2 distribution)
3) Ran the unit tests, which all fail due to IllegalAccessErrors

Here's an example:
java.lang.IllegalAccessError: tried to access method
com.intel.bluetooth.NativeLibLoader.getOS()I from class
com.intel.bluetooth.NativeTestCase
at com.intel.bluetooth.NativeTestCase.setUp(NativeTestCase.java:60)
at junit.framework.TestCase.runBare(TestCase.java:132)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:
81)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
196)

Are there instructions out there discussing how to properly configure
bluecove in OSX?
This is what I'm following:
http://code.google.com/p/bluecove/wiki/Documentation#Installation

Jeremy

Vlad Skarzhevskyy

unread,
Apr 18, 2008, 3:50:32 PM4/18/08
to bluecov...@googlegroups.com
You only need to add bluecove jar to be able to use JSR-82.  If you are adding other jars used in test project for unit tests it is up to you...
There are no special instruction on how to configure bluecove on Mac OS X because there are no special configuration.

I see you are compiling and running bluecove unit tests.
The static function NativeLibLoader.getOS is in distribution jar... Also the class is abstract but it is working fine when I run the tests. But I have not done this from Eclipse on OS X. Tests are executed by maven during build.  Probably Eclipse on OS X + JUnit 4 doing something strange with classes.  I used only junit-3.8.1 and was happy with it.  On Windows JUnit 4.4 works the same way for me in Eclipse 3.3.2

If you really want to build and test bluecove then get full tree from svn or unzip full sources .gz and create eclipse project using: "mvn eclipse:eclipse"...  The created project works for me on Linux, OSX and windows...

Also for OS X I suggest you to take 2.0.3 version since important initialization bug has been flexed in this new version...



--
Vlad

PS
 JUnit tests in main bluecove project do not test any Bluetooth functionality!  To test communication we used different project and does require two devices at execution time...
 http://snapshot.bluecove.org/bluecove-examples/bluecove-tester/index.html

Jeremy Przasnyski

unread,
Apr 19, 2008, 7:13:32 PM4/19/08
to bluecove-users
The problem was cause by either JDK 1.6 (vs default of JDK 1.5) or
junit 4.4 instead of 3.8.1. The tests now run fine in my environment.

Jeremy

On Apr 18, 12:50 pm, "Vlad Skarzhevskyy" <skarzhevs...@gmail.com>
wrote:
> You only need to add bluecove jar to be able to use JSR-82.  If you are
> adding other jars used in test project for unit tests it is up to you...
> There are no special instruction on how to configure bluecove on Mac OS X
> because there are no special configuration.
>
> I see you are compiling and running bluecove unit tests.
> The static function NativeLibLoader.getOS is in distribution jar... Also the
> class is abstract but it is working fine when I run the tests. But I have
> not done this from Eclipse on OS X. Tests are executed by maven during
> build.  Probably Eclipse on OS X + JUnit 4 doing something strange with
> classes.  I used only junit-3.8.1 and was happy with it.  On Windows JUnit
> 4.4 works the same way for me in Eclipse 3.3.2
>
> If you really want to build and test bluecove then get full tree from svn or
> unzip full sources .gz and create eclipse project using: "mvn
> eclipse:eclipse"...  The created project works for me on Linux, OSX and
> windows...
>
> Also for OS X I suggest you to take 2.0.3 version since important
> initialization bug has been flexed in this new version...
>
> --
> Vlad
>
> PS
>  JUnit tests in main bluecove project do not test any Bluetooth
> functionality!  To test communication we used different project and does
> require two devices at execution time...
>  http://snapshot.bluecove.org/bluecove-examples/bluecove-tester/index....

Jeremy Przasnyski

unread,
Apr 19, 2008, 6:50:44 PM4/19/08
to bluecove-users
Any time I'm trying to learn a new API I throw in the project's unit
tests to see the types of things that can be done. I think it's also a
good way to ensure things are properly configured... if the tests run,
then I can safely assume I've gotten things configured OK.

In this scenario I'm just doing some prototyping to see if I can
connect a Wiimote via bluecove to control some visualizations written
against the Processing.org APIs. I'm not doing anything special or out
of the ordinary here.

I'll try the latest source off trunk & throw in junit-3.8.1.

Jeremy

On Apr 18, 12:50 pm, "Vlad Skarzhevskyy" <skarzhevs...@gmail.com>
wrote:
> You only need to add bluecove jar to be able to use JSR-82.  If you are
> adding other jars used in test project for unit tests it is up to you...
> There are no special instruction on how to configure bluecove on Mac OS X
> because there are no special configuration.
>
> I see you are compiling and running bluecove unit tests.
> The static function NativeLibLoader.getOS is in distribution jar... Also the
> class is abstract but it is working fine when I run the tests. But I have
> not done this from Eclipse on OS X. Tests are executed by maven during
> build.  Probably Eclipse on OS X + JUnit 4 doing something strange with
> classes.  I used only junit-3.8.1 and was happy with it.  On Windows JUnit
> 4.4 works the same way for me in Eclipse 3.3.2
>
> If you really want to build and test bluecove then get full tree from svn or
> unzip full sources .gz and create eclipse project using: "mvn
> eclipse:eclipse"...  The created project works for me on Linux, OSX and
> windows...
>
> Also for OS X I suggest you to take 2.0.3 version since important
> initialization bug has been flexed in this new version...
>
> --
> Vlad
>
> PS
>  JUnit tests in main bluecove project do not test any Bluetooth
> functionality!  To test communication we used different project and does
> require two devices at execution time...
>  http://snapshot.bluecove.org/bluecove-examples/bluecove-tester/index....
Reply all
Reply to author
Forward
0 new messages