[ 
https://issues.apache.org/jira/browse/WW-5593?focusedWorklogId=996127&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-996127
 ]

ASF GitHub Bot logged work on WW-5593:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Dec/25 18:50
            Start Date: 14/Dec/25 18:50
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #1469:
URL: https://github.com/apache/struts/pull/1469#issuecomment-3651807892

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1469) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [1 New 
issue](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1469&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1469&issueStatuses=ACCEPTED)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1469&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [100.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1469&metric=new_coverage&view=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1469&metric=new_duplicated_lines_density&view=list)
  
     
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1469)
   
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 996127)
    Time Spent: 0.5h  (was: 20m)

> Convention plugin fails with NoClassDefFoundError when scanning classes with 
> missing dependencies
> -------------------------------------------------------------------------------------------------
>
>                 Key: WW-5593
>                 URL: https://issues.apache.org/jira/browse/WW-5593
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>            Reporter: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.2.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The convention plugin's {{PackageBasedActionConfigBuilder}} catches only 
> {{ClassNotFoundException}} but not {{NoClassDefFoundError}} when testing 
> action class candidates. This causes complete application startup failures 
> instead of graceful degradation when classes have missing optional 
> dependencies.
> *Impact*:
> - Application fails to start when convention plugin encounters classes with 
> unavailable dependencies
> - Particularly affects users setting struts.convention.action.includeJars
> - Common during redeployment or with optional dependencies (e.g., JUnit for 
> test classes)
> *Current behavior* (PackageBasedActionConfigBuilder.java:664):
> {code:java}
>   } catch (ClassNotFoundException ex) {
>       LOG.error("Unable to load class [{}]", classInfo.getName(), ex);
>       return false;
>   }
> {code}
> *Expected behavior*:
> Should also catch NoClassDefFoundError, following the pattern used in 
> DefaultClassFinder and other Struts core classes (DefaultInterceptorFactory, 
> XmlDocConfigurationProvider).
> *Proposed fix*:
> {code:java}
>   } catch (ClassNotFoundException | NoClassDefFoundError ex) {
>       LOG.error("Unable to load class [{}]. Perhaps it exists but certain 
> dependencies are not available?",
>                 classInfo.getName(), ex);
>       return false;
>   }
> {code}
> *Reproduction*:
> 1. Use convention plugin with struts.convention.action.includeJars configured
> 2. Deploy application without JUnit dependency at runtime
> 3. Convention plugin attempts to scan org.apache.struts2.XWorkTestCase
> 4. Application fails with NoClassDefFoundError instead of logging and 
> continuing
> *Related classes*:
> - PackageBasedActionConfigBuilder.java (line 664)
> - DefaultClassFinder.java (correct pattern at line 283-286)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to