Package org.apache.cactus.util

Examples of org.apache.cactus.util.ChainedRuntimeException


    public InputStream getInputStream()
    {
        try {
            return this.connection.getInputStream();
        } catch (IOException e) {
            throw new ChainedRuntimeException(e);
        }
    }
View Full Code Here


                            getConnection().getURL().getPort()),
                        Cookie.getCookiePath(getWebRequest(),
                            getConnection().getURL().getFile()),
                        new Header(headerName, headerValue));
                } catch (HttpException e) {
                    throw new ChainedRuntimeException(
                        "Error parsing cookies", e);
                }

                // Transform the HttpClient cookies into Cactus cookies and
                // add them to the cookieVector vector
View Full Code Here

            // In JDK 1.2 URLDecoder.decode throws an Exception. This is not
            // needed for JDK 1.3+ but needed to keep JDK 1.2.2 compatibility
            try {
                value = URLDecoder.decode(value);
            } catch (Exception e) {
                throw new ChainedRuntimeException("Error URL decoding ["
                    + value + "]", e);
            }
        }

        return value;
View Full Code Here

            reason += "\t- The server is not running,\r\n";
            reason += "\t- The server redirector is not correctly mapped in "
                + "web.xml,\r\n";
            reason += "\t- Something else ... !";

            throw new ChainedRuntimeException(reason);
        }

        return out;
    }
View Full Code Here

            Constructor constructor = connectionHelperClass.getConstructor(
                new Class[] {String.class});
            connectionHelper = (ConnectionHelper) constructor.newInstance(
                new Object[] {theUrl});
        } catch (Exception e) {
            throw new ChainedRuntimeException("Failed to load the ["
                + Configuration.getConnectionHelper() + "] ConnectionHelper "
                + "class", e);
        }

        return connectionHelper;
View Full Code Here

     */
    public HttpSessionCookie getSessionCookie()
    {
        if (getConfiguration() == null)
        {
            throw new ChainedRuntimeException("setConfiguration() should have "
                + "been called prior to calling getSessionCookie()");
        }
       
        ConnectionHelper helper = ConnectionHelperFactory.getConnectionHelper(
            ((WebConfiguration) getConfiguration()).getRedirectorURL(this),
            getConfiguration());

        WebRequest obtainSessionIdRequest = new WebRequest(
            (WebConfiguration) getConfiguration());
           
       
        //Not sure whether I should be adding the service parameter to
        //this request (this) or to the obtainSessionIdRequest
        //seems obvious that it should be the obtainSessionIdRequest
        RequestDirectives directives =
            new RequestDirectives(obtainSessionIdRequest);
        directives.setService(ServiceEnumeration.CREATE_SESSION_SERVICE);

        HttpURLConnection resultConnection;
        try
        {
            resultConnection =
                helper.connect(obtainSessionIdRequest, getConfiguration());
        }
        catch (Throwable e)
        {
            throw new ChainedRuntimeException("Failed to connect to ["
                + ((WebConfiguration) getConfiguration()).getRedirectorURL(this)
                + "]", e);
        }

        WebResponse response;
        try
        {
            response =
                (WebResponse) new WebResponseObjectFactory().getResponseObject(
                    WebResponse.class.getName(),
                    obtainSessionIdRequest,
                    resultConnection);
        }
        catch (ClientException e)
        {
            throw new ChainedRuntimeException("Failed to connect to ["
                + ((WebConfiguration) getConfiguration()).getRedirectorURL(this)
                + "]", e);
        }

        Cookie cookie = response.getCookieIgnoreCase("jsessionid");
View Full Code Here

                config = new PropertyResourceBundle(
                    new FileInputStream(configOverride));
            }
            catch (IOException e)
            {
                throw new ChainedRuntimeException(
                    "Cannot read cactus configuration file ["
                    + configOverride + "]", e);
            }
        }
View Full Code Here

        // from the Cactus configuration file.
        String contextURL = System.getProperty(CACTUS_CONTEXT_URL_PROPERTY);

        if (contextURL == null)
        {
            throw new ChainedRuntimeException("Missing Cactus property ["
                + CACTUS_CONTEXT_URL_PROPERTY + "]");
        }

        return contextURL;
    }
View Full Code Here

        // from the Cactus configuration file.
        String contextURL = System.getProperty(CACTUS_CONTEXT_URL_PROPERTY);

        if (contextURL == null)
        {
            throw new ChainedRuntimeException("Missing Cactus property ["
                + CACTUS_CONTEXT_URL_PROPERTY + "]");
        }

        return contextURL;
    }
View Full Code Here

                config = new PropertyResourceBundle(
                    new FileInputStream(configOverride));
            }
            catch (IOException e)
            {
                throw new ChainedRuntimeException(
                    "Cannot read cactus configuration file ["
                    + configOverride + "]", e);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.cactus.util.ChainedRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.