I am implementing Spring Session with Redis.
I am getting the following exception:
SEVERE [RMI TCP Connection(3)-127.0.0.1]
org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks
The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal]
(value [java.lang.ThreadLocal#e9d8bb]) and a value of type [io.netty.util.internal.InternalThreadLocalMap]
(value [io.netty.util.internal.InternalThreadLocalMap#1559b23])
but failed to remove it when the web application was stopped. Threads are going to be
renewed over time to try and avoid a probable memory leak.
I have the following dependencies:
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>5.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>2.2.1.RELEASE</version>
</dependency>
I can see that lettuce-core is dragging in the io.netty classes:
[INFO] +- io.lettuce:lettuce-core:jar:5.2.1.RELEASE:compile
[INFO] | +- io.netty:netty-common:jar:4.1.43.Final:compile
[INFO] | +- io.netty:netty-handler:jar:4.1.43.Final:compile
[INFO] | | +- io.netty:netty-buffer:jar:4.1.43.Final:compile
[INFO] | | \- io.netty:netty-codec:jar:4.1.43.Final:compile
[INFO] | +- io.netty:netty-transport:jar:4.1.43.Final:compile
[INFO] | | \- io.netty:netty-resolver:jar:4.1.43.Final:compile
[INFO] | \- io.projectreactor:reactor-core:jar:3.3.0.RELEASE:compile
[INFO] | \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
The io.netty exception is a known, unfixed defect.
Is there a way to work around this? I've already tried the following:
Used version 5.1.8.RELEASE of lettuce-core: Same exception
Used version 5.0.5.RELEASE of lettuce-core: Get NoSuchMethodError: io.lettuce.core.api.StatefulConnection.closeAsync()
Is there a workaround for this problem?
The bug report comments indicate this will mitigate the problem, but will not fully solve it. Perhaps an approach like the following will be good enough for your use case?
public class MyServletContextListener implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
}
public void contextDestroyed(ServletContextEvent event) {
io.netty.util.internal.InternalThreadLocalMap.destroy();
}
}
Related
I created an application using the apache isis simpleapp-archetype and then added the dependencies (isis-module-security-dom and jbcrypt) of the security module to my pom.xml's and the modules and services to my DomainAppAppManifest.
After running mvn clean install on the project the following error happens in the integration tests module:
[INFO] introspecting org.apache.isis.applib.services.iactn.Interaction: class-level details
[INFO] calling #PostConstruct on all domain services
seed-users-and-roles-fixture-script : EXEC org.isisaddons.module.security.seed.SeedUsersAndRolesFixtureScript
seed-users-and-roles-fixture-script/global-tenancy : EXEC org.isisaddons.module.security.seed.scripts.GlobalTenancy
[INFO] abort transaction IsisTransaction#517e381b[state=MUST_ABORT,commands=0]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Simple App ......................................... SUCCESS [ 0.608 s]
[INFO] Simple App DOM ..................................... SUCCESS [ 14.607 s]
[INFO] Simple App Fixtures ................................ SUCCESS [ 1.285 s]
[INFO] Simple App Application ............................. SUCCESS [ 2.204 s]
[INFO] Simple App Integration Tests ....................... FAILURE [ 17.539 s]
[INFO] Simple App Webapp .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.654 s
[INFO] Finished at: 2016-09-26T18:44:48+07:00
[INFO] Final Memory: 65M/572M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.13.0:swagger (default) on project groupid-demo-integtests: Execution default of goal org.apache.isis.tool:isis-maven-plugin:1.13.0:swagger failed: org.datanucleus.store.rdbms.exceptions.MissingTableException: Required table missing : "ISISSECURITY.APPLICATIONROLE" in Catalog "" Schema "ISISSECURITY". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.schema.autoCreateTables"
-> [Help 1]
In principle I followed the documentation found in the security module github repository, but this didn't really work at all, and by taking a look at the quickstart module I figured the security dependencies needed to be added to the parent POM, and the the bcrypt dependency needs to be added to the App POM, and the security-plugin dependency to the Dom POM.
To reproduce the error, this is the what I did:
Create project with archetype
mvn archetype:generate -D archetypeGroupId=org.apache.isis.archetype -D archetypeArtifactId=simpleapp-archetype -D archetypeVersion=1.13.0 -D groupId=my.groupid -D artifactId=groupid-demo -D version=1.0-SNAPSHOT -D archetypeRepository=http://repository-estatio.forge.cloudbees.com/snapshot/ -B
Then in /groupid-demo/pom.xml I added these dependencies:
<dependency>
<groupId>org.isisaddons.module.security</groupId>
<artifactId>isis-module-security-dom</artifactId>
<version>1.13.1</version>
</dependency>
<dependency>
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
<version>0.3m</version>
</dependency>
In /groupid-demo-app/pom.xml I added this dependency:
<dependency>
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
</dependency>
In /groupid-demo-app/src/main/java/domainapp/app/DomainAppAppManifest.java I modified the modules and services as follows:
#Override
public List<Class<?>> getModules() {
return Arrays.asList(
DomainAppDomainModule.class, // domain (entities and repositories)
DomainAppFixtureModule.class, // fixtures
DomainAppAppModule.class // home page service etc
,org.isisaddons.module.security.SecurityModule.class
);
}
#Override
public List<Class<?>> getAdditionalServices() {
return Arrays.asList(
org.isisaddons.module.security.dom.password.PasswordEncryptionServiceUsingJBcrypt.class
);
}
In /groupid-demo-dom/pom.xml I added this dependency:
<dependency>
<groupId>org.isisaddons.module.security</groupId>
<artifactId>isis-module-security-dom</artifactId>
</dependency>
And then /groupid-demo-webapp/src/main/webapp/WEB-INF/shiro.ini has been modified like this:
[main]
....
# to use .ini file
# securityManager.realms = $iniRealm
isisModuleSecurityRealm=org.isisaddons.module.security.shiro.IsisModuleSecurityRealm
authenticationStrategy=org.isisaddons.module.security.shiro.AuthenticationStrategyForIsisModuleSecurityRealm
securityManager.authenticator.authenticationStrategy = $authenticationStrategy
securityManager.realms = $isisModuleSecurityRealm
Finally I executed mvn clean install on the root pom and got above error.
Any idea what I am missing here? This is really just a bare bone simpleapp-archetype app with the only modification applied being the added security module.
Yes, I hit the same issue today when putting together this demo app for the issue you raised on the Apache Isis mailing list.
The issue is that the maven plugin, which generates the swagger spec, uses its own AppManifest, and that manifest needs to correctly reference security.
Since I didn't want to get side-tracked on this, I simply disabled the swagger goal in the pom.xml (remove the '!' exclamation mark).
HTH
Dan
I Have followed steps given in the site to configure maven plugin. When I give "mvn evosuite:generate", it hangs with below detail in console.
[INFO] Going to start job for: com.emirates.gws.service.grouprequest.GroupRequestServiceImpl.
Following are the environment detail
Windows 7
maven-3.2.1
jdk1.7.0_72
Following are the detail shown in console
[INFO] --- evosuite-maven-plugin:0.2.0:generate (default-cli) # gws-grouprequest-implementation ---
[WARNING] The POM for org.slf4j:slf4j-api:jar:1.7.12 is missing, no dependency information available
[WARNING] The POM for org.ow2.asm:asm-all:jar:5.0.4 is missing, no dependency information available
[WARNING] The POM for dk.brics.automaton:automaton:jar:1.11-8 is missing, no dependency information available
[WARNING] The POM for com.googlecode.gentyref:gentyref:jar:1.2.0 is missing, no dependency information available
[WARNING] The POM for net.sf.jgrapht:jgrapht:jar:0.8.3 is missing, no dependency information available
[WARNING] The POM for commons-cli:commons-cli:jar:1.3 is missing, no dependency information available
[WARNING] The POM for org.kohsuke:graphviz-api:jar:1.1 is missing, no dependency information available
[INFO] Going to generate tests with EvoSuite
[INFO] Total memory: 800mb
[INFO] Time per class: 2 minutes
[INFO] Number of used cores: 1
[INFO] Target: D:\EGIT\Projects\GWS\Source\gws-project-MICE\gws-grouprequest\gws-grouprequest-implementation\target\classes
[INFO] Basedir: D:\EGIT\Projects\GWS\Source\gws-project-MICE\gws-grouprequest\gws-grouprequest-implementation
[INFO] SLF4J: Class path contains multiple SLF4J bindings.
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/org/evosuite/evosuite-master/0.2.0/evosuite-master-0.2.0.jar!/org/slf4j/impl/S
taticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/org/evosuite/evosuite-runtime/0.2.0/evosuite-runtime-0.2.0.jar!/org/slf4j/impl
/StaticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/D:/EGIT/Projects/GWS/M2_REPO/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl
/StaticLoggerBinder.class]
[INFO] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[INFO] SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
[INFO] * EvoSuite
[INFO] [MASTER] 21:49:11.703 [main] WARN ProjectAnalyzer - Cannot handle com.emirates.gws.service.payments.PaymentServiceImpl due to: class java.lan
g.ClassNotFoundException Method code too large!
[INFO] Going to execute 32 jobs
[INFO] Going to start job for: com.emirates.gws.service.grouprequest.GroupRequestServiceImpl
From your settings, it looks like you are using 1 core, 2 minutes per class, and trying to generate tests for 32 classes: this means it will take up to 64 minutes to complete. However, each time a new class is done (roughly every 2 minutes), you should get a new entry in the logs.
Btw, it seems you are using only 800MB of memory. Just in case, it is better to use some more, eg 1-1.5GB
Following is bit worrying:
[INFO] [MASTER] 21:49:11.703 [main] WARN ProjectAnalyzer - Cannot handle com.emirates.gws.service.payments.PaymentServiceImpl due to: class java.lan
g.ClassNotFoundException Method code too large!
Java does have limits on how large a method can be. EvoSuite needs to add some instrumentation on the bytecode to work, and that might lead to exceed the limit :(
I need to create a Simple web Application with Spring and CXF Setup
I am using apache-maven-3.0.3 Support for this.
Please tell me what me what number to enter in mvn command prompt , to generate those required artifacts for this.
I tried this way , it only generated the Java Interface and Implementation class
HelloWorld 2. HelloWorldImpl
and two xml files inside WEB-INF
beans 2. web
But i don't know why no jar files have been got created.
I tried this way
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 135: 116
Define value for property 'groupId': : com
Define value for property 'artifactId': : MyAPP
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': com: :
Confirm properties configuration:
groupId: com
artifactId: MyAPP
version: 1.0-SNAPSHOT
package: com
Y: : y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: cxf-jaxws-javafirst:2.1.4
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com
[INFO] Parameter: packageName, Value: com
[INFO] Parameter: package, Value: com
[INFO] Parameter: artifactId, Value: MyAPP
[INFO] Parameter: basedir, Value: C:\myapp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: C:\myapp\MyAPP
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:49.062s
[INFO] Finished at: Sun Sep 25 16:47:29 IST 2011
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
Archetypes are convenient, but I don't think they are going to be helpful to you for this case. This tutorial is a nice, basic example that outputs a running webapp using Spring and Maven. I would suggest you download the code, have a play around and figure out how it works, then start layering in your CXF functionality.
Go forth and build something awesome!
Are there any tools which will notifiy you automatically of any new plugin additions from public maven repositories (e.g. Apache | Codehaus | JBoss | Sourceforge maven repository ...)
There is now an excellent site: https://www.artifact-listener.org/
Maven Versions Plugin
Not an automatic solution but you can use the Maven Versions Plugin has a versions:display-plugin-updates goal that will check all the plugins and reports used in your project and display a list of those plugins with newer versions available. Here is an example of the output it produces:
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.codehaus.mojo.versions-maven-plugin.it:parent:pom:2.0
[INFO] task-segment: [versions:display-plugin-updates]
[INFO] ------------------------------------------------------------------------
[INFO] [versions:display-plugin-updates]
[INFO]
[INFO] The following plugin updates are available:
[INFO] maven-checkstyle-plugin .................................. 2.1 -> 2.2
[INFO] maven-clean-plugin ....................................... 2.1 -> 2.2
[INFO] maven-deploy-plugin ...................................... 2.3 -> 2.4
[INFO] maven-javadoc-plugin ..................................... 2.4 -> 2.5
[INFO] maven-site-plugin .......................... 2.0-beta-6 -> 2.0-beta-7
[INFO]
[WARNING] The following plugins do not have their version specified:
[WARNING] maven-compiler-plugin ..................... (from super-pom) 2.0.2
[WARNING] maven-deploy-plugin ......................... (from super-pom) 2.3
[WARNING] maven-install-plugin ........................ (from super-pom) 2.2
[WARNING] maven-javadoc-plugin ........................ (from super-pom) 2.4
[WARNING] maven-site-plugin .................... (from super-pom) 2.0-beta-6
[WARNING] org.codehaus.mojo:build-helper-maven-plugin .................. 1.2
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Mon Sep 01 15:55:18 IST 2008
[INFO] Final Memory: 6M/104M
[INFO] ------------------------------------------------------------------------
It can also be used to produce a report (part of the site) that you could for example generate each night.
I was not necessarily looking for updates on the libraries used in my project, but was interested in obtaining regular updates on certain products which I am interested in.
For this, the best option might be to subscribe to the relevant mailing lists (by mail or RSS) and to track announcements.
maven release:perform is failing to distribute via FTP.
The first thing I checked is that I can access the target server with the given credentials from the command line. I can with passive FTP but not with active FTP (known firewall restriction). What I can see from googling is that Maven uses passive FTP by default. Is that correct? If not, how can I cause it to use passive FTP?
Assuming Maven is using passive FTP, I would appreciate any other advice.
My configuration:
settings.xml:
<servers>
<server>
<id>repo-ftp</id>
<username>myUserName</username>
<password>myPassword</password>
</server>
</servers>
parent POM:
<distributionManagement>
<repository>
<id>repo-ftp</id>
<url>ftp://myServer</url>
</repository>
<snapshotRepository>
<id>repo-ftp</id>
<url>ftp://myServer</url>
</snapshotRepository>
</distributionManagement>
The error message:
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] FATAL ERROR
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] org.apache.maven.wagon.AbstractWagon.openConnection()V
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Trace
[INFO] java.lang.AbstractMethodError: org.apache.maven.wagon.AbstractWagon.openConnection()V
[INFO] at org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:143)
[INFO] at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:235)
[INFO] at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:153)
[INFO] at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:80)
[INFO] at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:162)
[INFO] at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
[INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:616)
[INFO] at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
[INFO] at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
[INFO] at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
[INFO] at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 16 seconds
[INFO] [INFO] Finished at: Wed Oct 21 17:43:11 UTC 2009
[INFO] [INFO] Final Memory: 25M/47M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Maven execution failed, exit code: '1'
UPDATE
I did have an extension node in the parent POM:
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-beta-5</version>
</extension>
After reviewing the reply from cetnar I realized that I need beta-2 for my particular version of maven. When I switched the extension node to reference beta-2, maven properly complained about not having it available. So, I downloaded and installed using
mvn install:install-file -DgroupId=org.apache.maven.wagon -DartifactId=wagon-ftp -Dversion=1.0-beta-2 -Dpackaging=jar -Dfile=./wagon-ftp-1.0-beta-2-sources.jar
(which is a cut-and-paste from the error message I got, with my local copy of the .jar in the appropriate location).
Now, I get:
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] BUILD ERROR
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Error deploying artifact: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp
[INFO]
[INFO] Component descriptor cannot be found in the component repository: org.apache.maven.wagon.Wagonftp.
Any advice for that problem?
UPDATE 2
I did not have wagon-ftp.jar or commons-net.jar in $M2_HOME/lib but do now. I get the same error.
$M2_HOME/lib:
commons-cli.jar -> ../../java/commons-cli.jar
commons-net.jar -> ../../java/commons-net.jar
doxia-sink-api.jar -> ../../java/doxia-sink-api.jar
jsch.jar -> ../../java/jsch.jar
jtidy.jar -> ../../java/jtidy.jar
maven2.jar -> ../../java/maven2.jar
plexus-container-default.jar -> ../../java/plexus-container-default.jar
plexus-interactivity-api.jar -> ../../java/plexus-interactivity-api.jar
plexus-utils.jar -> ../../java/plexus-utils.jar
wagon-file.jar -> ../../java/wagon-file.jar
wagon-ftp-1.0-beta-2.jar -> ../../java/wagon-ftp.jar
wagon-ftp.jar -> ../../java/wagon-ftp.jar
wagon-http-lightweight.jar -> ../../java/wagon-http-lightweight.jar
wagon-http-shared.jar -> ../../java/wagon-http-shared.jar
wagon-provider-api.jar -> ../../java/wagon-provider-api.jar
wagon-ssh-common.jar -> ../../java/wagon-ssh-common.jar
wagon-ssh-external.jar -> ../../java/wagon-ssh-external.jar
wagon-ssh.jar -> ../../java/wagon-ssh.jar
xml-apis.jar -> ../../java/xml-apis.jar
Note that all other dependencies were deployed using symbolic links to another directory so I continued the same pattern. Access rights are the same for all files. I tried providing both a wagon-ftp.jar and wagon-ftp-1.0-beta-2.jar symbolic link.
I'm not very excited about the prospect of upgrading to the latest version of maven (for fear of new problems), but is that my best option? Any other ideas?
SOLUTION
It worked! Kind of. Now I get an authentication error, but that's a different issue.
The a-ha moment was the mention of -sources and I realized I had downloaded wagon-ftp-1.0-beta-2-sources.jar but installed with -Dversion=1.0-beta-2 (no -sources)... so I copied the sources JAR to the binary jar file name :-).
Thank you all for your help with this!
The setup looks good. And yes, passive mode is the default (see WAGON-143). That said, according to the trace (java.lang.AbstractMethodError is thrown when something tries to call an abstract method), it's obvious that your wagon isn't compatible with your version of maven. Wagon madness...
It's surely not the best place but this is actually documented in the Guide to using Extenstions (pay a special attention to the "Note" at the bottom):
Extensions are used to enable Wagon
providers, used for the transport of
artifact between repositories, and
plug-ins which provide lifecycle
enhancements. Wagon providers
<project>
...
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-beta-2</version>
</extension>
</extensions>
</build>
...
</project>
Note: Wagon 1.0-beta-3+ requires Maven 2.1.0 or above. For Maven 2.0.10
and earlier, use Wagon 1.0-beta-2.
EDIT: About the new error, the maven deploy plugin FAQ describes something very similar:
If you are using the deploy:deploy-file goal and encounter this error:
"Error deploying artifact: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp"
Then you need to place the appropriate wagon provider in your %M2_HOME%/lib. In this case the provider needed is ftp, so we have to place the wagon-ftp jar in the lib directory of your Maven 2 installation.
If the error description is something like this:
"Error deploying artifact: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp org/apache/commons/net/ftp/FTP"
Then you need to place the commons-net jar in %M2_HOME%/lib.
I don't get why one would have to do that but try to put wagon-ftp-1.0-beta-2.jar in %M2_HOME%/lib.
EDIT2: I've read the question again and it looks like you did install a "sources" jar which, of course, doesn't contain the required classes for the runtime. Before following the advice above, try to put wagon-ftp-1.0-beta-2.jar in your repository (and not wagon-ftp-1.0-beta-2-sources.jar).
Did you define wagon-ftp as a extension in your pom?
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-alpha-3</version>
</extension>
</extensions>
If yes I thing the problem is in wrong versions maven and wagon-ftp. Here is one article about this problem.
In maven-user-list I found that you need to use 1.0-beta-2 of the ftp wagon with 2.0.9. 1.0-beta-3 will work with 2.0.10 and Wagon 1.0-beta-5 release will only work as an extension in Maven 2.1.0-M1 and above.