简体   繁体   English

我如何解决这个错误注入构造函数,java.lang.NoClassDefFoundError: javax/crypto/SecretKey

[英]how do i solve this Error injecting constructor, java.lang.NoClassDefFoundError: javax/crypto/SecretKey

i also tried the below mentioned steps:我还尝试了以下提到的步骤:

  1. check maven version by mvn -version in cmd通过 mvn -version 在 cmd 中检查 maven 版本

  2. check prerequisites such as gmconstant.js, application.prop, jboss-deploymnet_structure.xml,pom file with others or follow the env setup document与其他人一起检查 gmconstant.js、application.prop、jboss-deploymnet_structure.xml、pom 文件等先决条件或遵循 env 设置文档

  3. check java version as 1.8.0_161 and ur maven version should be 3.6.2 or 3.6.3检查 java 版本为 1.8.0_161,你的 maven 版本应该是 3.6.2 或 3.6.3

  4. if maven is not deploying try executing this command如果 Maven 未部署,请尝试执行此命令

    Call mvn -Dbuild.version=Local -Doutput.dir="C:\\jboss-eap-7.0\\standalone\\deployments" clean install
  5. try getting the entire project folder from others and check in your environment尝试从其他人那里获取整个项目文件夹并检查您的环境

  6. if setting your environmental variables, then give SET PATH=C in command prompt as administrator如果设置环境变量,则在命令提示符中以管理员身份提供 SET PATH=C

  7. deleting the files unders .m2 folder /repository删除 .m2 文件夹/repository 下的文件

    C:\\Users\\asophia.m2\\repository C:\\用户\\asophia.m2\\repository

  8. also added the below mention paths in environment variables还在环境变量中添加了下面提到的路径

     C:\\Oracle\\Middleware\\jdk160_18\\bin C:\\Program Files\\Java\\jre1.8.0_161 C:\\Program Files\\Java\\jdk1.8.0_161

    also set the path C:\\Tools\\apache-maven-3.6.2\\bin in user variable还在用户变量中设置路径 C:\\Tools\\apache-maven-3.6.2\\bin

You have to add the encryption jar in C:\\Program Files\\Java\\jdk1.8.0_161\\jre\\lib\\ext or whatever jdk you are using and then register it as well.您必须在C:\\Program Files\\Java\\jdk1.8.0_161\\jre\\lib\\ext或您正在使用的任何 jdk 中添加加密 jar,然后也将其注册。

Since you are using Oracle jdk, you probably need their jar (JCE).由于您使用的是 Oracle jdk,因此您可能需要他们的 jar (JCE)。

https://www.oracle.com/java/technologies/java-archive-downloads-java-plat-downloads.html#JCE-1_2_2-G-JS https://www.oracle.com/java/technologies/java-archive-downloads-java-plat-downloads.html#JCE-1_2_2-G-JS

Quoting the documentation:引用文档:

Installing Providers安装提供程序

In order to be used, a cryptographic provider must first be installed, then registered either statically or dynamically.为了使用,必须首先安装加密提供程序,然后静态或动态注册。

Static Registration静态注册

The configuration file is located in the following location:配置文件位于以下位置:

Unix: /lib/security/java.security Unix:/lib/security/java.security

Windows: \\lib\\security\\java.security Windows:\\lib\\security\\java.security

You can check the documentation for a well detailed explanation:您可以查看文档以获得详细的解释:

https://docs.oracle.com/javase/7/docs/technotes/guides/security/crypto/CryptoSpec.html https://docs.oracle.com/javase/7/docs/technotes/guides/security/crypto/CryptoSpec.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何解决此错误线程“ main”中的异常java.lang.NoClassDefFoundError:javax / crypto / SecretKey - how do I solve this error Exception in thread “main” java.lang.NoClassDefFoundError: javax/crypto/SecretKey 如何解决AsynchronousJiraRestClientFactory的java.lang.NoClassDefFoundError? - How do I solve a java.lang.NoClassDefFoundError for AsynchronousJiraRestClientFactory? java.lang.NoClassDefFoundError:如何解决此错误? - java.lang.NoClassDefFoundError: how do I fix this error? 在Spring MVC中注入构造函数java.lang.NoClassDefFoundError时出错:com / thoughtworks / xstream / io / HierarchicalStreamDriver - Error injecting constructor, java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver in Spring MVC 如何解决“java.lang.NoClassDefFoundError”? - How can I solve "java.lang.NoClassDefFoundError"? java.lang.NoClassDefFoundError如何解决此问题? - java.lang.NoClassDefFoundError How to solve this issue? 如何解决java.lang.NoClassDefFoundError? 硒 - How to solve java.lang.NoClassDefFoundError? Selenium 如何解决java.lang.NoClassDefFoundError - How to solve java.lang.NoClassDefFoundError 我该如何解决这个问题 java.lang.NoClassDefFoundError: sun/security/ssl/HandshakeStateManager? - How do i solve this problem java.lang.NoClassDefFoundError: sun/security/ssl/HandshakeStateManager? 如何解决“主线程中的异常 java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException” - How to solve " Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM