Search in sources :

Example 6 with ServiceException

use of org.apache.openejb.server.ServiceException in project tomee by apache.

the class ServerServlet method service.

protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    if (!activated) {
        response.getWriter().write("");
        return;
    }
    ServletInputStream in = request.getInputStream();
    ServletOutputStream out = response.getOutputStream();
    try {
        RequestInfos.initRequestInfo(request);
        ejbServer.service(in, out);
    } catch (ServiceException e) {
        throw new ServletException("ServerService error: " + ejbServer.getClass().getName() + " -- " + e.getMessage(), e);
    } finally {
        RequestInfos.clearRequestInfo();
    }
}
Also used : ServletException(javax.servlet.ServletException) ServletInputStream(javax.servlet.ServletInputStream) ServiceException(org.apache.openejb.server.ServiceException) ServletOutputStream(javax.servlet.ServletOutputStream)

Example 7 with ServiceException

use of org.apache.openejb.server.ServiceException in project tomee by apache.

the class DerbyNetworkService method start.

@Override
public void start() throws ServiceException {
    if (this.disabled) {
        return;
    }
    try {
        this.serverControl = new NetworkServerControl(host, port);
        this.serverControl.start(new LoggingPrintWriter("Derby"));
        if (verbose) {
            LOGGER.info("Starting openejb-derbynet with derby " + serverControl.getRuntimeInfo() + " " + serverControl.getSysinfo());
        }
    } catch (Exception e) {
        throw new ServiceException(e);
    }
}
Also used : ServiceException(org.apache.openejb.server.ServiceException) NetworkServerControl(org.apache.derby.drda.NetworkServerControl) LoggingPrintWriter(org.apache.openejb.util.LoggingPrintWriter) IOException(java.io.IOException) ServiceException(org.apache.openejb.server.ServiceException)

Aggregations

ServiceException (org.apache.openejb.server.ServiceException)7 IOException (java.io.IOException)4 InetSocketAddress (java.net.InetSocketAddress)2 DatagramPacket (java.net.DatagramPacket)1 InetAddress (java.net.InetAddress)1 MulticastSocket (java.net.MulticastSocket)1 SocketAddress (java.net.SocketAddress)1 SocketException (java.net.SocketException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 UnknownHostException (java.net.UnknownHostException)1 Connection (java.sql.Connection)1 DatabaseMetaData (java.sql.DatabaseMetaData)1 SQLException (java.sql.SQLException)1 Map (java.util.Map)1 Properties (java.util.Properties)1 TreeSet (java.util.TreeSet)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ExecutorService (java.util.concurrent.ExecutorService)1 ReentrantLock (java.util.concurrent.locks.ReentrantLock)1 Binding (javax.naming.Binding)1