Tag Archives: The problem record

com.alibaba.fastjson .JSONException: For input string: “3000-01-01” or “9999-12-31”

FastJSON Parser exception after 2999 time range

Exception in thread "main" com.alibaba.fastjson.JSONException: For input string: "9999-12-31 00:00:00.000+0000"
    at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:665)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:365)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:269)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:488)
    at com.xxx.xxx.main(StpBpmVariableSetter.java:146)
Caused by: java.lang.NumberFormatException: For input string: "9999-12-31 00:00:00.000+0000"

FastJSON is known to be fixed in version 1.2.49, and can be fixed with an upgrade

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.49</version>
</dependency>

 

@Value gets the configuration file value and returns null

The @value gets the configuration file Value returns NULL
In custom parameters parser implementation HandlerMethodArgumentResolver subclasses, access to @ the Value label Value is null.
Example:

@Configuration
public class ArgumentResolverConfig extends WebMvcConfigurerAdapter {


    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) 
    {
        argumentResolvers.add(new UserArgumentResolver());
    }

}

Direct new UserArgumentResolver(), not managed by the Spring container, so use @value to get an invalid Value in the UserArgumentResolver
Revised:

@Configuration
public class ArgumentResolverConfig extends WebMvcConfigurerAdapter {

    @Bean
    public UserArgumentResolver getUserArgumentResolver(){
        return new UserArgumentResolver();
    }

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(getUserArgumentResolver());
    }
}

The @bean annotation is given to the Spring container-managed Bean, at which point @Value gets the configuration file Value.

Error 2104 Silverlight Could Not download the Silverlight Application

There are a number of online fixes for Error 2104, mostly because IIS doesn’t support Silverlight’s MIME type, but usually these don’t solve the problem. I hope you found this article helpful by listing how to fix the 2104 errors you encountered.
Recently, I have been working on a Silverlight + ASP.NET project. After the adoption of Sprint2, I found that my solution could not load Silverlight applications properly after Branch introduced the new Sprint3. The display error is:

Line: 56
Error: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight Application.check Web Server Settings
It’s strange that the same Solution loaded and ran well the last time. Check the MIME type Settings for IIS following the online prompts and find definitions for.xAP,.xAML, and.xBAP. So why is that?I stumbled upon the fact that in Silverlight Web projects, the default location for the compiled.xAP ClientBin directory is empty, which means there are no source objects needed for the Siliverlight control. Suddenly, there would be an error initializing Silverlight objects without a.xAP file.
Solution: Right-click a Web Project and select Project Denpendents, and in the dialog that opens, place the Silverlight Project as a dependent on the Web Project, so that each time it is compiled, the Silverlight Project is first compiled and the.xAP file is copied to the Web Project’s ClientBin(default) directory:


Of course, for some environments that haven’t run Silverlight projects, try adding MIME types first.