Skip to content

Commit

Permalink
Provide more accurate warning messages on XML parse failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
swaldman committed Mar 16, 2019
1 parent f38f276 commit a93dc64
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/java/com/mchange/v2/c3p0/cfg/C3P0Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,19 @@ private static C3P0Config findLibraryC3P0Config( boolean warn_on_conflicting_ove
}
catch (Exception e)
{

if ( logger.isLoggable(MLevel.WARNING) )
logger.log( MLevel.WARNING, "XML configuration disabled! Verify that standard XML libs are available.", e);
if ( e instanceof ClassNotFoundException )
{
if ( logger.isLoggable(MLevel.WARNING) )
logger.log( MLevel.WARNING, "XML configuration disabled! Verify that standard XML libs are available.", e);
}
else
{
if ( logger.isLoggable(MLevel.SEVERE) )
{
logger.log( MLevel.SEVERE, "An error occurred while trying to parse the XML configuration!" );
logger.log( MLevel.SEVERE, "XML CONFIGURATION IGNORED!", e);
}
}

HashMap flatDefaults = C3P0ConfigUtils.extractHardcodedC3P0Defaults();
flatDefaults.putAll( C3P0ConfigUtils.extractC3P0PropertiesResources() );
Expand Down
3 changes: 3 additions & 0 deletions src/test-properties/c3p0.properties
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ com.mchange.v2.log.MLog=slf4j
#com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL=ALL
#com.mchange.v2.log.jdk14logging.suppressStackWalk=true

#com.mchange.v2.c3p0.cfg.xml.usePermissiveParser=true
#com.mchange.v2.c3p0.cfg.xml.expandEntityReferences=true

#com.mchange.v2.c3p0.VMID=poop

#com.mchange.v2.resourcepool.experimental.useScatteredAcquireTask=false
Expand Down

0 comments on commit a93dc64

Please sign in to comment.