Tuesday, January 16, 2024

virtualbox6: debian: netbeans install issues: "dpkg: warning: 'ldconfig' not found in PATH or not executable" and "pkg-deb: error: archive 'apache-netbeans_....deb' uses unknown compression for member 'control.tar.zst', giving up"

 

>PROBLEMS/SOLUTIONS


You desire to install Netbeans on a Debian O.S. using the VirtualBox v.6 because the VirtualBox v.7 fails on your current Windows 10 installation.

The first task is to download the Netbeans, and we usually do this using the last version, trying the following commands to install:

sudo apt install openjdk-17-jdk curl wget unzip
cd /home/USERNAME/Downloads
chmod 777 apache-netbeans_20-1_all.deb
dpkg -i apache-netbeans_20-1_all.deb

>PROBLEM #1

Then, the "dpkg" command throws the following error message:

dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable


>SOLUTION #1

scite /etc/profile &
export PATH=$PATH:/sbin

or

scite ~/.profile
export PATH=$PATH:/sbin

- Reboot and run dpkg command again, and you may get the problem #2.

>PROBLEM #2

Running the install command again:

dpkg -i apache-netbeans_20-1_all.deb


Returns:

pkg-deb: error: archive 'apache-netbeans_20-1_all.deb' uses unknown compression for member 'control.tar.zst', giving up
dpkg: error processing archive apache-netbeans_20-1_all.deb (--install):
 dpkg-deb --control subprocess returned error exit status 2



>SOLUTION #2

Remembering that VirtualBox v.6 is no longer maintained, we need to consider a possible downgrade.
If the last Netbeans version fails with the following procedure, download a previous version, until you get compatibility. In this procedure the attempt with the v.19 was enough.

Download the Netbeans , first apply alien command to make it compatible, then run dpkg as follow:

alien apache-netbeans_19-1_all.deb
dpkg -i apache-netbeans_19-1_all.deb

And... voilĂ !

Now, read to run Netbeans, and  on prompt do:

netbeans &

Note: if everything goes well, the installation set the netbeans command at:

/usr/bin/netbeans &


>ENV

Windows 10
VirtualBox 6
debian 10..12
netbeans 19..20

Tuesday, January 2, 2024

oracle: SQL Error: ORA-01861: literal does not match format string , 01861. 00000 - "literal does not match format string"


 >PROBLEM


The attempt to insert data from a migrated code from PostgreSQL to on a Oracle database using automatic generator resulted a generic message error.


- The insert command:

INSERT INTO loc_users( loc_users_id, nome, login, email, senha, nascimento, celular, idioma, ativo ) VALUES ( 1, 'Yuzefo', 'Abibeh', 'william@copel.com.br', 'Apukoyal', '1951-08-31', '05292770147', 'english', 1);



- Oracle returns a generic message not providing a tip to a specific field:


SQL Error: ORA-01861: literal does not match format string

01861. 00000 -  "literal does not match format string"

*Cause:    Literals in the input must be the same length as literals in

           the format string (with the exception of leading whitespace).  If the

           "FX" modifier has been toggled on, the literal must match exactly,

           with no extra whitespace.

*Action:   Correct the format string to match the literal.


>SOLUTION


Check your DDL comparing with the insert statement.

Usually operations involving date, time and timestamp cause issues during migration.

In this example, the field "nascimento" (born date in portuguese) has an incompatible format for date as concerns Oracle's usage.


Set TO_DATE() function:

TO_DATE('1951-08-31', 'YYYY-MM-DD')


INSERT INTO loc_users( loc_users_id, nome, login, email, senha, nascimento, celular, idioma, ativo ) VALUES ( 1, 'Yuzefo', 'Abibeh', 'william@copel.com.br', 'Apukoyal', TO_DATE('1951-08-31', 'YYYY-MM-DD'), '05292770147', 'english', 1);



>ENV

oracle 11g


Monday, January 1, 2024

oracle: timestamp ORA-01882: timezone region not found

 

>PROBLEM


Attempt to insert data using sqlplus (command console) into a table having TIMESTAMP type fails, returning error message.

SQL>INSERT INTO card( id, title, content, cardsz, colors, created_at, updated_at ) VALUES ( 1, 'test1 modified', 'hello world!\n', '', 'yellow', TIMESTAMP '2021-11-27 02:41:25 PM', TIMESTAMP '2022-06-01 09:56:56 PM');

- Output:
ERROR at line 1:
ORA-01882: timezone region not found


The target table configuration:

desc card;

ID NUMBER(10,0) No 1
TITLE VARCHAR2(255 BYTE) Yes 2
CONTENT CLOB Yes 3
CARDSZ VARCHAR2(16 BYTE) Yes 4
COLORS VARCHAR2(32 BYTE) Yes 5
CREATED_AT TIMESTAMP(6) No CURRENT_TIMESTAMP 6
UPDATED_AT TIMESTAMP(6) Yes "CURRENT_TIMESTAMP " 7


>SOLUTION


The issue was caused due a notation difference between the timestamp format migrated from a PostgreSQL dump, that uses the "AM|PM" and no reference to timezone (i.e. -03:00) values.

In the example given, the issue was solved just replacing the "PM" with the timezone value (-03:00) string from the timestamp, as follows:

INSERT INTO card( id, title, content, cardsz, colors, created_at, updated_at ) VALUES ( 1, 'test1 modified', 'hello world!\n', '', 'yellow', TIMESTAMP '2021-11-27 02:41:25 -03:00', TIMESTAMP '2022-06-01 09:56:56 -03:00');


>ENV


oracle 11g
sqlplus


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...