For a long time did not do SSH project, recently took a look at the upgrade to 3.x Appfuse, the new version of the use of some problems occurred in the process of troubleshooting, summarized as follows, for later use. This article source: http://blog.csdn.net/bluishglc/article/details/38640715 prohibited any form of reprint, or will entrust CSDN official maintenance rights!
Start
The first step in using Appfuse naturally is to build the project through Archetype:generate. This is not a problem, the official Quickstart:http://appfuse.org/display/apf/appfuse+quickstart page gives the tools to help us generate the Archetype:generate command line, Unfortunately, this page refers to some of the JS files located on the googleapis.com, the Chinese children may not be able to access these files (why you understand), at least in the writing of this article googleapis.com is not accessible from the country. If these JS files are missing, the page will not automatically generate the command line, although the command itself is not complex, but it is very laborious to write its archetyperepository address and Archetypeartifactid, the following gives four examples, This can be modified as a blueprint:
Example one: Build a single spring Mvc+spring+hibernate project named demo, Appfuse version: 3.0.0
Example two: Building a single spring Mvc+spring+hibernate project called demo, Appfuse version: 3.0.1-snapshot
MVN archetype:generate-b-darchetypegroupid=org.appfuse.archetypes-darchetypeartifactid= appfuse-basic-spring-archetype-darchetypeversion=3.0.1-snapshot-dgroupid=com. Yourcompany-dartifactid=demo- Darchetyperepository=https://oss.sonatype.org/content/repositories/appfuse
Example three: Build a spring Mvc+spring+hibernate-based multi-module project called Sample, Appfuse version: 3.0.0
Example four: Build a spring Mvc+spring+hibernate-based multi-module project called Sample, Appfuse version: 3.0.1-snapshot
MVN archetype:generate-b-darchetypegroupid=org.appfuse.archetypes-darchetypeartifactid= appfuse-modular-spring-archetype-darchetypeversion=3.0.1-snapshot-dgroupid=com. Yourcompany-dartifactid=sample- Darchetyperepository=https://oss.sonatype.org/content/repositories/appfusec
After you build the project, it's easy to build and run the newly built project as instructed by the official documentation, but if you're unlucky, you might encounter some of the following problems:
Problems and Solutions
question one:
Use 3.0.0 version, execute MVN appfuse: Full-source failed, using MVN appfuse:full-source-e to view the error message, report the following error:
[ERROR] Failed to execute goal org.appfuse.plugins: Appfuse-maven-plugin:3.0.0:full-source (DEFAULT-CLI) on project Demo:execution default-cli of
goal Org.appfuse.plugins:appfuse-maven-plugin:3.0.0:full-source failed:java.net.UnknownHostException:raw.github.com: Unknown host raw.github.com
Workaround:
For this issue, the author of the Appfuse in/HTTP The explanation is given in appfuse.547863.n4.nabble.com/appfuse-failed-to-get-full-source-td4657086.html because of the sub-domain name that GitHub changed. A new version of 3.0.1-snapshot was created for this author to address this issue. In my personal usage, this is a very strange problem, the first implementation of MVN Appfuse:full-source did encounter this problem, the next day there is no problem, Theoretically raw.github.com will redirect to the new target domain name, but it seems to be subject to network and configuration for a variety of reasons, this problem is indeed possible. However, using the 3.0.1-snapshot version is not a good solution, and the next FAQ is on the 3.0.1-snapshot version.
question two:
Using the 3.0.1-snapshot version, perform the MVN jetty:run times with the following error:
Java.lang.IllegalStateException:org.slf4j.LoggerFactory could not being successfully initialized.
Workaround:
This problem is really a developer to the user dug a "pit", just from the error log is difficult to find a direct cause, but a line of information in the log:
An API incompatibility is encountered while executing Org.eclipse.jetty:jetty-maven-plugin:xxxxxx:run: Java.lang.ExceptionInInitializerError:null
How much or give us some clues to check the Pom.xml file generated using the 3.0.1-snapshot version, we found that the jetty plugin is configured like this:
<plugin><groupid>org.eclipse.jetty</groupid><artifactid>jetty-maven-plugin</ artifactid><version>8.1.14.v20131031</version><configuration><webapp>< Contextpath>/</contextpath></webapp></configuration></plugin>
With a closer look, we'll see that jetty migrated eclipse, and its version starts with 9.0.0, and there's no 8.1.14.v20131031 this version, and how does this 8.1.14.v20131031 version come from? Look at 3.0.0 's pom.xml we found the answer:
<plugin><groupid>org.mortbay.jetty</groupid><artifactid>jetty-maven-plugin</ artifactid><version>8.1.14.v20131031</version><configuration><webapp>< Contextpath>/</contextpath></webapp></configuration></plugin>
The 8.X version of Jetty is still in its Mortbay version. Obviously, when the author upgraded from 3.0.0 to 3.0.1-snapshot, the wrong version of Jetty! In this way, the solution comes out and changes the <groupid>org.Eclipse.jetty</groupid> in the plug-in configuration to <groupid>org.Mortbay .jetty</groupid> can do it.
Suggestions
Since 3.0.1-snapshot is still in the development phase and may have different problems with different periods of use, the second problem mentioned earlier is an example, so it is recommended to use the 3.0.0 version first.