-
1. Re: same SLSB in multiple clusters
ablevine1 Sep 21, 2006 9:51 PM (in response to ablevine1)So, I,ve found that this is supposed to be able to be done by using jboss.xml files in the META-INF directory of your ejb jar file, but I can;t seem to get it to work
My session implemetation class looks like this:
@Stateless
@Remote(ProductManagerSession.class)
@Local(ProductManagerSession.class)
public class ProductManagerSessionImpl extends AbstractManagerSession implements ProductManagerSession
{
....
}
with both a remote and local interface:
then my jboss.xml file looks like this for one of the clusters:
<enterprise-beans>
<!-- ProductManagerSessionImpl remote -->
<ejb-name>ProductManagerSessionImpl</ejb-name>
<jndi-name>ProductManagerSessionImpl/remote</jndi-name>
true
<cluster-config>
<partition-name>AppPartition</partition-name>
<load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailable</load-balance-policy>
</cluster-config>
<!-- ProductManagerSessionImpl local -->
<ejb-name>ProductManagerSessionImpl</ejb-name>
<jndi-name>ProductManagerSessionImpl/local</jndi-name>
true
<cluster-config>
<partition-name>AppPartition</partition-name>
<load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailable</load-balance-policy>
</cluster-config>
</enterprise-beans>
It is then packaged in an ear file named app.ear
when I try to connect using a remote client using the jndi name app/ProductManagerSessionImpl/remote
I get a NamingException saying "remote not bound"
What am I doing wrong??
Do I also need an ejb-jar.xml file??
Is there something I am missing from jboss.xml??
Any suggestions would be appreciated -
2. Re: same SLSB in multiple clusters
ablevine1 Sep 21, 2006 9:52 PM (in response to ablevine1)So, I,ve found that this is supposed to be able to be done by using jboss.xml files in the META-INF directory of your ejb jar file, but I can;t seem to get it to work
My session implemetation class looks like this:
@Stateless
@Remote(ProductManagerSession.class)
@Local(ProductManagerSession.class)
public class ProductManagerSessionImpl extends AbstractManagerSession implements ProductManagerSession
{
....
}
with both a remote and local interface:
then my jboss.xml file looks like this for one of the clusters:
<enterprise-beans>
<!-- ProductManagerSessionImpl remote -->
<ejb-name>ProductManagerSessionImpl</ejb-name>
<jndi-name>ProductManagerSessionImpl/remote</jndi-name>
true
<cluster-config>
<partition-name>AppPartition</partition-name>
<load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailable</load-balance-policy>
</cluster-config>
<!-- ProductManagerSessionImpl local -->
<ejb-name>ProductManagerSessionImpl</ejb-name>
<jndi-name>ProductManagerSessionImpl/local</jndi-name>
true
<cluster-config>
<partition-name>AppPartition</partition-name>
<load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailable</load-balance-policy>
</cluster-config>
</enterprise-beans>
It is then packaged in an ear file named app.ear
when I try to connect using a remote client using the jndi name app/ProductManagerSessionImpl/remote
I get a NamingException saying "remote not bound"
What am I doing wrong??
Do I also need an ejb-jar.xml file??
Is there something I am missing from jboss.xml??
Any suggestions would be appreciated -
3. Re: same SLSB in multiple clusters
ablevine1 Sep 21, 2006 9:59 PM (in response to ablevine1)REPOSTED DUE TO JUMBLED XML
So, I,ve found that this is supposed to be able to be done by using jboss.xml files in the META-INF directory of your ejb jar file, but I can;t seem to get it to work
My session implemetation class looks like this:
@Stateless
@Remote(ProductManagerSession.class)
@Local(ProductManagerSession.class)
public class ProductManagerSessionImpl extends AbstractManagerSession implements ProductManagerSession
{
....
}
with both a remote and local interface:
then my jboss.xml file looks like this for one of the clusters:<jboss> <enterprise-beans> <!-- ProductManagerSessionImpl remote --> <session> <ejb-name>ProductManagerSessionImpl</ejb-name> <jndi-name>ProductManagerSessionImpl/remote</jndi-name> <clustered>true</clustered> <cluster-config> <partition-name>AppPartition</partition-name> <load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailable</load-balance-policy> </cluster-config> </session> <!-- ProductManagerSessionImpl local --> <session> <ejb-name>ProductManagerSessionImpl</ejb-name> <jndi-name>ProductManagerSessionImpl/local</jndi-name> <clustered>true</clustered> <cluster-config> <partition-name>AppPartition</partition-name> <load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailable</load-balance-policy> </cluster-config> </session> </enterprise-beans> </jboss>
It is then packaged in an ear file named app.ear
when I try to connect using a remote client using the jndi name app/ProductManagerSessionImpl/remote
I get a NamingException saying "remote not bound"
What am I doing wrong??
Do I also need an ejb-jar.xml file??
Is there something I am missing from jboss.xml??
Any suggestions would be appreciated -
4. Re: same SLSB in multiple clusters
ablevine1 Sep 21, 2006 11:15 PM (in response to ablevine1)additionally, I would like to add that I am using JBoss-4.0.4GA with the EJB3.0 release that came bundled with it
-
5. Re: same SLSB in multiple clusters
ablevine1 Sep 22, 2006 2:31 PM (in response to ablevine1)I figured out the correct way to do this file after quite a bit of trial and error:
<jboss> <enterprise-beans> <!-- ProductManagerSessionImpl just one entry for each session bean and leave out the jndi names--> <session> <ejb-name>ProductManagerSessionImpl</ejb-name> <clustered>true</clustered> <cluster-config> <!-- use notation below instead of actual partition name --> <partition-name>${jboss.partition.name}</partition-name> <load-balance-policy>org.jboss.ha.framework.interfaces.FirstAvailable</load-balance-policy> </cluster-config> </session> </enterprise-beans> </jboss>
However now when one of the servers in the partition I get a CannotConnectException until I create a new context and do a new lookup. -
6. Re: same SLSB in multiple clusters
ablevine1 Sep 22, 2006 2:34 PM (in response to ablevine1)I meant to say that when one of the servers in the partition is brought down I get a CannotConnectException from the client, so it seems as if the automatic failover in the client stub is not working. could changing the load balancing policy fix this??
-
7. Re: same SLSB in multiple clusters
jotis99 Dec 4, 2006 1:45 PM (in response to ablevine1)I'm facing the same issue? Can you post the sample XMl snippset for ProductManagerSessionImpl in the the ejb-jar.xml?
-
8. Re: same SLSB in multiple clusters
jotis99 Dec 4, 2006 1:49 PM (in response to ablevine1)Shouldn't JBoss @Clustered.partiotion automatically pick up the partition name specified in ${jboss.partition.name}? Why is it hard-coded to read DefaultPartition? Developers shouldn't need to add this to jboss.xml. Is this is a bug?
-
9. Re: same SLSB in multiple clusters
brian.stansberry Dec 4, 2006 3:19 PM (in response to ablevine1)This is a missing bit of functionality. See http://jira.jboss.com/jira/browse/EJBTHREE-424.
-
10. Re: same SLSB in multiple clusters
jotis99 Dec 5, 2006 1:14 AM (in response to ablevine1)I'm trying to add a Clustered partition name in the jboss.xml since I cannot hardcode it as an annotation (EJB deploeyed in 2 clusters). I've tried numerous combinations and scoured the forums to no avail. Does JBoss support jboss-specific overrides in jboss.xml? THe following did NOT work for me. Is this a JBoss bug or my bug? Do I need an entry ejb-jar.xml at all if I'm only adding stuff in jboss.xml?
NOTE: this web app is garbling my HTML post for the clustered element!
------------
jboss.xml
<enterprise-beans>
<ejb-name>ClusteredSampleImpl</ejb-name>
<clustered>true </clustered>
<cluster-config>
<partition-name>ApplicationPartition</partition-name>
<load-balance-policy>org.jboss.ha.framework.interfaces.RandomRobin</load-balance-policy>
</cluster-config>
</enterprise-beans>
-------------------
<enterprise-beans>
<ejb-name>ClusteredSampleImpl</ejb-name>
</enterprise-beans>
----------------------
where the I have:
@Local
@Remote
public interface ClusteredSample
{
public String ping() ;
public String getSystemProperty(String propertyName) ;
}
@Stateless
public class ClusteredSampleImpl implements ClusteredSample
{
} -
11. Re: same SLSB in multiple clusters
jotis99 Dec 5, 2006 9:01 AM (in response to ablevine1)Does this (JIRA EJBTHREE-424) mean that you cannot specify a partition name from jboss.xml too? I've tried lots of permutations to no avail.
The following from jboss.xml doesn't seem to work:
<cluster-config>
<partition-name>ApplicationPartition</partition-name>
<load-balance-policy>org.jboss.ha.framework.interfaces.RandomRobin</load-balance-policy>
</cluster-config> -
12. Re: same SLSB in multiple clusters
jotis99 Dec 5, 2006 9:02 AM (in response to ablevine1)Does this (JIRA EJBTHREE-424) mean that you cannot specify a partition name from jboss.xml too? I've tried lots of permutations to no avail.
The following from jboss.xml doesn't seem to work:
<cluster-config>
<partition-name>ApplicationPartition</partition-name>
<load-balance-policy>org.jboss.ha.framework.interfaces.RandomRobin</load-balance-policy>
</cluster-config> -
13. Re: same SLSB in multiple clusters
ablevine1 Dec 5, 2006 6:50 PM (in response to ablevine1)apparently not unless you are using EJB3 RC9 or higher
-
14. Re: same SLSB in multiple clusters
brian.stansberry Dec 5, 2006 11:22 PM (in response to ablevine1)That is correct. http://jira.jboss.com/jira/browse/EJBTHREE-569