How to do the clustering and load-balancing in JBoss server 4.0.1-RC2
by usharani avirneni
Hi all,
I am using jboss server(4.0.1-RC2).
I started the jboss server with the default cluster on two different machines(say A and B) with the following command: run -c all
Then I copied packaged war file in the farm folder in the machine A. It is replicating the war file in the machine B.
Now I have one problem. We are using properties file contains the machine address/name and this file is part of war file. Whenever I am copying the war file in one machine, it is replicating to second machine. I copied the war file in A machine with it's address in the properties file. If the machine A's server was down and B's server is up and running then how it will handle the requests with it's address in the properties. How can I fix this problem.
Am I in right direction or not. If not can anybody please help me to do the clustering and load-balancing in JBoss server. I am new to this.
Thanks in advance.
---------------------------------
Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool.
18Â years, 11Â months
[JNDI/Naming/Network] - java.sql.SQLException: Bigger type length than Maximum
by Rajesh.Gajula
Hi,
I have an application deployed in jboss cluster and deployment fine.
when i tried to access the fields in the application , i got the below exceptions in the logs ..
INFO | jvm 5 | 2007/07/19 04:38:25 | 04:38:25,343 ERROR [ManualAdjustmentAction] Error in action classINFO | jvm 5 | 2007/07/19 04:38:25 | com.ge.hc.osb.exception.OSBException: SQL Exception :
INFO | jvm 5 | 2007/07/19 04:38:25 | at com.ge.hc.osb.dao.ManualAdjustmentDAO.getDetailList(ManualAdjustmentDAO.java:117)
INFO | jvm 5 | 2007/07/19 04:38:25 | at com.ge.hc.osb.service.ManualAdjustmentService.getDetailList(ManualAdjustmentService.java:50)
INFO | jvm 5 | 2007/07/19 04:38:25 | at com.ge.hc.osb.action.ManualAdjustmentAction.viewManualAdjustmentPage(ManualAdjustmentAction.java:113)
INFO | jvm 5 | 2007/07/19 04:38:25 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 5 | 2007/07/19 04:38:25 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO | jvm 5 | 2007/07/19 04:38:25 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO | jvm 5 | 2007/07/19 04:38:25 | at java.lang.reflect.Method.invoke(Method.java:585)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
INFO | jvm 5 | 2007/07/19 04:38:25 | at com.ge.hc.osb.action.OSBActionServlet.process(OSBActionServlet.java:94)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
INFO | jvm 5 | 2007/07/19 04:38:25 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
INFO | jvm 5 | 2007/07/19 04:38:25 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
INFO | jvm 5 | 2007/07/19 04:38:25 | at com.ge.hc.osb.action.AuthorizationFilter.doFilter(AuthorizationFilter.java:109)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.jboss.web.tomcat.tc5.sso.ClusteredSingleSignOn.invoke(ClusteredSingleSignOn.java:366)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
INFO | jvm 5 | 2007/07/19 04:38:25 | at java.lang.Thread.run(Thread.java:595)
INFO | jvm 5 | 2007/07/19 04:38:25 | Caused by: java.sql.SQLException: Bigger type length than Maximum
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:884)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CMAREngine.buffer2Value(T4CMAREngine.java:2201)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CMAREngine.unmarshalUB2(T4CMAREngine.java:1050)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:111)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CTTIdcb.receiveFromRefCursor(T4CTTIdcb.java:103)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CResultSetAccessor.unmarshalOneRow(T4CResultSetAccessor.java:167)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:791)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CTTIrxd.unmarshal(T4CTTIrxd.java:707)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:529)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:180)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:783)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1026)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2884)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:2975)
INFO | jvm 5 | 2007/07/19 04:38:25 | at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4111)
INFO | jvm 5 | 2007/07/19 04:38:25 | at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:183)
INFO | jvm 5 | 2007/07/19 04:38:25 | at com.ge.hc.osb.dao.ManualAdjustmentDAO.getDetailList(ManualAdjustmentDAO.java:86)
INFO | jvm 5 | 2007/07/19 04:38:25 | ... 38 more
FYI .. am using 10.0.1.3 ojdbc.jar file in the server, and even i tried with 10.0.1.5 driver , Still i am getting the same exception.
It will be great if you can gimme any suggestions or solution ?
thanks,
-Raj
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065638#4065638
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065638
18Â years, 11Â months
[JCA/JBoss] - Performance Vows ?
by jsbhangra
Hi All...
I have built a web-application , which connects to the Oracle 10g Express edition at the backend..
I have set the maximum connection pool size to 1500 connections ..
But while load testing according to the client requirements ,1200 requests per minute.
The connection breaks up , which makes some requests unprocessed ..
I have set my oracle processes to 400 ...
Help me in performance tuning my application
My Database Connection file is :
|
| public class Database {
|
|
| public Database() {
| }
|
|
| private static InitialContext ic=null;
| private static Context ctx=null;
| private static DataSource ds=null;
| private static Connection con=null;
| private static int makeCount=0;
| private static int dropCount=0;
|
| /**
| *Makes Connection with database Returns Connection Object
| */
|
| public synchronized static Connection makeConnection() throws Exception {
| try{
|
| InitialContext ctx = new InitialContext();
| ds = (DataSource)ctx.lookup("java:mydatasource");
| con =ds.getConnection();
|
| log.info("Data Base Connection Created Sucessfully" + ds + con);
| makeCount++;
| log.info("Connections Made"+makeCount);
| } catch (Exception e) {
| log.error("Can not create Connection :"+ e);
| }
| return con;
| }
|
| /**
| * @param Connection Object
| * Closes the database Connection
| */
|
| public synchronized static void dropConnection(Connection con) {
| try {
|
| log.info("Closing Connection");
|
| dropCount++;
| log.info("Connections Dropped"+dropCount);
|
| if ( con != null) {
| con.close();
| }
| } catch (Exception e) {
| // Could not drop connection
| e.printStackTrace();
| } finally {
| con = null;
| }
| }
|
| }
|
I ecounter this problem ... for some requests i f i icrease the requests more than 1200 per minute ....
| ; - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Listener refused the connection with the following error:
| ORA-12519, TNS:no appropriate service handler found
| The Connection descriptor used by the client was:
| localhost:1521:XE
| ))
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065637#4065637
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065637
18Â years, 11Â months
[EJB 3.0] - Re: what happen with my entity bean , need expert help
by ejbiva
hi ALRubinger,the SessionBean just as follows
@Stateful
public class ShoppingCartBean implements ShoppingCart
{
@Inject
private EntityManager manager;
private Order order;
public void buy(String product, int quantity, double price)
{
if (order == null) order = new Order();
order.addPurchase(product, quantity, price);
}
public Order getOrder()
{
return order;
}
public void checkout()
{
manager.create(order);
}
}
/// Entity bean
@Entity
@Table(name = "PURCHASE_ORDER")
public class Order implements java.io.Serializable
{
private int id;
private double total;
private Collection lineItems;
@Id(generate = GeneratorType.AUTO)
public int getId()
{
return id;
}
public void setId(int id)
{
this.id = id;
}
public double getTotal()
{
return total;
}
public void setTotal(double total)
{
this.total = total;
}
public void addPurchase(String product, int quantity, double price)
{
if (lineItems == null) lineItems = new ArrayList();
LineItem item = new LineItem();
item.setOrder(this);
item.setProduct(product);
item.setQuantity(quantity);
item.setSubtotal(quantity * price);
lineItems.add(item);
total += quantity * price;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "order_id")
public Collection getLineItems()
{
return lineItems;
}
public void setLineItems(Collection lineItems)
{
this.lineItems = lineItems;
}
}
@Entity
@Table(name = "order_line_item")
public class LineItem implements java.io.Serializable
{
private int id;
private double subtotal;
private int quantity;
private String product;
private Order order;
@Id(generate = GeneratorType.AUTO)
public int getId()
{
return id;
}
public void setId(int id)
{
this.id = id;
}
public double getSubtotal()
{
return subtotal;
}
public void setSubtotal(double subtotal)
{
this.subtotal = subtotal;
}
public int getQuantity()
{
return quantity;
}
public void setQuantity(int quantity)
{
this.quantity = quantity;
}
public String getProduct()
{
return product;
}
public void setProduct(String product)
{
this.product = product;
}
@ManyToOne
@JoinColumn(name = "order_id")
public Order getOrder()
{
return order;
}
public void setOrder(Order order)
{
this.order = order;
}
}
/////// and testing console as follows
public class Client
{
public static void main(String[] args) throws Exception
{
InitialContext ctx = new InitialContext();
// ShoppingCart cart = (ShoppingCart) ctx.lookup(ShoppingCart.class.getName());
//Calculator calculator = (Calculator) ctx.lookup("CalculatorBean/remote");
ShoppingCart cart = (ShoppingCart) ctx.lookup("ShoppingCartBean/remote");
System.out.println("Buying 2 memory sticks");
cart.buy("Memory stick", 2, 500.00);
System.out.println("Buying a laptop");
cart.buy("Laptop", 1, 2000.00);
System.out.println("Print cart:");
Order order = cart.getOrder();
System.out.println("Total: $" + order.getTotal());
for (LineItem item : order.getLineItems())
{
System.out.println(item.getQuantity() + " " + item.getProduct() + " " + item.getSubtotal());
}
System.out.println("Checkout");
cart.checkout();
}
}
any defect?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065630#4065630
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065630
18Â years, 11Â months