[JBoss Cache: Core Edition] - How do items get automatically removed from the cache?
by eightmd
I've just started looking at JBossCache and I was writing some tests to see how it works. I am trying to put nodes into the cache and then see them expire. I have used a region and used n LRU eviction policy. I was thinking that setting TimeToLiveSeconds and/or MaxAgeSeconds would cause the node to be completely removed from the cache. I know that the RegionManager has to wake up so I setWakeUpIntervalSeconds on the EvictionConfiguration to 4 seconds.
| LRUConfiguration lru = new LRUConfiguration();
| lru.setMaxNodes(5000);
| lru.setTimeToLiveSeconds(2);
| lru.setMaxAgeSeconds(2);
|
I did a sleep for 10 seconds and the node was still there.
I then tried doing the following which I found in the user manual.
| Long future = new Long(System.currentTimeMillis() + 2000);
| cache.getRoot().getChild(nodeFqn).put(ExpirationConfiguration.EXPIRATION_KEY, future);
|
| assertTrue(cache.getRoot().hasChild(nodeFqn));
| Thread.sleep(10000);
|
| // after 5 seconds, expiration completes
| assertFalse(cache.getRoot().hasChild(nodeFqn));
|
The node was still there.
Then I tried this:
| ExpirationConfiguration ec = new ExpirationConfiguration();
| ec.setTimeToLiveSeconds(2);
|
| cache.getRoot().getChild(nodeFqn).put(ExpirationConfiguration.EXPIRATION_KEY, ec);
|
| assertTrue(cache.getRoot().hasChild(nodeFqn));
| Thread.sleep(10000);
|
| // after 5 seconds, expiration completes
| Node n1 = cache.getRoot().getChild(nodeFqn);
| assertFalse(cache.getRoot().hasChild(nodeFqn));
|
The node was still there. So if anyone can tell me what I'm missing I would appreciate it. I am expecting to see the node gone from the cache by one of these methods. Thanks for any help you can provide.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162152#4162152
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162152
17 years, 9 months
[JBoss Messaging] - Not able to connect to remote Queue through Bridge
by jjacobwip
Hi,
We were trying to setup a Messaging bridge between Jboss SOA platform 4.2.2 and Jboss AS 4.0.4. I have an remote MQ queue running on 4.0.4 server. We are doing this to avoid any incompatability between Jboss Messaging in SOA and MQ in 4.0.4.
We set the Source as the remote queue running on 4.0.4 and target as a local queue running in SOA platform. But when the bridge configuration is deployed, its throwing the below exception
| 2008-07-02 12:02:44,108 WARN [org.jboss.jms.server.bridge.Bridge] Failed to set up connections
| java.lang.NullPointerException
| at javax.naming.InitialContext.getURLScheme(InitialContext.java:228)
| at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:277)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:66)
| at org.jboss.jms.server.bridge.JNDIConnectionFactoryFactory.createConnectionFactory(JNDIConnectionFactoryFactory.java:46)
| at org.jboss.jms.server.bridge.Bridge.createConnection(Bridge.java:832)
| at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:944)
| at org.jboss.jms.server.bridge.Bridge.start(Bridge.java:306)
| at org.jboss.jms.server.bridge.BridgeService.startService(BridgeService.java:346)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
|
Below is excerpts from our hajndi-jms-ds.xml. We are using LocalJMSProvider
| <!-- The JMS provider loader -->
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.jms:service=JMSProviderLoader,name=HAJNDIJMSProvider">
| <attribute name="ProviderName">DefaultJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">
| org.jboss.jms.jndi.JNDIProviderAdapter
| </attribute>
| <!-- The combined connection factory -->
| <attribute name="FactoryRef">XAConnectionFactory</attribute>
| <!-- The queue connection factory -->
| <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
| <!-- The topic factory -->
| <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
| <!-- Access JMS via HAJNDI -->
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=${jboss.bind.address:localhost}:1100
| jnp.disableDiscovery=false
| jnp.partitionName=${jboss.partition.name:DefaultPartition}
| jnp.discoveryGroup=${jboss.partition.udpGroup:230.0.0.4}
| jnp.discoveryPort=1102
| jnp.discoveryTTL=16
| jnp.discoveryTimeout=5000
| jnp.maxRetries=1
| </attribute>
| </mbean>
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.messaging:service=JMSProviderLoader,name=LocalJMSProvider">
| <attribute name="ProviderName">LocalJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
| <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
| <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=${jboss.bind.address:localhost}:1100
| </attribute>
| </mbean>
|
Our bridge config is as below
| <mbean code="org.jboss.jms.server.bridge.BridgeService"
| name="jboss.messaging:service=Bridge,name=IPMBridge"
| xmbean-dd="xmdesc/Bridge-xmbean.xml">
|
| <!-- The JMS provider loader that is used to lookup the source destination -->
| <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=10.200.171.60</depends>
|
| <!-- The JMS provider loader that is used to lookup the target destination -->
| <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=LocalJMSProvider</depends>
|
| <!-- The JNDI lookup for the source destination -->
| <attribute name="SourceDestinationLookup">/queue/SOA_STD</attribute>
|
| <!-- The JNDI lookup for the target destination -->
| <attribute name="TargetDestinationLookup">/queue/IPMQueue</attribute>
|
| <!-- The username to use for the source connection
| <attribute name="SourceUsername">bob</attribute>
| -->
|
| <!-- The password to use for the source connection
| <attribute name="SourcePassword">cheesecake</attribute>
| -->
|
Below is our remote queue config
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=10.200.171.60">
|
| <attribute name="ProviderName">RemoteJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
|
| <!-- The combined connection factory -->
| <attribute name="FactoryRef">XAConnectionFactory</attribute>
| <!-- The queue connection factory -->
| <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
| <!-- The topic factory -->
| <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
| <!-- Uncomment to use HAJNDI to access JMS -->
|
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=10.200.171.60:1199
| </attribute>
| </mbean>
|
Could somebody let us know whats wrong with this configuration? We have gone through other threads which talks about the same issue, but was not that helpful.
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162134#4162134
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162134
17 years, 9 months
[JBoss Portal] - Ldap Configuration With Jboss Portal
by amitdon19
Hi All,
I am unable get to log in into Portal after configuring Portal with OpenDS Ldap.
When first time i am trying to get log in by user/user credential its showing me an error of "message: Access to the requested resource has been denied.description: Access to the specified resource (Access to the requested resource has been denied) has been forbidden."
but on very second attempt portal get authenticate with same credentials (user/user).This same case happens with admin/admin credentials.
but if I am trying to get log in with other credentials then it shows me an error of "Your account is disabled ">
Please help me out with this error.
I made following changes to configure portal with OpenDS Ldap:
All changes are in Bold
I used Following ldif:
dn: dc=jboss,dc=org
| objectclass: top
| objectclass: dcObject
| objectclass: organization
| dc: jboss
| o: jboss
|
| dn: ou=People,dc=jboss,dc=org
| objectclass: top
| objectclass: organizationalUnit
| ou: People
|
| dn: uid=user,ou=People,dc=jboss,dc=org
| objectclass: top
| objectclass: inetOrgPerson
| objectclass: person
| uid: user
| cn: JBoss Portal user
| sn: user
| userPassword: user
| mail: email(a)email.com
|
|
| dn: uid=admin,ou=People,dc=jboss,dc=org
| objectclass: top
| objectclass: inetOrgPerson
| objectclass: person
| uid: admin
| cn: JBoss Portal admin
| sn: admin
| userPassword: admin
| mail: email(a)email.com
|
| dn: ou=Roles,dc=jboss,dc=org
| objectclass: top
| objectclass: organizationalUnit
| ou: Roles
|
| dn: cn=User,ou=Roles,dc=jboss,dc=org
| objectClass: top
| objectClass: groupOfNames
| cn: User
| description: the JBoss Portal user group
| member: uid=user,ou=People,dc=jboss,dc=org
|
| dn: cn=Admin,ou=Roles,dc=jboss,dc=org
| objectClass: top
| objectClass: groupOfNames
| cn: Echo
| description: the JBoss Portal admin group
| member: uid=admin,ou=People,dc=jboss,dc=org
1.In C:\jboss-portal-2.6.5.SP1\server\default\deploy\jboss-portal.sar\META-INF\jboss-service.xml
<mbean
| code="org.jboss.portal.core.identity.service.IdentityServiceControllerImpl"
| name="portal:service=Module,type=IdentityServiceController"
| xmbean-dd=""
| xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
| <xmbean/>
| <depends>portal:service=Hibernate</depends>
| <depends
| optional-attribute-name="IdentityEventBroadcaster"
| proxy-type="attribute">portal:service=IdentityEventManager</depends>
| <attribute name="JndiName">java:/portal/IdentityServiceController</attribute>
| <attribute name="RegisterMBeans">true</attribute>
| <attribute name="ConfigFile">conf/identity/ldap_identity-config.xml</attribute>
| <attribute name="DefaultConfigFile">conf/identity/standardidentity-config.xml</attribute>
| </mbean>
|
2.In C:\jboss-portal-2.6.5.SP1\server\default\deploy\jboss-portal.sar\conf\identity\ldap_identity-config.xml
<identity-configuration>
| <datasources>
| <datasource>
| <name>LDAP</name>
| <config>
| <option>
| <name>host</name>
| <value>localhost</value>
| </option>
| <option>
| <name>port</name>
| <value>389</value>
| </option>
| <option>
| <name>adminDN</name>
| <value>cn=Directory Manager</value>
| </option>
| <option>
| <name>adminPassword</name>
| <value>password</value>
| </option>
| <!--<option>
| <name>protocol</name>
| <value>ssl</value>
| </option>-->
| </config>
| </datasource>
| </datasources>
| <modules>
| <module>
| <!--type used to correctly map in IdentityContext registry-->
| <type>User</type>
| <implementation>LDAP</implementation>
| <!--Use this implementation for more flexible user retrieval-->
| <class>
| org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl
| </class>
| <config/>
| </module>
| <module>
| <type>Role</type>
| <implementation>LDAP</implementation>
| <!--Use this implementation for more flexible user retrieval-->
| <class>
| org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl
| </class>
| <config/>
| </module>
| <module>
| <type>Membership</type>
| <implementation>LDAP</implementation>
| <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=People,dc=jboss,dc=org</value>
| </option>
| <!--Uncomment to use with LDAPExtUserModuleImpl-->
| <option>
| <name>userSearchFilter</name>
| <value><![CDATA[(&((uid={0})(objectClass=person)))]]></value>
| </option>
| <option>
| <name>roleCtxDN</name>
| <value>ou=Roles,dc=jboss,dc=org</value>
| </option>
| <!--Uncomment to use with LDAPExtRoleModuleImpl-->
| <option>
| <name>roleSearchFilter</name>
| <value><![CDATA[(&((cn={0})(objectClass=groupOfNames)))]]></value>
| </option>
| </option-group>
| </options>
|
| </identity-configuration>
3.In C:\jboss-portal-2.6.5.SP1\server\default\deploy\jboss-portal.sar\conf\login-config.xml
| <application-policy name="portal">
| <authentication>
| <login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="sufficient">
| <module-option name="unauthenticatedIdentity">guest</module-option>
| <module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
| <module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
| <module-option name="additionalRole">Authenticated</module-option>
| <module-option name="password-stacking">useFirstPass</module-option>
| </login-module>
| <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required" >
| <module-option name="java.naming.factory.initial">
| com.sun.jndi.ldap.LdapCtxFactory
| </module-option>
| <module-option name="java.naming.provider.url">
| ldap://localhost:389/
| </module-option>
| <module-option name="java.naming.security.authentication">
| simple
| </module-option>
| <module-option name="bindDN">cn=Directory Manager</module-option>
| <module-option name="bindCredential">password</module-option>
| <module-option name="baseCtxDN">ou=People,dc=jboss,dc=org</module-option>
| <module-option name="baseFilter">(uid={0})</module-option>
| <module-option name="rolesCtxDN">ou=Roles,dc=jboss,dc=org</module-option>
| <module-option name="roleFilter">(member={1})</module-option>
| <module-option name="roleAttributeID">memberOf</module-option>
| <module-option name="roleRecursion">-1</module-option>
| <module-option name="roleNameAttributeID">cn</module-option>
| <module-option name="roleAttributeIsDN">true</module-option>
| <module-option name="searchTimeLimit">5000</module-option>
| <module-option name="searchScope">SUBTREE_SCOPE</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162126#4162126
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162126
17 years, 9 months