[Messaging, JMS & JBossMQ] - hung JBoss context lookup
by sranjan
I have JMS Client inside weblogic 8.1 listening to a queue hosted in JBoss3.2.5. I have an ExceptionListener which tries to reconnect the queue if connection is broken and restart the listener.
Our client is rebooting JBOSS every morning, and my jms client would detect the broken connection and would try to reconnect every 60 seconds till it is finally connected. But sometimes, once in a 10 days, it would get into hung mode and after few tries, it would give up. Once it get into this condition, I need to manually stop the weblogic process and restart it.
I took the thread dump today, where it seems that while doing the context lookup, it is reading socket and get hung there. Below is the thread dump and re-try code for connection. Please help me if anyone has seen this issue and solved it.
ThreadDump of the hung thread
"UIL2.SocketManager.ReadTask#3 client=172.17.100.14:8093" daemon prio=5 tid=0x0494ddb0 nid=0x1704 runnable [0x072cf000..0x072cfd94]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
- locked <0x2a7a3c50> (a java.io.BufferedInputStream)
at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2140)
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2153)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2621)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:734)
at java.io.ObjectInputStream.(ObjectInputStream.java:251)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:194)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1185)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.bluemartini.nextor.jms.JBossMQManager.initConnection(JBossMQManager.java:124)
at com.bluemartini.nextor.jms.JBossMQManager.initialize(JBossMQManager.java:97)
at com.bluemartini.nextor.jms.JBossMQManager.reinitialize(JBossMQManager.java:245)
at com.bluemartini.nextor.jms.JBossMQManager$_ExceptionListener.onException(JBossMQManager.java:359)
- locked <0x1a41af38> (a com.bluemartini.nextor.jms.JBossMQManager$_ExceptionListener)
at org.jboss.mq.Connection.asynchFailure(Connection.java:439)
- locked <0x1a41af38> (a com.bluemartini.nextor.jms.JBossMQManager$_ExceptionListener)
at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145)
at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:398)
at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:332)
at java.lang.Thread.run(Thread.java:534)
My reconnect Code
while (!bConnected_ && !BMThreadManager.aborted())
{
try {
Hashtable props = new Hashtable();
props.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory_);
props.put(Context.PROVIDER_URL, providerURL_);
//props.put("java.naming.rmi.security.manager", "yes");
props.put(Context.URL_PKG_PREFIXES, urlPkgPrefixes_);
//Get the initial context with given properties
ctx_ = new InitialContext(props);
BMLog.log(LOG_COMPONENT, 4, "BM JMS: Preparing for context lookup");
//Get the connection factory
QueueConnectionFactory queueConnectionFactory_ =
(QueueConnectionFactory)ctx_.lookup("UIL2ConnectionFactory");
BMLog.log(LOG_COMPONENT, 4, "BM JMS: QueueConnectionFactory:" + queueConnectionFactory_ );
BMLog.log(LOG_COMPONENT, 0, "BM JMS: Creating Queue Connection to JMS Server " + providerURL_);
// Get a Queue Connection to the JMS server
System.out.println("BM JMS: Creating Queue Connection to JMS Server " + providerURL_);
BMLog.log(LOG_COMPONENT, 0, "BM JMS: Creating Queue Connection to JMS Server " + providerURL_);
queueConnection_ = queueConnectionFactory_.createQueueConnection();
queueConnection_.setExceptionListener(exceptionListener_);
System.out.println("BM JMS: Successfully connected to JMS Server " + providerURL_);
BMLog.log(LOG_COMPONENT, 0, "BM JMS: Successfully connected to JMS Server " + providerURL_);
bConnected_ = true;
// increment connectionID
//connectionID_ = connectionID_ + 1;
}
catch (Throwable e)
{
System.out.println("BM JMS: Connect to JMS Server " + providerURL_ + " failed. Will retry in " + nSleepSecs_ + " seconds");
BMLog.log(LOG_COMPONENT, 0, "BM JMS: Unable to create connection to server: " + providerURL_, e);
if (e instanceof JMSException) {
Exception le = ((JMSException)e).getLinkedException();
if (le != null )
BMLog.log(LOG_COMPONENT, 0, "BM JMS: Linked Exception: ", le);
}
cleanup(true);
try {
Thread.sleep(nSleepSecs_.intValue() * 1000);
} catch (InterruptedException ie) {
BMLog.log(LOG_COMPONENT, 2, "Thread Exception ", ie);
}
}
BMLog.log(LOG_COMPONENT, 2, "bConnected_ :" + bConnected_);
BMLog.log(LOG_COMPONENT, 2, "BMThreadManager.aborted()" + BMThreadManager.aborted());
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093209#4093209
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093209
18Â years, 7Â months
[JBoss Seam] - Captcha image doesn't appear =(
by paulovittor23
Hi, Im trying to implement an exeample using the captcha feature but I'm getting a blank image when I run my application...
I think it's because the element "captcha" from the #{captcha.id} are null or something like that...
Reading the documentation I saw that I need to register the module captcha in the application.xml file, but this file does'nt exists in my seam app =(
It's really necessary ? Should I create it ?
The captcha servlet is declared at web.xml correctely, like above:
anonymous wrote :
|
| <servlet-name>Seam Resource Servlet</servlet-name>
| <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
|
|
| <servlet-mapping>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
And in the login page I added the folling code:
anonymous wrote :
|
| <h:graphicImage value="/seam/resource/captcha?#{captcha.id}"/>
|
|
|
| <h:outputLabel for="verifyCaptcha">Enter the above letters</h:outputLabel>
| <h:inputText id="verifyCaptcha" value="#{captcha.response}" required="true"/>
| <h:message for="verifyCaptcha"/>
|
|
Someone knows what it could be ?
I appreciate your attention =)
[]s
Paulo Vitor
São Paulo, Brazil
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093204#4093204
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093204
18Â years, 7Â months
[Security & JAAS/JBoss] - Re: writing new LoginModul - unable to replace Principal ??
by patwary_shiva
I am getting Bad password for username=admin
Below is the stack trace of the exception :
authInfo=AppConfigurationEntry[]:
[0]
LoginModule Class: org.jboss.security.ClientLoginModule
ControlFlag: LoginModuleControlFlag: required
Options:[1]
LoginModule Class: org.imixs.jboss.security.LdapLoginModuleExt
ControlFlag: LoginModuleControlFlag: required
Options:name=RoleSeachContext, value=ou=Groups, dc=axeda, dc=com
name=java.naming.security.principal, value=uid=admin, ou=Administrators, ou=TopologyManagement, o=NetscapeRoot
name=LoginNameSearch, value=(&(uid={0})(objectclass=person))
name=java.naming.factory.initial, value=com.sun.jndi.ldap.LdapCtxFactory
name=java.naming.security.credentials, value=admin
name=roleNameAttributeID, value=cn
name=roleFilter, value=(&(cn={0})(objectclass=groupofUniqueNames))]]</module-option>
<module-option name="baseFilter"><![CDATA[(&(uid={0})(objectclass=person))
name=java.naming.security.authentication, value=simple
name=java.naming.provider.url, value=ldap://leda.axeda.com:389/
name=roleAttributeID, value=cn
name=RoleSearch, value=(&(cn={0})(objectclass=groupofUniqueNames))
name=LoginNameSeachContext, value=ou=People, dc=axeda, dc=com
name=uidAttributeID, value=uniqueMember
name=LoginNameToCompositeName, value=true
name=roleAttributeIsDN, value=false
2007-10-09 16:19:42,694 TRACE [org.jboss.security.ClientLoginModule] Security domain: servicelinkdomain
2007-10-09 16:19:42,694 TRACE [org.jboss.security.ClientLoginModule] Enabling restore-login-identity mode
2007-10-09 16:19:42,694 TRACE [org.jboss.security.ClientLoginModule] Begin login
2007-10-09 16:19:42,694 TRACE [org.jboss.security.ClientLoginModule] Obtained login: admin, credential.class: [C
2007-10-09 16:19:42,694 TRACE [org.jboss.security.ClientLoginModule] End login
2007-10-09 16:19:42,725 DEBUG [org.imixs.jboss.security.LdapLoginModuleExt] Bad password for username=admin
2007-10-09 16:19:42,725 TRACE [org.jboss.security.ClientLoginModule] abort
2007-10-09 16:19:42,725 TRACE [org.jboss.security.SecurityAssociation] clear, server=true
2007-10-09 16:19:42,725 TRACE [org.jboss.security.plugins.JaasSecurityManager.servicelinkdomain] Login failure
javax.security.auth.login.FailedLoginException: Password Incorrect/Password Required
at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:213)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:603)
at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:537)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:491)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:258)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:417)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
2007-10-09 16:19:42,725 TRACE [org.jboss.security.plugins.JaasSecurityManager.servicelinkdomain] End isValid, false
below is the configuration:
<login-module code="org.jboss.security.ClientLoginModule" flag="required"/>
<login-module code="org.imixs.jboss.security.LdapLoginModuleExt" flag="required">
<module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
<module-option name="java.naming.provider.url">ldap://sample.sample.sample:389/</module-option>
<module-option name="java.naming.security.authentication">simple</module-option>
<module-option name="searchTimeLimit">5000</module-option>
<!-- searchScope is neccesary for Domino SUBTREE_SCOPE -->
<module-option name="searchScope"></module-option>
<!-- Params for Distinguished Name Search -->
<module-option name="LoginNameToCompositeName">false</module-option>
<module-option name="LoginNameSeachContext">ou=People, dc=axeda, dc=com</module-option>
<module-option name="LoginNameSearch"><![CDATA[(&(uid={0})(objectclass=person))]]></module-option>
<!-- Params for Role Search -->
<module-option name="roleAttributeID">cn</module-option>
<module-option name="RoleSeachContext">ou=Groups, dc=axeda, dc=com</module-option>
<module-option name="RoleSearch"><![CDATA[(&(cn={0})(objectclass=groupofUniqueNames))]]></module-option>
<!-- Principal und Credentials for ldap lookups -->
<module-option name="java.naming.security.principal">uid=admin, ou=Administrators, ou=TopologyManagement, o=NetscapeRoot</module-option>
<module-option name="java.naming.security.credentials">sample</module-option>
</login-module>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093201#4093201
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093201
18Â years, 7Â months
[JBoss Seam] - Re: Ajax4jsf UnboundedFifoBuffer
by asookazian
I reproduced the exception:
| Exception during request processing: javax.servlet.ServletException: org.apache.commons.collections.UnboundedFifoBuffer
|
in a Seam app using JBoss 4.0.5.GA and Seam 1.2.1.GA by adding the following to my build.xml for a seam-gen'd app:
| <copy todir="${war.dir}/WEB-INF/lib">
| <fileset dir="${lib.dir}">
| <include name="ajax4jsf*.jar" />
| <include name="richfaces*.jar" />
| <include name="oscache*.jar" />
| <include name="jsf-facelets.jar" />
| <include name="jboss-seam-*.jar" />
| <!-- include commons-*.jar files for JSF 1.2 -->
| <!--
| <include name="commons-digester-*.jar"/>
| <include name="commons-beanutils-*.jar"/>
| -->
| <exclude name="jboss-seam-gen.jar" />
|
|
Commenting the commons*.jar lines as above fixed it...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093198#4093198
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093198
18Â years, 7Â months