[Messaging, JMS & JBossMQ] - java.io.IOException: Client is not connected
by hskiran
Hello members,
I am getting the following exception during following scenarios:
1. If the date/time on the JBOSS server machine changes (example during day light saving time changes)
2.When network connection abrubtly disconnects and reconnects.
I am using 4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023).
In the error message it is mentioned ""use javax.jms.Connection.setExceptionListener() to handle this error and reconnect". I wrote the ExceptionListener, but what does it mean "reconnect" ? How it can be done programatically.
Exception as follows:
[org.jboss.mq.il.uil2.ServerSocketManagerHandler] Setting up the UILClientIL Connection
org.jboss.mq.Connection] Connection failure, use javax.jms.Connection.setExceptionListener() to handle this error and reconnect
org.jboss.mq.SpyJMSException: Cannot ping the JMS server; - nested throwable: (java.io.IOException: Client is not connected)
at org.jboss.mq.SpyJMSException.getAsJMSException(SpyJMSException.java:66)
at org.jboss.mq.SpyJMSException.rethrowAsJMSException(SpyJMSException.java:51)
at org.jboss.mq.Connection.pingServer(Connection.java:887)
at org.jboss.mq.Connection$PingTask.run(Connection.java:1327)
at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(ClockDaemon.java:364)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.IOException: Client is not connected
at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:238)
at org.jboss.mq.il.uil2.SocketManager.sendReply(SocketManager.java:224)
at org.jboss.mq.il.uil2.UILServerIL.ping(UILServerIL.java:462)
at org.jboss.mq.Connection.pingServer(Connection.java:883)
Thanks and Regards,
Shahsi Kiran
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985484#3985484
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985484
19Â years, 7Â months
[Tomcat, HTTPD, Servlets & JSP] - a problem about jboss
by shihuaguo
a example to demonstrate this problem:
two jsp pages:
hello.jsp:
| <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
|
| <HTML>
| <HEAD> <title>Input Name Page</title> </HEAD>
| <body bgcolor="white">
| <f:view>
| <h:form id="helloForm">
| <h:commandLink value="Say hello" action="sayhello"></h:commandLink>
| <h:commandLink value="Say hello2" action="sayhello"></h:commandLink>
| </h:form>
| </f:view>
| </body>
| </HTML>
|
sayhello.jsp
| <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
|
| <f:view>
| <h3>
| <t:outputText value="hello"/>
| </h3>
| </f:view>
|
faces-config.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE faces-config
| PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
| "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
| <faces-config>
|
| <navigation-rule>
| <from-view-id>/test/hello.jsp</from-view-id>
| <navigation-case>
| <from-outcome>sayhello</from-outcome>
| <to-view-id>/test/sayhello.jsp</to-view-id>
| <redirect />
| </navigation-case>
| </navigation-rule>
|
| </faces-config>
|
|
web.xml:
| <listener>
| <listener-class>
| org.apache.myfaces.webapp.StartupServletContextListener
| </listener-class>
| </listener>
| <servlet>
| <servlet-name>FacesServlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
| <servlet-mapping>
| <servlet-name>FacesServlet</servlet-name>
| <url-pattern>/faces/*</url-pattern>
| </servlet-mapping>
|
|
| <filter>
| <filter-name>LogFilter</filter-name>
| <filter-class>com.recency.XY0631.filter.LogFilter</filter-class>
| </filter>
| <filter-mapping>
| <filter-name>LogFilter</filter-name>
| <url-pattern>*.jsp</url-pattern>
| </filter-mapping>
|
|
then i did the following steps:
1, i visit hello.jsp in my internet explorer, the logger print "request url=.../hello.jsp" in console.
2,i click "Say hello" link , the page direct to sayhello.jsp , the logger print "request url=.../sayhello.jsp" in console.
3,i push "back" button on internet explorer, the page return to .../hello.jsp,the logger didn't print anything.
4,i click "Say hello" link , page didn't direct to sayhello.jsp ,the logger printed "request url=.../hello.jsp", (they acted as what they did in step 1)
5,i clicked "Say hello" link again, the page direct to sayhello.jsp ,the logger printed "request url=.../sayhello.jsp".
why i hava to click "Say hello" link twice?(i have used tomcat instead, it don't hava this problem)
is this a jboss's bug ?(i found the jbpm-starters-kit-3.1.2's default jboss server also have this problem)
thanks for any help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985483#3985483
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985483
19Â years, 7Â months
[JBoss Portal] - Re: Bug or not ? (request attributes lost)
by cyril.jouiï¼ supinfo.com
Hello,
I use a custom "faces-context-factory" in my faces-config.xml :
<factory>
| <faces-context-factory>com.labosun.portal.myfaces.context.PortletFacesContextFactory</faces-context-factory>
| </factory>
FacesContextImpl :
package com.labosun.portal.myfaces.context;
|
| import java.util.Iterator;
| import java.util.Set;
|
| import javax.faces.context.ExternalContext;
| import javax.portlet.PortletContext;
| import javax.portlet.PortletRequest;
| import javax.portlet.PortletResponse;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
| import org.apache.myfaces.context.ReleaseableExternalContext;
| import org.apache.myfaces.context.servlet.ServletFacesContextImpl;
|
| public class PortletFacesContextImpl extends ServletFacesContextImpl {
|
| private final static Log logger = LogFactory
| .getLog(PortletFacesContextImpl.class);
|
| public PortletFacesContextImpl(PortletContext ctx, PortletRequest request,
| PortletResponse response) {
| super(ctx, request, response);
| }
|
| public void setExternalContext(ReleaseableExternalContext context) {
| ExternalContext extNew = (ExternalContext) context;
|
| // update new external context
| Set keySet = getExternalContext().getRequestMap().keySet();
| Iterator keySetIt = keySet.iterator();
| while (keySetIt.hasNext()) {
| String att = (String) keySetIt.next();
| if (extNew.getRequestMap().get(att) == null) {
| extNew.getRequestMap().put(att,
| getExternalContext().getRequestMap().get(att));
| }
| }
| super.setExternalContext(context);
| }
| }
|
package com.labosun.portal.myfaces.context;
|
| import javax.faces.FacesException;
| import javax.faces.context.FacesContext;
| import javax.faces.context.FacesContextFactory;
| import javax.faces.lifecycle.Lifecycle;
| import javax.portlet.PortletContext;
| import javax.portlet.PortletRequest;
| import javax.portlet.PortletResponse;
|
| public class PortletFacesContextFactoryImpl extends FacesContextFactory {
|
| public FacesContext getFacesContext(Object context, Object request,
| Object response, Lifecycle lifecycle) throws FacesException {
|
| if (context == null) {
| throw new NullPointerException("context");
| }
| if (request == null) {
| throw new NullPointerException("request");
| }
| if (response == null) {
| throw new NullPointerException("response");
| }
| if (lifecycle == null) {
| throw new NullPointerException("lifecycle");
| }
|
| return new PortletFacesContextImpl((PortletContext) context,
| (PortletRequest) request, (PortletResponse) response);
| }
|
| }
|
It works .it! but it may have some troubles if you have many portlets which uses MyFaces in one page ... (maybe ... I have no problem but I didn't test
a lot !
Good luck !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985477#3985477
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985477
19Â years, 7Â months
[JCA/JBoss] - Slow DataSouce Failover
by jsicotte2
I am experiencing a slow failover when simulating a network failure. My setup consists of the following: Two servers, each with an instance of JBoss and MySQL running on them. I will refer to the servers as a "primary" and "backup". Both the primary and backup have their DataSources set to point to the MySQL instance running on the primary server. They are HA DataSources, so they also point to the backup server. I simulate a network failure by unplugging the primary from a network hub. Then the following happens:
1) The backup server/node detects the failure.
2) Several minutes go by after the cluster failure, and then our app is deployed.
After playing with Log4j settings and some more testing, I have narrowed the issue down to a set of failures:
2006-10-26 15:50:34,843 INFO [org.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:/DefaultDS
|
| 2006-10-26 15:51:06,343 WARN [org.jboss.resource.adapter.jdbc.local.HALocalManagedConnectionFactory] Destroying connection that is not valid
|
| 2006-10-26 15:51:50,484 WARN [org.jboss.resource.adapter.jdbc.local.HALocalManagedConnectionFactory] Destroying connection that is not valid
|
| 006-10-26 15:52:28,437 WARN [org.jboss.resource.adapter.jdbc.local.HALocalManagedConnectionFactory] Destroying connection that is not valid
|
| 2006-10-26 15:52:49,578 WARN [org.jboss.resource.adapter.jdbc.local.HALocalManagedConnectionFactory]
| Failed to create connection for jdbc:mysql://nscluster-3:4589/netsight: Communications link failure
Since the DataSouce connection pool size is set to a minimum of three, it seems that a database connection is not considered dead until all thread pool connections are timed out. The timeouts take a little over two minutes to complete, and if the minimum thread pool size was larger, the failover time would be protracted even more. Is there any way to reduce the duration of the timeouts and/or speed up this process?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985475#3985475
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985475
19Â years, 7Â months