Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Jasypt org.Jasypt.exceptions.EncryptionOperationNotPossibleException_Java_Spring Boot_Jasypt - Fatal编程技术网

Java Jasypt org.Jasypt.exceptions.EncryptionOperationNotPossibleException

Java Jasypt org.Jasypt.exceptions.EncryptionOperationNotPossibleException,java,spring-boot,jasypt,Java,Spring Boot,Jasypt,我试图在我的Jasypt中使用3DES,但我遇到了一个例外 但当我使用默认算法时,它运行良好 这是代码- public MyEncryptablePropertyResolver(Environment environment) { char[] password = "password".toCharArray(); this.encryptor = new PooledPBEStringEncryptor();

我试图在我的Jasypt中使用3DES,但我遇到了一个例外

但当我使用默认算法时,它运行良好

这是代码-

public MyEncryptablePropertyResolver(Environment environment) {
                char[] password = "password".toCharArray();
                this.encryptor = new PooledPBEStringEncryptor();
                SimpleStringPBEConfig config = new SimpleStringPBEConfig();
                config.setPasswordCharArray(password);
                config.setAlgorithm("PBEWithMD5AndTripleDES");
                config.setKeyObtentionIterations("1000");
                config.setPoolSize(1);
                config.setProviderName("SunJCE");
                config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
                config.setStringOutputType("base64");
                encryptor.setConfig(config);
            }
这是个例外

org.jasypt.exceptions.EncryptionOperationNotPossibleException: null
    at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1055) ~[jasypt-1.9.2.jar:na]
    at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725) ~[jasypt-1.9.2.jar:na]
    at org.jasypt.encryption.pbe.PooledPBEStringEncryptor.decrypt(PooledPBEStringEncryptor.java:498) ~[jasypt-1.9.2.jar:na]
    at com.platform.core.config.PlatformEncryptionConfiguration$MyEncryptablePropertyResolver.resolvePropertyValue(PlatformEncryptionConfiguration.java:51) ~[classes/:na]
    at com.ulisesbocchio.jasyptspringboot.resolver.DefaultLazyPropertyResolver.resolvePropertyValue(DefaultLazyPropertyResolver.java:41) ~[jasypt-spring-boot-2.0.0.jar:na]
    at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:16) ~[jasypt-spring-boot-2.0.0.jar:na]
    at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableMapPropertySourceWrapper.getProperty(EncryptableMapPropertySourceWrapper.java:29) ~[jasypt-spring-boot-2.0.0.jar:na]
    at org.springframework.core.env.CompositePropertySource.getProperty(CompositePropertySource.java:59) ~[spring-core-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener$ExtendedDefaultPropertySource.getProperty(BootstrapApplicationListener.java:430) ~[spring-cloud-context-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:13) ~[jasypt-spring-boot-2.0.0.jar:na]
    at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableMapPropertySourceWrapper.getProperty(EncryptableMapPropertySourceWrapper.java:29) ~[jasypt-spring-boot-2.0.0.jar:na]
    at org.springframework.boot.bind.PropertySourcesPropertyValues.getEnumerableProperty(PropertySourcesPropertyValues.java:165) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
    at org.springframework.boot.bind.PropertySourcesPropertyValues.processEnumerablePropertySource(PropertySourcesPropertyValues.java:148) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
    at org.springframework.boot.bind.PropertySourcesPropertyValues.processPropertySource(PropertySourcesPropertyValues.java:127) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
    at org.springframework.boot.bind.PropertySourcesPropertyValues.<init>(PropertySourcesPropertyValues.java:117) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
    at org.springframework.boot.bind.PropertySourcesPropertyValues.<init>(PropertySourcesPropertyValues.java:78) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
    at org.springframework.boot.bind.PropertySourcesPropertyValues.<init>(PropertySourcesPropertyValues.java:66) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
    at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.getFirstNonLoopbackHostInfo(HostInfoEnvironmentPostProcessor.java:47) ~[spring-cloud-commons-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.postProcessEnvironment(HostInfoEnvironmentPostProcessor.java:34) ~[spring-cloud-commons-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
org.jasypt.exceptions.EncryptionOperationNotPossibleException:null
在org.jasypt.encryption.pbe.standardpebytencryptor.decrypt(standardpebytencryptor.java:1055)~[jasypt-1.9.2.jar:na]
在org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)~[jasypt-1.9.2.jar:na]
在org.jasypt.encryption.pbe.PooledPBEStringEncryptor.decrypt(PooledPBEStringEncryptor.java:498)~[jasypt-1.9.2.jar:na]
在com.platform.core.config.PlatformEncryptionConfiguration$MyEncryptablePropertyResolver.resolvePropertyValue(PlatformEncryptionConfiguration.java:51)~[classes/:na]
在com.ulisesbocchio.jasyptspringboot.resolver.DefaultLazyPropertyResolver.resolvePropertyValue(DefaultLazyPropertyResolver.java:41)~[jasypt-spring-boot-2.0.0.jar:na]
在com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:16)~[jasypt-spring-boot-2.0.0.jar:na]
在com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableMapPropertySourceWrapper.getProperty(EncryptableMapPropertySourceWrapper.java:29)~[jasypt-spring-boot-2.0.0.jar:na]
在org.springframework.core.env.CompositePropertySource.getProperty(CompositePropertySource.java:59)~[spring-core-4.3.11.RELEASE.jar:4.3.11.RELEASE]
在org.springframework.cloud.bootstrap.bootstrapplicationListener$ExtendedDefaultPropertySource.getProperty(bootstrapplicationListener.java:430)~[spring-cloud-context-1.3.0.RELEASE.jar:1.3.0.RELEASE]
在com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:13)~[jasypt-spring-boot-2.0.0.jar:na]
在com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableMapPropertySourceWrapper.getProperty(EncryptableMapPropertySourceWrapper.java:29)~[jasypt-spring-boot-2.0.0.jar:na]
在org.springframework.boot.bind.PropertySourcesPropertyValues.getEnumerableProperty(PropertySourcesPropertyValues.java:165)~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
在org.springframework.boot.bind.PropertySourcesPropertyValues.processEnumerablePropertySource(PropertySourcesPropertyValues.java:148)~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
在org.springframework.boot.bind.PropertySourcesPropertyValues.processPropertySource(PropertySourcesPropertyValues.java:127)~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
在org.springframework.boot.bind.PropertySourcesPropertyValues.(PropertySourcesPropertyValues.java:117)~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
在org.springframework.boot.bind.PropertySourcesPropertyValues.(PropertySourcesPropertyValues.java:78)~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
在org.springframework.boot.bind.PropertySourcesPropertyValues.(PropertySourcesPropertyValues.java:66)~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
在org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.getFirstNonLoopbackHostInfo(HostInfoEnvironmentPostProcessor.java:47)~[spring-cloud-commons-1.3.0.RELEASE.jar:1.3.0.RELEASE]
在org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.PostProcessor(HostInfoEnvironmentPostProcessor.java:34)~[spring-cloud-commons-1.3.0.RELEASE.jar:1.3.0.RELEASE]
在org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182)~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
在org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168)~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
在org.springframework.context.event.simpleApplicationEventMulticast.doInvokeListener(simpleApplicationEventMulticast.java:172)~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
在org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]

如果您使用的是TripleDES,请确保为JDK安装了Java加密扩展

你用的是什么jasypt版本?根据版本的不同,您可能还需要为您的
SimpleStringPBEConfig
提供ivGenerator。