Error: Could not find or load main class weblogic.security.Encrypt

廉价感情. 提交于 2019-12-22 08:08:05

问题


I am trying to encrypt a database password for my Java EE Application in the terminal. according to this tutorial

The steps are as follows:

  1. Change directory to your domain’s bin folder (For Eg. cd WLS_home\user_projects\domains\mydomain\bin)
  2. Use setDomainEnv.cmd/sh script to setup the environment
  3. Run java weblogic.security.Encrypt which will prompt for the password and will print the encrypted value in stdout.

However, when I execute 'java weblogic.security.Encrypt', I am presented with the following:

Error: Could not find or load main class weblogic.security.Encrypt

I am developing my project in Eclipse and have configured my Weblogic-12.1.3 server in Eclipse. I am not sure why this error is happening, but I expect its because my java version is 1.8, and maybe it expects me to use java 1.6 which I think comes with Weblogic installation.

java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

回答1:


You must type
cd WLS_home/user_projects/domains/mydomain/bin/

. ./setDomainEnv.sh

You must use two separate dots, that should do the trick!




回答2:


I am using Java 8 with WebLogic 12.1.3 on Linux. I had to add some classpath entries, but it worked like this:

java -cp /home/devuser/Oracle/Middleware/Oracle_Home/wlserver/modules/features/*:/home/devuser/Oracle/Middleware/Oracle_Home/wlserver/modules/*  weblogic.security.Encrypt



回答3:


I had the same issue when I set set enableHotswapFlag= to true. please leave this flag empty and try.



来源:https://stackoverflow.com/questions/30943752/error-could-not-find-or-load-main-class-weblogic-security-encrypt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!