[Clustering/JBoss] - Re: RoundRobin, new cluster member & SFSB == NPE
by ben.wangï¼ jboss.com
No, I can't reproduce from my system. I have tried both RoundRobin and FirstAvailable. They failover just fine. I use two node cluster to restart one.
Here is my bean code snippet:
| @Stateful(name="GangDispute")
| @Clustered(loadBalancePolicy= org.jboss.ha.framework.interfaces.FirstAvailable.class)
| //@Clustered
| @Remote(GangDispute.class)
| public class GangDisputeBean implements java.io.Serializable, GangDispute
| {
| private long arrestedGuys = 0;
|
| public long newGuysArrested(long newArrests)
| {
| arrestedGuys+=newArrests;
| System.out.println("Total arrested guys: " + arrestedGuys + "( +" + newArrests + " arrests)");
| return arrestedGuys;
| }
|
| public long getNbArrestedGuys ()
| {
| return arrestedGuys;
| }
|
and client
| Client () throws Exception
| {
| //Get JNDI context
| Context naming = new InitialContext ();
| ClassLoader loader = Thread.currentThread().getContextClassLoader();
| Enumeration rsrcs = loader.getResources("jndi.properties");
| while( rsrcs.hasMoreElements() )
| {
| System.out.println(rsrcs.nextElement());
| }
| System.out.println("JNDI.env: "+naming.getEnvironment());
| System.out.println("Looking up GangDispute/remote");
| //Look up the Remote
| gd = (GangDispute)naming.lookup ("GangDispute/remote");
| }
|
| public void test ()
| {
|
| try
| {
| while (true)
| {
| long total = gd.newGuysArrested (1);
| System.out.println("Total number of arrested guys: " + total);
|
| try
| {
| synchronized (this)
| {
| this.wait (1000);
|
| ...
|
and jndi.prperties:
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.provider.url=jnp://localhost:1100
| java.naming.factory.url.pkgs=org.jboss.naming
|
I am now using exactly 4.0.5.GA as well. How do you run yours?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983664#3983664
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983664
19Â years, 6Â months
[JNDI/Naming/Network] - Re: The JNDI problem when deploying the JPetStore with jboss
by jaikiran
anonymous wrote : There are two Item.xml one is under %JPESTORE_HOME%\build\webapp\WEB-INF\classes\com\ibatis\jpetstore\persistence\sqlmapdao\sql
Both the files are the same. One is in the deployed application and one is a part of the source. If you are aware of how to build the JPetStore then do the below mentioned changes to
anonymous wrote : The other one is under %JPETSTORE_HOME%\src\com\ibatis\jpetstore\persistence\sqlmapdao\sql
Else do it under the other one.
Here's the change that you can try:
Try changing the queries to:
<select id="getItemListByProduct" resultClass="item" parameterClass="string" cacheModel="itemCache">
| SELECT
| I.ITEMID,
| LISTPRICE,
| UNITCOST,
| SUPPLIER AS supplierId,
| I.PRODUCTID AS "product.productId",
| NAME AS "product.name",
| DESCN AS "product.description",
| CATEGORY AS "product.categoryId",
| STATUS,
| ATTR1 AS attribute1,
| ATTR2 AS attribute2,
| ATTR3 AS attribute3,
| ATTR4 AS attribute4,
| ATTR5 AS attribute5
| FROM ITEM I, PRODUCT P
| WHERE P.PRODUCTID = I.PRODUCTID
| AND I.PRODUCTID = #value#
| </select>
|
| <select id="getItem" resultClass="item" parameterClass="string" cacheModel="quantityCache">
| select
| I.ITEMID,
| LISTPRICE,
| UNITCOST,
| SUPPLIER AS supplierId,
| I.PRODUCTID AS "product.productId",
| NAME AS "product.name",
| DESCN AS "product.description",
| CATEGORY AS "product.categoryId",
| STATUS,
| ATTR1 AS attribute1,
| ATTR2 AS attribute2,
| ATTR3 AS attribute3,
| ATTR4 AS attribute4,
| ATTR5 AS attribute5,
| QTY AS quantity
| from ITEM I, INVENTORY V, PRODUCT P
| where P.PRODUCTID = I.PRODUCTID
| and I.ITEMID = V.ITEMID
| and I.ITEMID = #value#
| </select>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983658#3983658
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983658
19Â years, 6Â months