[JBossCache] - Remove is not properly deleting child nodes when run in a tr
by dh717
I have code that (within a single transaction) removes a node and then puts a new value into the cache that is a child of the removed node. After the transaction completes, the cache contains the new value AND the child nodes that should have been removed when the parent node was removed. If I execute the same code without a transaction, it works correctly, only the new value is present and all of the original children of the removed node are gone. The following code is a simple demonstration of the problem:
public class RemoveNodeTxProblem {
public static void main(String[] args) throws Exception {
CacheFactory<String, Object> factory = DefaultCacheFactory.getInstance();
Cache<String, Object> cache = factory.createCache(new XmlConfigurationParser().parseFile(args[0]), false);
cache.create();
cache.start();
Fqn rootFqn = Fqn.fromString("/a/b");
cache.put(rootFqn, "c", true);
TransactionManager txMgr = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
txMgr.begin();
cache.removeNode(rootFqn);
cache.put(rootFqn, "d", "Blah");
txMgr.commit();
System.out.println("c = " + cache.get(rootFqn, "c")); // c = true when tx is used, null when tx is not used
System.out.println("d = " + cache.get(rootFqn, "d"));
cache.stop();
}
}
Is this a bug? If not, is there a way to get the non-transactional behavior (deleted children don't come back after a new child is added) in a transactional way? I'm running JBoss Cache 2.0.0 GA and JOTM 2.0.9 as my transaction manager.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132002#4132002
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132002
16 years, 8 months
[JBoss Messaging] - no Inet4Address associated with interface
by matimus
Hi im trying to start up a basic messaging server on vista, and i am getting these errors. anyone have a clue what this means?
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: C:\workspace\jboss-4.2.2.GA
JAVA: C:\Program Files\Java\jdk1.5.0_13\bin\java
JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -
Dsun.rmi.dgc.server.gcInterval=3600000
CLASSPATH: C:\Program Files\Java\jdk1.5.0_13\lib\tools.jar;C:\workspace\jboss-4.2.2.GA\bin\run.jar
===============================================================================
15:33:24,299 INFO [Server] Starting JBoss (MX MicroKernel)...
15:33:24,302 INFO [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)
15:33:24,305 INFO [Server] Home Dir: C:\workspace\jboss-4.2.2.GA
15:33:24,306 INFO [Server] Home URL: file:/C:/workspace/jboss-4.2.2.GA/
15:33:24,309 INFO [Server] Patch URL: null
15:33:24,311 INFO [Server] Server Name: messaging-node0
15:33:24,312 INFO [Server] Server Home Dir: C:\workspace\jboss-4.2.2.GA\server\messaging-node0
15:33:24,314 INFO [Server] Server Home URL: file:/C:/workspace/jboss-4.2.2.GA/server/messaging-node0/
15:33:24,316 INFO [Server] Server Log Dir: C:\workspace\jboss-4.2.2.GA\server\messaging-node0\log
15:33:24,318 INFO [Server] Server Temp Dir: C:\workspace\jboss-4.2.2.GA\server\messaging-node0\tmp
15:33:24,320 INFO [Server] Root Deployment Filename: jboss-service.xml
15:33:24,683 INFO [ServerInfo] Java version: 1.5.0_13,Sun Microsystems Inc.
15:33:24,686 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_13-b05,Sun Microsystems Inc.
15:33:24,687 INFO [ServerInfo] OS-System: Windows Vista 6.0,x86
15:33:25,144 INFO [Server] Core system initialized
15:33:28,672 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
15:33:28,715 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
15:33:29,556 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
15:33:29,633 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
15:33:29,895 INFO [TransactionManagerService] Starting recovery manager
15:33:29,979 INFO [TransactionManagerService] Recovery manager started
15:33:29,981 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
15:33:34,047 INFO [EJB3Deployer] Starting java:comp multiplexer
15:33:36,676 WARN [UDP] failed to join /224.0.0.75:7500 on eth2: java.net.SocketException: Unrecognized Windows Sockets error:
0: no Inet4Address associated with interface
15:33:36,679 WARN [UDP] failed to join /224.0.0.75:7500 on net5: java.net.SocketException: Unrecognized Windows Sockets error:
0: no Inet4Address associated with interface
15:33:36,681 WARN [UDP] failed to join /224.0.0.75:7500 on eth4: java.net.SocketException: Unrecognized Windows Sockets error:
0: no Inet4Address associated with interface
15:33:36,683 WARN [UDP] failed to join /224.0.0.75:7500 on net9: java.net.SocketException: Unrecognized Windows Sockets error:
0: no Inet4Address associated with interface
15:33:36,685 WARN [UDP] failed to join /224.0.0.75:7500 on net11: java.net.SocketException: Unrecognized Windows Sockets error:
0: no Inet4Address associated with interface
15:33:36,687 WARN [UDP] failed to join /224.0.0.75:7500 on net14: java.net.SocketException: Unrecognized Windows Sockets error:
0: no Inet4Address associated with interface
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131997#4131997
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131997
16 years, 8 months
[JBossCache] - JndiBoundTreeCacheProvider
by spatik
Hai, I get this Type cast error when Iam using JndiBoundTreeCacheProvider.
02:33:24,653 ERROR [STDERR] Caused by: java.lang.ClassCastException: $Proxy200 cannot be cast to org.jboss.cache.TreeCache
| 02:33:24,653 ERROR [STDERR] at org.hibernate.cache.JndiBoundTreeCacheProvider.getTreeCacheInstance(JndiBoundTreeCacheProvider.java:61)
| 02:33:24,653 ERROR [STDERR] at org.hibernate.cache.JndiBoundTreeCacheProvider.buildCache(JndiBoundTreeCacheProvider.java:31)
| 02:33:24,653 ERROR [STDERR] at org.hibernate.cache.UpdateTimestampsCache.<init>(UpdateTimestampsCache.java:42)
| 02:33:24,653 ERROR [STDERR] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:337)
| 02:33:24,653 ERROR [STDERR] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
When I checked the JndiBoundTreeCacheProvider Class, I saw that the author has tried to typecast the JRMPProxyObject to org.jboss.cache.TreeCache.
Can you please tell me if this issue has been fixed. If it is not is there any work arounds for the same.
Thanks.
Here is my configuration for the exporting the Treecache MBean with a JNDI:
<mbean
| code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
| name="jboss:service=proxyFactory,type=jrmp,target=factory">
| <attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
| <attribute name="TargetName">sensei:service=TreeCache</attribute>
| <attribute name="JndiName">SenseiCache</attribute>
| <attribute name="InvokeTargetMethod">true</attribute>
| <attribute name="ExportedInterface">org.jboss.cache.TreeCacheMBean</attribute>
| <attribute name="ClientInterceptors">
| <interceptors>
| <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
| <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
| <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
| </interceptors>
| </attribute>
| <depends>jboss:service=invoker,type=jrmp</depends>
| <depends>sensei:service=TreeCache</depends>
| </mbean>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131995#4131995
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131995
16 years, 8 months
[JBoss Messaging] - JBoss exception when sending message to IBM MQ
by seanshih
Hi,
I got this error when I run my java code:
Could not create JNDI API context: javax.naming.NoInitialContextException: Cannot instantiate class: java.naming.factory.init ial [Root exception is java.lang.ClassNotFoundException: java.naming.factory.initial]
Can someone tell me what went wrong in my code?
***********************************************
import java.lang.*;
import javax.jms.*;
import javax.naming.*;
import java.util.Properties;
public class IBMMQSender {
public static void main(String[] args) {
String queueName = null;
InitialContext jndiContext = null;
QueueConnectionFactory queueConnectionFactory = null;
QueueConnection queueConnection = null;
QueueSession queueSession = null;
Queue queue = null;
QueueSender queueSender = null;
TextMessage message = null;
final int NUM_MSGS;
if ( (args.length < 1) || (args.length > 2) ) {
System.out.println("Usage: java IBMMQSender " +
"<queue-name> [<number-of-messages>]");
System.exit(1);
}
queueName = new String(args[0]);
System.out.println("Queue name is " + queueName);
if (args.length == 2){
NUM_MSGS = (new Integer(args[1])).intValue();
} else {
NUM_MSGS = 1;
}
/*
* Create a JNDI API InitialContext object if none exists
* yet.
*/
try {
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "java.naming.factory.initial");
properties.put(Context.URL_PKG_PREFIXES, "java.naming.factory.url.pkgs");
properties.put(Context.PROVIDER_URL, "java.naming.provider.url");
jndiContext = new InitialContext(properties);
//jndiContext = new InitialContext();
} catch (NamingException e) {
System.out.println("Could not create JNDI API " +
"context: " + e.toString());
System.exit(1);
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131993#4131993
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131993
16 years, 8 months
[JBoss Portal] - Re: help needed in LDAP authentication in portal environ.
by rammy1984
hi i followed the jboss docs ..... i was actually tryin to write to test case ..... but now i just deployed and found it is working cool :)
this is what iam doing in my code
LoginContext lc = new LoginContext("portal",
new UsernamePasswordHandler("test", "test".toCharArray()));
UserModule module = (UserModule) new InitialContext().lookup("java:/portal/UserModule");
RoleModule roleModule =(RoleModule) new InitialContext().lookup("java:/portal/RoleModule");
UserProfileModule userProfileModule = (UserProfileModule) new InitialContext().lookup("java:/portal/UserProfileModule");
MembershipModule membershipModule= (MembershipModule) new InitialContext().lookup("java/portal/MembershipModule");
org.jboss.portal.identity.User userIdentity;
userIdentity = ( org.jboss.portal.identity.User) module.findUserByUserName("testUser");
String gotFromLdap = userIdentity.getUserName();
userIdentity.updatePassword("xyxyyx");
lc.logout();
now i have other questions cropping up........
1. In logincontext iam using "portal" but the problem is when iam building using maven all my tests are failing saying that no login is configured for "portal" ......
is there any other approach i can take ? or
how can i use LdapExtLoginModule in here.....
i want to use this for its advanced search feature.....
do u have suggestions.... plz guide me in this
BTW above code is working so anyone who wanted to have sample code for using Identity management API 's you can use this :)
thanks guyz.... but plz help me with above clarifications
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131978#4131978
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131978
16 years, 8 months