Package webapp

Examples of webapp.WebAppException


//            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);

            unmarshaller = ctx.createUnmarshaller();

        } catch (JAXBException e) {
            throw new WebAppException("Jaxb init failed", e);
        }
    }
View Full Code Here


    public <T> T unmarshall(Reader reader)  {
        try {
            return (T) unmarshaller.unmarshal(reader);
        } catch (JAXBException e) {
            throw new WebAppException("Jaxb unmarshall failed", e);
        }
    }
View Full Code Here

    public void marshall(Object instance, Writer writer) {
        try {
            marshaller.marshal(instance, writer);
        } catch (JAXBException e) {
            throw new WebAppException("Jaxb marshal failed", e);
        }
    }
View Full Code Here

    public DirectConnection()  {
        try {
            Class.forName("org.postgresql.Driver").newInstance();
        } catch (Exception e) {
            throw new WebAppException("Driver initialization exception", e);
        }
    }
View Full Code Here

        try (Connection conn = CONN_FACTORY.getConnection(); PreparedStatement st = conn.prepareStatement(sql)) {
            T res =  executor.execute(st);
            st.execute();
            return res;
        } catch (SQLException e) {
            throw new WebAppException("Error executing '" + sql + "'", e);
        }
    }
View Full Code Here

            } catch (SQLException e) {
                conn.rollback();
                throw e;
            }
        } catch (SQLException e) {
            throw new WebAppException("Transaction failed", e);
        }
    }
View Full Code Here

        Assert.assertEquals(new MinMax<String>(null).new Pair("-5", "9"), p2);
    }

    @Test(expected = WebAppException.class)
    public void testException() throws Exception {
        throw new WebAppException("test");
    }
View Full Code Here

                                while (rs.next()) {
                                    addContact(rs, resume);
                                }
                                return resume;
                            }
                            throw new WebAppException("Resume " + uuid + " is not found");
                        }
                    }
                }
        );
    }
View Full Code Here

            @Override
            public Void execute(PreparedStatement st) throws SQLException {
                st.setString(1, uuid);

                if (st.executeUpdate() == 0) {
                    throw new WebAppException("Resume not found", uuid);
                }
                return null;
            }
        });
    }
View Full Code Here

                            st.setString(1, resume.getFullName());
                            st.setString(2, resume.getHomePage());
                            st.setString(3, resume.getLocation());
                            st.setString(4, resume.getUuid());
                            if (st.executeUpdate()==0) {
                                throw new WebAppException("Resume not found", resume);
                            }
                        }
                        replaceContact(conn, resume);
                        return null;
                    }
View Full Code Here

TOP

Related Classes of webapp.WebAppException

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.