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

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


                    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

    }

    public Object createConnectionFactory(ConnectionManager connMgr) throws ResourceException {
        LOG.info("connManager=" + connMgr);
        if (connMgr == null) {
            throw new ResourceAdapterInternalException("Non-Managed usage is not supported, "
                        + "the ConnectionManager argument can not be null");
        }
        init(connMgr.getClass().getClassLoader());
        //jcaBusFactory.setAppserverClassLoader(connMgr.getClass().getClassLoader());
        LOG.fine("Setting AppServer classloader in jcaBusFactory. " + connMgr.getClass().getClassLoader());
View Full Code Here

    public Object getConnection(Class iface, URL wsdlLocation, QName serviceName, QName portName)
        throws ResourceException {
       
        if (!iface.isInterface()) {
            throw new ResourceAdapterInternalException(
                    "The first argument to getConnection must be an Interface",
                    new IllegalArgumentException(iface.toString() + " is not an Interface."));
        }

        LOG.info("connecting to: " + iface);
View Full Code Here

        try {
            //REVISIT we need to use the CXF defualt BusFactory
            bf = org.apache.cxf.BusFactory.newInstance(getBusClassName());
            bus = bf.createBus();
        } catch (Exception ex) {
            throw new ResourceAdapterInternalException("Failed to initialize cxf runtime", ex);
        }

        return bus;
    }
View Full Code Here

            //extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/", httpTransport);
           
            bus.setExtension(new WSDLManagerImpl(), WSDLManager.class);

        } catch (Exception ex) {
            throw new ResourceAdapterInternalException("Failed to initialize cxf runtime", ex);
        }
    }
View Full Code Here

        } catch (Exception ex) {
            if (ex instanceof ResourceAdapterInternalException) {
                throw (ResourceException)ex;
            } else {
                ex.printStackTrace();
                throw new ResourceAdapterInternalException("Failed to initialize connector runtime", ex);
            }
        } finally {
            Thread.currentThread().setContextClassLoader(original);
        }
    }
View Full Code Here

        // java:/ejbs/A={http:/a/b/b}SoapService@http://localost:wsdls/a.wsdl

        try {
            jndiContext = new InitialContext();
        } catch (NamingException ne) {
            throw new ResourceAdapterInternalException(
                      "Failed to construct InitialContext for EJBServant(s) jndi lookup, reason: "
                       + ne, ne);
        }

        deregisterServants(bus);
View Full Code Here

        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

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.