Skip to main content

CommunicationException

com.sun.jmx.snmp.daemon.CommunicationException

CommunicationException is described in the javadoc comments as:

Represents exceptions raised due to communications problems, for example when a managed object server is out of reach.

This API is a Sun Microsystems internal API and is subject to change without notice.


version: 1.19 12/19/03 author: Sun Microsystems, Inc

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.jmx.snmp.daemon.SnmpAdaptorServer.doBind()

/**
     * Creates the datagram socket.
     */
protected void doBind() throws CommunicationException, InterruptedException {
    try {
        synchronized (this) {
            socket = new DatagramSocket(port, address);
        }
        dbgTag = makeDebugTag();
    } catch (SocketException e) {
        if (e.getMessage().equals(InterruptSysCallMsg)) throw new InterruptedException(e.toString()); else {
            if (isDebugOn()) {
                debug('doBind', 'cannot bind on port ' + port);
            }
            throw new CommunicationException(e);
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.snmp.daemon.SnmpAdaptorServer.doReceive()

/**
     * Reads a packet from the datagram socket and creates a request 
     * handler which decodes and processes the request.
     */
protected void doReceive() throws CommunicationException, InterruptedException {
    try {
        packet = new DatagramPacket(new byte[bufferSize], bufferSize);
        socket.receive(packet);
        int state = getState();
        if (state != ONLINE) {
            if (isTraceOn()) {
                trace('doReceive', 'received a message but state not online, returning.');
            }
            return;
        }
        createSnmpRequestHandler(this, servedClientCount, socket, packet, root, mibs, ipacl, pduFactory, userDataFactory, topMBS, objectName);
    } catch (SocketException e) {
        if (e.getMessage().equals(InterruptSysCallMsg)) throw new InterruptedException(e.toString()); else throw new CommunicationException(e);
    } catch (InterruptedIOException e) {
        throw new InterruptedException(e.toString());
    } catch (CommunicationException e) {
        throw e;
    } catch (Exception e) {
        throw new CommunicationException(e);
    }
    if (isTraceOn()) {
        trace('doReceive', 'received a message');
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

com.sun.jmx.snmp.daemon.CommunicatorServer.waitForStart(long)

/**
     * Waits until the communicator is started or timeout expires.
     * @param timeout Time in ms to wait for the connector to start.
     *        If <code>timeout</code> is positive, wait for at most
     *        the specified time. An infinite timeout can be specified
     *        by passing a <code>timeout</code> value equals 
     *        <code>Long.MAX_VALUE</code>. In that case the method
     *        will wait until the connector starts or fails to start. 
     *        If timeout is negative or zero, returns as soon as possible 
     *        without waiting.
     * @exception CommunicationException if the connectors fails to start.
     * @exception InterruptedException if the thread is interrupted or the
     *            timeout expires.
     */
private void waitForStart(long timeout) throws CommunicationException, InterruptedException {
    if (isTraceOn()) trace('waitForStart', 'Timeout=' + timeout + ' ; current state = ' + getStateString());
    final long startTime = System.currentTimeMillis();
    synchronized (stateLock) {
        while (state == STARTING) {
            final long elapsed = System.currentTimeMillis() - startTime;
            final long remainingTime = timeout - elapsed;
            if (remainingTime < 0) {
                if (isTraceOn()) trace('waitForStart', 'timeout < 0, return without wait');
                throw new InterruptedException('Timeout expired');
            }
            try {
                stateLock.wait(remainingTime);
            } catch (InterruptedException e) {
                if (isTraceOn()) trace('waitForStart', 'wait interrupted');
                if (state != ONLINE) throw e;
            }
        }
        if (state == ONLINE) {
            if (isTraceOn()) trace('waitForStart', 'started');
            return;
        } else if (startException instanceof CommunicationException) {
            throw (CommunicationException) startException;
        } else if (startException instanceof InterruptedException) {
            throw (InterruptedException) startException;
        } else if (startException != null) {
            throw new CommunicationException(startException, 'Failed to start: ' + startException);
        } else {
            throw new CommunicationException('Failed to start: state is ' + getStringForState(state));
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Comments

Popular posts from this blog

NullPointerException

java.lang.NullPointerException NullPointerException is described in the javadoc comments as: Thrown when an application attempts to use null in a case where an object is required. These include: Calling the instance method of a null object. Accessing or modifying the field of a null object. Taking the length of null as if it were an array. Accessing or modifying the slots of null as if it were an array. Throwing null as if it were a Throwable value. Applications should throw instances of this class to indicate other illegal uses of the null object. author: unascribed version: 1.19, 12/19/03 since: JDK1.0 Where is this exception thrown? Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown. The message ' java.lang.NullPointerException: ' is thrown within the method: com.sun.corba.se.impl.interceptors.ClientRequestInfoImpl.get_r

Connection refused: No available router to destination

This is a simple symptom-cause-solution blog entry only. I hope these blogs will help fellow administrators. Symptom The following exception occurs in WebLogic server logs. Most likely to occur during WebLogic server start-up, but similar exceptions may occur at other times. java.net.ConnectException: t3://myserver:8000: Destination unreachable; nested exception is: java.net.ConnectException: Connection refused: connect; No available router to destination] at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:49) at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773) at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:363) at weblogic.jndi.Environment.getContext(Environment.java:307) at weblogic.jndi.Environment.getContext(Environment.java:277) Cause This message (Connection refused: connect; No available

SocketException

java.net.SocketException SocketException is described in the javadoc comments as: Thrown to indicate that there is an error in the underlying protocol, such as a TCP error. author: Jonathan Payne version: 1.17, 12/19/03 since: JDK1.0 Where is this exception thrown? Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown. The message ' java.net.SocketException: ... ' is thrown within the method: java.net.ServerSocket.createImpl() The message ' java.net.SocketException: ... ' is thrown within the method: java.net.Socket.createImpl(boolean) The message ' java.net.SocketException: ... ' is thrown within the method: java.net.SocksSocketImpl.connect(SocketAddress, int) The message ' java.net.SocketException: ... ' is thrown within the method: java.net.SocksSocketImpl.socksBind(InetSocketAddress) The message