Target A revision of all the main steps to install an Angular site with Spring Boot web service using Docker. The app calls the web service that works with a mocking database and shows the top ten movies list. The main page loads the movies’ list on its initialization. Since the persistence layer is not … Read More “Docker: Step-by-Step For An Angular Project Using Spring Boot Web Service [ML33743]” »
Category: java
EXAMPLE #1 – Simplest public enum Enum_ { SCJP, SCWCD, SWWD, WWFF; public static void main(String[] args) { System.out.println(Enum_.SCJP); System.out.println(Enum_.valueOf(“SCJP”)); Enum_[] e = Enum_.values(); System.out.println(“e[1] = ” + e[1]); System.out.println(“Enum_.SCJP = ” + Enum_.SCJP); System.out.println(“Enum_.valueOf(\”SCJP\”) = ” + Enum_.valueOf(“SCJP”)); Enum_[] ae = Enum_.values(); System.out.println(“Enum_[] ae: “); for(Enum_ e1:ae) { System.out.println(e1); } Enum_ en = Enum_.SCJP; … Read More “Java: Enum Examples – Templates for Enumerations” »
Scenario Suppose that you try to start an Eclipse installation, and it fails returning exit code 8, 13, etc. , something like “java terminated exit code 8“. This is usually caused due to the version of Java used by the environment that it is incompatible with the version of the Eclipse installation. Another situation comes … Read More “Java: Handling Java Installation on Debian/Ubuntu – Eclipse fails with exit code” »
>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 … Read More “WILDFLY/JBOSS: WFLYJPA0061: Persistence unitName was not specified and double persistence unit definitions” »
>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. … Read More “JBOSS: JBAS014775: New missing/unsatisfied dependencies:” »
1. Setup configuration: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <archive> <manifest> <mainClass> main.ProductionTools </mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </execution> </executions> </plugin> 2. Execute the command below. mvn clean install 3. Check the created file ended with jar-with-dependencies Verify the folder, target, for the jar ended with the name “jar-with-dependencies”. … Read More “MAVEN: GENERATING AN EXECUTABLE JAR” »
>PROBLEM When running “mvn clean install” you get: Fatal error compiling: invalid target release: >SOLUTION Set JAVA_HOME envvar or include it into the script which runs maven. export JAVA_HOME=”/home/portables_d/jdk1.8.0_144″ >ENV linux/debian Andre DiasBrazilian system analyst graduated by UNESA (University Estácio de Sá – Rio de Janeiro). Geek by heart. ultering.com/it4us/?page_id=2048
PROBLEM Maven fails to load spring references Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from http://maven.repository.redhat.com/ga/ … Read More “MAVEN: FAILS TO LOAD SPRING REFERENCES” »
class Base { private final String USER_AGENT = “Mozilla/5.0”; public void testConnection ( URL url){ try { HttpURLConnection con = (HttpURLConnection) url.openConnection(); // optional default is GET con.setRequestMethod(“GET”); //add request header con.setRequestProperty(“User-Agent”, USER_AGENT); int responseCode = con.getResponseCode(); System.out.println(“\nSending ‘GET’ request to URL : ” + url); System.out.println(“Response Code : ” + responseCode); BufferedReader in = … Read More “JAVA: HTTP – SIMPLE CALL” »
Import into your pom.xml the following xml part. <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.9.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.9.1</version> </dependency> </dependencies> create the configuration file configuration.xml <?xml version=”1.0″ encoding=”UTF-8″?> <Configuration> <Appenders> <Console name=”Console”> <PatternLayout pattern=”%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} – %msg%n”/> </Console> </Appenders> <Loggers> <Root level=”trace”> <AppenderRef ref=”Console”/> </Root> </Loggers> </Configuration> use it import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; class … Read More “LOG4J 2: QUICKSTART AND CONCEPTS” »