Skip to main content

ActivationException

java.rmi.activation.ActivationException

ActivationException is described in the javadoc comments as:

General exception used by the activation interfaces.

As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism. The 'detail exception' that may be provided at construction time and accessed via the public {link: #detail} field is now known as the cause, and may be accessed via the {link: Throwable#getCause()} method, as well as the aforementioned 'legacy field.'

Invoking the method {link: Throwable#initCause(Throwable)} on an instance of ActivationException always throws {@link IllegalStateException}.
author: Ann Wollrath version: 1.24, 12/19/03 since: 1.2

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.

java.rmi.activation.ActivationGroup.createGroup(ActivationGroupID, ActivationGroupDesc, long)

/**
     * Create and set the activation group for the current VM.  The
     * activation group can only be set if it is not currently set.
     * An activation group is set using the <code>createGroup</code>
     * method when the <code>Activator</code> initiates the
     * re-creation of an activation group in order to carry out
     * incoming <code>activate</code> requests. A group must first be
     * registered with the <code>ActivationSystem</code> before it can
     * be created via this method.
     * The group class specified by the
     * <code>ActivationGroupDesc</code> must be a concrete subclass of
     * <code>ActivationGroup</code> and have a public constructor that
     * takes two arguments: the <code>ActivationGroupID</code> for the
     * group and the <code>MarshalledObject</code> containing the
     * group's initialization data (obtained from the
     * <code>ActivationGroupDesc</code>.
     * If the group class name specified in the
     * <code>ActivationGroupDesc</code> is <code>null</code>, then
     * this method will behave as if the group descriptor contained
     * the name of the default activation group implementation class.
     * Note that if your application creates its own custom
     * activation group, a security manager must be set for that
     * group.  Otherwise objects cannot be activated in the group.
     * <code>java.rmi.RMISecurityManager</code> is set by default.
     * If a security manager is already set in the group VM, this
     * method first calls the security manager's
     * <code>checkSetFactory</code> method.  This could result in a
     * <code>SecurityException</code>. If your application needs to
     * set a different security manager, you must ensure that the
     * policy file specified by the group's
     * <code>ActivationGroupDesc</code> grants the group the necessary
     * permissions to set a new security manager.  (Note: This will be
     * necessary if your group downloads and sets a security manager).
     * After the group is created, the
     * <code>ActivationSystem</code> is informed that the group is
     * active by calling the <code>activeGroup</code> method which
     * returns the <code>ActivationMonitor</code> for the group. The
     * application need not call <code>activeGroup</code>
     * independently since it is taken care of by this method.
     * Once a group is created, subsequent calls to the
     * <code>currentGroupID</code> method will return the identifier
     * for this group until the group becomes inactive.
     * @param id the activation group's identifier
     * @param desc the activation group's descriptor
     * @param incarnation the group's incarnation number (zero on group's
     * initial creation)
     * @return the activation group for the VM
     * @exception ActivationException if group already exists or if error
     * occurs during group creation 
     * @exception SecurityException if permission to create group is denied.
     * (Note: The default implementation of the security manager 
     * <code>checkSetFactory</code>
     * method requires the RuntimePermission 'setFactory')
     * @see SecurityManager#checkSetFactory
     * @since 1.2
     */
public static synchronized ActivationGroup createGroup(ActivationGroupID id, final ActivationGroupDesc desc, long incarnation) throws ActivationException {
    SecurityManager security = System.getSecurityManager();
    if (security != null) security.checkSetFactory();
    if (currGroup != null) throw new ActivationException('group already exists');
    if (canCreate == false) throw new ActivationException('group deactivated and ' + 'cannot be recreated');
    try {
        String groupClassName = desc.getClassName();
        if (groupClassName == null) {
            groupClassName = sun.rmi.server.ActivationGroupImpl.class.getName();
        }
        final String className = groupClassName;
        Class cl;
        try {
            cl = (Class) java.security.AccessController.doPrivileged(new PrivilegedExceptionAction() {

                public Object run() throws ClassNotFoundException, MalformedURLException {
                    return RMIClassLoader.loadClass(desc.getLocation(), className);
                }
            });
        } catch (PrivilegedActionException pae) {
            throw new ActivationException('Could not load default group ' + 'implementation class', pae.getException());
        }
        Constructor constructor = cl.getConstructor(groupConstrParams);
        Object[] params = new Object[] { id, desc.getData() };
        Object obj = constructor.newInstance(params);
        if (obj instanceof ActivationGroup) {
            ActivationGroup newGroup = (ActivationGroup) obj;
            currSystem = id.getSystem();
            newGroup.incarnation = incarnation;
            newGroup.monitor = currSystem.activeGroup(id, newGroup, incarnation);
            currGroup = newGroup;
            currGroupID = id;
            canCreate = false;
        } else {
            throw new ActivationException('group not correct class: ' + obj.getClass().getName());
        }
    } catch (java.lang.reflect.InvocationTargetException e) {
        e.getTargetException().printStackTrace();
        throw new ActivationException('exception in group constructor', e.getTargetException());
    } catch (ActivationException e) {
        throw e;
    } catch (Exception e) {
        throw new ActivationException('exception creating group', e);
    }
    return currGroup;
}

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

java.rmi.activation.ActivationGroup.setSystem(ActivationSystem)

/**
     * Set the activation system for the VM.  The activation system can
     * only be set it if no group is currently active. If the activation
     * system is not set via this call, then the <code>getSystem</code>
     * method attempts to obtain a reference to the
     * <code>ActivationSystem</code> by looking up the name
     * 'java.rmi.activation.ActivationSystem' in the Activator's
     * registry. By default, the port number used to look up the
     * activation system is defined by
     * <code>ActivationSystem.SYSTEM_PORT</code>. This port can be overridden
     * by setting the property <code>java.rmi.activation.port</code>.
     * If there is a security manager, this method first
     * calls the security manager's <code>checkSetFactory</code> method.
     * This could result in a SecurityException.
     * @param system remote reference to the <code>ActivationSystem</code>
     * @exception ActivationException if activation system is already set
     * @exception SecurityException if permission to set the activation system is denied.
     * (Note: The default implementation of the security manager 
     * <code>checkSetFactory</code>
     * method requires the RuntimePermission 'setFactory')
     * @see #getSystem
     * @see SecurityManager#checkSetFactory
     * @since 1.2
     */
public static synchronized void setSystem(ActivationSystem system) throws ActivationException {
    SecurityManager security = System.getSecurityManager();
    if (security != null) security.checkSetFactory();
    if (currSystem != null) throw new ActivationException('activation system already set');
    currSystem = system;
}

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

java.rmi.activation.ActivationGroup.currentGroup()

/**
     * Returns the current group for the VM.
     * @exception ActivationException if current group is null (not active)
     */
static synchronized ActivationGroup currentGroup() throws ActivationException {
    if (currGroup == null) {
        throw new ActivationException('group is not active');
    }
    return currGroup;
}

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

java.rmi.activation.ActivationGroup.internalCurrentGroupID()

/**
     * Returns the activation group identifier for the VM.  If an
     * activation group does not exist for this VM, a default
     * activation group is created. A group can be created only once,
     * so if a group has already become active and deactivated.
     * @return the activation group identifier
     * @exception ActivationException if error occurs during group
     * creation, if security manager is not set, or if the group
     * has already been created and deactivated.
     */
static synchronized ActivationGroupID internalCurrentGroupID() throws ActivationException {
    if (currGroupID == null) throw new ActivationException('nonexistent group');
    return currGroupID;
}

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

java.rmi.activation.ActivationGroup.getSystem()

/**
     * Returns the activation system for the VM. The activation system
     * may be set by the <code>setSystem</code> method. If the
     * activation system is not set via the <code>setSystem</code>
     * method, then the <code>getSystem</code> method attempts to
     * obtain a reference to the <code>ActivationSystem</code> by
     * looking up the name 'java.rmi.activation.ActivationSystem' in
     * the Activator's registry. By default, the port number used to
     * look up the activation system is defined by
     * <code>ActivationSystem.SYSTEM_PORT</code>. This port can be
     * overridden by setting the property
     * <code>java.rmi.activation.port</code>.
     * @return the activation system for the VM/group
     * @exception ActivationException if activation system cannot be
     *  obtained or is not bound
     * (means that it is not running)
     * @see #setSystem
     * @since 1.2
     */
public static synchronized ActivationSystem getSystem() throws ActivationException {
    if (currSystem == null) {
        try {
            int port;
            port = ((Integer) java.security.AccessController.doPrivileged(new GetIntegerAction('java.rmi.activation.port', ActivationSystem.SYSTEM_PORT))).intValue();
            currSystem = (ActivationSystem) Naming.lookup('//:' + port + '/java.rmi.activation.ActivationSystem');
        } catch (Exception e) {
            throw new ActivationException('unable to obtain ActivationSystem', e);
        }
    }
    return currSystem;
}

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

Recovering WebLogic Passwords

In one of my previous articles ( here ) I explained that the SerializedSystemIni.dat file in WebLogic contains the key used to encrypt and decrypt passwords. If you're not currently keeping this file secure I suggest you do, as with it someone can (to name a few things): Decrypt the WebLogic admin username and password from boot.properties. Recover database passwords, if JDBC Connection pools are configured, from config.xml. Recover the keystore passwords from config.xml and obtain SSL certificates stored in the jks keystores. Essentially, they can do whatever they want, so if you don't know who can read your SerializedSystemIni.dat files, look... now. In this article I will show how easy it is for this file to be used to recover lost passwords via a simple WLST script. The Script The script I use to decrypt passwords is incredibly short, and it works with WebLogic 8, 9 and 10 (probably for version 7 too). To use it, just create a new file called decryptpwd.py and paste the fol