You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/03/23 08:12:18 UTC

[GitHub] [shardingsphere-elasticjob] BertOnline opened a new issue #1855: [Bug] shardingsphere-elasticjob-lite-ui-backend-3.0.0-RC1 bug

BertOnline opened a new issue #1855:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1855


   ## Bug Report
   
   ### Which version of ElasticJob did you use?
   3.0.0-RC1 
   
   ### Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?
   elasticjob-lite
   
   ### Expected behavior
   ![image](https://user-images.githubusercontent.com/17882970/112112846-fee89780-8bf0-11eb-86ec-4ad59277ee12.png)
   
   ### Actual behavior
   When I click the update button, I get an exception
   ```text
   Failed to specialize base type org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfiguration<org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration> as org.apache.shardingsphere.elasticjob.tracing.yaml.YamlTracingConfiguration, problem: Type parameter #1/1 differs; can not specialize org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration with org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration<$1> (through reference chain: org.apache.shardingsphere.elasticjob.lite.ui.web.response.ResponseResult["model"]->org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO["jobExtraConfigurations"]->java.util.ArrayList[0])
   ```
   
   ### Reason analyze (If you can)
   Error reason: Job configuration serialization exception, Jackson serialization failed
   Error location: JobConfigController- > get api/jobs/config/ {jobname}. After reading the configuration from ZK, use YamlEngine.unmarshal And then get JobConfigurationPOJO, The generic type of jobExtraConfigurations attribute in POJO is interface Collection<YamlConfiguration<JobExtraConfiguration>>, while the generic class after unmarshal is: Collection<YamlTracingConfiguration<YamlDataSourceConfiguration>>,, However, YamlDataSourceConfiguration is not a subclass of JobExtraConfiguration, which leads to serialization exception. It is found that jobExtraConfigurations is not used in job configuration through debugging at the front and rear ends. Therefore, the property is temporarily removed when returning, and then the property value before updating is reset.
   
   ### Example codes for reproduce this issue (such as a github link).
   ```java
   // JobConfigController
       
       /**
        * Get job configuration.
        *
        * @param jobName job name
        * @return job configuration
        */
       @GetMapping(value = "/{jobName:.+}")
       public ResponseResult<JobConfigurationPOJO> getJobConfig(@PathVariable("jobName") final String jobName) {
           JobConfigurationPOJO data = jobAPIService.getJobConfigurationAPI().getJobConfiguration(jobName);
           // fix serialize exception
           data.getJobExtraConfigurations().clear();
           //
           return ResponseResultUtil.build(data);
       }
       
       /**
        * Update job configuration.
        *
        * @param jobConfiguration job configuration
        */
       @PutMapping
       public ResponseResult<Boolean> updateJobConfig(@RequestBody final JobConfigurationPOJO jobConfiguration) {
           // for missing jobExtraConfiguration
           JobConfigurationPOJO old = jobAPIService.getJobConfigurationAPI().getJobConfiguration(jobConfiguration.getJobName());
           jobConfiguration.setJobExtraConfigurations(old.getJobExtraConfigurations());
           //
           jobAPIService.getJobConfigurationAPI().updateJobConfiguration(jobConfiguration);
           return ResponseResultUtil.build(Boolean.TRUE);
       }
    
   // JobConfigurationPOJO
    
   private Collection<YamlConfiguration<JobExtraConfiguration>> jobExtraConfigurations = new LinkedList<>();
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] BertOnline closed issue #1855: [Bug] shardingsphere-elasticjob-lite-ui-backend-3.0.0-RC1 bug

Posted by GitBox <gi...@apache.org>.
BertOnline closed issue #1855:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1855


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org