[JBoss Portal] - Re: How to get Ldap informations?
by kmekme
I've got other questions : In which class is the Map of Identity Modules? I can't find the method getLDAPModules()...
And why do I have to map it again? Isn't it specified with this code:
| <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
| <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
| <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule</module-option>
| <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule</module-option>
|
I've already tried with this configuration in ldap_identity-config.xml :
| <identity-configuration>
| <datasources>
| <datasource>
| <name>LDAP</name>
| <config>
| <option>
| <name>host</name>
| <value>cbh57.bdxdom.mck</value>
| </option>
| <option>
| <name>port</name>
| <value>389</value>
| </option>
| <option>
| <name>adminDN</name>
| <value>CN=Manager</value>
| </option>
| <option>
| <name>adminPassword</name>
| <value>secret</value>
| </option>
| </config>
| </datasource>
| </datasources>
|
| <modules>
| <module>
| <!--type used to correctly map in IdentityContext registry-->
| <type>User</type>
| <implementation>LDAP</implementation>
| <class>
| org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl
| </class>
| <config/>
| </module>
| <module>
| <type>Role</type>
| <implementation>LDAP</implementation>
| <class>
| org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl
| </class>
| <config/>
| </module>
| <module>
| <type>Membership</type>
| <implementation>LDAP</implementation>
| <class>
| org.jboss.portal.identity.ldap.LDAPStaticGroupMembershipModuleImpl
| </class>
| <config/>
| </module>
| <module>
| <type>UserProfile</type>
| <implementation>DELEGATING</implementation>
| <config>
| <option>
| <name>ldapModuleJNDIName</name>
| <value>java:/portal/LDAPUserProfileModule</value>
| </option>
| </config>
| </module>
| <module>
| <type>DBDelegateUserProfile</type>
| <implementation>DB</implementation>
| <config>
| <option>
| <name>randomSynchronizePassword</name>
| <value>true</value>
| </option>
| </config>
| </module>
| <module>
| <type>LDAPDelegateUserProfile</type>
| <implementation>LDAP</implementation>
| <config/>
| </module>
| </modules>
|
| <options>
| <option-group>
| <group-name>common</group-name>
| <option>
| <name>userCtxDN</name>
| <value>OU=McKesson,DC=bdxdom,DC=mck</value>
| </option>
| <option>
| <name>uidAttributeID</name>
| <value>sAMAccountName</value>
| </option>
| <option>
| <name>userSearchFilter</name>
| <value><![CDATA[(&((sAMAccountName={0})(objectClass=user)))]]></value>
| </option>
| <option>
| <name>roleCtxDN</name>
| <value>OU=McKesson,DC=bdxdom,DC=mck</value>
| </option>
| <option>
| <name>roleSearchFilter</name>
| <value><![CDATA[(&((CN={0})(objectClass=group)))]]></value>
| </option>
| <option>
| <name>searchScope</name>
| <value>SUBTREE_SCOPE</value>
| </option>
| </option-group>
|
| </options>
| </identity-configuration>
|
And i could get all the ldap informations I needed with the mapping in profile-config.xml
But when I try to use user and roles synchronisation(like above), I can't.
Is there an easier way to map the ldap informations?
Is it to possible to change the configuration in identity-config.xml to map LDAP?
Sorry to ask so many questions :)
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153297#4153297
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153297
17 years, 11 months
[Persistence, JBoss/CMP, Hibernate, Database] - Unknown ordinal value for enum class
by swenbarth
Hi, I'm currently using JBoss 4.0.4GA with EJB3, MySQL 5.0 and mysql-connector-java-5.0.6
I have a bean with an enumeration attribute:
| private ItemType type;
|
| @Column(name = "TYPE", nullable = false)
| public ItemType getType() {
| return type;
| }
|
| public void setType(ItemType type) {
| this.type = type;
| }
|
The Enumeration is defined as follows:
| public enum ItemType {
| SERVICE, MATERIAL, SURCHARGE, PLANNED_WITHDRAWAL, ACTUAL_WITHDRAWAL, FREETEXT_TEMPLATE
| }
|
This works fine most of the time. However, occasionally this very attribute is written to the DB with bogus values, and when retrieving the bean, I get the following error:
anonymous wrote :
| java.lang.IllegalArgumentException: Unknown ordinal value for enum class xxx.xxx.xxx.xxx.enums.ItemType: -2147483644
| at org.hibernate.type.EnumType.nullSafeGet(EnumType.java:88)
| at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:104)
| at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
| at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:1983)
| at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1372)
| at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1300)
| at org.hibernate.loader.Loader.getRow(Loader.java:1197)
| at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:569)
| at org.hibernate.loader.Loader.doQuery(Loader.java:689)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
| at org.hibernate.loader.Loader.loadCollection(Loader.java:1919)
| at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
| at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:541)
| at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
| at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1705)
| at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
| at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:755)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:229)
| at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
| at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
| at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
| at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2821)
| at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:370)
| at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:351)
| at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:122)
| at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:178)
| at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86)
| at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:871)
| at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
| at org.hibernate.impl.SessionImpl.get(SessionImpl.java:801)
| at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:155)
| ...
|
When I check directly in the DB, I find this strange value (-2147483644), so the exception is entirely correct.
This problem is not reproducable, as I said the attribute is written correctly to the DB most of the time.
Does anyone know how to approach this problem?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153272#4153272
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153272
17 years, 11 months