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