com.sun.tools.attach.AgentLoadException The exception thrown when an agent cannot be loaded into the target Java virtual machine.

This exception is thrown by {@link VirtualMachine#loadAgent VirtualMachine.loadAgent} or{@link VirtualMachine#loadAgentLibrary VirtualMachine.loadAgentLibrary}, {@link VirtualMachine#loadAgentPath loadAgentPath} methodsif the agent, or agent library, cannot be loaded.

* implementation so this isn 't necessary )
int rc = x.returnValue () ;
switch ( rc ) {
case JNI_ENOMEM:
throw new AgentLoadException ( "Insuffient memory" ) ;
case ATTACH_ERROR_BADJAR:
throw new AgentLoadException ( "Agent JAR not found or no Agent-Class attribute" ) ;
case ATTACH_ERROR_NOTONCP:
throw new AgentLoadException ( "Unable to add JAR file to system class path" ) ;
case ATTACH_ERROR_STARTFAIL:
throw new AgentInitializationException ( "Agent JAR loaded but agent failed to initialize" ) ;
default :
throw new AgentLoadException ( "Failed to load agent - unknown reason: " + rc ) ;
// read completion status
int status = readInt ( is ) ;
if ( status != 0 ) {
// special case the load command so that the right exception is thrown
if ( cmd.equals ( "load" )) {
throw new AgentLoadException ( "Failed to load agent library" ) ;
} else {
throw new IOException ( "Command failed in target VM" ) ;
}
// Special-case the "load" command so that the right exception is
// thrown.
if ( cmd.equals ( "load" )) {
throw new AgentLoadException ( "Failed to load agent library" ) ;
} else {
throw new IOException ( "Command failed in target VM" ) ;
View Full Code Here
// If non-0 it means an error but we need to special-case the
// "load" command to ensure that the right exception is thrown.
if ( completionStatus != 0 ) {
sis.close () ;
if ( cmd.equals ( "load" )) {
throw new AgentLoadException ( "Failed to load agent library" ) ;
} else {
throw new IOException ( "Command failed in target VM" ) ;
}
// Special-case the "load" command so that the right exception is
// thrown.
if ( cmd.equals ( "load" )) {
throw new AgentLoadException ( "Failed to load agent library" ) ;
} else {
throw new IOException ( "Command failed in target VM" ) ;
// If non-0 it means an error but we need to special-case the
// "load" command to ensure that the right exception is thrown.
if ( completionStatus != 0 ) {
sis.close () ;
if ( cmd.equals ( "load" )) {
throw new AgentLoadException ( "Failed to load agent library" ) ;
} else {
throw new IOException ( "Command failed in target VM" ) ;
// read completion status
int status = readInt ( is ) ;
if ( status != 0 ) {
// special case the load command so that the right exception is thrown
if ( cmd.equals ( "load" )) {
throw new AgentLoadException ( "Failed to load agent library" ) ;
} else {
throw new IOException ( "Command failed in target VM" ) ;
222
}
// Special-case the "load" command so that the right exception is
// thrown.
if ( cmd.equals ( "load" )) {
throw new AgentLoadException ( "Failed to load agent library" ) ;
} else {
throw new IOException ( "Command failed in target VM" ) ;
* implementation so this isn 't necessary )
int rc = x.returnValue () ;
switch ( rc ) {
case JNI_ENOMEM:
throw new AgentLoadException ( "Insuffient memory" ) ;
case ATTACH_ERROR_BADJAR:
throw new AgentLoadException ( "Agent JAR not found or no Agent-Class attribute" ) ;
case ATTACH_ERROR_NOTONCP:
throw new AgentLoadException ( "Unable to add JAR file to system class path" ) ;
case ATTACH_ERROR_STARTFAIL:
throw new AgentInitializationException ( "Agent JAR loaded but agent failed to initialize" ) ;
default :
throw new AgentLoadException ( "Failed to load agent - unknown reason: " + rc ) ;

Related Classes of com.sun.tools.attach.AgentLoadException

  • sun.tools.attach.BsdVirtualMachine
  • sun.tools.attach.HotSpotVirtualMachine
  • sun.tools.attach.SolarisVirtualMachine
  • sun.tools.attach.LinuxVirtualMachine
  • sun.tools.attach.WindowsVirtualMachine
  •