Tabnine Logo
ResourceException.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
javax.resource.ResourceException

Best Java code snippets using javax.resource.ResourceException.getMessage (Showing top 20 results out of 315)

origin: apache/geode

 /**
  * Destroys the underline physical connection to EIS.
  *
  * @param connectionObject connection Object.
  */
 @Override
 void destroyPooledConnection(Object connectionObject) {
  try {
   ((ManagedConnection) connectionObject)
     .removeConnectionEventListener((ConnectionEventListener) connEventListner);
   ((ManagedConnection) connectionObject).destroy();
   connectionObject = null;
  } catch (ResourceException rex) {
   if (logger.isTraceEnabled()) {
    logger.trace(
      "ManagedPoolcacheImpl::destroyPooledConnection:Exception in closing the connection.Ignoring it. The exeption is {}",
      rex.getMessage(), rex);
   }
  }
 }
}
origin: stackoverflow.com

 @ControllerAdvice
public class ExceptionHandlerAdvice { 

  @ExceptionHandler(ResourceException.class)
  public ResponseEntity handleException(ResourceException e) {
    // log exception 
    return ResponseEntity.status(e.getHttpStatus()).body(e.getMessage());
  }         
}
origin: com.java-adventures.rsc/remote-system-connector

@SuppressWarnings("unchecked")
@Override
public CONNECTION_TYPE getConnection() {
  log.debug("getConnection {} MCF: {}", this.cm, this.mcf);
  try {
    return (CONNECTION_TYPE) cm.allocateConnection(mcf,
        getConnectionRequestdebug());
  } catch (ResourceException ex) {
    throw new RuntimeException(ex.getMessage());
  }
}
origin: AdamBien/connectorz

@Override
public Bucket getBucket() {
  out.println("#FileBucketStore.getConnection " + this.cm + " MCF: " + this.mcf);
  try {
    return (Bucket) cm.allocateConnection(mcf, getConnectionRequestInfo());
  } catch (ResourceException ex) {
    throw new RuntimeException(ex.getMessage());
  }
}
origin: AdamBien/connectorz

@Override
public JCAExecutor newExecutor(){
  out.println("#WorkManagerExecutorFactory.getConnection " + this.cm + " MCF: " + this.mcf);
  try {
    return (JCAExecutor) cm.allocateConnection(mcf, null);
  } catch (ResourceException ex) {
    throw new RuntimeException(ex.getMessage(),ex);
  }
}
origin: org.objectweb.jonas/jonas-jca-jdbc-glue

public Connection getConnection() throws SQLException {
  if (isDebugOn) {
    mcf.trace.log(BasicLevel.DEBUG, "");
  }
  try {
    Connection con = (Connection) cm.allocateConnection(mcf, null);
    if (con == null) {
      SQLException se = new SQLException("Null connection object returned");
      throw se;
    }
    return con;
  } catch (ResourceException re) {
    throw new SQLException(re.getMessage());
  }
}
origin: org.apache.openejb/openejb-core

@Override
public Object invoke(final String actionName, final Object[] params, final String[] signature) throws MBeanException, ReflectionException {
  if (actionName.equals("stop")) {
    activationContext.stop();
  } else if (actionName.equals("start")) {
    try {
      activationContext.start();
    } catch (ResourceException e) {
      logger.error("Error invoking " + actionName + ": " + e.getMessage());
      throw new MBeanException(new IllegalStateException(e.getMessage(), e));
    }
  } else {
    throw new MBeanException(new IllegalStateException("unsupported operation: " + actionName));
  }
  return null;
}
origin: org.apache.tomee/openejb-core

@Override
public Object invoke(final String actionName, final Object[] params, final String[] signature) throws MBeanException, ReflectionException {
  if (actionName.equals("stop")) {
    activationContext.stop();
  } else if (actionName.equals("start")) {
    try {
      activationContext.start();
    } catch (ResourceException e) {
      logger.error("Error invoking " + actionName + ": " + e.getMessage());
      throw new MBeanException(new IllegalStateException(e.getMessage(), e));
    }
  } else {
    throw new MBeanException(new IllegalStateException("unsupported operation: " + actionName));
  }
  return null;
}
origin: org.apache.tomee/openejb-core

@Override
public Object invoke(final String actionName, final Object[] params, final String[] signature) throws MBeanException, ReflectionException {
  if (actionName.equals("stop")) {
    activationContext.stop();
  } else if (actionName.equals("start")) {
    try {
      activationContext.start();
    } catch (ResourceException e) {
      logger.error("Error invoking " + actionName + ": " + e.getMessage());
      throw new MBeanException(new IllegalStateException(e.getMessage(), e));
    }
  } else {
    throw new MBeanException(new IllegalStateException("unsupported operation: " + actionName));
  }
  return null;
}
origin: org.jboss.jbossas/jboss-as-connector

/**
* Returns the composite throwable message.
*
* @return  The composite throwable message.
*/
public String getMessage()
{
 return NestedThrowable.Util.getMessage(super.getMessage(), getLinkedException());
}
origin: eclipse-ee4j/glassfish

Connection getJaxrConnection()
 throws JAXRException
{
 checkIfValid();
 try
 {
  return this.mc.getJaxrConnection();
 }
 catch (ResourceException localResourceException)
 {
  throw new JAXRException(ResourceBundle.getBundle("com/sun/connector/jaxr/LocalStrings").getString("Unable_to_obtain_JAXR_Connection_") + localResourceException.getMessage());
 }
}

origin: org.springframework.data/spring-data-gemfire

  public static void close(boolean throwOnError, Consumer<String> logger) {
    get().ifPresent(connection -> {
      try {
        connection.close();
      }
      catch (ResourceException cause) {
        String message = String.format("Failed to close Pivotal GemFire Connection: %s", cause.getMessage());
        if (throwOnError) {
          throw newRuntimeException(cause, message);
        }
        else {
          logger.accept(message);
        }
      }
    });
  }
}
origin: org.springframework.data/spring-data-geode

  public static void close(boolean throwOnError, Consumer<String> logger) {
    get().ifPresent(connection -> {
      try {
        connection.close();
      }
      catch (ResourceException cause) {
        String message = String.format("Failed to close GemFire Connection: %s", cause.getMessage());
        if (throwOnError) {
          throw newRuntimeException(cause, message);
        }
        else {
          logger.accept(message);
        }
      }
    });
  }
}
origin: org.objectweb.jonas/jonas-jca-jdbc-glue

public Connection getConnection(String user, String pwd) throws SQLException {
  if (isDebugOn) {
    mcf.trace.log(BasicLevel.DEBUG, "" + user);
  }
  try {
    ConnectionRequestInfoImpl info = new ConnectionRequestInfoImpl(user, pwd);
    Connection con = (Connection) cm.allocateConnection(mcf, info);
    if (con == null) {
      SQLException se = new SQLException("Null connection object returned");
      throw se;
    }
    return con;
  } catch (ResourceException re) {
    throw new SQLException(re.getMessage());
  }
}
origin: org.firebirdsql.jdbc/jaybird-jdk18

/**
 * Helper method to create message text for constructor accepting
 * ResourceException ({@link #FBSQLException(ResourceException)})
 *
 * @param ex
 *            ResourceException
 * @return Exception message
 */
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
private static String createResourceMessage(ResourceException ex) {
  Throwable cause = resolveCause(ex);
  if (cause instanceof GDSException) {
    return createGDSExceptionMessage((GDSException) cause);
  }
  return "Resource Exception. " + ex.getMessage();
}
origin: org.firebirdsql.jdbc/jaybird-jdk17

/**
 * Helper method to create message text for constructor accepting
 * ResourceException ({@link #FBSQLException(ResourceException)})
 *
 * @param ex
 *            ResourceException
 * @return Exception message
 */
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
private static String createResourceMessage(ResourceException ex) {
  Throwable cause = resolveCause(ex);
  if (cause instanceof GDSException) {
    return createGDSExceptionMessage((GDSException) cause);
  }
  return "Resource Exception. " + ex.getMessage();
}
origin: eclipse-ee4j/glassfish

Connection getConnection(Properties paramProperties)
 throws JAXRException
{
 try
 {
  JaxrConnectionRequestInfo localJaxrConnectionRequestInfo = new JaxrConnectionRequestInfo(paramProperties);
  return (Connection)this.cm.allocateConnection(this.mcf, localJaxrConnectionRequestInfo);
 }
 catch (ResourceException localResourceException)
 {
  throw new JAXRException(localResourceException.getMessage());
 }
}

origin: eclipse-ee4j/glassfish

public Connection getConnection()
 throws JAXRException
{
 try
 {
  JaxrConnectionRequestInfo localJaxrConnectionRequestInfo = null;
  if (this.properties != null) {
   localJaxrConnectionRequestInfo = new JaxrConnectionRequestInfo(this.properties);
  }
  log.fine("JAXRConnectionFactory getConnection - ConnectionManager calling allocateConnection");
  return (Connection)this.cm.allocateConnection(this.mcf, localJaxrConnectionRequestInfo);
 }
 catch (ResourceException localResourceException)
 {
  throw new JAXRException(localResourceException.getMessage());
 }
}

origin: org.springframework.data/spring-data-gemfire

public static GFConnection acquire(GFConnectionFactory connectionFactory, boolean throwOnError,
    Consumer<String> logger) {
  try {
    return of(connectionFactory.getConnection());
  }
  catch (ResourceException cause) {
    String message =
      String.format("Failed to acquire Pivotal GemFire Connection from GemFire's JCA ResourceAdapter: %s",
        cause.getMessage());
    if (throwOnError) {
      throw newRuntimeException(cause, message);
    }
    else {
      logger.accept(message);
      return null;
    }
  }
}
origin: org.springframework.data/spring-data-geode

public static GFConnection acquire(GFConnectionFactory connectionFactory, boolean throwOnError,
    Consumer<String> logger) {
  try {
    return of(connectionFactory.getConnection());
  }
  catch (ResourceException cause) {
    String message =
      String.format("Failed to acquire GemFire Connection from GemFire's JCA ResourceAdapter: %s",
        cause.getMessage());
    if (throwOnError) {
      throw newRuntimeException(cause, message);
    }
    else {
      logger.accept(message);
      return null;
    }
  }
}
javax.resourceResourceExceptiongetMessage

Javadoc

Returns a detailed message string describing this exception.

Popular methods of ResourceException

  • <init>
    Constructs a new throwable with the specified cause.
  • getErrorCode
    Get the error code.
  • getCause
  • printStackTrace
  • getLinkedException
    Get the exception linked to this ResourceException
  • initCause
  • setLinkedException
    Add a linked Exception to this ResourceException.
  • toString
  • getHttpStatus
  • getStatus
  • setErrorCode
    Set the error code.
  • setErrorCode

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now