Encountered a weird behavior when running my Spring Boot + JSF (PrimeFaces) application in Docker container (using java -jar xxx.jar as ENTRYPOINT). It keep complaining “xhtml Not Found in ExternalContext as a Resource” when I access the page, in fact that runs well either using java -jar command or mvn spring:run in host machine.
After some hard time, manage to figure out why…….. phew….
… it was caused by wrong jar packaging structure, and correct structure should look as below:
Nearly didn’t remember when was the last time I celebrate Merdeka (at least hoisting our national flag in front of house). But I feel a little special this year as many Merdeka celebration mtv shared around social media 🙂
~Happy Merdeka Malaysia~
Happened to me hence jot down here for future reference, perhaps helpful to you also 🙂
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed.
Error: "Connection refused: connect. Verify the connection properties.
Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port.
Make sure that TCP connections to the port are not blocked by a firewall.
Try to configure the TCP port as below from Sql Server Configuration Manager:
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'xxxx'.
Try to configure as below from Microsoft SQL Server Management Studio:
Has been a while, I was thinking to blog this out but “lazy” bugs keep biting me 🙁 so I didn’t manage to do it. Until yesterday, I was looking for some related info but I hardly recall what I did previously. Phew… so decided to jot down here.
Typically software application should at least perform 2 types of automate tests which are unit test and integration test. For me… the distinction between these two are pretty straight forward:
Test on smallest unit of application such as method / function
Test on combination of few units in application to prove they run nicely with external resource (if there is any)
Cheap to run, fast to run (normally less than a minute)
Slower compared with unit test (normally few minutes or more)
NOT depends on external resources such as database, third party services, disk access
Normally involve database, disk access, other services
Report generated in <PROJECT>/target/surefire-reports
Report generated in <PROJECT>/target/failsafe-reports
By viewing the status report generated by surefire & failsafe plugin doesn’t create much insight, but we can make use of Jacoco plugin to create code coverage report as below. Here are minimal sample Maven configuration for Jacoco:
Jacoco coverage reports generated at <PROJECT>/target/site/* when we run mvn verify (bind to maven verify phase). To view the coverage reports, simply open <PROJECT>/target/site/jacoco/index.html with browser.
Yay ! we have now cover first part of test (automate unit + integration test), and if you notice, we done all steps manually (run maven command, open report from target folder) just to get the report display.
Moreover, we just able to view the coverage report locally, how if we want to share with other team members or to make it public accessible.
And…….. How can we automate the whole process ?
Da.. Dang !! We have Jenkins (Continuous Integration) + SonarQube (Continuous Code Quality Inspection) to help us 🙂
Setting up Jenkins is pretty straight forward, just follow steps from Jenkins Guided Tour or Installing Jenkins. We should able to see something as below if Jenkins setup successfully and launch in browser. Let’s continue with SonarQube setup by following “Get Started in Two Minutes” guide from it’s official site. And if nothing goes wrong, we should able to bring up SonarQube console via browser as below: Until this stage, you might feel a little tired or sleepy, it’s okie to refresh yourself with a cup of coffee 🙂
To allow Jenkins to work with SonarQube, we might need a little setup as below.
Generate authentication token from SonarQube and store it somewhere as steps below for subsequent Jenkins configuration use.
Goto Manage Jenkins –> Configure System, There should have SonarQube configuration module available.
Just configure it by click on AddSonarQube, and fill in necessary information (sample below), then Save it.
Trying to flash my niece’s phone with other rom which hope to have light weight OS, but no luck and end up with infinite boot screen load 🙁
Google around but also no luck to get any useful info (at least for this model of phone), some people sharing to use SP Flash, any other alternative which doesn’t work for my case too. End up I found the solution from ZTE site, which is to download the original rom and flash it…. phew….