Saturday, January 8, 2022

maven: Error: Could not find or load main class...Caused by: java.lang.ClassNotFoundException:...

 

>PROBLEM


Attempt to run a mvn command, for instance:

  mvn -version

  

Returns:

  <!--Could not find or load main class ...

  Caused by: java.lang.ClassNotFoundException: ...-->



>SOLUTION


Check your envvars (environment variables).

The configuration shall be something like this:


M2_HOME = C:\apache-maven

MAVEN_OPTS=-Xms256m -Xmx512m

Path=%Path%;%M2_HOME%\bin


For some mistake, you may have a misconfiguration. For example:


***WRONG:

MAVEN_OPTS=-%M2_HOME%\bin



>ENV

Windows 10

apache-maven





@CTL: y;faq-Error: Could not find or load main class...Caused by: java.lang.ClassNotFoundException:<memo<maven;.

Tuesday, January 4, 2022

angular: Cannot parse arguments. See below for the reasons. Argument --ssl could not be parsed using value "true\r".Valid type(s) is: boolean

 

>PROBLEM


Angular project fails starting and returns the following error message:


Cannot parse arguments. See below for the reasons.

Argument --ssl could not be parsed using value "true\r".Valid type(s) is: boolean



>SOLUTION


It happens when a project using Windows encoding is deploy on *nix environment due the carriage return (CR) differences.

Convert the CRs to unix format.

There are many ways of doing that:


1. If using Git, when it is installed, during its install wizard, there are options to set automatically de CR format.


2. Free apps like SciTE, Notepad++, VSCode and etc. have encoding and CR converters.


>ENV

windows 10

angular



@CTL:
y;faq-Cannot parse arguments. See below for the reasons. Argument --ssl could not be parsed using value "true\r".Valid type(s) is: boolean<memo<angular;.

Monday, January 3, 2022

docker: angular service returns ERR_EMPTY_RESPONSE

 

>PROBLEM


Attempt to access an Angular project running from a docker fails, returning on the browser "ERR_EMPTY_RESPONSE".


>SOLUTION


Add --host argument to the "ng serve" command to start the service.


- before:

ng serve --port 4400 --ssl true


- after:

ng serve --port 4400 --ssl true --host 0.0.0.0

also tested OK with:
ng serve --port 4400 --ssl true --host=0.0.0.0


>ENV

windows 10
angular 16


>ref

tipsfordev.com/localhost-didn-t-send-data-err-empty-response-and-curl-52-empty-reply-from-server


@CTL:

y;faq-angular: ERR_EMPTY_RESPONSE<memo<docker;.

Sunday, January 2, 2022

docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "-v": executable file not found in $PATH: unknown.

 

>PROBLEM


Attempt to map a volume fails retuning:


docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "-v": executable file not found in $PATH: unknown.


>SOLUTION


WRONG:

docker run -it --name extodo alsdias/express_todo -v C:\data:/home


RIGHT:

docker run -it --name extodo -v C:\data:/home alsdias/express_todo


>ENV

w10

docker


Friday, December 31, 2021

vmware v.15: VMware Workstation and Device/Credential Guard are not compatible


>PROBLEM

VMware Workstation and Device/Credential Guard are not compatible


>SOLUTION

If using VMWare v.15, upgrade it to v15.5


>ENV

w10

vmware15


Monday, December 13, 2021

Jira Application: Listing closed sprints

 

>PROBLEM

You need to access the issues from closed sprints.


>SOLUTION

On the images below, follow the arrows by their order:









Tuesday, November 16, 2021

Angular: SassError: Expected newline

>PROBLEM

You have a Angular project using SaSS.

Starting the server, returns the following message:

  SassError: Expected newline


>SOLUTION

Correct the .sass files converting to Sass syntax.

- syntax:
https://sass-lang.com/documentation/syntax

- Example:


>before


label {
  display: block;
  margin-top: 10px;
}

.card-container.card {
  max-width: 400px !important;
  padding: 40px 40px;
}

.card {
  background-color: #f7f7f7;
  padding: 20px 25px 30px;
  margin: 0 auto 25px;
  margin-top: 50px;
  -moz-border-radius: 2px;
  -webkit-border-radius: 2px;
  border-radius: 2px;
  -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
  -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}

.profile-img-card {
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
  display: block;
  -moz-border-radius: 50%;
  -webkit-border-radius: 50%;
  border-radius: 50%;
}


>after


label
  display: block
  margin-top: 10px


.card-container.card
  max-width: 400px !important
  padding: 40px 40px


.card
  background-color: #f7f7f7
  padding: 20px 25px 30px
  margin: 0 auto 25px
  margin-top: 50px
  -moz-border-radius: 2px
  -webkit-border-radius: 2px
  border-radius: 2px
  -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3)
  -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3)
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3)


.profile-img-card
  width: 96px
  height: 96px
  margin: 0 auto 10px
  display: block
  -moz-border-radius: 50%
  -webkit-border-radius: 50%
  border-radius: 50%


>ENV

w10
node16
Angular13

Tuesday, October 12, 2021

vue create fails to start project using npm run serve returning: Local: "http://[C:]:3000/"


>PROBLEM

Following the instructions in Vue's documentation after issuing the command:

npm run service


returns the following:

Local: "http://[C:]:3000/"


Naturally, this address fails.

 



>SOLUTION

After searching Vue's documentations and trying to set configuration files, the easiest way was to start the app using the following comand:

npm run serve -- --port 3000 --host localhost








TIP

Try vite instead using just vue. Check its topic here.


>ENV

Windows 10
Tested with Vue 2 and 3



The App Stalking Thing And The Disguised Threats

For Portuguese Version


Cell phones (smartphones) are objects of our daily lives.

If before we could not leave the house without a wallet (money and documents), today we are moving to replace it through the cell phone.

At first, I saw this as a good thing.

Wallet and cell phone are uncomfortable to carry because of their volume and weight.

Women wear purses, maybe they don't mind too much, but men like to use their pockets to avoid having their hands full.

With the possibility of paying bills via cell phone, I almost thought of retiring the old wallet, but I thought again.

There are several points of consideration, however, I will stick to the main ones:


- If someone steals your cell phone, or you lose it?
The cellphone concentrates everything and this increases the chances of deceit.
Despair is greater.

- If the cellphone is "contaminated" by apparently harmless applications that we installed ourselves because they offered something that interested us, and for free (something irresistible for most of us).

These "pseudo-harmless" applications mostly collect information as a form of payment for the so-called free service. 


Nothing is free.
Everything needs a livelihood.

When the information collected is not that harmful, we still don't care.

The question is how to measure this?
How can we know the content of the information passed on that was presumable safe to be made public today but will no longer be so tomorrow?

Sometimes the useless information today, under a future context may become something very sensitive.


In the face of all this, I have long been reduced my personal exposure, because accepting this exposure is contributing to the loss of the little freedom that will be left tomorrow, as we get used to via gradual acceptance to, as it was like in the past when the boyfriend went out with a girlfriend accompanied by her younger brother by her parents' imposition. 😊

I didn't catch that time, but I became the younger brother. Terrible for me and for them. 😁


My attention to the subject of security has worsened, resulting in a very serious occurrence with access to my bank account at Itaú (Brazil's bank). Despite accessing the account, bill payments were blocked, which required me to wait from a few hours to a few days to unlock them.

I sometimes resorted to the bank's IT support, but without a solution.

They always returned the same small list of apps that are not compatible with the itaú's bank app and must be uninstalled, otherwise they block any transaction.


There were two solutions: either give up on the bank or solve the problem by digging yourself into the issue.

Since I like Itaú (many years of account), and being an IT professional, I accepted as a challenge to solve the problem because I had time to do so, as I was on vacation.

If in the day-to-day rush, I wouldn't have had time, and I would certainly have transferred all the operations to another bank's account that hasn't this obstacle.

I had already uninstalled all remote cell phone applications that Itaú's IT support had condemned as incompatible with the bank's security terms, but the problem remained.


I had to create a new criterion, different from the support direction so that I wouldn't end up having to uninstall all mobile apps using that mobile option that deletes everything and returns to the original state when you bought it. . 👿

It would be my last option.



The criterion I've chosen was to survey by the name of the manufacturer.

As the TeamViewer application causes this blocking for the Itaú Bank app, I searched my cell phone for all the applications and started research through the notebook via browser, collecting information about each one of them, until... I discovered that the LifeAR application was manufactured by TeamViewer, the same manufacturer as the remote connection application that goes by that name (TeamViewer).

The problem is that this application has nothing to do with a remote connection, at least by its description.
It is an application of "augmented reality", and for this reason, I would never discover it if I had not adopted a different approach of solution, different from the one that the bank's support had given me.

I uninstalled the LifeAR app and tested it after 2 days of waiting for support to unlock my transactions. This delay in blocking made the testings quite difficult. 
Each unsuccessful attempt represented 1 to 2 days waiting for unlock until I could make a new test.
I needed to get it right fast, with as few tries as possible, or wipe everything off my cell if I didn't have the time.

Bingo!
Once I uninstalled the LifeAR augmented reality app, the locks were gone and I was able to start scheduling my accounts. 
Lucky I don't leave accounts until the last minute to pay them.
I always act in advance because I don't trust connectivity: Murphey's Law.

What if you weren't an IT professional, or weren't lucky enough to have the time to "play" with this issue for days? 
It would certainly end up in line at the bank, or in line at an ATM (those self-service machines).

A few days later, through Estadão Newspaper, I accessed this article from the Link channel, which deals with IT issues, talking about the most recent threats of hacking via stalking through apps that we install ourselves on cell phones.

After re-evaluating the news that threatens our security, as the antivirus is often not prepared for such new issues, and therefore lets them pass and does not detect them until you become the guinea pig (or lab mouse) that will trigger the alert to the manufacturers who will then take action.
But becoming a lab mouse can be very expensive.

Conclusion: the best solution is to have two different cell phones.
One without any apps installed except those of the banking and finance agents we trust.
Another "playground" phone, where you can install the apps you like, those utilities that make a difference in our lives.

Indeed!...
However, it is worth remembering that you will continue to be tracked by Google for all your activities (pictured below).
Turning off the cell phone is no use. Just taking out the battery is effective while they do not embed a not removable extra battery (in this extreme case, just letting it behind would be the solution or buying an alternative without this resource).
 
Don't conform.
If your freedom isn't important for you, maybe others' freedom is, including your children's future.

Government despotism grows intensely, whether by democracies or by totalitarian regimes.
The cell phone is the perfect surveillance tool.

Mind about this!


PARTIAL COPY OF E-MAIL SENT TO THE MANAGEMENT OF ITAÚ BANK




GOOGLE MAPS TIMELINE (TRACKING REPORT)












Novas Ameaças de Segurança em APPs





Celulares (smartphones) tornaram-se objetos do cotidiano.
Se antes não podíamos sair de casa sem a carteira (dinheiro e documentos), hoje caminhamos para substituí-la através do celular.

A priori vi com bons olhos.
Carteira e celular são incômodos para carregar pelo volume e peso que têm.
Mulheres usam bolsa, talvez não se importem muito, mas homens gostam de usar os bolsos para evitar ter as mãos ocupadas.

Com o viabilização do pagamento de contas via celular, quase pensei em aposentar a velha carteira, mas repensei.

Existem vários pontos de consideração, no entanto, vou ficar com os principais:

- Se roubarem o celular, ou perdê-lo?
O celular concentra tudo e isso aumenta as chances de dolo.
O desespero é maior.

- Se o celular estiver "contaminado" por aplicações aparentemente inofensivas que nós mesmos instalamos porque ofereciam algo que nos interessava, e de graça (algo irresistível para a maioria de nós).
Essas aplicações "pseudoinofensivas" na maioria das vezes coletam informações como forma de pagamento pelo serviço dito gratuito. Nada é de graça. Tudo precisa de uma forma de subsistência.
Quando a informação coletada não é tão prejudicial, ainda não nos importamos.

A questão é como medir isso?
Como podemos saber o teor da informação repassada e quando o que é aparentemente seguro tornar público hoje deixa de sê-lo amanhã?


Às vezes, a informação inútil de hoje, sob um novo contexto do amanhã, torna-se algo muito sensível.

Diante de tudo isso, há muito venho reduzindo minha exposição pessoal, porque aceitar essa exposição é contribuir para a perda da pouca liberdade que sobrará amanhã, à medida que vamos nos acostumando (e aceitando) a ser pajeados pelos nossos celulares, assim como era bem antigamente em que o namorado saia com a namorada acompanhada do irmão caçula por imposição dos pais dela. 😊

Eu não peguei essa época, mais cheguei a ser o irmão caçula. Terrível para mim e para eles. 😁

A minha atenção sobre o assunto segurança se agravou diante uma ocorrência muito séria com o acesso à minha conta bancária no Itaú. Apesar de acessar a conta, os pagamentos de contas eram bloqueados, o que me exigia esperar de algumas horas a alguns dias para desbloqueá-los.

Recorri inúmeras vezes ao suporte de TI do banco, mas sem solução.
Eles retornavam sempre a mesma pequena lista de aplicações que não são compatíveis com a app do banco e que devem ser desinstaladas, pois do contrário, elas bloqueiam qualquer transação.


Tinha duas soluções: ou desistir do banco ou descobrir o problema.

Já que gosto do Itaú (muitos anos como correntista), e sendo profissional de TI, aceitei como desafio resolver o problema pois tinha tempo à ocasião, já que estava de férias.
No corre-corre do dia-a-dia, eu não teria tido tempo, e certamente teria transferido todas as operações para outro banco onde também tenho conta e que não apresentava esse empecilho.

Eu já havia desinstalado todos os aplicativos de conexão remota do celular que o suporte de TI do Itaú havia condenado como incompatível com os termos de segurança do banco, mas o problema continuava.

Eu tinha que criar um critério novo, diferente da orientação do suporte, para que não acabasse tendo que desinstalar todas as apps do celular, ou seja, utilizar aquela opção do celular em que o mesmo apaga tudo e retorna ao estado original de quando você comprou. 👿
Seria minha última opção.

O critério que escolhi foi eleger o nome do fabricante.
Como a aplicação TeamViewer provoca esse bloqueamento para a app do Itaú, pesquisei no meu celular todas as aplicações que tinha e comecei uma pesquisa pelo notebook via browser coletando informações sobre cada uma delas, até que... descobri que a aplicação LifeAR era fabricada pela TeamViewer, o mesmo fabricante da aplicação de conexão remota que leva esse nome (TeamViewer).

O problema é que tal aplicação nada tem com conexão remota, ao menos no descritivo que ela traz.
Trata-se de uma aplicação de "realidade aumentada", e que por essa razão jamais iria descobrir se não tivesse adotado uma outra lógica de solução, diferente daquela que o suporte havia me passado.

Desinstalei a aplicação LifeAR e testei após 2 dias de espera para que o suporte desbloqueasse minhas transações. Essa demora nos bloqueios tornavam os testes bastante difíceis. Cada tentativa com insucesso representava de 1 a 2 dias para desbloquear, até que pudesse fazer um novo teste.
Eu precisava acertar rápido, com o menor número de tentativas possível ou apagar tudo do celular, se não tivesse mais tempo.

Bingo!
Uma vez desinstalada a app de realidade aumentada LifeAR, os bloqueios se foram e pude começar a agendar minhas contas. Sorte que não deixo contas para a última hora, sempre agendo com muita antecedência porque não confio em conectividade: Lei de Murphey.

E se você não fosse um profissional de TI, ou não tivesse tido a sorte de ter tempo para "brincar" com isso durante dias?  Certamente acabaria na fila do banco, ou na fila de uma ATM (aquelas máquinas de autoatendimento).

Alguns dias depois, através do Jornal Estadão acessei este artigo do canal Link que trata de assuntos de TI, falando das ameaças mais recentes de hackeamento via stalking através de apps que nós mesmos instalamos no celular.

Depois de reavaliar as novidades que ameaçam nossa segurança, já que o antivirus muitas vezes ainda não está preparado para tais novidades, e portanto deixa passar porque ainda não detecta, até que você se torne a cobaia que irá disparar o alerta aos fabricantes que então tomarão providência. 
Só que virar cobaia pode sair muito caro.

Conclusão: a melhor solução é ter dois celulares diferentes.
Um sem qualquer app instalada, exceto aquelas dos agentes bancários e financeiros em que temos confiança, e um outro celular de "playground", onde você pode instalar as apps que gosta, aquelas utilidades que fazem diferença em nossas vidas.

Deveras!... 
Contudo convém lembrar que você continuará rastreado pelo Google em todas a suas atividades (foto abaixo).
Desligar o celular não adianta. Só mesmo tirando a bateria até que eles inventem 
a qualquer pretexto uma bateria extra embutida, não removível. Neste caso só desativando tal bateria extra ou dando preferência a celulares sem a mesma. Futuro? Sim, mas não improvável.
 
Não se conforme.
Se a sua liberdade não é importante, talvez a dos outros seja, incluindo o futuro dos seus filhos.

O despotismo governamental cresce intensamente, sejam nas democracias ou nos regimes totalitários.
O celular é o instrumento perfeito de
surveillance.

Pensa nisso!

Nota: alguns links podem estar em inglês. Utilize o modo de tradução do browser ou do próprio site.


CÓPIA PARCIAL DE E-MAIL ENVIADO À GERÊNCIA DO BANCO ITAÚ





GOOGLE MAPS TIMELINE (RELATÓRIO COM SEU RASTREAMENTO)







Monday, October 11, 2021

Avoid Lenovo - Short-term Support (Evite Lenovo - Assistência Técnica de Curto Prazo)


NOTE
ENGLISH  VERSION (below after prints)


PORTUGUESE VERSION


Aproximadamente 1 ano e meio atrás comprei um Lenovo Yoga.
A máquina sempre teve uma performance no limite do desejável.
No resto, funcionava sem problemas.
Imaginava comprar uma SSD para resolver o problema da lentidão.

Repentinamente, o notebook perdeu a conexão com o Wi-Fi usando cabo.
Verificando o problema, descobri que as portas USB haviam parado de funcionar.

Qualquer tentativa de reparo via disco de recuperação ou imagem, tornou-se inviável sem conexão USB. Notebooks modernos não vêm mais com CD-ROM, que embora algo já em desuso, poderia representar uma medida paliativa.

Acessei o suporte, expliquei o problema.

A resposta foi que não têm mais peças e a fábrica não dá mais assistência.

Aproximadamente 18 meses depois da compra, a minha lata de lixo ficou mais gorda.

Lições aprendidas:

- Lenovo de novo, JAMAIS!

- Produto chinês? Só em último caso.


Lembrando que temos duas boas razões para evitar produtos chineses:

- A política one-way: compre, mas fora da garantia, só a sorte.

- A política expansionista: comprando produtos chineses você transfere dinheiro (recursos) e fortalece um regime político que à medida que se fortalece, está mostrando a que veio (Tibete, Taiwan, etc.)


 

 






ENGLISH VERSION


I purchased a Lenovo Yoga notebook approximately 1.5 years ago.

The machine performed at its minimum desirable limit.

Anyway, it worked without problems, so I imagined buying an SSD to help to solve the performance issue.


Suddenly, the notebook lost the Wi-Fi connection using cable.

Checking the malfunction, I found that the USB ports had stopped working.

Any repair attempt via recovery disk or image became unfeasible without the USB connection. Modern notebooks have no longer CD-ROM, which could be a palliative measure.


Accessing Lenovo's support, I explained the malfunction.

The answer was that they do not have any more replaceable parts and the factory provides no further assistance.

Approximately 18 months after purchase, my trash got fatter.


Lessons Learned:

- Lenovo again, NEVER!

- Chinese product? Only as a last resort.

Remembering that we have two good reasons to avoid Chinese products:

- Unilateral policy: buy, but out of warranty, just luck may help you.

- The expansionist policy: by buying Chinese products, you transfer money (resources) and strengthen a political regime that, as it gets stronger, shows what purposes come for.  (Tibet, Taiwan, etc.)

Wednesday, August 25, 2021

hibernate: java.lang.IllegalArgumentException: org.hibernate.QueryException: Unable to resolve path


 >PROBLEM


java.lang.IllegalArgumentException: org.hibernate.QueryException: Unable to resolve path [e.title], unexpected token [e] [select e from br.com.adr.model.entity.security.uni.RoleEntity WHERE e.title = :title]



>SOLUTION


Original code:

String sql = "select e from " + this.entityName + " WHERE e.title = :title";

Query query = em.createQuery(sql, RoleEntity.class);

query.setParameter("title", title);


Fixing the code:

Missing the 'e' entity alias:

String sql = "select e from " + this.entityName + " e WHERE e.title = :title";


>ENV

Windows 10
JSF 2.2
WildFly 21

Tuesday, August 24, 2021

JEE: Using JSF, Primefaces and p:growl the messages return duplicated (twice).

 

>PROBLEM

Using JSF, Primefaces and p:growl the messages return duplicated (twice).





This kind of issue may have alternative reasons.
On this post it is shown two of them:
- The simple case
and
- The modal case


>SOLUTION #1 - SIMPLE CASE

Find the p:grow element.

Switch the p:growl attribute from:

<p:growl id="growl" showDetail="true"/>

to:

<p:growl id="growl" showDetail="false"/>


Supposing the java code is something like this:

public String remove() {
FacesMessage success = null;
try {
bsn.delete(toEntity());
success = new FacesMessage(FacesMessage.SEVERITY_INFO, "SUCCESS: ID " + this.id + " removed", null);
FacesContext.getCurrentInstance().addMessage(null, success);
clean();
return ModelConfigSvc.SUCCESS;
} catch (BsnException e) {
success = new FacesMessage(FacesMessage.SEVERITY_ERROR, "deletion failed",null);
FacesContext.getCurrentInstance().addMessage(null, success);
return ModelConfigSvc.FAIL;
}
}


or
public String remove() {
FacesMessage success = null;
try {
bsn.delete(toEntity());
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "SUCCESS: ID " + this.id + " removed", null));
clean();
return ModelConfigSvc.SUCCESS;
} catch (BsnException e) {
success = new FacesMessage(FacesMessage.SEVERITY_ERROR, "deletion failed",null);
FacesContext.getCurrentInstance().addMessage(null, success);
return ModelConfigSvc.FAIL;
}
}






>SOLUTION #2 - MODAL CASE

Scenario:
There is a page that lists entities and it may trigger modal pages to update, delete, etc.
In such cases, the modal message may aggregate to the origin page's message, in this case the listing page.

A fast way to fix this leads us to switch the return value to keep the modal opened and not returning to the listing page, so the message doesn't accumulate twice, one from the modal (p:messages) and the other from the listing page (p:growl).

So, it is changed from:
return ModelConfigSvc.SUCCESS;

To:
return ModelConfigSvc.FAIL;

Below, it is shown the detailed information using the "deletion" to illustrate the example.






Issue to be fixed - doubled messages when the modal is closed after the deletion





THE CODE

faces-config.xhtml



roleList.xhtml





roleDeletion.xhtml exibted as modal







FIXING THE ISSUE


RoleDeletion.java







Return value switched to fix the issue

RoleDeletion.java 





Issue fixed






>ENV


Windows 10
JSF 2.2
WildFly 21





Saturday, August 21, 2021

JEE: Caused by: java.lang.IllegalArgumentException: UT010009: Servlet Faces Servlet of type class javax.faces.webapp.FacesServlet does not implement jakarta.servlet.Servlet

 

>PROBLEM


The application fails when deployed on the server (Wildfly/jBoss) return the following message:

  Caused by: java.lang.IllegalArgumentException: UT010009: Servlet Faces Servlet of type class javax.faces.webapp.FacesServlet does not implement jakarta.servlet.Servlet



>SOLUTION


Check the following configuration:

- JDK'S version

- Libraries' versions (Maven's dependencies, etc.)

If the configuration seems correct, try to downgrade (or maybe upgrade) the server's version of JBoss or Wildfly.

For instance, from v.23 to v.21 or lower.

The application server's JEE version must be compatible with the project's libraries versions.

        Check WildFly's JEE versions on its download page.



>ENV

JDK 8/11

Wildfly 21

Eclipse

Windows 10

Tuesday, August 17, 2021

iptables: No chain/target/match by that name.


>PROBLEM

When running a "iptables conntrack" command, for instance like this:
    iptables -A INPUT -p tcp --dport 8081 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
 
returns the error message:
  
  iptables: No chain/target/match by that name.


>SOLUTION

The solution may contemplate alternatives due different causes.
This post shows two of them.

>using linux on a openvz container

OpenVZ servers share a kernel with the host, and as a result, you cannot load any kernel modules, and do some other tasks.

Ask your service provider to turn on the NetFilter for the server.


>linux, but not a container

Check this link.


>ENV

OpenVz container


Wednesday, August 4, 2021

debian 10: nginx fails to install after system upgrade


 >PROBLEM


Scenario:

After performing an upgrade using:

apt update

apt upgrade


nginx returns installing issues and fails to start, returning an error message like this:


Aug 04 13:28:47 myserver.com systemd[1]: Failed to start A high performance web server and a reverse proxy server.

dpkg: error processing package nginx-full (--configure):

 installed nginx-full package post-installation script subprocess returned error exit status 1

dpkg: dependency problems prevent configuration of nginx:

 nginx depends on nginx-full (<< 1.14.2-2+deb10u4.1~) | nginx-light (<< 1.14.2-2+deb10u4.1~) | nginx-extras (<< 1.14.2-2+deb10u4.1~); however:

  Package nginx-full is not configured yet.

  Package nginx-light is not installed.

  Package nginx-extras is not installed.


>SOLUTION

1. Check the installed packages:

  dpkg -l nginx*

Returns:

||/ Name           Version          Architecture Description
+++-==============-================-============-=========================================================
iU  nginx          1.14.2-2+deb10u4 all          small, powerful, scalable web/proxy server
ii  nginx-common   1.14.2-2+deb10u4 all          small, powerful, scalable web/proxy server - common files
un  nginx-doc      <none>           <none>       (no description available)
un  nginx-extras   <none>           <none>       (no description available)
iF  nginx-full     1.14.2-2+deb10u4 amd64        nginx web/proxy server (standard version)
un  nginx-light    <none>           <none>       (no description available)
root@again4u:/opt# dpkg remove nginx-1.14.2


2. Purge the packages:

  apt purge nginx-common nginx-full


3. Testing the removal:

  dpkg -l nginx*
root@again4u:/opt# dpkg -l nginx*
dpkg-query: no packages found matching nginx*

Shall return "no packages found..."


4. Deactivate the firewall, temporarily.


5. Reinstall nginx.

  apt install -f nginx
  

6. If reinstallation fails returning the same previous issue, uninstall nginx again, repeating the steps above and reboot the server.

If using a remote server, use the provider's interface to reboot it.

Deactivate the firewall, temporarily, and install nginx again:

  apt install -f nginx



7. Test the installation.

  systemctl status nginx

If successful, return something like this:

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-08-04 13:54:48 EDT; 22min ago
     Docs: man:nginx(8)
 Main PID: 723 (nginx)
    Tasks: 3 (limit: 4915)
   Memory: 16.3M
   CGroup: /system.slice/nginx.service
           ├─723 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ├─726 nginx: worker process
           └─727 nginx: worker process


8. Start the firewall.


>ENV

debian 10

Thursday, July 29, 2021

Eclipse issue: Could not write metadata for '/RemoteSystemsTempFiles' ... (Access is denied)

 

>PROBLEM


Eclipse throws the following message:

Could not write metadata for '/RemoteSystemsTempFiles' ... (Access is denied)
..\eclipse-jee-2021-03_revision\.metadata\.plugins\org.eclipse.core.resources\.projects\RemoteSystemsTempFiles\.markers.snap (Access is denied)






>SOLUTION

1. Most probable possibility is folder corruption.
Delete it and make it again.

Example (Windows, dos):
mkdir L:\portables_d\ide_home\eclipse-jee-2021-03_revision\.metadata\.plugins\org.eclipse.core.resources\.projects\RemoteSystemsTempFiles\.markers.snap



2. Less probable is access permission.
If linux, check and use chmod.
If Windows, follow the figure:



>ENV

Windows 10
eclipse-jee-2021-03

Thursday, July 22, 2021

Eclipse: JSF: schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd'


>PROBLEM 

Eclipse returns on face-config.xml file the following message:

  schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd'


>SOLUTION

1. Test the URLs pointing them on the browse to make sure that they exist.

<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">

2. If all URLs points to a valid page, try to change something on the page and save again.
In this example, the "faces-config" element was rearranged like this:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">





>ENV


st03ajs
jsf2.2
java13
wildfly8

Friday, July 16, 2021

Git - Fix Corrupted Object Issue - Simple solution for: error: object file .git/objects ... fatal: loose object ...is corrupt


>PROBLEM

Git pull command fails returning error message of corrupted file:


git pull

error: object file .git/objects/dd/4b0b1a777609ba3f787823e566bfc989905319 is empty

fatal: loose object dd4b0b1a777609ba3f787823e566bfc989905319 (stored in .git/objects/dd/4b0b1a777609ba3f787823e566bfc989905319) is corrupt



>SOLUTION

1.. Copy the corrupted file from another local repository.
If there isn't another, you may clone one.


2. Issue the pull command again.


>ENV

windows 10


 







Wednesday, March 31, 2021

Maven: [ERROR] Child module..does not exist @


 >PROBLEM


mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=ejb-javaee7


Returns:

[ERROR] Child module..does not exist @



>SOLUTION

Check your pom.xml.

Also, check the mirror's configuration in the maven's settings.xml file.


Example: 

C:\Users\MYLOGIN\.m2\settings.xml


<mirrors>

<mirror>

<id>client-repo</id>

<mirrorOf>*</mirrorOf>

<url>http://xyz.core.cliente:8099/nexus/content/groups/my-group/</url>

</mirror>

</mirrors>


Comment, or remove the mirror that is not providing connection.

If it is a project mandatory resource, then report.


>ENV

Windows10

(Same for *nix or apple except the paths)


Friday, March 12, 2021

JavaScript: error NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'

>PROBLEM


After adding an implementation to bind using ngModel , for instance:

  <p>

    <label for="example-ngModel">[(ngModel)]:</label>

    <input [(ngModel)]="currentItem.name" id="example-ngModel">

  </p>


Return the error message:

  error NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'



>SOLUTION

@SEE: this issue may also be caused by other factors, check:
angular-ngform-error-ng8002-cant-bind.html


Make sure that the app.module.ts has the following configuration:


import { BrowserModule } from '@angular/platform-browser';

import { NgModule } from '@angular/core';

import { FormsModule } from '@angular/forms'; // <--- JavaScript import from Angular


@NgModule({

  declarations: [

    AppComponent,

// ...

  ],

  imports: [

    BrowserModule,

    FormsModule,

    AppRoutingModule

  ],

  providers: [],

  bootstrap: [AppComponent]

})

export class AppModule { }



In the app.component.ts (or whatever) file, check the import and make sure the constructor() and ngOnInit() are both declared:


import { Component,  OnInit } from '@angular/core';  // minimal

//import { Component,  OnInit, Output, Input, EventEmitter } from '@angular/core';  // usual 


  constructor() { }

  ngOnInit(): void {

  }


>MORE


>ENV

node.js 14.x.x

windows



Tuesday, March 9, 2021

JavaScript: TypeScript: This condition will always return 'true' since the types 'string' and 'EventEmitter' have no overlap.ts(2367)


 >PROBLEM


The code below returns the error message:

This condition will always return 'true' since the types 'string' and 'EventEmitter<string>' have no overlap.ts(2367)



*** BAD

  crossOffItem(event: EventEmitter<string>): void {

      const ritems = this.items.filter( it => it !== event);

      this.items = ritems;

  }




>SOLUTION


TypeScript complains that the types are not explicitly equivalent or comparable.


*** OK

  crossOffItem(event: EventEmitter<string>): void {

      const ritems = this.items.filter( it => it !== event.toString());

      this.items = ritems;

  }



POOR SOLUTION


  crossOffItem(event: EventEmitter<string>): void {

      const val = event.toString();

      const ritems = this.items.filter( it => it !== val);

      this.items = ritems;

  }


>ENV

Node.js v.14.15.4

Wednesday, March 3, 2021

Oracle Cloud: Linux VM denies access returning "oracle cloud public key WARNING: UNPROTECTED PRIVATE KEY FILE" message

>PROBLEM

You are using Windows and the procedures suggested by Oracle's documentations to connect the Oracle Cloud Linux VM fail returning the message:

oracle cloud Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

>SOLUTION

Faster than "fighting" for an ideal solution via Windows, perform the procedure on Linux environment using a Docker container or a virtual machine (VirtualBox, VMware, etc.). 


>ENV

Oracle Cloud Linux VM
Windows 10
Debian 10/VMware

Tuesday, March 2, 2021

legacy: Netbeans v.6.7.1 Installation - JDK not found issue

 

>PROBLEM

Attempt to execute the installer fails returning message that JDK was not found.


>SOLUTION

This procedure avoids messing with the configuration of your system.

Java installers usually use the following default paths:
C:\Program Files\Java
C:\Program Files (x86)\Common Files\Oracle\Java\javapath

The Netbeans v6.7.1 installer uses by default this:
C:\ProgramData\Oracle\Java\javapath

To avoid changing the System's configuration, the installation may be done as below.

1. Java setup for Netbeans v.6.7.1 

Netbeans v6.7.1 searches "java.exe" by default under the following path:
  C:\ProgramData\Oracle\Java\javapath\java.exe
Check if it is present on the system.

If present, check the java's version:
  C:\ProgramData\Oracle\Java\javapath\java.exe java -version
The Netbeans 6.7.1 accepts Java 8 version.

If not, copy from another folder on the system the "java.exe" for Java 8.
Try the usual default places referred above.
Copy the java executables to the netbean's default path (better all of them, just in case):
java.exe
javaw.exe
javaws.exe

2. Extracts the bundle from the Netbeans executable.
netbeans-6.7.1-ml-windows.exe --extract

3. Run the bundle extrated to start the installer.
java -jar bundle.jar





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