Tuesday, March 2, 2021
legacy: Netbeans v.6.7.1 Installation - JDK not found issue
Saturday, February 20, 2021
Git: FAILURE DUE TO CORRUPTED FILE: remote: error: inflate: data stream error ... remote: error: unable to unpack ... remote: fatal: loose object ... error: remote unpack failed:
>PROBLEM
>SOLUTION
After some research, the best documentation to fix this was "Recovering from repository corruption" but also comments that against corruption the best alternative is a backup.
Although having backups, it didn't help in this case because the backups also had exactly the same issue since a backup is a copy. Because it is not an incremental copy, the backup was useless.
SAVING THE PAST
Faster than trying to fix it for the sake of time saving, the corrupted remote repository was renamed from "code" to "code_corrupted_200220" and saved its copy.
This backup may be used to get some previous commit, or even an attempt to fix it if really necessary just because it is required an old version of a file. Since "clone" command was able to clone to local repository although the warning, this corrupted remote repository is still useful to recover old stuff.
GOING AHEAD WITH THE FUTURE
mkdir clone
cd clone
The old one is preserved in the backup mentioned above, just in case.
The procedure was usual except that it is required to set upstream, resembling the procedure when a remote repository is switched (git remote remove origin, git remote add origin new_path).
git commit -am "MACHINE_NAME: corrupted remote repository switching"
git pull origin master
git push --set-upstream origin master
The same procedure was repeated to all local clients.
In such cases it would be useful to have two files in different positions on the disk, in order to recover the information from a particular damaged disk position. This should be really an option because it would double the resources' requirement, but sometimes it is a desirable option if hardware has the power to supply this redundancy without being noticeable and disk space is not a restriction.
The full disk was checked successfully. No errors found, except this occurrence.
>ENV
Monday, February 15, 2021
How to use VS Code with Multiple Configurations with Backup
>PROBLEM
You need to work with different environments and workspaces for different purposes when working with different programming languages or different contexts.
For each context or environment, you've installed the desired extensions.
Also, it is interesting to keep a backup of the environment to save time.
What does happen next?
If you have just one configuration setup and many needs, the VS Code configuration begins growing, eventually getting heavy, slow, and taking too much memory.
Also, the extensions' default shortcuts begin to conflict with each other.
>SOLUTION
There are at least three approaches:
1. Versioning control using branches, or
2. Separate configuration folders, or
3. Option 1 plus option 2.
Versioning control using branches
The VS Code default folder that holds its configuration setup is under
"C:\Users\YOUR_LOGIN\.vscode" folder.
Create a git repository there.
For each kind of environment desired, create a specific branch.
The master branch would aggregate everything, but in this case, there is no use unless you do want to keep a backup of just one setup.
Separate configuration folders
The default folder is at:
%USERPROFILE%\.vscode\extensions
Before creating the symbolic link, move the default extension folder to the new place desired, then create it:
mklink /D %USERPROFILE%\.vscode\extensions "NEW_PATH_DESIRED\extensions"
Ex.:
mklink /D C:\Users\YOUR_USER\.vscode\extensions "D:\ide_home\vscode\Code\extensions"
Option 1 plus option 2
You may combine the two options above, but better if the branches keep a keyword to avoid losing control.
The best of all is that you never lose your env, never need to reconfigure, and may switch fast the environments preserving then VS Code app from getting messed and slow.
ATTEMPT FAILURE NOTE
Wednesday, February 3, 2021
Blue Screen with one of the following messages: windows system error STATUS_WAIT_2 0x80070002 or windows system error STATUS_WAIT_3 0x80070003
>PROBLEM
When rebooting the machine, returned blue screen with the following message:
windows system error STATUS_WAIT_3 0x80070003
Another attempt, returned another message:
windows system error STATUS_WAIT_2 0x80070002
>SCENARIO
The machine was very, very slow, and once in a while appeared "bad clusters". This situation took several weeks. During all this time, the checklist below passed:
HD fragmentation: OK
HD S.M.A.R.T. status and test: OK
Scandisk: no errors, OK
Antivirus: disabled during the tests.
Unexpected processes consuming CPU's resources: none
Internet connection: disabled
All programs closed, just the usual services were turned on.
Hardware temperature: OK
Windows Registry: OK
Suddenly, when a reboot is done, the blue screen with the messages.
All attempts possible were performed — all "Windows Recovery" options failed, returning messages like "not possible", "done but failed", and things like that. Fixing reboot, cloning a new reboot partition from a backup HD, attempt to restore an image or restore the system from a "restore point" and etc. had failed.
>SOLUTION
The HD was removed from the slot and inserted back twice.
An intermittent bad contact caused maybe by slight oxidation, dust, vibration, etc. was causing the unexpected "bad blocks".
In this scenario, the Windows system made an automatic update that was not able to get to the end.
Considering the two problems together plus interrupted update procedure, the mess was complete.
The solution came, after solving the contact issue, let Windows finishes the update. Long and twice, but the issue was solved but the system was inconsistent, missing several DLLs, requiring more one more solution.
This time at least was possible to restore to a previous point before the unlucky Windows update and perform again that required update.
When rare events happen to get together at the same time, just Murphy explains! :-)
Eventually, the system was up and running again!
Well done Windows!!! Wow!!!
>ENV
Saturday, January 23, 2021
Git: Updates were rejected because a pushed branch tip is behind its remote counterpart
>PROBLEM
Git push fails returning "Updates were rejected because a pushed branch tip is behind its remote counterpart...".
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to .. SOME DIR PATH
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
>SOLUTION
Following the hint suggested in the output:
git push --help
The --force option solves:
git push --force origin master
Because it was behind the counterpart, it may cause some side effect on log.
When performed the command, everything was fine, no issues, but another client had to push with --force flag too, but no further issues.
>ENV
Windows 10
Git version 2.19.1.windows.1
Tuesday, January 19, 2021
Slow Machine? Warn Up - Check this before it is too late
>PROBLEM
Also, you have noticed that the system requires HD fixes, leading to scans to fix block references, more frequently than usual.
>SOLUTION
Free: HD Clone, Disk Genius
Paid: DriveClone, EaseUS Partition Master
TIP
If you have split your HD into two partitions, for instance, "C:" for Windows and "D:" for data, you get a better chance to solve this issue and gain more time until the HD replacement by moving your data on "D:" partition to another disk and deleting D:.
In this case, the HD will be less required and the issue may slow down, giving you an extra time before the HD substitution, something that may save you time, money and opportunity.
I've solved recently an issue like this just deleting the data partition. The HD got half work to do, so the situation became bearable. On the remaining free space, I cloned the "C:", getting to "C:" partitions on the same disk, but one of them disable at a time. If the HD's initial boot is preserved, when the active "C:" partition is gone, you may switch to the other just activating it. After you finish your work, you may clone the active "C:" partition to replace the defective one.
This saved me many hours during an urgent work that I couldn't stop for long maintenance and enabled me to deliver the task on time.
Always consider using different partitions for the system and the data, even if working with other S.O. different of Windows.
>ENV
Git rebase fails to continue
>PROBLEM
git pull --rebase
Details here
>SOLUTION
>ENV
Monday, January 18, 2021
git: 'credential-cache' is not a git command. See 'git --help'.
>PROBLEM
git: 'credential-cache' is not a git command. See 'git --help'.
>SOLUTION
Edit .git\config fille and remove:
[credential]
helper = cache
>ENV
Windows 10
Tuesday, December 15, 2020
MariaDB: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
>PROBLEM
This procedure resets the MariaDB root password when it is not possible to access the database returning:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
>SOLUTION
- Stop database:
sudo systemctl stop mariadb
- Test:
sudo systemctl status mariadb
You shall get;
Status: "MariaDB server is down"
To return to console, use Ctrl+C
- This command shall return empty:
sudo pgrep mysqld
- Starting the database using safe mode:
sudo mysqld_safe --skip-grant-tables --skip-networking &
or
sudo mysqld_safe --skip-grant-tables &
"Enter" to return to prompt.
USING A TEMPORARY PASSWORD
mysql -u root
use mysql;
flush privileges;
update user SET PASSWORD=PASSWORD('secret') WHERE USER='root';
GRANT ALL PRIVILEGES ON root.* TO 'root'@'localhost' WITH GRANT OPTION;
flush privileges;
quit
- kill all mysqld processes
sudo pgrep mysqld
- Kill by the PID numbers returned, for example:
sudo kill -9 1234
sudo kill -9 4567
- Start the database:
sudo systemctl start mariadb
WHEN THE DATABASE FAILS TO START
- To check:
TESTING AND SWITCHING TO DEFINITIVE PASSWORD
- Access the database again to test the "secret" temporary password and also to change to the definitive password:
mysql -u root -p
pass: secret
use mysql;
flush privileges;
UPDATE mysql.user SET authentication_string = PASSWORD('MY_DEFINITIVE_PASSWORD') WHERE User = 'root' AND Host = 'localhost';
GRANT ALL PRIVILEGES ON root.* TO 'root'@'localhost' WITH GRANT OPTION;
GRANT RELOAD ON *.* TO 'root'@'localhost';
flush privileges;
quit
- Access the database again to test the definitive password:
mysql -u root -p
pass: MY_DEFINITIVE_PASSWORD
***NOTE:
If after switching to the definitive password, the problem comes back denying access, it is because the characters used in the password caused the issue.
Avoid password like this:
Abc1234#-_ (the -_ didn't work during my attempts)
For sure, use a password with just numbers and letters.
To get confidence, repeat the procedure.
If you desire to use special chars, you may try after making sure that you got success at least once, that way you may discover which special char to avoid in your password.
>ENV
debian 10/9
10.x , 10.3.27-MariaDB
DIFFERENT BEHAVIORS DUE TO ENVIRONMENT DIFFERENCES
This procedure was executed several times successfully, but you may get some issue with some command shown above.
Below, there are some alternatives, not all of them of course, that you may try if some command fails.
set password for 'root'@'localhost' = password('secret');
- or
ALTER USER 'root'@'localhost' IDENTIFIED BY 'secret';
ADDITIONAL SOURCES
www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password
robbinespu.github.io/eng/2018/03/29/Reset_mariadb_root_password.html
ALTERNATIVE SITE
alsdias.blogspot.com/2020/12/mariadb-error-1045-28000-access-denied.html
@SYSREF:
y;reset root password<memo<mariadb;.
Monday, December 14, 2020
Wi-Fi modem/router fails to connect via wi-fi or RJ-45
>PROBLEM
The "ZTE MF253L LTE Wireless" Wi-Fi modem/router sometimes fails to accept Wi-Fi connections and comes with issues when using RJ-45.
A very odd defect that occurred after some years of usage.
>SOLUTION
ZTE MF253L has not a wide signal range but works well.
Instead of buying another modem/router, I decided to use a tp-link Wireless N 450Mbps router, model TL-WR940N, connected to the ZTE's internet output, using the RJ-45 cable.
The TL-WR940N model has a good signal range.
Now, I connect the notebooks direct to the tp-link router, instead of to the ZTE's, solving the connection issues. No more problems, at all.
Sometimes, when the ZTE's direct connection is not failing, it is possible to use it without the tp-link, but it is not an advantage at all, but remains as an alternative in case of a casual tp-link failure.
When the provider's connection fails, the Window's wi-fi connections keeps the tp-link router active waiting and as soon as the connection is on again and nothing is changed on the notebooks connected to the tp-link.
This saves time when the failures are short.
If not, you may connect to the tp-link another modem/router using another number, a second option when you have it, without changing clients' configurations. If you have many machines, it helps a lot.
For some reason, sometimes Windows fails to reconnect the Wi-Fi, forcing to do a reboot.
This workaround also avoids this reboot.
Thursday, November 26, 2020
Git: ! [remote rejected] master -> master (unable to migrate objects to permanent storage) error: failed to push some refs to 'ssh://REPOSITORY_PATH_HERE'
>PROBLEM
git push
! [remote rejected] master -> master (unable to migrate objects to permanent storage)
error: failed to push some refs to 'ssh://REPOSITORY_PATH_HERE'
>SOLUTION
For instance, supposing:
/home/git/myProject
>ENV
Windows (client)
Sunday, September 27, 2020
Online Tool to Convert Text to HTML with Pre-defined Tags And Selectors
>PROBLEM
You want to copy a code snippet and paste into an HTML page that has its own CSS selectors.
For example, you are working on Eclipse, VSCode, Atom, Sublime, etc. and you wish to copy and paste the snippet below to your post in HTML.
server { server_name marketing.example.com marketing.example.org marketing. example.net; rewrite ^ http://www.example.com/marketing/application.do permanent; } server { server_name communication.example.com communication.example.org communication.example.net; rewrite ^ http://www.example.com/comms/index.cgi permanent; } server { server_name www.example.org www.example.net; rewrite ^ http://www.example.com$request_uri permanent; }
>SOLUTION
You may try ultering.com/it4us/converter, a free online tool, that offers fast shortcuts. For instance, paste the text in the box and try CTRL+.
Saturday, September 26, 2020
nginx install: debian: Job for nginx.service failed because the control process exited with error code
>PROBLEM
Returns:
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. invoke-rc.d: initscript nginx, action "start" failed. ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2020-09-26 22:49:18 UTC; 7ms ago Docs: man:nginx(8) Process: 21405 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE) Process: 21404 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Sep 26 22:49:17 mind4y.com nginx[21405]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use) Sep 26 22:49:17 mind4y.com nginx[21405]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use) Sep 26 22:49:17 mind4y.com nginx[21405]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use) Sep 26 22:49:18 mind4y.com nginx[21405]: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use) Sep 26 22:49:18 mind4y.com nginx[21405]: nginx: [emerg] listen() to [::]:80, backlog 511 failed (98: Address already in use) Sep 26 22:49:18 mind4y.com nginx[21405]: nginx: [emerg] still could not bind() Sep 26 22:49:18 mind4y.com systemd[1]: nginx.service: Control process exited, code=exited status=1 Sep 26 22:49:18 mind4y.com systemd[1]: Failed to start A high performance web server and a reverse proxy server. Sep 26 22:49:18 mind4y.com systemd[1]: nginx.service: Unit entered failed state. Sep 26 22:49:18 mind4y.com systemd[1]: nginx.service: Failed with result 'exit-code'. dpkg: error processing package nginx-full (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of nginx: nginx depends on nginx-full (<< 1.10.3-1+deb9u4.1~) | nginx-light (<< 1.10.3-1+deb9u4.1~) | nginx-extras (<< 1.10.3-1+deb9u4.1~); however: Package nginx-full is not configured yet. Package nginx-light is not installed. Package nginx-extras is not installed. nginx depends on nginx-full (>= 1.10.3-1+deb9u4) | nginx-light (>= 1.10.3-1+deb9u4) | nginx-extras (>= 1.10.3-1+deb9u4); however: Package nginx-full is not configured yet. Package nginx-light is not installed. Package nginx-extras is not installed. dpkg: error processing package nginx (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: nginx-full nginx E: Sub-process /usr/bin/dpkg returned an error code (1)
>SOLUTION
nginx[21405]: nginx: [emerg] listen() to 0.0.0.0:80
Switch Nginx or Apache to another port.
In this case, Nginx is switched to port 81.
1. Edit:
/etc/nginx/sites-enabled/default
Switch from:
server {
listen 80 default_server;
listen [::]:80 default_server;
To:
server {
listen 81 default_server;
listen [::]:81 default_server;
2. Start nginx
>EXTRA
apt update
apt autoremove
- verifying dependencies:
apt -f install
>ENV
Sunday, September 6, 2020
Clients fail to Connect Debian on VMWare Virtual Machine
>PROBLEM
VMWare has ping to host but host has not ping to the VMWare running Debian.
>SOLUTION
First, you must make sure that the VMWare network interface configuration is correct.
Summarizing: it is required two interfaces at least.
One for the Internet that it is mapped to NAT, and a second to access a local network, for instance, that shall be mapped to the local interface on your host. If Windows, you may access the network interfaces using the command: ncpa.cpl.
Map in the network interfaces using the same order.
For instance, if the guest is a Debian and has eth0 (Internet) and eth1(local), map the network adapters in VMWare's settings using the same order.
https://appuals.com/fix-vmware-bridged-network-not-working/
service network-manager restart
Try to ping your VM:
ping 10.0.0.XX
IMPORTANT NOTE
Sometimes the VPN impedes the access.
Test disconnecting the VPN.
>ENV
VMWare 8 running Debian 7 or 10
VMWare 15.5 running Debian 7 or 10
Thursday, August 13, 2020
When you type a command and opens Windows Store or another
>PROBLEM
For instance, on console, you type python and opens instead Windows Store panel or another program.
>SOLUTION
- Go to:
C:\Users\your_user_login_here\AppData\Local\Microsoft\WindowsApps
- Possibly, there is an equivalent command shadowing the one you really wish.
Delete it or rename it.
That's it.
Saturday, July 11, 2020
Angular: fallbackLoader option has been deprecated
>PROBLEM
ng serve
...
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
...
webpack: Compiled successfully.
>SOLUTION
If using angular-cli, do:
npm uninstall -g angular-cli
npm install -g @angular/cli
If desired to perform just local changes, take out the "-g" option.
Sometimes, when a project is recently created using deprecated packages, it is faster to recreate the project using the new env, up to date.
>env
node.js
angular
Sunday, June 7, 2020
GPG error: ... The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8C718D3B5072E1F5
>PROBLEM
>SOLUTION
apt-get update
apt-get update
>ENV
Saturday, May 16, 2020
JPA entity removal fails silently
>PROBLEM
>SOLUTION
The test failed again, returning same result — silently ignoring remove.
I set back the code to the previous condition testing again to confirm results.
The confirmations was successful, confirming suspicion of two issues, database and code implementation.
>ENV
>NOTE
Wednesday, May 6, 2020
WILDFLY/JBOSS: WFLYJPA0061: Persistence unitName was not specified and multiple persistence unit definitions
>PROBLEM
Creating a persistence.xml file having two persistence units caused the following Wildfly's error message:
Caused by: java.lang.IllegalArgumentException: WFLYJPA0061: Persistence unitName was not specified and there are 2 persistence unit definitions in application deployment deployment "todos.war". Either change the application deployment to have only one persistence unit definition or specify the unitName for each reference to a persistence unit.
The persistence.xml configuration used was:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="primary"> <jta-data-source>java:jboss/datasources/TasksJsfQuickstartDS</jta-data-source> <properties> <!-- Properties for Hibernate --> <property name="hibernate.hbm2ddl.auto" value="create-drop" /> <property name="hibernate.show_sql" value="false" /> </properties> </persistence-unit> <persistence-unit name="pgTestoneDS"> <jta-data-source>java:jboss/datasources/pgTestoneDS</jta-data-source> <properties> <!-- <property name="hibernate.hbm2ddl.auto" value="create-drop" /> --> <!-- <property name="hibernate.show_sql" value="false" /> --> </properties> </persistence-unit> </persistence>
>SOLUTION
After some failures, I've decided to repeat the same configuration but doing the things in a different order.
The following order was successful:
1. Refactor the code that concerns the primary persistent-unit (or the the initial persistent-unit, whatever the name it has).
2. Create a qualifier to this first perstent-unit.
3. Refactor the dao layer in order to apply the its qualifier where the entity maneger is injected.
4. Recompile the project and perfome a full deploy.
5. Start the server and test.
6. Stop the server
7. If not successful, fix the code revising from step 1.
8. if successful, add the second persistent-unit to persistence.xml file.
9. Create the database manager class, its qualifier, the entities and dao layer always using the respective qualifier for the second persistent-unit to differ from the initial code implemented for the first persistent-unit.
10. Recompile the project and perfome a full deploy.
11. Start the server and test.
>WHAT NOT TO DO
To get more details and source code, point to WILDFLY/JBOSS: WFLYJPA0061: Persistence unitName was not specified and double persistence unit definitions
>ENV
Windows 10
Wildfly 18
JEE/CDI/JPA
Thursday, April 30, 2020
[ERROR] Non-resolvable import POM: Failure to find org.wildfly.bom:wildfly-jakartaee8-with-tools:pom:20.0.0.Beta1-SNAPSHOT
>PROBLEM
After download of Wildfly QuickStart Examples (https://github.com/wildfly/quickstart), the attempt to run the command
mvn clean package -Pdocs
to generate documentation, fails and returns:
[ERROR] Non-resolvable import POM: Failure to find org.wildfly.bom:wildfly-jakartaee8-with-tools:pom:20.0.0.Beta1-SNAPSHOT in https://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced @ org.wildfly.quickstarts:quickstart-parent:20.0.0.Beta1-SNAPSHOT, L:\work\devcli_\java\lab\jsf\wildfly_quickstart-master\pom.xml, line 106, column 25 -> [Help 2]
>SOLUTION
Inspecting the repository defined by the pom.xml:
repository.jboss.org/nexus/content/groups/public/
and it respective package was not found:
I tried to find another repository containing 20.0.0.Beta1-SNAPSHOT version, but it was being time consuming, so after "time out" I've decide that the most practical solution would be use the last final version.
That way the pom.xml file was switched to 19.0.1.Final version and the commands executed successfully.
SOURCES
Original pom.xml
wildfly_quickstarts_20_0_0_Beta1-SNAPSHOT
L:\transp\1___downloads\wildfly_quickstarts_pom_19_0_1_Final.txt
The original pom.xml switched to 19.0.1.Final:
wildfly_quickstarts_pom_19_0_1_Final
NOTE: I also let some additional repositories found during the survey, just in the case.
ADDITIONAL TIP
The project's pom.xml file also requires the respective adjustment to 19.0.0.Final version.
Using the helloworld project as example, switch the version value in
<parent>
<groupId>org.wildfly.quickstarts</groupId>
<artifactId>quickstart-parent</artifactId>
<!--
Maintain separation between the artifact id and the version to help prevent
merge conflicts between commits changing the GA and those changing the V.
-->
<version>19.0.0.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
>ENV
java 13
maven 3
Wednesday, April 22, 2020
[javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Critical error during deployment: : com.sun.faces.config.ConfigurationException:
>PROBLEM
After deploying the project then starting the server it is returned the following message:
11:56:58,222 GRAVE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Critical error during deployment: : com.sun.faces.config.ConfigurationException:
Source Document: vfs:/L:/portables_d/jboss-as-7.1.1.Final_8080_proeducacao_2/standalone/deployments/bin1371_eshop.war/WEB-INF/lib/richfaces-core-impl.jar/META-INF/faces-config.xml
Cause: Unable to create a new instance of 'org.richfaces.resource.ResourceHandlerImpl': java.lang.reflect.InvocationTargetException
>SOLUTION
This happens when is skipped a step of the "New Dynamic Web Project" wizard where the JSF is set.
On the "JSF Capabilities" during creation it is necessary to define JSF library.
Go to Navigator panel, point on the project then Alt + Enter to access project's properties.
Se the same jar path configuration set on Java, Build Path, Libraries tab and find to where you jar libs are pointing to.
Use the same configuration for Java Server Faces properties. Point to Project Facets , Java Server Faces.
>ENV
eclipse luna
windows 10
jsf/seam project
Wednesday, April 15, 2020
JBOSS: JBAS014775: New missing/unsatisfied dependencies:
>PROBLEM
Starting JBoss, the server fails to load datasource throwing the following message:
18:21:37,781 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report JBAS014775: New missing/unsatisfied dependencies: service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source.java:jboss/datasources/mysqlTestoneDS, service jboss.data-source.java:jboss/datasources/proeducacaoDS]
>SOLUTION
Check the configuration and change driver.You may choose checking on or other in first place. It on your guess.
CHECKING DATASOURCE CONFIGURATION
standalone.xml
Go to JBoss install dir and open the standalone.xml file.For instance:
D:\jboss-as-7.1.1.Final_8080\standalone\configuration\standalone.xml
The configuration shall be something like this:
DATABASE MODULE
Go to JBoss install dir under modules\com\mysql\main folder.For example:
D:\portables_d\jboss-as-7.1.1.Final_8080\modules\com\mysql\main
Open file the file having .index suffix.
Example:
mysql-connector-java-5.1.13-bin.jar.index
Compare with the configuration in the standalone.xml file:
<driver name="mysql" module="com.mysql"> <driver-class>com.mysql.jdbc.Driver</driver-class> </driver>
In this case, they match.
The required class is present in the jar of the database's driver.
If the configuration is ok, then it is time to test another version for the driver.
SWITCHING DRIVERS
Replace the current driver for a new one.
RESULT
SUCCESS>ENV
jboss-as-7.1.1.FinalWindows 10
Mysql 5.X
Tuesday, April 14, 2020
How to Implement a JavaScript Project Using Express with ORM (Sequelize), MVC model, OO (Object-Oriented programming) and Design Patterns?
>PROBLEM
The usual approach of JavaScript programmers makes no use of object-oriented programming, or mixes both styles, the "function-oriented" approach, common on this kind of platform due to its origins from browser's programming — old times! Please, do not take this for functional programming that it is something different.
Just because it is used "functions" instead of classes doesn't mean that it is necessarily functional programming.
The old approach although fast and easy in some way, becomes cumbersome over time, turning out a project with difficult maintenance, cohesion issues, and tangled code.
ES6 offers a marvelous object-oriented implementation, easy and practical.
ORM is a key concern to decouple persistence.
Persistence pattern turns code concise and reusable extending resources and providing cohesion.
Another side effect is that ORM is more secure.
It may protect against SQL injection.
After Node.js, JavaScript becomes a "grown-up boy", having its own platform to run full implementation across a project, and no more a "browser's language".
How to use OO/ORM/DAO patterns with JavaScript/Node.js?
>SOLUTION
Since this kind of approach is relatively new for JavaScript programmers and not very popular although used by seniors developers, it is easier than supposed.
In order to become accessible for everyone who intends to evolve adopting the ES6's OO resources, the subject was split into pieces ("Jack methodology") to turn things easier — it was created a step-by-step tutorial.
The code isn't a definitive version for production, but a good start to get the grips of it.
(Revision 2022 using Node.js v.16)
Enjoy!
Thursday, March 5, 2020
Lógica Míope
Eu li esta manchete na BBC dizendo que o nosso hábito por assistir streaming vai poluir o planeta ainda mais intensamente com a adoção do 5G.
Então o texto explica o porquê informando que muitos datacenters no mundo são movidos a energia fóssil (derivados de petróleo, carvão).
O detalhe da má fé ou da "percepção míope" da manchete é transferir a culpa para o usuário final de um problema de infraestrutura energética mundial.
Ok então, seguindo a "lógica também fóssil" do artigo inglês, vamos parar de assistir videos.
Oras, se não estamos na frente da tela, estamos na frente da direção, que por sua vez também usa energia fóssil.
E aqueles que não usam carro para a diversão, certamente usam de forma indireta algum serviço que faz uso de combustíveis fósseis.
Bares precisam de mercadoria, que são transportadas por caminhões ou trens que também usam combustível fóssil.
A energia dos bares, cinemas, teatros e etc em muitos locais do planeta também são abastecidos por energia fóssil.
Então, entre na geladeira no final de semana e evite trabalhar, porque viver polui!!!
É mais do que evidente que não são os usuários diretos ou indiretos na cadeia de serviços os verdadeiros responsáveis, mas o modelo econômico de geração de energia mundial que precisa de uma revisão urgente.
Ao usuário final cabe apenas concientização através da pressão política na cobranção da revisão desse modelo.
De nada vai adiantar políticas simplistas que buscam "congelar a atividade da humanidade".
A solução vem do esforço conjunto da ciência amparada pelo desejo político, porque parar de viver para não poluir faz tanto sentido quanto poluir até parar de viver.
What a short sighted vision BBC.co.uk !!!
Transcrição parcial do texto da BBC:
With the launch of streaming services from Disney and Apple, the rollout of 5G and the growth in cryptocurrencies, experts are warning about the impact this huge rise in data use could have on the environment.
There are now hundreds of thousands of data centres around the world, storing everything from viral videos to doctors' notes and even bank account details. Many of them run on electricity generated by burning fossil fuels.
Film and TV writer Beth Webb went in search of the internet and discovered that 'the cloud' is actually a vast network of energy-guzzling data centres and undersea cables.
eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
>PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...
-
>PROBLEM Using JSF, Primefaces and p:growl the messages return duplicated (twice). This kind of issue may have alternative reasons. On ...
-
>PROBLEM An attempt to update the local repository using pull and push fails returning the following message: ... ! [remote rejected] m...