[ 
https://issues.apache.org/jira/browse/FLUME-1789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13535120#comment-13535120
 ] 

Brock Noland commented on FLUME-1789:
-------------------------------------

I get the error below on my mac with:

$ java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

How about we just select the keystore based on the JVM? Ie sun-test.keystore 
and ibm-test.keystore.

{noformat}
estWithExistingKeyStore(org.apache.flume.channel.file.encryption.TestJCEFileKeyProvider)
  Time elapsed: 0.415 sec  <<< ERROR!
java.lang.RuntimeException: java.security.UnrecoverableKeyException: 
com.ibm.crypto.provider.AESSecretKey. Key = key-0, passwordFile = 
/var/folders/6l/2kf3r2pj1t176h2nhdwfpk1r0000gp/T/1355854596783-0/key-0
        at 
org.apache.flume.channel.file.encryption.JCEFileKeyProvider.getKey(JCEFileKeyProvider.java:82)
        at 
org.apache.flume.channel.file.encryption.TestJCEFileKeyProvider.testKeyProvider(TestJCEFileKeyProvider.java:107)
        at 
org.apache.flume.channel.file.encryption.TestJCEFileKeyProvider.testWithExistingKeyStore(TestJCEFileKeyProvider.java:92)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:228)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:103)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
Caused by: java.security.UnrecoverableKeyException: 
com.ibm.crypto.provider.AESSecretKey
        at com.sun.crypto.provider.SunJCE_z.a(DashoA13*..)
        at com.sun.crypto.provider.JceKeyStore.engineGetKey(DashoA13*..)
        at java.security.KeyStore.getKey(KeyStore.java:763)
{noformat}
                
> Unit tests TestJCEFileKeyProvider and TestFileChannelEncryption fail with IBM 
> JDK and flume-1.3.0
> -------------------------------------------------------------------------------------------------
>
>                 Key: FLUME-1789
>                 URL: https://issues.apache.org/jira/browse/FLUME-1789
>             Project: Flume
>          Issue Type: Bug
>          Components: Channel, Test
>    Affects Versions: v1.3.0
>         Environment: IBM Java 6 SR 12
> RHEL 6.3
>            Reporter: Aline Guedes Pinto
>            Priority: Minor
>              Labels: test, test-materials,
>             Fix For: v1.3.0
>
>         Attachments: test.keystore
>
>
> The unit tests TestJCEFileKeyProvider and TestFileChannelEncryption fail
> when running with IBM Java 6. Only the test cases that use an existing
> keystore file fail. It seems like the problem is that IBM keytool can't read
> the file test.keystore provided with flume (which was probably generated
> with SUN's keytool). Replacing the file test.keystore (at
> flume-ng-channels/flume-file-channel/src/test/resources) with one generated
> by IBM keytool fixes the issue (and it also works with SUN Java 6).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to