I'm having an issue running maven with the IBM SDK. When I execute the
following code in eclipse I have no problem:

@Test
    public void testSecureRandom() {
        UUIDGenerator generator = new UUIDGenerator();

        generator.generateRandomBasedUUID();
        System.out.println("This is working");
        Assert.assertTrue(true);
    }


Running it in maven gives me a failure with the following exception:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.235 sec
<<< FAILURE!
testSecureRandom(TestSecureRandom)  Time elapsed: 0.131 sec  <<< ERROR!
java.lang.NullPointerException
    at java.security.SecureRandom.nextBytes(SecureRandom.java:292)
    at UUIDGenerator.generateRandomBasedUUID(UUIDGenerator.java:138)

The problem is that the service "IBMSecureRandom" is not found when running
in maven. Is there a workaround for this problem?

I'm using the following configuration
Apache Maven 2.1.0 (r755702; 2009-03-18 20:10:27+0100)
Java version: 1.6.0
Java home: /opt/ibm-java-i386-60/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.28-11-generic" arch: "x86" Family: "unix"

with java version:
java version "1.6.0"
Java(TM) SE Runtime Environment (build pxi3260sr4-20090219_01(SR4))
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Linux x86-32
jvmxi3260-20090215_29883 (JIT enabled, AOT enabled)
J9VM - 20090215_029883_lHdSMr
JIT  - r9_20090213_2028
GC   - 20090213_AA)
JCL  - 20090218_01

All help is welcome!
Joris

Reply via email to