通過修改jdbc配置檔案方式修改Weblogic資料來源密碼
(1)直接修改weblogic的資料來源配置檔案中密文密碼為最新的明文密碼【首次嘗試,以失敗告終,weblogic並沒用將JDBC配置檔案中的密碼從明文自動轉化成為密文,並遇到了新問題】
進入JDBC配置檔案所在路徑
[cams@mymc1 jdbc]$ cd /home/cams/bea/middleware/user_projects/domains/cams/config/jdbc
開啟配置檔案並進行修改
[cams@mymc1 jdbc]$ vi CAMSDB-2211-jdbc.xml
將XXX中的密文密碼改為明文密碼
然後啟動weblogic域,並檢視啟動日誌
[cams@mymc1 jdbc]$ cd /home/cams/bea/middleware/user_projects/domains/cams
[cams@mymc1 jdbc]$ nohup ./startWebLogic.sh &
[cams@mymc1 jdbc]$ tail -f nohup.out
發現如下報錯資訊:
-
<2016-9-12 下午10時22分47秒 CST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor java.net.URLClassLoader@6639c8c1/null of module null. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed
-
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:161)
-
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
-
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
-
at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409)
-
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
-
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768)
-
at weblogic.jdbc.module.JDBCDeploymentHelper.getJDBCDataSourceBean(JDBCDeploymentHelper.java:186)
-
at weblogic.jdbc.module.JDBCDeploymentHelper.createJDBCDataSourceDescriptor(JDBCDeploymentHelper.java:51)
-
at weblogic.management.mbeans.custom.JDBCSystemResource.loadDescriptor(JDBCSystemResource.java:60)
-
at weblogic.management.mbeans.custom.ConfigurationExtension.getExtensionRoot(ConfigurationExtension.java:178)
-
at weblogic.management.mbeans.custom.JDBCSystemResource.getJDBCResource(JDBCSystemResource.java:45)
-
at weblogic.management.mbeans.custom.JDBCSystemResource._postCreate(JDBCSystemResource.java:50)
-
at weblogic.management.configuration.JDBCSystemResourceMBeanImpl._postCreate(JDBCSystemResourceMBeanImpl.java:355)
-
at weblogic.descriptor.internal.AbstractDescriptorBean._postCreate(AbstractDescriptorBean.java:670)
-
at weblogic.management.configuration.DomainMBeanImpl.setJDBCSystemResources(DomainMBeanImpl.java:11820)
-
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 com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:48)
-
at com.bea.staxb.runtime.internal.RuntimeBindingType$BeanRuntimeProperty.setValue(RuntimeBindingType.java:539)
-
at com.bea.staxb.runtime.internal.AttributeRuntimeBindingType$QNameRuntimeProperty.fillCollection(AttributeRuntimeBindingType.java:381)
-
at com.bea.staxb.runtime.internal.MultiIntermediary.getFinalValue(MultiIntermediary.java:52)
-
at com.bea.staxb.runtime.internal.AttributeRuntimeBindingType.getFinalObjectFromIntermediary(AttributeRuntimeBindingType.java:140)
-
at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalBindingType(UnmarshalResult.java:200)
-
at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:169)
-
at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65)
-
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:150)
-
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
-
at weblogic.management.provider.internal.DescriptorManagerHelper.loadDescriptor(DescriptorManagerHelper.java:68)
-
at weblogic.management.provider.internal.RuntimeAccessImpl$IOHelperImpl.parseXML(RuntimeAccessImpl.java:690)
-
at weblogic.management.provider.internal.RuntimeAccessImpl.parseNewStyleConfig(RuntimeAccessImpl.java:270)
-
at weblogic.management.provider.internal.RuntimeAccessImpl.<init>(RuntimeAccessImpl.java:115)
-
at weblogic.management.provider.internal.RuntimeAccessService.start(RuntimeAccessService.java:41)
-
at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesManager.java:461)
-
at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:166)
-
at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:881)
-
at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:568)
-
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:469)
-
at weblogic.Server.main(Server.java:71)
-
Caused by: com.bea.xml.XmlException: java.lang.IllegalArgumentException: In production mode, it's not allowed to set a clear text value to the property: PasswordEncrypted of JDBCDriverParamsBean
-
at com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:54)
-
at com.bea.staxb.runtime.internal.RuntimeBindingType$BeanRuntimeProperty.setValue(RuntimeBindingType.java:539)
-
at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType$ElementQNameProperty.fill(ByNameRuntimeBindingType.java:351)
-
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillElementProp(LiteralUnmarshalResult.java:159)
-
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents(ByNameUnmarshaller.java:51)
-
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoIntermediary(AttributeUnmarshaller.java:47)
-
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.unmarshalElementProperty(LiteralUnmarshalResult.java:184)
-
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillElementProp(LiteralUnmarshalResult.java:156)
-
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents(ByNameUnmarshaller.java:51)
-
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoIntermediary(AttributeUnmarshaller.java:47)
-
at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalBindingType(UnmarshalResult.java:199)
-
at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:169)
-
at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65)
-
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:150)
-
... 39 more
-
Caused by: java.lang.IllegalArgumentException: In production mode, it's not allowed to set a clear text value to the property: PasswordEncrypted of JDBCDriverParamsBean
-
at weblogic.j2ee.descriptor.wl.JDBCDriverParamsBeanImpl.setPasswordEncrypted(JDBCDriverParamsBeanImpl.java:430)
-
at weblogic.j2ee.descriptor.wl.JDBCDriverParamsBeanImpl.setPasswordEncryptedAsString(JDBCDriverParamsBeanImpl.java:276)
-
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 com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:48)
-
... 52 more
-
.>
- <2016-9-12 下午10時22分47秒 CST> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason: [Management:141266]Parsing Failure in config.xml: weblogic.management.ManagementRuntimeException: weblogic.application.ModuleException: >
(2)查詢問題的解決方案【weblogic不能啟動:PasswordEncrypted of JDBCDriverParamsBean問題】
找到解決方案連結如下:
http://oraclemiddlewareblog.com/2012/04/25/unable-to-start-weblogic-passwordencrypted-of-serverstartmbean/
內容如下:
-
The Weblogic administration server is not starting and the complete error message is:
-
-
“In production mode, it’s not allowed to set a clear text value to the property: PasswordEncrypted of ServerStartMBean”
-
-
If this is occurring in Weblogic versions 10.3.1 or earlier, then it is a known bug with the administration console. The bug will cause a <password-encrypted> tag of a certain weblogic instance in your domain to be set to a null value in the config.xml. This will happen if you modify some startup arguments of that instance in the administration console. Weblogic will interpret the null value as a plain text password, which is not allowed in a production domain, thus the error in starting the server.
-
-
There is a patch that you can apply for this issue, but there are also some quick workarounds that might prove very useful if there is a time constraint for starting the administration service.
-
-
-
The first solution, and the one that is recommended since it is the final fix is to apply the patch delivered by Oracle for this issue:
-
-
– PKJ1 for Weblogic 10.3.1
-
– 6RDR for Weblogic 10.3
-
-
Both patches are released for generic platforms. If you are having a hard time identifying these patches in the new My Oracle Support site, please check out this post for instructions on how to find “old style” Weblogic patches in My Oracle Support.
-
-
Then, there are a few workarounds that you can quickly apply based on your needs:
-
-
1. The quickest solution is to switch your domain to Development mode. This will allow you to start the administration server, but take into consideration the implications that this change has on the runtime of the server, such as different logging levels and runtime performance.
-
-
2. Another way you can solve this issue is to simply copy the value of the empty tag from another instance in your domain. Locate another instance in the config.xml for which you have the <password-encrypted> tag correctly defined and copy it to the empty tag.
-
-
<password-encrypted>{AES}ve8cqLahYHyy8prbAudZTIyRvk4rNG+7kKvANZdaJzU=</password-encrypted>
-
-
3. If you simply do not have the encrypted password, you can encrypt it yourself using a utility provided by Weblogic:
-
-
– Run $DOMAIN_HOME/bin/setDomainEnv.sh so set the environment variables for your domain
-
– Execute: ‘java weblogic.security.Encrypt’
- – Enter the password in clear text and the encrypted value will be returned in the output. Copy that in the empty tag in the config.xml and restart the administration server.
(3)按照上述第三種方法執行【再次遇到錯誤】
-
[cams@mymc1 bin]$ cd /home/cams/bea/middleware/user_projects/domains/cams/bin
-
[cams@mysc1 bin]$ setDomainEnv.sh
-
[cams@mymc1 bin]$ java weblogic.security.Encrypt
-
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/security/Encrypt
-
Caused by: java.lang.ClassNotFoundException: weblogic.security.Encrypt
-
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
-
at java.security.AccessController.doPrivileged(Native Method)
-
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
-
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
-
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
-
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
- Could not find the main class: weblogic.security.Encrypt. Program will exit.
(4)接著查詢該問題的處理方案【成功執行並生成了新的密文】
-
encrypting password in weblogic (get java.lang.ClassNotFoundException:)
-
if you need to encrypt password and get java.lang.ClassNotFoundException: weblogic.security.Encrypt then use this way /app/bea/WLS1031/jdk/bin/java -cp /app/bea/WLS1031/wlserver_10.3/server/lib/weblogic.jar:$java weblogic.security.Encrypt yourpassword
-
PS: i have called java cause it was not in my env.
- if you already have java in your env then /opt/bea/WLS1031/wlserver_10.3/server/lib/weblogic.jar:$java weblogic.security.Encrypt yourpassword
-
[cams@mymc1 ~]$ cp /home/cams/bea/middleware/wlserver_10.3/server/lib/weblogic.jar /home/cams/bea/middleware/user_projects/domains/cams/
-
[cams@mymc1 ~]$ cd /home/cams/bea/middleware/user_projects/domains/cams/
- [cams@mymc1 cams]$ java -cp weblogic.jar weblogic.security.Encrypt password
{AES}dUH3nDtUg3LfPBCngOAAPFgsIW4gVRPyD25aibk4zVQ=
這裡測試在另外一個weblogic下生成的密文為:
{AES}GA2sa2jSBeEtCoyt2g6NxJS3JPIWth70Z7s6dmIJ1uM=
顯然兩個相同密碼在不同weblogic下生成的密文大不相同。
(5)修改weblogic的資料來源配置檔案中密文密碼為最新的密文密碼【還是遇到問題,賬戶鎖定了】
進入JDBC配置檔案所在路徑
[cams@mymc1 jdbc]$ cd /home/cams/bea/middleware/user_projects/domains/cams/config/jdbc
開啟配置檔案並進行修改
[cams@mymc1 jdbc]$ vi CAMSDB-2211-jdbc.xml
將XXX中的密文密碼改為最新密文密碼
然後啟動weblogic域,並檢視啟動日誌
[cams@mymc1 jdbc]$ cd /home/cams/bea/middleware/user_projects/domains/cams
[cams@mymc1 jdbc]$ nohup ./startWebLogic.sh &
[cams@mymc1 jdbc]$ tail -f nohup.out
發現如下報錯資訊:
- weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: ORA-28000: the account is locked
(6)處理最後的問題【結果再次遇到報錯,不細心造成的】
這裡需要聯絡資料庫管理員,使用system或者sys使用者登入資料庫,執行查詢語句:
SQL> select * from dba_users where account_status <> 'OPEN' ;
找到鎖定的使用者,然後執行解鎖語句:
SQL> alter user XXXX account unlock;
然後再次重啟,還是發現報錯資訊:
ORA-01017: invalid username/password; logon denied
經過檢查,因為在替換的時候,有一個密文替換錯了,導致資料來源連線失敗。這裡重新替換即可。
最終,weblogic啟動成功,一切OK!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31394774/viewspace-2142428/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- WebLogic中修改資料來源賬號密碼Web密碼
- weblogic配置JDBC資料來源WebJDBC
- 通過配置檔案來修改WAS控制檯Session過期時間的方法Session
- discuz資料庫遷移,改密碼後,相關配置檔案修改資料庫密碼
- 通過替換frm檔案方式修改表結構
- MySQL8.0 For Windows 安裝教程(自定義配置檔案、密碼方式修改)MySqlWindows密碼
- oracle 修改資料檔案路徑(四種方式)Oracle
- 織夢資料庫配置檔案修改資料庫配置方法資料庫
- 透過命令列修改nacos配置檔案命令列
- weblogic忘記密碼,之後的修改Web密碼
- 修改資料檔案地址
- Git修改配置檔案Git
- Weblogic資料來源配置文件Web
- 資料庫修改網站密碼?後臺修改網站?資料庫網站密碼
- 修改資料檔案路徑
- phpMyadmin配置檔案修改PHP
- 修改Oracle的配置檔案Oracle
- 用程式修改配置檔案
- weblogic GridLink資料來源配置Web
- 在weblogic上配置資料來源薦Web
- Java程式碼修改yml配置檔案屬性Java
- 1.6.5.2. 通過密碼檔案驗證連線資料庫密碼資料庫
- 公司網站怎麼修改?資料庫內網站密碼修改?網站資料庫內網密碼
- 透過修改控制檔案scn推進資料庫scn資料庫
- MYSQL 修改ROOT密碼的常規方式與暴力方式MySql密碼
- 網站資料庫密碼怎麼修改?網站資料庫密碼
- 通過移動資料檔案來均衡檔案I/O
- weblogic10.3.6重置/修改控制檯賬號密碼Web密碼
- Ubuntu 修改密碼Ubuntu密碼
- 修改ftp密碼FTP密碼
- Linux通過Shell指令碼命令修改密碼不需要互動Linux指令碼密碼
- 網站檔案修改資料庫,安全高效地修改網站資料庫中的檔案資訊網站資料庫
- 解密JBoss和Weblogic資料來源連線字串和控制檯密碼解密Web字串密碼
- 公司網站密碼怎麼修改?修改密碼網站?網站密碼
- 修改檔案、資料夾許可權
- 通過修改資料字典,變更表的owner
- weblogic 10.3.6 修改AdminServer為不需要輸入密碼的方式開啟WebServer密碼
- “網遊大盜”透過修改登錄檔盜密碼(轉)密碼