Oracle

訪問目錄時使用 Oracle BPM 和 weblogic 的 javax.naming.InvalidNameException

  • May 25, 2015

我們在啟動集群(2 個託管伺服器,1 個管理員)時遇到此異常,我們僅在 weblogic 10.3 中部署了與 OBPM 10.3.1 SP1 對應的耳朵。當伺服器集群啟動時,其中一個託管伺服器(第一個啟動的伺服器)由於此重複錯誤而超載並耗盡與目錄 DB 的連接。看起來引擎正試圖從 LDAP 伺服器獲取資訊,但我不知道為什麼它會建構錯誤的查詢。

fuego.directory.DirectoryRuntimeException: Exception [javax.naming.InvalidNameException: CN=Alvarez Guerrero Bernardo
DEL:ca9ef28d-3b94-4e8f-a6bd-8c880bb3791b,CN=Deleted Objects,DC=corp: [LDAP: error code 34 - 0000208F: NameErr: DSID-031001BA, problem 2006 (BAD_NAME), data 8349, best match of:
       'CN=Alvarez Guerrero Bernardo
DEL:ca9ef28d-3b94-4e8f-a6bd-8c880bb3791b,CN=Deleted Objects,DC=corp,dc=televisa,dc=com,dc=mx'
^@]; remaining name 'CN=Alvarez Guerrero Bernardo
DEL:ca9ef28d-3b94-4e8f-a6bd-8c880bb3791b,CN=Deleted Objects,DC=corp'].
       at fuego.directory.DirectoryRuntimeException.wrapException(DirectoryRuntimeException.java:85)
       at fuego.directory.hybrid.ldap.JNDIQueryExecutor.selectById(JNDIQueryExecutor.java:163)
       at fuego.directory.hybrid.ldap.JNDIQueryExecutor.selectById(JNDIQueryExecutor.java:110)
       at fuego.directory.hybrid.ldap.Repository.selectById(Repository.java:38)
       at fuego.directory.hybrid.msad.MSADGroupValueProvider.getAssignedParticipantsInternal(MSADGroupValueProvider.java:124)
       at fuego.directory.hybrid.msad.MSADGroupValueProvider.getAssignedParticipants(MSADGroupValueProvider.java:70)
       at fuego.directory.hybrid.ldap.Group$7.getValue(Group.java:149)
       at fuego.directory.hybrid.ldap.Group$7.getValue(Group.java:152)
       at fuego.directory.hybrid.ldap.LDAPResult.getValue(LDAPResult.java:76)
       at fuego.directory.hybrid.ldap.LDAPOrganizationGroupAccessor.setInfo(LDAPOrganizationGroupAccessor.java:352)
       at fuego.directory.hybrid.ldap.LDAPOrganizationGroupAccessor.build(LDAPOrganizationGroupAccessor.java:121)
       at fuego.directory.hybrid.ldap.LDAPOrganizationGroupAccessor.build(LDAPOrganizationGroupAccessor.java:114)
       at fuego.directory.hybrid.ldap.LDAPOrganizationGroupAccessor.fetchGroup(LDAPOrganizationGroupAccessor.java:94)
       at fuego.directory.hybrid.HybridGroupAccessor.fetchGroup(HybridGroupAccessor.java:146)
       at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at fuego.directory.provider.DirectorySessionImpl$AccessorProxy.invoke(DirectorySessionImpl.java:756)
       at $Proxy66.fetchGroup(Unknown Source)
       at fuego.directory.DirOrganizationalGroup.fetch(DirOrganizationalGroup.java:275)
       at fuego.metadata.GroupManager.loadGroup(GroupManager.java:225)
       at fuego.metadata.GroupManager.find(GroupManager.java:57)
       at fuego.metadata.ParticipantManager.addNestedGroups(ParticipantManager.java:621)
       at fuego.metadata.ParticipantManager.buildCompleteRoleAssignments(ParticipantManager.java:527)
       at fuego.metadata.Participant$RoleTransitiveClousure.build(Participant.java:760)
       at fuego.metadata.Participant$RoleTransitiveClousure.access$100(Participant.java:692)
       at fuego.metadata.Participant.buildRoles(Participant.java:401)
       at fuego.metadata.Participant.updateMembers(Participant.java:372)
       at fuego.metadata.Participant.<init>(Participant.java:64)
       at fuego.metadata.Participant.createUncacheParticipant(Participant.java:84)
       at fuego.server.persistence.jdbc.JdbcProcessInstancePersMgr.loadItems(JdbcProcessInstancePersMgr.java:1706)
       at fuego.server.persistence.Persistence.loadInstanceItems(Persistence.java:838)
       at fuego.server.AbstractInstanceService.readInstance(AbstractInstanceService.java:791)
       at fuego.ejbengine.EJBInstanceService.getLockedROImpl(EJBInstanceService.java:218)
       at fuego.server.AbstractInstanceService.getLockedROImpl(AbstractInstanceService.java:892)
       at fuego.server.AbstractInstanceService.getLockedImpl(AbstractInstanceService.java:743)
       at fuego.server.AbstractInstanceService.getLockedImpl(AbstractInstanceService.java:730)
       at fuego.server.AbstractInstanceService.getLocked(AbstractInstanceService.java:144)
       at fuego.server.AbstractInstanceService.getLocked(AbstractInstanceService.java:162)
       at fuego.server.AbstractInstanceService.unselectAllItems(AbstractInstanceService.java:454)
       at fuego.server.execution.ToDoItemUnselect.execute(ToDoItemUnselect.java:105)
       at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
       at fuego.transaction.TransactionAction.startNestedTransaction(TransactionAction.java:527)
       at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:548)
       at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
       at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
       at fuego.server.execution.DefaultEngineExecution.executeAutomaticWork(DefaultEngineExecution.java:62)
       at fuego.server.execution.EngineExecution.executeAutomaticWork(EngineExecution.java:42)
       at fuego.server.execution.ToDoItem.executeAutomaticWork(ToDoItem.java:261)
       at fuego.ejbengine.ItemExecutionBean$1.execute(ItemExecutionBean.java:223)
       at fuego.server.execution.DefaultEngineExecution$AtomicExecutionTA.runTransaction(DefaultEngineExecution.java:304)
       at fuego.transaction.TransactionAction.startBaseTransaction(TransactionAction.java:470)
       at fuego.transaction.TransactionAction.startTransaction(TransactionAction.java:551)
       at fuego.transaction.TransactionAction.start(TransactionAction.java:212)
       at fuego.server.execution.DefaultEngineExecution.executeImmediate(DefaultEngineExecution.java:123)
       at fuego.server.execution.EngineExecution.executeImmediate(EngineExecution.java:66)
       at fuego.ejbengine.ItemExecutionBean.processMessage(ItemExecutionBean.java:209)
       at fuego.ejbengine.ItemExecutionBean.onMessage(ItemExecutionBean.java:120)
       at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
       at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
       at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
       at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4547)
       at weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
       at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
       at weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
       at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5058)
       at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
       at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
       at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.naming.InvalidNameException: CN=Alvarez Guerrero Bernardo
DEL:ca9ef28d-3b94-4e8f-a6bd-8c880bb3791b,CN=Deleted Objects,DC=corp: [LDAP: error code 34 - 0000208F: NameErr: DSID-031001BA, problem 2006 (BAD_NAME), data 8349, best match of:
       'CN=Alvarez Guerrero Bernardo
DEL:ca9ef28d-3b94-4e8f-a6bd-8c880bb3791b,CN=Deleted Objects,DC=corp,dc=televisa,dc=com,dc=mx'
^@]; remaining name 'CN=Alvarez Guerrero Bernardo
DEL:ca9ef28d-3b94-4e8f-a6bd-8c880bb3791b,CN=Deleted Objects,DC=corp'
       at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2979)
       at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2794)
       at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1826)
       at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1749)
       at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)
       at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:338)
       at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:321)
       at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248)
       at fuego.jndi.FaultTolerantLdapContext.search(FaultTolerantLdapContext.java:612)
       at fuego.directory.hybrid.ldap.JNDIQueryExecutor.selectById(JNDIQueryExecutor.java:136)
       ... 67 more

我們終於解決了這個問題。它是由 LDAP 查詢中的特殊字元引起的。OBPM 引擎將字元串 \0A 換行為新行,該字元串出現在查詢中的 Bernardo 之後:

'CN=Alvarez Guerrero Bernardo\0ADEL:ca9ef28d-3b94-4e8f-a6bd-8c880bb3791b,CN=Deleted Objects,DC=corp,dc=televisa,dc=com,dc=mx'

當引擎解析查詢時,它看起來像:

'CN=Alvarez Guerrero Bernardo
DEL:ca9ef28d-3b94-4e8f-a6bd-8c880bb3791b,CN=Deleted Objects,DC=corp,dc=televisa,dc=com,dc=mx'

我們不知道為什麼查詢包含“\0A”字元串,但 OBPM 在遷移後的第一次執行中循環執行該查詢。我們在Oracle程式碼中插入一些程式碼來刪除字元串,問題就解決了。之後,我們從Oracle恢復原始程式碼,問題沒有再次出現。

引用自:https://serverfault.com/questions/134575