Deploying on Wildfly using jboss-as-maven-plugin - java

I'm actually really new to this...
everytime I try to deploy a war file in Wildfly it gives me this error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.774 s
[INFO] Finished at: 2015-03-23T01:56:20+08:00
[INFO] Final Memory: 24M/283M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Fi
nal:deploy (default-cli) on project jbpm6-example: Could not execute goal deploy
on E:\Apps\jbpm6-example\target\jbpm6-example-1.0.war. Reason: Error could not
execute operation '{
[ERROR] "address" => [],
[ERROR] "operation" => "read-attribute",
[ERROR] "name" => "launch-type"
[ERROR] }'. java.net.ConnectException: JBAS012144: Could not connect to remote:/
/localhost:9999. The connection timed out
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
I've tried configuring the plugin in pom.xml like this to connect to port 9999 since from what I've searched wildfly is using port 9990..
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.3.Final</version>
<configuration>
<hostname>localhost</hostname>
<port>9999</port>
</configuration>
</plugin>
but still can't deploy it...
I've also tried using the wildfly-maven-plugin but it also gives me an error: Deployment failed and was rolled back

Older jboss-as-maven-plugin will not work with WildFly. You need to use the newer wildfly-maven-plugin only. It can be defined as:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.1.0.Alpha1</version>
</plugin>
...
</plugins>
...
</build>
...
</project>
And then mvn wildfly:deploy will work.
Here is a blog that provide more details:
http://blog.arungupta.me/wildfly-maven-plugin-tech-tip-9/
All Java EE 7 samples at https://github.com/javaee-samples/javaee7-samples use this plugin as well.
Alternatively, you can find a simpler Java EE 7 sample using this plugin at:
https://github.com/javaee-samples/javaee7-simple-sample/blob/master/pom.xml

Related

Can't deploy jars to S3 after upgrading from Java 8 to Java 10, what's going on?

After upgrading from Java 8 to Java 10, I can't no longer deploy to AWS S3. I have this in the build section of my pom.xml:
<extensions>
<extension>
<groupId>com.allogy.maven.wagon</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.1.0</version>
</extension>
</extensions>
and then I defined the repos:
<distributionManagement>
<repository>
<id>projectx-aws-release</id>
<name>ProjectX AWS Release Repository</name>
<url>s3://projectx-support/maven2</url>
</repository>
<snapshotRepository>
<id>projectx-aws-snapshots</id>
<name>ProjectX AWS Snapshot Repository</name>
<url>s3://projectx-support/maven2</url>
</snapshotRepository>
</distributionManagement>
This is the error I'm getting:
Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed: A required class was missing while executing org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy: javax/xml/bind/Datatype
Converter
The full output from when things start to go wrong is:
Uploading to projectx-aws-release: s3://projectx-support/maven2/tech/projectx/projectxcommon/1.0.0-beta.9/projectxcommon-1.0.0-beta.9.jar
[INFO] File permissions: Private
[INFO] Logged in - projectx-support
[INFO] Uploading: s3://projectx-support/maven2/tech/projectx/projectxcommon/1.0.0-beta.9/projectxcommon-1.0.0-beta.9.jar
[INFO] Logged off - projectx-support
[INFO] Transfers: 1 Time: 368ms Amount: 71.5k Throughput: 194.232 KB/s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.811 s
[INFO] Finished at: 2018-06-27T11:53:20+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project projectxcommon: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed: A required class was missing while executing org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy: javax/xml/bind/Datatype
Converter
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/pupeno/.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.jar
[ERROR] urls[1] = file:/C:/Users/pupeno/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[2] = file:/C:/Users/pupeno/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>tech.projectx:projectxcommon:1.0.0-beta.9, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : javax.xml.bind.DatatypeConverter
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
Any ideas what's going on? Is this a class that was present in Java 8 and not in Java 10? That sounds unlikely.
I tried adding javax.xml.bind to my project this way:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
but that made no difference in the error.
I managed to fix the issue updating the wagon from version 1.1.0 to 1.2.0

OpenClover not Running - Error

I am trying to integrate OpenClover into my project.
I have a Java based webapp and I use maven
I have setup the plugin as follows
<plugin>
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId>
<version>4.2.0</version>
<configuration>
<targetPercentage>50%</targetPercentage>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
When I run the following command
mvn clean test clover:aggregate clover:clover -Dsurefire.skip.tests=false;
I get this error
[ERROR] Failed to execute goal org.openclover:clover-maven-plugin:4.2.0:setup (default-cli) on project fcservices-web: Execution default-cli of goal org.openclover:clover-maven-plugin:4.2.0:setup failed: Unable to load the mojo 'setup' (or one of its required components) from the plugin 'org.openclover:clover-maven-plugin:4.2.0': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) No implementation for org.apache.maven.execution.MavenSession was bound.
[ERROR] while locating com.atlassian.maven.plugin.clover.CloverSetupMojo
[ERROR] at ClassRealm[plugin>org.openclover:clover-maven-plugin:4.2.0, parent: sun.misc.Launcher$AppClassLoader#55f96302]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.openclover:clover-maven-plugin:4.2.0:setup)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.openclover:clover-maven-plugin:4.2.0:setup
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
Any ideas what is up here?
Thank you
Damien
From error it looks like you need higher version of Maven or older version of Clover plugin.
Going to the latest version of Maven (3.5.2) resolved this issue

Failed to read artifact descriptor for commons-jxpath:commons-jxpath:jar:1.3-osgi:

I am facing below mentioned error while building through maven . I have tried many solutions like using mirror but none of them is working . Please point me in some direction to fix the issue.
Downloading: http://repository.codehaus.org/org/beanshell/bsh/2.0b4-osgi/bsh-2.0b4-osgi.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.779 s
[INFO] Finished at: 2016-05-23T13:26:22+05:30
[INFO] Final Memory: 16M/308M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project net-myproject-ticketing-reports: Could not resolve dependencies for project net.myproject.ticketing.reports:net-myproject-ticketing-reports:jar:1.0.1-SNAPSHOT: Failed to collect dependencies at com.myproject.resourcelib.thirdparty.framework:mule-mule-2.2.1:jar:2.2.1 -> org.mule.transports:mule-transport-bpm:jar:2.2.1 -> org.mule.modules:mule-module-client:jar:3.4.0 -> org.mule.modules:mule-module-xml:jar:3.4.0 -> commons-jxpath:commons-jxpath:jar:1.3-osgi: Failed to read artifact descriptor for commons-jxpath:commons-jxpath:jar:1.3-osgi: Could not transfer artifact commons-jxpath:commons-jxpath:pom:1.3-osgi from/to codehaus (http://repository.codehaus.org): Failed to transfer file: http://repository.codehaus.org/commons-jxpath/commons-jxpath/1.3-osgi/commons-jxpath-1.3-osgi.pom. Return code is: 503 , ReasonPhrase:Service Unavailable. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
The problem is that codehaus.org was closed and is no longer available, but older versions of Mule still mention that repository as a place to resolve some dependencies. Specifically commons-jxpath:commons-jxpath:jar:1.3-osgi which appears to be non-standard rebundling of version 1.3 with added OSGI support.
What you can do:
use a newer version of Mule that no longer depends on custom artifacts that are not available in standard repositories
find a different repository that hosts this artifact and add custom repository location either to user settings.xml or project pom.xml.
With option 2 random googling presents this repository: (not sure if it's a good choice!)
<repositories>
<repository>
<id>mule-old-dependencies</id>
<url>http://repository.idega.com/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

Maven WildFly Plugin: Could not execute goal deploy

I want to deploy my war-files with the maven wildfly-plugin.
I use the wildfly-8.2.0.Final-version and I was to force to change the port of the management-console to http://127.0.0.1:9990.
This is my maven configuration:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
<configuration>
<jbossHome>C:\wildfly-8.2.0.Final</jbossHome>
<hostname>127.0.0.1</hostname>
<port>8080</port>
<serverConfig>standalone-full.xml</serverConfig>
</configuration>
</plugin>
I get following error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.705 s
[INFO] Finished at: 2016-02-01T22:46:43+01:00
[INFO] Final Memory: 21M/171M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) on project wildfly: Could not execute goal deploy on C:\Users\laudatio\Documents\Java\wildfly\target\wildfly.war. Reason: I/O Error could not execute operation '{
[ERROR] "operation" => "read-attribute",
[ERROR] "address" => [],
[ERROR] "name" => "launch-type"
[ERROR] }': java.io.IOException: Unknown service name
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Any suggestions?
The error message isn't great, it's been fixed upstream, but the issue is you've got the wrong port defined. The plugin uses the management port which by default is 9990. If you change the configuration to <port>9990</port> or leave it off it should work.
A side note most of the configuration you have is not needed. The jbossHome and serverConfig are only needed for the run and start goals. If you're just deploying you don't need any of that configuration defined. The defaults should be correct.
The reason of the problem could be one of the following:
The deployment of any archive (jar, war, ear) through wildfly-maven-plugin plugin will happen only if the WildFly is listening at its management port which is 9990 by default. So make sure that WildFly is listening at its management port.
If WildFly is listening at its management port then check if your host file located at %SYSTEM_ROOT%\System32\drivers\etc for windows machine is configured correctly. i.e. your local host is mapped correctly for both IPv4 and IPv6.
127.0.0.1 localhost
::1 localhost

Maven - Build failure : Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean

I've a problem with the following dependency in my pom.xml where org.springframework.version = 3.1.0.RELEASE:
<!-- Spring MVC framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
When I execute the command line 'mvn clean install', I've the following error :
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.052s
[INFO] Finished at: Sat Dec 07 15:49:04 CET 2013
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project myGoogleAppEngine: Failed to clean project: Failed to delete C:\EclipseProjects\myGoogleAppEngine\target\myGoogleAppEngine-0.0.1-SNAPSHOT\WEB-INF\lib\spring-webmvc-3.1.0.RELEASE.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
By seeing on http://mvnrepository.com/artifact/org.springframework/spring-webmvc/3.1.0.RELEASE , there aren't any errors in my dependency.
I tried to close the project and Eclipse and open again Eclipse but it doesn't work.
Do you have any solutions ?
Thank you

Categories

Resources