[JNDI/Naming/Network] - Re: Slow JMS destination lookup
by mohitanchlia
Below is the code. I have timing around the code and only piece that's slow is when there is a ctx.lookup involved.
| private Object lookupJndi(String jndiName) {
| Object result = null;
|
| try {
| result = ctx.lookup(jndiName);
| } catch (NamingException e) {
| throw new ServiceLocatorException("JNDI lookup error while looking up resource: '" + jndiName + "'", e);
| }
| return result;
| }
|
| cache = Collections.synchronizedMap(new WeakHashMap<String, Object>());
|
| public Object lookup(String jndiName, boolean useCache) {
| Object result = null;
| long t1=System.currentTimeMillis();
| if (useCache) {
| if (cache.containsKey(jndiName)) {
| result = cache.get(jndiName);
| }
|
| // WeakHashMap can return null
| if (result == null) {
| result = lookupJndi(jndiName);
| logger.info(jndiName + " Lookup took " + (System.currentTimeMillis() - t1));
| t1=System.currentTimeMillis();
| // we need to make copy of the key
| // as the original one can be a literal from the
| // String pool which prevents it from being garbage collected
| // and our WeakHashMap working
| cache.put(new String(jndiName), result);
| logger.info(jndiName + " Lookup insert in cache took " + (System.currentTimeMillis() - t1));
| t1=System.currentTimeMillis();
| }else{
| logger.info(jndiName + " Lookup from cache took " + (System.currentTimeMillis() - t1));
| t1=System.currentTimeMillis();
| }
| } else {
| result = lookupJndi(jndiName);
| logger.info(jndiName + " Lookup took " + (System.currentTimeMillis() - t1));
| t1=System.currentTimeMillis();
| }
| return result;
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232070#4232070
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232070
16 years, 11 months
[JBoss Messaging] - JBoss slowing down
by pratimkm
We are using JBM 1.4.2 GA SP1 with JBoss 4.2 GA. We are hosting our jboss servers on Solaris 10 (4 processors /8 GB memory). We do not persist messages more than 30-40 at a time. We also use JMS transactions for message rollback within session beans. Some of the message consumers are local MDBs and some of them are remote custom JMS clients. The remote clients are beyond a firewall and we have to refresh the connections between the client and JBM every 30 minutes.
We are noticing that the JBoss server is gradually slowing down as more messages are processed and after about 3-4 weeks it tries to consume more than 100% of the cpu resources and crashes. We have checked with JProbe that there are no memory leak and also tuned the JVM with these parameters -Xms2048m -Xmx2048m -server -Dsun.rmi.dgc.client.gcInterval=1800000
-Dsun.rmi.dgc.server.gcInterval=1800000 -XX:MaxPermSize=768m -XX:+UseParallelGC -X
X:ParallelGCThreads=4 -XX:NewRatio=1 -XX:SurvivorRatio=12 -XX:+UseLargePages -verb
ose:gc -XX:+PrintGCDetails"
We also see this kind of messages before crash
javax.jms.JMSException: Could not create a session: org.jboss.resource.JBossResourceExcept
ion: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (java.lang.IllegalStateException: Transaction TransactionImple < ac,
BasicAction: ad7d148:b3f9:49ff9638:c7b9 status: ActionStatus.ABORTED > is not active STATUS_ROLLEDBACK)
2009-05-13 05:08:51,229 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger] Periodic recovery - second pass <Wed, 13 May 2009 05:08:51>
2009-05-13 05:08:51,367 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract java.lang.String ebond.co
mmon.XMLCommunicationHandlerLocal.putToWaitingQueue(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String), causedBy:
java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive]
The transaction is not active!
Any help would be appreciated.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232069#4232069
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232069
16 years, 11 months
[Clustering/JBoss] - DWR issues in cluster....
by sureshrk19
Hi All,
I have 2 node Jboss (version: 4.2.3GA) cluster setup with session stickiness enabled; apache/mod_jk is front-end loadbalancer.
My application is using dwr for ajax calls at the web layer; when I deploy this on standalone node and access... it works fine.
When I deploy it on cluster... the session replication is working fine (i.e., httpsession data is properly replicated) but, the call to invoke dwr controller is not triggered on fail-over.
When I print the URL: it is ".htm" as per the definition dwr controller should trigger "DispatcherServlet" hence invoke "DashBoardController" but, no action after URL.
web.xml entry:
-----------------
<servlet-name>sample</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>sample</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
------------
I have home page configured thru DWR controller...
entry in the dwr controller xml is:
----------------------
dashboardController
...
/jsp/stboard.jsp
-----------------
The class "DashBoardController" is never called when the request is served from fail-over node in cluster.
If I call "dash board" from the same node where the session is created then, it works fine.
the call to dashboard was made form filter.. the code snippet is...
---------
public class DWRFilter implements AjaxFilter {
.......
public Object doFilter(Object obj, Method method, Object[] params,
AjaxFilterChain chain) throws Exception {
....
return chain.doFilter(obj, method, params);
}
......
}
-----------
I validated the session on fail-over node... it is same as parent node (where the session was created).
Any pointers would be highly appreciated.
Thanks,
Suresh
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232059#4232059
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232059
16 years, 11 months
[JBoss Messaging] - JMS over HTTPS:any alternative to jboss 4
by yashendrac
We are migrating to JBoss5.0.1 from JBoss4.2.1
Our application uses jbossmq-httpil.sar(HTTP/HTTPS Invocation Layer, part of JBossMQ in jboss4, which allows accessing JBossMQ service over the HTTP or HTTPS protocols)
In new Jboss Msssing, jbossmq-httpil.sar is not there. Does anybody know the alternative to jbossmq-httpil in JBoss 5.
Also I am accessing HTTPServerILServiceMBean from my code to set some values.
Code:
1. HTTPServerILServiceMBean mbean = (HTTPServerILServiceMBean) MBeanProxyExt.create(HTTPServerILService
| 2. MBean.class, "jboss.mq:service=InvocationLayer,type=HTTPS");
| 3. mbean.setURLHostName(address.getHostAddress());
|
| HTTPServerILServiceMBean mbean = (HTTPServerILServiceMBean) MBeanProxyExt.create(HTTPServerILService MBean.class, "jboss.mq:service=InvocationLayer,type=HTTPS"); mbean.setURLHostName(address.getHostAddress());
|
Any suggestion would be highly appreciated.
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232032#4232032
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232032
16 years, 11 months