Marco Zanini

Ranch Hand
+ Follow
since Oct 31, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marco Zanini

I probably found out why WatchDog is missing some events when I add a directory containing a bunch of files, the problem is that the new directory has to be registered and in the meantime some events are gone. What can I do?
10 years ago
Hi to all, I'm using jsch to operate on remote filesystems with sftp. The only problem is that I have to cancel a directory that have files in it but jsch (sftp?) cannot cancel non-empty directories. Is there a way to do it or do I have to memorize the entire remote filesystem in order to be able to cancel contained files?
Hi to all, I'm developing a program in order to recursively watch a directory for changes. The program works fine but when I copy a directory with a lot of files inside some of them are just missed and the overflow event is never raised. Here's my code, the watchDog puts every event in a blockinQueue read by the farmer.



This is the Farmer:


Has anyone tried to use this service and had similar problems? I searched trough the internet but wasn't able to find anything.

Thanks
10 years ago
Hi to all, I'm experiencing problems building a jar file with maven using Eclipse plugin, this is the log:

[DEBUG] After assembly is interpolated:

<?xml version="1.0"?>
<assembly xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<outputDirectory>/doc</outputDirectory>
<directory>doc/</directory>
</fileSet>
<fileSet>
<outputDirectory>/doc/api</outputDirectory>
<directory>target/site/apidocs</directory>
</fileSet>
</fileSets>
</assembly>



[DEBUG] All known ContainerDescriptorHandler components: [plexus, metaInf-spring, file-aggregator, metaInf-services]
[DEBUG] FileSet[doc/] dir perms: -1 file perms: -1
[DEBUG] The archive base directory is 'null'
[DEBUG] FileSet[doc/api/] dir perms: -1 file perms: -1
[DEBUG] The archive base directory is 'null'
[DEBUG] Cannot find ArtifactResolver with hint: project-cache-aware
org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
role: org.apache.maven.artifact.resolver.ArtifactResolver
roleHint: project-cache-aware
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:229)
at org.apache.maven.shared.repository.DefaultRepositoryAssembler.contextualize(DefaultRepositoryAssembler.java:721)
at org.codehaus.plexus.PlexusLifecycleManager.contextualize(PlexusLifecycleManager.java:264)
at org.codehaus.plexus.PlexusLifecycleManager.manageLifecycle(PlexusLifecycleManager.java:240)
at org.codehaus.plexus.PlexusLifecycleManager.manageDeferredLifecycles(PlexusLifecycleManager.java:216)
at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:141)
at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:75)
at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1021)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:80)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:50)
at org.sonatype.guice.bean.locators.EntryListAdapter$ValueIterator.next(EntryListAdapter.java:113)
at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:187)
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:413)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.util.NoSuchElementException
at java.util.AbstractList$Itr.next(AbstractList.java:350)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:249)
... 50 more
[DEBUG] No dependency sets specified.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.774s
[INFO] Finished at: Tue Mar 13 09:20:25 GMT 2012
[INFO] Final Memory: 10M/25M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:attached (make-assembly) on project scamall: Failed to create assembly: Error creating assembly archive bin: You must set at least one file. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:attached (make-assembly) on project scamall: Failed to create assembly: Error creating assembly archive bin: You must set at least one file.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to create assembly: Error creating assembly archive bin: You must set at least one file.
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:472)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.plugin.assembly.archive.ArchiveCreationException: Error creating assembly archive bin: You must set at least one file.
at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:196)
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:413)
... 21 more
Caused by: org.codehaus.plexus.archiver.ArchiverException: You must set at least one file.
at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain(AbstractZipArchiver.java:272)
at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute(AbstractZipArchiver.java:250)
at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:871)
at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive(AssemblyProxyArchiver.java:512)
at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:192)
... 22 more
[ERROR]
[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



My pom.xml is:


Thank you to everybody!
10 years ago
Well, after trying it for a while I can say it works great! Authenticating the user trough the LDAP local directory and then accessing Google Apps on the cloud is great!

Cheers
10 years ago
So, I have to be sorry again, many times one thinks things are well explained but it's wrong.

So I have an application running on a web server on my machine. I want to obtain access to google services using oAuth. So I have to make a request to the Google server with some parameters and read the parameter in the response which is embedded in the title of the page. This is because for authoriing the application the user is redirected to an url that asks him for permissions and then Google redirects the browser to the webpage which title I have to examine.

I hope now everything is clear, thank you for your patience.
10 years ago
Oh sorry, I need to acquire it with my application without user intervention.
10 years ago
You ask google for an authorization code and google will provide you one embedded in the title of the page. You should save it and send it again to google together with other parameters to get an access token.

Authorization code is passed as code when you send it to Google. I think that this phrase in that link leaves no doubts: "The authorization code can be returned to your application in the title bar of the browser or to an http://localhost port in the query string."
10 years ago
Hi to all,
I need to get a parameter who's inside the title of a web page. I am using servlets and java. How can I do? I suppose I should wait for the page to load too.

Many thanks!
10 years ago
Thank you, I'll give it a try! And then let you know if it works good.
10 years ago
Hi to all, I'm trying to implement an application on google app engine and I want to be able to manage the identity of my users. I want to use SAML and I found some interesting projects like: http://www.forgerock.com/openam.html. Anyway, now I can't deploy the WAR because the uploader from google fails in compiling some files. Do you know other good choices to manage user's identity? Should I try another way?
10 years ago
Yes but I have to use Google App Engine. Thanks anyway.
10 years ago
Thank you, really fast! So I am wondering why it doesn't succeeds, sometimes the error is for a file missing, sometimes for a wrong method call. Maybe when you upload a war the server isn't supposed to do all the checks that the GAE upoader does (for example check if all the jsp files can be compiled).
10 years ago