Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] Need help to collect completion proposals made by code recommenders programetically

Hi Marcel,
Thanks for your reply. It works and gives me the following output:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Setting up recommender and model repository (downloads search index
the first time).
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
further details.
Query the recommender the first time (no model yet available).
Try #1: num of recs: 0
Waiting for model download to happen in background.
Exception in thread "pool-6-thread-1" java.lang.NullPointerException
	at org.eclipse.recommenders.models.AetherModelRepository$1.transferFailed(AetherModelRepository.java:155)
	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:677)
	at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:679)
Model got downloaded to
/tmp/1375896725191-0/repository/jre/jre/1.0.0/jre-1.0.0-call.zip.
try #2: num of recs: 2
	Recommendation{proposal=Ljava/lang/String.equals(Ljava/lang/Object;)Z,
probability=0.9843}
	Recommendation{proposal=Ljava/lang/String.equalsIgnoreCase(Ljava/lang/String;)Z,
probability=0.0122}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I am trying to understand the code. I can get the position of method
calling in a Java code. Now I need to create the right query and call
the recommender.computeRecommendations(query) method.
If I am missing something or something can help me to understand the
code, please let me know.

Thanks again for your help.

-Muhammad Asaduzzaman


On Wed, Aug 7, 2013 at 12:56 AM, Marcel Bruch
<marcel.bruch@xxxxxxxxxxxxxx> wrote:
> Hi Muhammad
>
> I reproduced the error. The reason is that (probably) due to the change to use package-imports rather than required-bundles some transitive dependencies cannot be resolved by Eclipse statically anymore. When running this code in an OSGI container it should work out-of-the-box. The SingleZipCallRecommender, however, should work out of the box.
>
>
> To make the EclipseOrgMain work (locally) in your case, add in the manifest.mf:
>
> Require-Bundle: […]
>  com.ning.async-http-client;bundle-version="1.6.5",
>  org.jboss.netty;bundle-version="3.2.5"
>
> Then you should be able to run EclipseOrgMain. Depending on whether you update the git repository or not, you will get a NPE on the console which can be ignored safely (fix for this is in Gerrit).
>
> HTH
> Marcel
>
>
> On Aug 7, 2013, at 7:37 AM, Muhammad Asaduzzaman <parvez.usask@xxxxxxxxx> wrote:
>
>> Hi Marcel,
>> I run the main method (Right click on the example folder and select
>> the option use as source folder) and I have received the same error:
>>
>> Setting up recommender and model repository (downloads search index
>> the first time).
>> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
>> SLF4J: Defaulting to no-operation (NOP) logger implementation
>> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
>> further details.
>> Exception in thread "main" java.util.concurrent.ExecutionException:
>> java.lang.NoClassDefFoundError: com/ning/http/client/AsyncHandler
>>       at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
>>       at java.util.concurrent.FutureTask.get(FutureTask.java:111)
>>       at org.eclipse.recommenders.models.AetherModelRepository.open(AetherModelRepository.java:111)
>>       at org.eclipse.recommenders.examples.calls.EclipseOrgCallRecommenderMain.main(EclipseOrgCallRecommenderMain.java:27)
>> Caused by: java.lang.NoClassDefFoundError: com/ning/http/client/AsyncHandler
>>       at org.eclipse.recommenders.models.AetherModelRepository$ManualWagonProvider.lookup(AetherModelRepository.java:400)
>>       at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.lookupWagon(WagonRepositoryConnector.java:282)
>>       at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.<init>(WagonRepositoryConnector.java:154)
>>       at org.sonatype.aether.connector.wagon.WagonRepositoryConnectorFactory.newInstance(WagonRepositoryConnectorFactory.java:142)
>>       at org.sonatype.aether.impl.internal.DefaultRemoteRepositoryManager.getRepositoryConnector(DefaultRemoteRepositoryManager.java:346)
>>       at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
>>       at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
>>       at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
>>       at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
>>       at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
>>       at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:191)
>>       at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:333)
>>       at org.eclipse.recommenders.models.AetherModelRepository$DownloadArtifactTask.call(AetherModelRepository.java:315)
>>       at org.eclipse.recommenders.models.AetherModelRepository$DownloadArtifactTask.call(AetherModelRepository.java:1)
>>       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>>       at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>>       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
>>       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>       at java.lang.Thread.run(Thread.java:679)
>> Caused by: java.lang.ClassNotFoundException: com.ning.http.client.AsyncHandler
>>       at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
>>       at java.security.AccessController.doPrivileged(Native Method)
>>       at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>>       at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
>>       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>>       at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>>       ... 19 more
>>
>> Any suggestion about resolving this issue?
>> Thanks again for your help.
>>
>> -Muhammad Asaduzzaman
>>
>> On Tue, Aug 6, 2013 at 1:33 PM, Marcel Bruch
>> <marcel.bruch@xxxxxxxxxxxxxx> wrote:
>>> What does
>>>
>>> I have moved the java
>>> source files (found in the example folder including
>>> EclipseOrgCallRecommenderMain.java) inside Eclipse to a package and
>>> try to run the main method.
>>>
>>>
>>>
>>> exactly mean? Are they still in the same project?
>>>
>>> You can simple right-click on the examples folder and select  "Build Path >
>>> Use as Source Folder". This should compile the classes and you should be
>>> able to run the main program.
>>>
>>> HTH
>>> Marcel
>>>
>>>
>>> On Aug 6, 2013, at 9:11 PM, Muhammad Asaduzzaman <parvez.usask@xxxxxxxxx>
>>> wrote:
>>>
>>> Hi,
>>> I have just noticed the files are in a folder. I have moved the java
>>> source files (found in the example folder including
>>> EclipseOrgCallRecommenderMain.java) inside Eclipse to a package and
>>> try to run the main method. This time program executes but gives me
>>> the following error:
>>>
>>>
>>>
>>> _______________________________________________
>>> recommenders-dev mailing list
>>> recommenders-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/recommenders-dev
>>>
>> _______________________________________________
>> recommenders-dev mailing list
>> recommenders-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/recommenders-dev
>
> _______________________________________________
> recommenders-dev mailing list
> recommenders-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/recommenders-dev


Back to the top