我正在尝试将 Weblogic 环境从 Oracle 移植到 PostgreSQL。当我使用 PostgreSQL 上的安全存储配置域时,它无法启动。
Mac OS X 上使用的是 Weblogic 12c、Java 7、PostgreSQL 9.3.4,但 Linux 上也存在同样的问题。
该域是使用安全存储数据源 PostgreSQL(下拉菜单中提供的选项)创建的,并经过正确配置。
该模式是基于 Derby 模式通过用 BYTEA 替换 BLOB 而创建的。
startWeblogic 给出:
<Aug 7, 2014 5:48:02 PM CEST> <Warning> <Security> <BEA-090076> <A failure occurred attempting to load LDIF for provider Authorizer from file /Users/darcher/Dev/wls/wlserver/server/lib/XACMLAuthorizerInit.ldift.>
<Aug 7, 2014 5:48:02 PM CEST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: weblogic.security.spi.ProviderInitializationException: A failure occurred attempting to load LDIF for provider Authorizer from file /Users/darcher/Dev/wls/wlserver/server/lib/XACMLAuthorizerInit.ldift..
weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: weblogic.security.spi.ProviderInitializationException: A failure occurred attempting to load LDIF for provider Authorizer from file /Users/darcher/Dev/wls/wlserver/server/lib/XACMLAuthorizerInit.ldift.
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:466)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:841)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(CommonSecurityServiceManagerDelegateImpl.java:870)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1032)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
Truncated. see log file for complete stacktrace
Caused By: com.bea.common.engine.ServiceInitializationException: weblogic.security.spi.ProviderInitializationException: A failure occurred attempting to load LDIF for provider Authorizer from file /Users/darcher/Dev/wls/wlserver/server/lib/XACMLAuthorizerInit.ldift.
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:365)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.CSSWLSDelegateImpl.getService(CSSWLSDelegateImpl.java:155)
Truncated. see log file for complete stacktrace
Caused By: weblogic.security.spi.ProviderInitializationException: A failure occurred attempting to load LDIF for provider Authorizer from file /Users/darcher/Dev/wls/wlserver/server/lib/XACMLAuthorizerInit.ldift.
at com.bea.common.store.bootstrap.internal.BootStrapServiceImpl.loadFullLDIFTemplate(BootStrapServiceImpl.java:910)
at com.bea.common.store.bootstrap.internal.BootStrapServiceImpl.loadLDIFTemplate(BootStrapServiceImpl.java:688)
at com.bea.common.store.bootstrap.internal.BootStrapServiceImpl.loadLDIFXACMLAuthorizerTemplate(BootStrapServiceImpl.java:176)
at com.bea.common.store.bootstrap.internal.BootStrapServiceImpl.loadLDIFXACMLAuthorizerTemplate(BootStrapServiceImpl.java:160)
at com.bea.common.security.internal.service.BootStrapServiceImpl.loadLDIFXACMLAuthorizerTemplate(BootStrapServiceImpl.java:106)
Truncated. see log file for complete stacktrace
Caused By: <openjpa-1.1.1-SNAPSHOT-r422266:957329 fatal store error> kodo.jdo.FatalDataStoreException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.
at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2170)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2017)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1915)
at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1833)
at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
Truncated. see log file for complete stacktrace
Caused By: <openjpa-1.1.1-SNAPSHOT-r422266:957329 nonfatal store error> kodo.jdo.DataStoreException: Batch entry 0 INSERT INTO BEAXACMLAP (DOMN, REALMN, TYPEN, CN, XVER, CTS, WCN, WCI, WXF, XD, XS, MTS) VALUES ('lxrccn', 'myrealm', 'Policies', 'urn:bea:xacml:2.0:entitlement:resource:type@E@Fmbean@G', '1.0', NULL, NULL, NULL, NULL, ?, '3', '2014-08-07 17:48:02.600000 +02:00:00') was aborted. Call getNextException to see the cause. {prepstmnt 1242995387 INSERT INTO BEAXACMLAP (DOMN, REALMN, TYPEN, CN, XVER, CTS, WCN, WCI, WXF, XD, XS, MTS) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(String) lxrccn, (String) myrealm, (String) Policies, (String) urn:bea:xacml:2.0:entitlement:resource:type@E@Fadm@G, (String) 1.0, (null) null, (null) null, (null) null, (null) null, (byte[]) [B@4f719938, (String) 3, (Timestamp) 2014-08-07 17:48:02.6] [reused=0]} [code=0, state=42501]
FailedObject: [cn=urn:bea:xacml:2.0:entitlement:resource:type@E@Fmbean@G,xacmlVersion=1.0,typeName=Policies,realm=myrealm,domain=lxrccn] [java.util.LinkedList]
at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4207)
at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4171)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:72)
at kodo.jdbc.kernel.BatchingPreparedStatementManager.executeBatch(BatchingPreparedStatementManager.java:304)
Truncated. see log file for complete stacktrace
Caused By: org.apache.openjpa.lib.jdbc.ReportingSQLException: Batch entry 0 INSERT INTO BEAXACMLAP (DOMN, REALMN, TYPEN, CN, XVER, CTS, WCN, WCI, WXF, XD, XS, MTS) VALUES ('lxrccn', 'myrealm', 'Policies', 'urn:bea:xacml:2.0:entitlement:resource:type@E@Fmbean@G', '1.0', NULL, NULL, NULL, NULL, ?, '3', '2014-08-07 17:48:02.600000 +02:00:00') was aborted. Call getNextException to see the cause. {prepstmnt 1242995387 INSERT INTO BEAXACMLAP (DOMN, REALMN, TYPEN, CN, XVER, CTS, WCN, WCI, WXF, XD, XS, MTS) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(String) lxrccn, (String) myrealm, (String) Policies, (String) urn:bea:xacml:2.0:entitlement:resource:type@E@Fadm@G, (String) 1.0, (null) null, (null) null, (null) null, (null) null, (byte[]) [B@4f719938, (String) 3, (Timestamp) 2014-08-07 17:48:02.6] [reused=0]} [code=0, state=42501]
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:57)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeBatch(LoggingConnectionDecorator.java:912)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPreparedStatement.java:244)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPreparedStatement.java:244)
Truncated. see log file for complete stacktrace
>
包含多个 BYTEA 字段的失败的“INSERT INTO BEAXACMLAP”让我相信 Weblogic for PostgreSQL 的 BLOB 处理已损坏。
是否可以在 PostgreSQL 上运行安全存储?也许可以通过一些创建脚本调整来实现?
答案1
不幸的是,异常中最有用的部分被隐藏了,因为使用了批处理,并且没有使用检查包装的异常getNextException
。由于您没有编写代码,因此可能不容易捕获它。
我建议检查 PostgreSQL 的服务器错误日志,可能在设置后log_statement = 'all'
,它会显示更多有用的信息,希望包括问题的真正原因。
(正如评论中指出的,这原来是一个权限问题)。