[JNDI/Naming/Network] - RMI Classloading
by imaeses
I'm curious and I hope I don't sound too stupid by asking this question.
I have a system that involves in its simplest form 2 subsystems, each of which is hosted on a separate machine running JBoss 4.0.5.GA. It happens that a component hosted in subsystem A wants to send a message to a queue hosted in subsystem B. Now I realize that it is possible to configure a remote connection factory in jms-ds.xml (I'm using JBoss Messaging, by the way) and this works fine. Perhaps it's even preferrable because the connections are pooled.
However, it should also be possible to create an InitialContext referencing the remote machine directly, as any free-standing component would do (and, in fact, this works fine, since the class loading hierarchy is simpler and the necessary classes are available on the client side in jboss-messaging-client.jar). If I try this, however, the lookup call fails with a ClassNotFoundException: org.jboss.jms.client.ClientConnectionFactory with the tag that RMI Classloading is not enabled. This class is the type of the object which we are trying to lookup.
My impression of what is going on is that, because the JBoss Messaging core classes are loaded by some mysterious ClassLoader which is neither the current not the thread's context ClassLoader, the lookup has no other recourse that to try and download the class definition from the remote server, which it cannot do.
My question is this: is it expressly forbidden by the J2EE specification to enable RMI Classloading from within a J2EE container? Or is it simply bad practice? Or is it neither of these, in which case, is there way to enable RMI classloading in JBoss?
Many thanks,
Adam
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023781#4023781
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023781
19Â years, 1Â month
[Clustering/JBoss] - Re: Clustering / Multicast routing
by bstansberryï¼ jboss.com
LOL. You're lucky. You tend to ask questions when I've got a few spare minutes to answer. :-)
To get that to work you'd have to do some tricks with the configuration of buddy replication. What you want is:
1) Node 1 always chooses node2 as buddy.
2) Node 2 chooses either 1 or 3.
3) Node 3 always chooses node2 as buddy.
#2 is simple; just include all 3 nodes in the same buddy pool.
For #1 and #3 you would probably need to create your own implementation of the BuddyLocator interface, one that accepts a config option identifying node2 as the preferred buddy.
As to whether it's worthwhile, it depends on how much load your app's usage of session replication puts on a buddy -- how much memory and cpu is used handling providing backup for a buddy.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023774#4023774
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023774
19Â years, 1Â month
[Persistence, JBoss/CMP, Hibernate, Database] - Are object references shared?
by nalbion
If I use JBoss, EJB3.0, JPA, Hibernate to do a query:
Query q = em.createQuery("SELECT c FROM City c WHERE c.country.id=?").setParameter(1,myCountry.id);
| List cities = q.getList();
|
will the following be true? cities.get(i).country == myCountry
...ie, are object references shared, or will each city have it's own instance of Country such that (only) cities.get(i).country.equals(myCountry)
The second part of my question is along the same lines. If different users load objects using similar queries, perhaps:
"SELECT c FROM City c WHERE c.country.id IN(?,?,?)" are new instances created for entities which have recently been loaded by another user? Would the following return true?
for each ( aCity in userA.cities ) {
| for each ( bCity in userB.cities ) {
| if( aCity == bCity ) {
| // share same object, not just copies of same records
| return true;
| }
| }
| }
| return false;
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023768#4023768
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023768
19Â years, 1Â month