Buggy code:
public class NuxeoContainer { protected static final Log log = LogFactory . getLog ( NuxeoContainer . class ) ; public static final String JNDI_TRANSACTION_MANAGER = "java:comp//TransactionManager" ; public static final String JNDI_USER_TRANSACTION = "java:comp//UserTransaction" ; public static final String JNDI_NUXEO_CONNECTION_MANAGER = "java:comp//NuxeoConnectionManager" ; private static NuxeoContainer . TransactionManagerWrapper transactionManager ; private static final UserTransaction userTransaction = new NuxeoContainer . UserTransactionImpl ( ) ; private static NuxeoContainer . ConnectionManagerWrapper connectionManager ; private static boolean isInstalled ; private static Context parentContext ; private static Map < String , Object > parentEnvironment = new HashMap < String , Object > ( ) ; protected static Context rootContext ; private NuxeoContainer ( ) { } public static synchronized void install ( ) throws NamingException { } public static synchronized void install ( NuxeoContainer . TransactionManagerConfiguration txconfig , NuxeoContainer . ConnectionManagerConfiguration cmconfig ) throws NamingException { } public static synchronized boolean isInstalled ( ) { } public static synchronized void uninstall ( ) throws NamingException { } public static synchronized void installNaming ( ) throws NamingException { } public static synchronized void uninstallNaming ( ) { } protected static void setupRootContext ( ) throws NamingException { } protected static void setAsInitialContext ( ) { } protected static void revertSetAsInitialContext ( ) { } public static void addDeepBinding ( String name , Object obj ) throws InvalidNameException , NamingException { } protected static void addDeepBinding ( Context dir , CompositeName comp , Object obj ) throws NamingException { } protected static void addBinding ( Context dir , Name name , Object obj ) throws NamingException { } protected static void removeBinding ( String name ) throws NamingException { } @ SuppressWarnings ( "unchecked" ) protected static < T > T resolveBinding ( String name ) throws NamingException { } public static TransactionManager getTransactionManager ( ) { } protected static Reference getTransactionManagerReference ( ) { } public static UserTransaction getUserTransaction ( ) throws NamingException { } protected static Reference getUserTransactionReference ( ) { } public static ConnectionManager getConnectionManager ( ) { } protected static Reference getConnectionManagerReference ( ) { } public static synchronized void initTransactionManager ( NuxeoContainer . TransactionManagerConfiguration config ) throws NamingException { } protected static NuxeoContainer . TransactionManagerWrapper lookupTransactionManager ( ) { } public static synchronized void initConnectionManager ( NuxeoContainer . ConnectionManagerConfiguration config ) throws NamingException { } public static synchronized void resetConnectionManager ( ) throws Exception { } protected static NuxeoContainer . ConnectionManagerWrapper lookupConnectionManager ( ) { } protected static TransactionManager createTransactionManager ( NuxeoContainer . TransactionManagerConfiguration config ) { } public static class UserTransactionImpl implements UserTransaction { protected boolean checked ; protected void check ( ) throws SystemException { } @ Override public int getStatus ( ) throws SystemException { } @ Override public void setRollbackOnly ( ) throws IllegalStateException , SystemException { } @ Override public void setTransactionTimeout ( int seconds ) throws SystemException { } @ Override public void begin ( ) throws NotSupportedException , SystemException { check ( ) ; NuxeoContainer . transactionManager . begin ( ) ; } @ Override public void commit ( ) throws IllegalStateException , SecurityException , HeuristicMixedException , HeuristicRollbackException , RollbackException , SystemException { } @ Override public void rollback ( ) throws IllegalStateException , SecurityException , SystemException { } } protected static GenericConnectionManager createConnectionManager ( NuxeoContainer . ConnectionManagerConfiguration config ) throws NamingException { } public static class TransactionManagerConfiguration { public int transactionTimeoutSeconds = 600 ; public void setTransactionTimeoutSeconds ( int transactionTimeoutSeconds ) { } } public static class TransactionManagerWrapper implements RecoverableTransactionManager { protected TransactionManager tm ; public TransactionManagerWrapper ( TransactionManager tm ) { } @ Override public Transaction suspend ( ) throws SystemException { } @ Override public void setTransactionTimeout ( int seconds ) throws SystemException { } @ Override public void setRollbackOnly ( ) throws IllegalStateException , SystemException { } @ Override public void rollback ( ) throws IllegalStateException , SecurityException , SystemException { } @ Override public void resume ( Transaction tobj ) throws IllegalStateException , InvalidTransactionException , SystemException { } @ Override public Transaction getTransaction ( ) throws SystemException { } @ Override public int getStatus ( ) throws SystemException { } @ Override public void commit ( ) throws IllegalStateException , SecurityException , HeuristicMixedException , HeuristicRollbackException , RollbackException , SystemException { } @ Override public void begin ( ) throws SystemException { try { tm . begin ( ) ; } catch ( javax . transaction . NotSupportedException e ) { <START_BUG> new RuntimeException ( e ) ; <END_BUG> } } @ Override public void recoveryError ( Exception e ) { } @ Override public void registerNamedXAResourceFactory ( NamedXAResourceFactory arg0 ) { } @ Override public void unregisterNamedXAResourceFactory ( String arg0 ) { } } public static class ConnectionManagerWrapper implements ConnectionManager { private static final long serialVersionUID = 1L ; protected AbstractConnectionManager cm ; protected final NuxeoContainer . ConnectionManagerConfiguration config ; public ConnectionManagerWrapper ( AbstractConnectionManager cm , NuxeoContainer . ConnectionManagerConfiguration config ) { } @ Override public Object allocateConnection ( ManagedConnectionFactory managedConnectionFactory , ConnectionRequestInfo connectionRequestInfo ) throws ResourceException { } public void reset ( ) throws Exception { } } public static class ConnectionManagerConfiguration { public String name = "NuxeoConnectionManager" ; public boolean useTransactionCaching = true ; public boolean useThreadCaching = true ; public boolean matchOne = true ; public boolean matchAll = true ; public boolean selectOneNoMatch = false ; public boolean partitionByConnectionRequestInfo = false ; public boolean partitionBySubject = true ; public int maxPoolSize = 20 ; public int minPoolSize = 0 ; public int blockingTimeoutMillis = 100 ; public int idleTimeoutMinutes = 0 ; public void setName ( String name ) { } public void setUseTransactionCaching ( boolean useTransactionCaching ) { } public void setUseThreadCaching ( boolean useThreadCaching ) { } public void setMatchOne ( boolean matchOne ) { } public void setMatchAll ( boolean matchAll ) { } public void setSelectOneNoMatch ( boolean selectOneNoMatch ) { } public void setPartitionByConnectionRequestInfo ( boolean partitionByConnectionRequestInfo ) { } public void setPartitionBySubject ( boolean partitionBySubject ) { } public void setMaxPoolSize ( int maxPoolSize ) { }

Fix:
throw new RuntimeException ( e ) ;