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:

Non-resolvable import POM: Failure to find org.wildfly.bom:wildfly-jakartaee8-with-tools:pom
[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 19.0.0.Final element to match the parent's new version.

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

helloworld's source file:
wildfly_quickstart_helloworld_project_pom


- Result:



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




Also check if the "Java Server Faces" configuration on Project Facets matches the "Java Build Path" configuration.

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.





In this case, switching to a newer driver it was enough.




Restart JBoss.

RESULT

SUCCESS





>ENV

jboss-as-7.1.1.Final
Windows 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.

NODE.JS: SEQUELIZE TUTORIAL SERIES
(Revision 2022 using Node.js v.16)


Enjoy!













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