Package org.apache.cxf.jca.core.resourceadapter

Examples of org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException


        Class interfaceClass = null;
        ClassLoader ejbClassLoader = null;
        ClassLoader currentThreadContextClassLoader = null;
        try {
            if ("".equals(serviceName)) {
                throw new ResourceAdapterInternalException(
                              "A WSDL service QName must be specified as the value of the EJB JNDI name key: "
                              + jndiName);
            } else {
                serviceQName = serviceQNameFromString(serviceName);

                serviceQNameFromString(serviceName);
               
                // Get ejbObject
                ejb = getEJBObject(jndiName);
                ejbClassLoader = ejb.getClass().getClassLoader();

                //NOTE we can use the ejbClassLoader to load WSDL
                currentThreadContextClassLoader = Thread.currentThread().getContextClassLoader();
                Thread.currentThread().setContextClassLoader(ejbClassLoader);
                              
                Thread.currentThread().setContextClassLoader(currentThreadContextClassLoader);

                nameSpace = serviceQName.getNamespaceURI();
                packageName = PackageUtils.parsePackageName(nameSpace, null);
               
                // Get interface of ejbObject
                interfaceName = jndiName.substring(0, jndiName.length() - 4);
                interfaceName = packageName + "." + interfaceName;

                interfaceClass = Class.forName(interfaceName);
               
                // NOTE We can check the annoation to descide which kind of frontend we will use
                // Almostly we just need to use the jax-ws frontend
                // If we have wsdl , then wsdl first,
                // else code first
               
                servant = publishServantWithoutWSDL(ejb, jndiName, nameSpace, interfaceClass);
            }
        } catch (Exception e) {
            throw new ResourceAdapterInternalException(e.getMessage());
        }
        synchronized (servantsCache) {
            if (servant != null) {
                servantsCache.add(servant);
            }
View Full Code Here


        boolean retVal = false;

        if (mcf.getMonitorEJBServiceProperties().booleanValue()) {
            URL url = mcf.getEJBServicePropertiesURLInstance();
            if (url == null) {
                throw new ResourceAdapterInternalException(
                           "MonitorEJBServiceProperties property is set to true,"
                           + " but EJBServicePropertiesURL is not set. "
                           + "Both properties must be set to enable monitoring.");
            }
            retVal = isFileURL(url);
View Full Code Here

        LOG.info("loadProperties, url=" + propsUrl);

        try {
            istream = propsUrl.openStream();
        } catch (IOException ioe) {
            throw new ResourceAdapterInternalException("Failed to openStream to URL, value=" + propsUrl
                                                       + ", reason:" + ioe, ioe);
        }

        try {
            props = new Properties();
            props.load(istream);
        } catch (IOException ioe) {
            props = null;
            throw new ResourceAdapterInternalException("Failed to load properties from " + propsUrl, ioe);
        } finally {
            try {
                istream.close();
            } catch (IOException ignored) {
                //do nothing here
View Full Code Here

                } else {
                    lp = t;
                }
            }
        } catch (java.util.NoSuchElementException nsee) {
            throw new ResourceAdapterInternalException(
                       "Incomplete QName, string is not in expected format: "
                       + "[{namespace}]local part[@ wsdl location url]. value:"
                       + qns, nsee);
        }
        LOG.fine("QN=" + qns + ", ns=" + nameSpace + ", lp=" + lp);
View Full Code Here

            StringTokenizer st = new StringTokenizer(qns, ",@", true);
            while (st.hasMoreTokens()) {
                String t = st.nextToken();
                if (",".equals(t)) {
                    if (portName != null) {
                        throw new ResourceAdapterInternalException(
                                   "portName already set, string is not in expected format:"
                                   + " [{namespace}]serviceName[,portName][@ wsdl location url]. value:"
                                   + qns);
                    }

                    portName = st.nextToken();

                    if ("@".equals(portName)) {
                        throw new ResourceAdapterInternalException(
                                   "Empty portName, string is not in expected format: "
                                   + "[{namespace}]serviceName[,portName][@ wsdl location url]. value:"
                                   + qns);
                    }
                }
            }
        } catch (java.util.NoSuchElementException nsee) {
            throw new ResourceAdapterInternalException(
                       "Incomplete QName, string is not in expected format: "
                       + "[{namespace}]serviceName[,portName][@ wsdl location url]. value:"
                       + qns, nsee);
        }
        return portName;
View Full Code Here

    }

    public void setResourceAdapter(ResourceAdapter aRA) throws ResourceException {
        LOG.info("Associate Resource Adapter with ManagedConnectionFactory by appserver. ra = " + ra);
        if (!(aRA instanceof ResourceAdapterImpl)) {
            throw new ResourceAdapterInternalException(
                "ResourceAdapter is not correct, it should be instance of ResourceAdapterImpl");
        }
        this.ra = aRA;
        mergeResourceAdapterProps();
    }
View Full Code Here

        }
    }

    protected void registerBus() throws ResourceException {
        if (ra == null) {
            throw new ResourceAdapterInternalException("ResourceAdapter can not be null");
        }
       
        ((ResourceAdapterImpl)ra).registerBus(getBus());
    }
View Full Code Here

                    connectionHandleActive = true;
                }

            }
        } catch (Exception ex) {        
            throw new ResourceAdapterInternalException("Error associating handle " + arg0
                                                       + " with managed connection " + this, ex);
        }
    }
View Full Code Here

                    obj = service.getPort(arReqInfo.getPortQName(), arReqInfo.getInterface());
                }
                setSubject(subject);
                return createConnectionProxy(obj, arReqInfo, subject);
            } catch (WebServiceException wse) {
                throw new ResourceAdapterInternalException("Failed to create proxy client for service "
                                                           + crInfo, wse);
            } finally {
//                Thread.currentThread().setContextClassLoader(orig);
            }

        }

        try {
            Object obj = null;
            Service service = Service.create(wsdlLocationUrl, serviceName);
            if (arReqInfo.getPortQName() != null) {               
                obj = service.getPort(arReqInfo.getPortQName(), arReqInfo.getInterface());
            } else {
                obj = service.getPort(arReqInfo.getInterface());
               
            }

            setSubject(subject);
            return createConnectionProxy(obj, arReqInfo, subject);

        } catch (WebServiceException wse) {
            throw new ResourceAdapterInternalException("Failed to getPort for " + crInfo, wse);
        } finally {
            Thread.currentThread().setContextClassLoader(orig);
        }
    }
View Full Code Here

    protected void validateReference(AbstractManagedConnectionImpl conn, javax.security.auth.Subject subj) {
    }

    public Object createConnectionFactory() throws ResourceException {
        throw new ResourceAdapterInternalException("Non-Managed usage is not supported, "
                        + "use createConnectionFactory with a ConnectionManager argument");
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException

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.