issue on Maven dependency in Azure pipeline - log4j

I have upgraded the log4j to 2.17 in my client machine azure pipeline, after that i am getting the error as below. Can anyone help me how to solve it.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Test_Automation: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 -> org.codehaus.plexus:plexus-container-default:jar:1.5.5 -> org.apache.xbean:xbean-reflect:jar:3.4 -> log4j:log4j:jar:1.2.12: Failed to read artifact descriptor for log4j:log4j:jar:1.2.12: Could not transfer artifact log4j:log4j:pom:1.2.12 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]

Seems SSL issue you have 2 options
configure ssl
use non https url for maven repository
For second option you may use:
<repository>
<id>maven</id>
<name>maven</name>
<url>http://repo1.maven.org/maven2</url>
</repository>

Related

Jaxb2 Maven Plugin protocol version fatal error

Plugin org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:jar:0.13.2: Could not transfer artifact org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:pom:0.13.2 from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [Help 1]
[ERROR]
Seeing the above error with Java v7 but not with Java v8

SSL problems running azure-webapp-maven-plugin config

when running:
mvn com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config
I end up with
[ERROR] Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config (default-cli) on project storingen-api: Max retries 0 times exceeded. Error Details: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config (default-cli) on project storingen-api: Max retries 0 times exceeded. Error Details: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Clearly this is a certificate problem that cannot be found. I have however no clue what certificate is needed nor in which keystore it needs to be. I suppose in the cacerts of my java distribution but it's not clear in any way.
Does anyone know which cert and where to put it ?
I just running into the same problem following Azure Learn Java Azure
Basically, this error ocurred because Java is trying to connect with your Azure Subscription at Azure Console. I saw the origin of this problem executing Maven command with -X. The log trace can be visualized over here, like this:
mvn com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:config -X
What I did to solve:
I tried inserting Azure certifications inside Java cacerts - following the explanation here. But it didn't change or solved the problem.
I searched for a new one version of azure-webapp-maven-plugin. Nowadays, the version is 2.3.0. You can check at Maven repository the last version. It fixed my problem and no more throws the error caused by Java.
before: mvn com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:config
after (I think so, that version fixes the problem): mvn com.microsoft.azure:azure-webapp-maven-plugin:2.3.0:config
Thanks

Azure Maven Plugin - Deployment Fails with wired error

mvn azure-functions:deploy fails with this wired error. Can you help me decipher the error.
[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.10.0:deploy (default-cli) on project function-sample-azure:
Unknown error with status code 403: Unrecognized field "evaluationDetails" (class com.microsoft.azure.PolicyViolationErrorInfo),
ot marked as ignorable (13 known properties: "policyDefinitionId", "policyDefinitionReferenceId", "policyDefinitionDisplayName", "policyAssignmentParameters",
"policyAssignmentName", "policySetDefinitionName", "policyDefinitionName", "policyAssignmentScope", "policyDefinitionEffect", "policyAssignmentId", "policySetDefinitionId",
"policySetDefinitionDisplayName", "policyAssignmentDisplayName"])
[ERROR] at [Source: (String)"{"policyDefinitionDisplayName":"STORAGE - Deny Storage account Version 1",
"policySetDefinitionDisplayName":"Storage-initiative-npd","evaluationDetails":{"evaluatedExpressions":
[{"result":"True","expressionKind":"Field","expression":"type","path":"type","expressionValue":"Microsoft.Storage/storageAccounts",
"targetValue":"Microsoft.Storage/storageAccounts","operator":"Equals"},{"result":"True","expressionKind":"Field","expression":"kind","path":"kind","expressionValue":"Storage",
"targetValue":"Sto"[truncated 911 chars]; line: 1, column: 154]
(through reference chain: com.microsoft.azure.CloudError["additionalInfo"]->java.util.ArrayList[0]->com.microsoft.azure.PolicyViolationErrorInfo["evaluationDetails"])
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.10.0:deploy
(default-cli) on project function-sample-azure: Unknown error with status code 403
Below are the properties and plugin configuration I am using. I also have an enterprise requirement to not create a new storage account with this deployment; but rather use an existing one is there are way to configure this.
<properties>
<java.version>1.8</java.version>
<functionAppName>12345600SampleFunctionApp</functionAppName>
<functionAppRegion>eastus2</functionAppRegion>
<region>eastus2</region>
<functionResourceGroup>myFunctionResourceGroup</functionResourceGroup>
<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
<start-class>com.wi.prdc.azure.sample.function.Main</start-class>
<azure.functions.java.library.version>1.4.2</azure.functions.java.library.version>
<azure.functions.maven.plugin.version>1.10.0</azure.functions.maven.plugin.version>
<wrapper.version>1.0.23.RELEASE</wrapper.version>
<appServicePlanName>myfunctionAppServicPlan</appServicePlanName>
</properties>
thanks for raising this issue. We will bump default version to v2 in the upcoming maven plugin releases.

Request cannot be proceed error in Jhipster registry version 4.0.0

I downloaded jhipster registry version 4.0.0, imported and run the registry successfully, when I open localhost:8761 I am getting request cannot be proceed error, there is no error information also.
When I used command mvnw I am getting an exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
One way is to use http protocol instead of https.
To do this go into your project directory > .mvn > wrapper > maven-wrapper.properties.
You will find something like distributionUrl=http://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip.
Change this url to using http instead of https.
Other solutions are more complex but there is no harm in trying.
Problems connecting via HTTPS/SSL through own Java client
Calling web service: javax.net.ssl.SSLException: Received fatal alert: protocol_version
javax.net.ssl.SSLException: Received fatal alert: protocol_version
Simply pass "-Dhttps.protocols=TLSv1.2" as extra argument

Error: Invalid or corrupt jarfile occured while trying to build recommendation engine of PredictionIO in Linux machine

Error occured while trying to build the recommendation engine using PredictionIO. Please anyone know how to solve this issue.
root#testing:~/PredictionIO/engines# pio build --verbose
[INFO] [Console$] Using command '/root/PredictionIO/sbt/sbt' at the current working directory to build.
[INFO] [Console$] If the path above is incorrect, this process will fail.
[INFO] [Console$] Uber JAR disabled. Making sure lib/pio-assembly-0.9.4.jar is absent.
[INFO] [Console$] Going to run: /root/PredictionIO/sbt/sbt package assemblyPackageDependency
[ERROR] [Console$] Error: Invalid or corrupt jarfile /root/PredictionIO/sbt/sbt-launch-0.13.7.jar
[ERROR] [Console$] Return code of previous step is 1. Aborting.
For me help to download this file
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.7/sbt-launch.jar
Rename downloaded file to sbt-launch-0.13.7.jar and replace previous file in PredictionIO/sbt/

Resources