Mahout Recommender Not Working Properly - java

I am working on Mahout and found an issue when I tried to change my csv, previously it was giving me proper recommendations.
Example code:
model = new FileDataModel(new File("E:\\WriteTest.csv"));
UserSimilarity similarity = new PearsonCorrelationSimilarity(model);
UserNeighborhood neighborhood = new NearestNUserNeighborhood(2,similarity,model);
Recommender recomender = new GenericUserBasedRecommender(model,neighborhood, similarity);
List<RecommendedItem> recommendations = recomender.recommend(1,1);
for(RecommendedItem recommendation: recommendations){
System.out.println(recommendation);
}
I have just updated the values of my csv and it has stopped giving me suggestion.
CSV that is not giving me any result:
1,13,9.9
1,26,9.0
1,40,4.0
2,83,9.9
2,167,9.0
2,250,4.0
3,91,9.9
3,167,9.0
3,274,4.0
4,91,9.9
4,167,2.0
CSV which is giving me result:
1,101,5.0
1,102,3.0
1,103,3.0
2,101,5.0
2,102,2.5
2,103,3.0
2,104,2.1
3,101,5.0
3,102,2.5
3,105,4.0
3,107,5.0
4,102,2.0
4,104,4.0
4,105,2.5
4,106,3.0
4,107,2.6
5,101,5.0
5,102,3.4
5,104,2.5
5,105,2.5
5,106,1.0
Output on console respectively:
Result from 1st Dataset Aug 27, 2011 2:45:06 AM
org.slf4j.impl.JCLLoggerAdapter info INFO: Creating FileDataModel for
file WriteTest.csv Aug 27, 2011 2:45:06 AM
org.slf4j.impl.JCLLoggerAdapter info INFO: Reading file info... Aug
27, 2011 2:45:06 AM org.slf4j.impl.JCLLoggerAdapter info INFO:
Readlines: 11 Aug 27, 2011 2:45:06 AM org.slf4j.impl.JCLLoggerAdapter
info INFO: Processed 4 users
I was expecting Item no 167 but din't find any recommendation
Output of 2nd dataset:
Aug 27, 2011 2:52:42 AM org.slf4j.impl.JCLLoggerAdapter info
INFO: Creating FileDataModel for file WriteTest.csv
Aug 27, 2011 2:52:42 AM org.slf4j.impl.JCLLoggerAdapter info
INFO: Reading file info...
Aug 27, 2011 2:52:42 AM org.slf4j.impl.JCLLoggerAdapter info
INFO: Read lines: 21
Aug 27, 2011 2:52:42 AM org.slf4j.impl.JCLLoggerAdapter info
INFO: Processed 5 users
RecommendedItem[item:105, value:3.25]

The recommender is working correctly. The problem is that your data is too sparse. It cannot find a similarity that would link two users such that 167 is recommendable. Try a more realistic data set and I think the behavior will look less surprising.

Related

Apache Cayenne: NullPointerException when commitChanges

I'm trying commitChanges, but catch java.lang.NullPointerException. log:
...
INFO: --- transaction started.
авг 04, 2015 12:33:59 PM org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy processSchemaUpdate
INFO: Full or partial schema detected, skipping tables creation
авг 04, 2015 12:33:59 PM org.apache.cayenne.log.CommonsJdbcEventLogger logQuery
INFO: SELECT NEXT_ID FROM AUTO_PK_SUPPORT WHERE TABLE_NAME = 'ARTIST'
авг 04, 2015 12:33:59 PM org.apache.cayenne.log.CommonsJdbcEventLogger logSelectCount
INFO: === returned 1 row. - took 16 ms.
авг 04, 2015 12:33:59 PM org.apache.cayenne.log.CommonsJdbcEventLogger logQueryError
INFO: *** error.
java.lang.NullPointerException
at com.relx.jdbc.jdbc2.LinterStatementImpl.getUpdateCount(LinterStatementImpl.java:419)
at org.apache.cayenne.access.jdbc.SQLTemplateAction.execute(SQLTemplateAction.java:190)
at org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:124)
at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:280)
at org.apache.cayenne.dba.JdbcPkGenerator.longPkFromDatabase(JdbcPkGenerator.java:310)
at org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:268)
at org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:171)
at org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:76)
at org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:78)
at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:188)
at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:144)
at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:853)
at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:817)
at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:877)
at org.apache.cayenne.access.DataDomain.onSyncNoFilters(DataDomain.java:814)
at org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(DataDomain.java:1031)
at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:817)
at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:756)
at CayenneTest2.main(CayenneTest2.java:61)
Table AUTO_PK_SUPPORT was created and filled Apache Cayenne.
Why throw the Exception?
From the stack trace you are working with Cayenne v. 3.1. The code in question is here. Cayenne SQLTemplateAction checks whether the result of the query is a ResultSet and with the answer being "no", assumes the result is an update count. So it tries to read the update count on line 190:
int updateCount = statement.getUpdateCount();
Somehow the underlying statement object (LinterStatementImpl) is not happy about that. I don't have access to source code of the Linter DB driver, so I can't say what exactly is wrong, but the driver is not behaving the way Cayenne expects it to.
Perhaps Linter is special enough to warrant its own Cayenne DbAdapter (??) Feel free to join Cayenne dev mailing list to discuss what it takes to write one.

How to enable FULL Logging with Ganymed SSH-2

I am developing a java application that executes ssh commands using Ganymed SSH-2
I need to produce full logs for each sequence of commands, e.g. zip file transfer, unzipping, zipping etc..
Having searched the source code for ch.ethz.ssh2.log.Logger i can set the boolean public static volatile boolean enabled = false; to true
this provides the following output
Mar 05, 2015 10:17:25 AM ch.ethz.ssh2.log.Logger info
INFO: kex_algo=diffie-hellman-group-exchange-sha1
Mar 05, 2015 10:17:25 AM ch.ethz.ssh2.log.Logger info
INFO: server_host_key_algo=ssh-rsa
Mar 05, 2015 10:17:25 AM ch.ethz.ssh2.log.Logger info
INFO: enc_algo_client_to_server=aes128-ctr
Mar 05, 2015 10:17:25 AM ch.ethz.ssh2.log.Logger info
INFO: enc_algo_server_to_client=aes128-ctr
Mar 05, 2015 10:17:25 AM ch.ethz.ssh2.log.Logger info
INFO: mac_algo_client_to_server=hmac-sha1-96
Mar 05, 2015 10:17:25 AM ch.ethz.ssh2.log.Logger info
INFO: mac_algo_server_to_client=hmac-sha1-96
Mar 05, 2015 10:17:25 AM ch.ethz.ssh2.log.Logger info
INFO: comp_algo_client_to_server=none
Mar 05, 2015 10:17:25 AM ch.ethz.ssh2.log.Logger info
INFO: comp_algo_server_to_client=none
However I also require ALL level logging for command execution including file transfers.
How do i configure the Logger to produce all the information available?
A little late answer but maybe someone still needs this info.
I managed to get the debug statements visible like this:
public void enableFineLogging() {
try {
ch.ethz.ssh2.log.Logger.enabled = true;
String name = "myDynamicFileNamePart";
FileHandler fileHandler = new FileHandler("./logs/"
+ name + "_SFTP.log", 10000000, 1000, true);
fileHandler.setLevel(Level.FINE);
fileHandler.setFormatter(new SimpleFormatter());
final Logger app = Logger.getLogger("ch.ethz");
app.setLevel(Level.FINE);
app.addHandler(fileHandler);
app.setUseParentHandlers(false);
} catch (Exception e) {
// Catchalog
}
}
With result in file with:
marras 15, 2017 12:16:56 IP. org.slf4j.impl.JCLLoggerAdapter info
INFO: Client identity string: SSH-2.0-SSHJ_0.19.1
marras 15, 2017 12:16:56 IP. org.slf4j.impl.JCLLoggerAdapter info
INFO: Server identity string: SSH-2.0-OpenSSH_6.6.1
marras 15, 2017 12:16:56 IP. org.slf4j.impl.JCLLoggerAdapter debug
FINE: Setting <> to null
marras 15, 2017 12:16:56 IP. org.slf4j.impl.JCLLoggerAdapter debug
FINE: Sending SSH_MSG_KEXINIT
marras 15, 2017 12:16:56 IP. org.slf4j.impl.JCLLoggerAdapter debug
FINE: Setting <> to SOME
marras 15, 2017 12:16:56 IP. org.slf4j.impl.JCLLoggerAdapter debug
FINE: Awaiting <>
marras 15, 2017 12:16:56 IP. org.slf4j.impl.JCLLoggerAdapter debug
FINE: Received SSH_MSG_KEXINIT
Use ConsoleHandler if you wish logs in console.
Also closing the log file needs to be considered with fileHandler.close() after you quit logging.
Tune the log level by choosing from SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL

Jersey: Couldn't find grammar element for class

I use Grails with the JaxRS 311 plugin. I use it with Jersey.
My application is running on a tomcat 7.0.55 server. My server logs in production show the following info messages. I was wondering why "Couldn't find grammar element for class" is an INFO log. Here is the log:
INFO: Couldn't find grammar element for class test.shared.dto.NotificationDtoCollection
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.UserDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.ItemDtoCollection
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.UploadItemDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.UploadItemDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.ItemDetailsDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.ItemDetailsDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class boolean
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
I found the following questions but they do not help in my case: Jersey: what does "couldn't find grammar element" mean? and A JSON object in a POST request for webserver with JERSEY
All my classes have a public default constructor and may be a second parameterized constructor:
class UserDto {
String id
String firstName
String lastName
public UserDto() { }
public UserDto(User user, User currentUser) {
...
}
}
What do these INFO log messages mean and how can I prevent them?
Those messages will go away if you setup the following parameter in your web.xml inside the definition of your <servlet>:
<init-param>
<param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
<param-value>true</param-value>
</init-param>
And restart your serlvet container to take effect.
Does it help if you use JAXB annotations for your classes? Perhaps you can use this as tutorial: http://www.vogella.com/tutorials/JAXB/article.html

Starting 2 hazelcast instances synchronously on a single machine (with hazelcast.initial.min.cluster.size=2)

How can I configure Hazelcast (optimally the version I currently use: 3.1.2) to run 2 hazelcast instances on a single machine, and block the first instance during startup until both instances are present?
hazelcast.initial.min.cluster.size
The blocking behavior described above can be implemented with the help of hazelcast.initial.min.cluster.size when running both instances on different machines: With the configuration:
Config cfg = new Config();
cfg.setProperty("hazelcast.initial.min.cluster.size",
Integer.toString(minimumInitialMembersInHazelCluster));
cfg.getGroupConfig().setName(clusterName);
hazelInst = Hazelcast.newHazelcastInstance(cfg);
run on different machines, I get the output
Apr 15, 2014 9:31:39 AM com.hazelcast.instance.DefaultAddressPicker
INFO: Prefer IPv4 stack is true.
Apr 15, 2014 9:31:39 AM com.hazelcast.instance.DefaultAddressPicker
INFO: Picked Address[192.168.31.105]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
Apr 15, 2014 9:31:40 AM com.hazelcast.system
INFO: [192.168.31.105]:5701 [dev] Hazelcast Community Edition 3.1.2 (20131120) starting at Address[192.168.31.105]:5701
Apr 15, 2014 9:31:40 AM com.hazelcast.system
INFO: [192.168.31.105]:5701 [dev] Copyright (C) 2008-2013 Hazelcast.com
Apr 15, 2014 9:31:40 AM com.hazelcast.instance.Node
INFO: [192.168.31.105]:5701 [dev] Creating MulticastJoiner
Apr 15, 2014 9:31:40 AM com.hazelcast.core.LifecycleService
INFO: [192.168.31.105]:5701 [dev] Address[192.168.31.105]:5701 is STARTING
Apr 15, 2014 9:31:43 AM com.hazelcast.cluster.MulticastJoiner
INFO: [192.168.31.105]:5701 [dev]
Members [1] {
Member [192.168.31.105]:5701 this
}
Apr 15, 2014 9:31:43 AM com.hazelcast.core.LifecycleService
INFO: [192.168.31.105]:5701 [dev] Address[192.168.31.105]:5701 is STARTED
Apr 15, 2014 9:31:43 AM HazelMultiInstanceExp <init>
SEVERE: debug: joined via JoinConfig{multicastConfig=MulticastConfig [enabled=true, multicastGroup=224.2.2.3, multicastPort=54327, multicastTimeToLive=32, multicastTimeoutSeconds=2, trustedInterfaces=[]], tcpIpConfig=TcpIpConfig [enabled=false, connectionTimeoutSeconds=5, members=[], requiredMember=null], awsConfig=AwsConfig{enabled=false, region='us-east-1', securityGroupName='null', tagKey='null', tagValue='null', hostHeader='ec2.amazonaws.com', connectionTimeoutSeconds=5}} with 1 members.
Apr 15, 2014 9:31:43 AM com.hazelcast.instance.DefaultAddressPicker
INFO: Prefer IPv4 stack is true.
Apr 15, 2014 9:31:43 AM com.hazelcast.instance.DefaultAddressPicker
INFO: Picked Address[192.168.31.105]:5702, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5702], bind any local is true
Apr 15, 2014 9:31:43 AM com.hazelcast.system
INFO: [192.168.31.105]:5702 [dev] Hazelcast Community Edition 3.1.2 (20131120) starting at Address[192.168.31.105]:5702
Apr 15, 2014 9:31:43 AM com.hazelcast.system
INFO: [192.168.31.105]:5702 [dev] Copyright (C) 2008-2013 Hazelcast.com
Apr 15, 2014 9:31:43 AM com.hazelcast.instance.Node
INFO: [192.168.31.105]:5702 [dev] Creating MulticastJoiner
Apr 15, 2014 9:31:43 AM com.hazelcast.core.LifecycleService
INFO: [192.168.31.105]:5702 [dev] Address[192.168.31.105]:5702 is STARTING
Apr 15, 2014 9:31:43 AM com.hazelcast.nio.SocketConnector
INFO: [192.168.31.105]:5702 [dev] Connecting to /192.168.31.105:5701, timeout: 0, bind-any: true
Apr 15, 2014 9:31:43 AM com.hazelcast.nio.SocketAcceptor
INFO: [192.168.31.105]:5701 [dev] Accepting socket connection from /192.168.31.105:60803
Apr 15, 2014 9:31:43 AM com.hazelcast.nio.TcpIpConnectionManager
INFO: [192.168.31.105]:5702 [dev] 60803 accepted socket connection from /192.168.31.105:5701
Apr 15, 2014 9:31:43 AM com.hazelcast.nio.TcpIpConnectionManager
INFO: [192.168.31.105]:5701 [dev] 5701 accepted socket connection from /192.168.31.105:60803
Apr 15, 2014 9:31:49 AM com.hazelcast.cluster.ClusterService
INFO: [192.168.31.105]:5702 [dev]
Members [2] {
Member [192.168.31.105]:5701
Member [192.168.31.105]:5702 this
}
but run with two instances on one machine, I get
Apr 15, 2014 9:25:14 AM com.hazelcast.instance.DefaultAddressPicker
INFO: Prefer IPv4 stack is true.
Apr 15, 2014 9:25:14 AM com.hazelcast.instance.DefaultAddressPicker
INFO: Picked Address[192.168.31.105]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
Apr 15, 2014 9:25:15 AM com.hazelcast.system
INFO: [192.168.31.105]:5701 [test3] Hazelcast Community Edition 3.1.2 (20131120) starting at Address[192.168.31.105]:5701
Apr 15, 2014 9:25:15 AM com.hazelcast.system
INFO: [192.168.31.105]:5701 [test3] Copyright (C) 2008-2013 Hazelcast.com
Apr 15, 2014 9:25:15 AM com.hazelcast.instance.Node
INFO: [192.168.31.105]:5701 [test3] Creating MulticastJoiner
Apr 15, 2014 9:25:15 AM com.hazelcast.core.LifecycleService
INFO: [192.168.31.105]:5701 [test3] Address[192.168.31.105]:5701 is STARTING
Apr 15, 2014 9:25:18 AM com.hazelcast.cluster.MulticastJoiner
INFO: [192.168.31.105]:5701 [test3]
Members [1] {
Member [192.168.31.105]:5701 this
}
Apr 15, 2014 9:25:18 AM com.hazelcast.instance.HazelcastInstanceImpl
INFO: [192.168.31.105]:5701 [test3] HazelcastInstance waiting for cluster size of 2
with the last INFO message repeated ad infinitum.
So the cluster size is the number of nodes in the cluster, not the number of hazelcast instances?
Blocking behavior on a single machine
I use cfg.setProperty("hazelcast.initial.min.cluster.size","2") so the two distributed instances start my distributed algorithm synchronously. Furthermore, it solves the problem that some hazelcast members are not found, see https://stackoverflow.com/a/20716919/750378.
So how do I avoid both problems when running on a single machine? It would be great if the cluster size would simple be the number of running hazelcast instances. Then I could keep my configuration above no matter how I deploy my two instances (on 1 or 2 machines).
Update
I have posted an issue about the cluster size at https://github.com/hazelcast/hazelcast/issues/2292.
You could use the same machine to run multiples Hazelcast instance. Under the hoods, Hazelcast binds differents ports for each instance.
Following, a simple test with two instances:
HazelcastInstance firstInstance = Hazelcast.newHazelcastInstance(new Config());
HazelcastInstance secondInstance = Hazelcast.newHazelcastInstance(new Config());
// Introducing a sample data in a map using the first instance
firstInstance.getMap("TEST_MAP").put("key", "test_value");
// Prints the value using the second instance. The result will be 'test_value'
System.out.println(secondInstance.getMap("TEST_MAP").get("key"));
When this code starts the console output is:
Members [2] {
Member [192.168.216.1]:5702
Member [192.168.216.1]:5703 this
}
As you can see, two instances were registered in the same IP but different ports.
You should start instances in different threads.
See following test:
public static void main(String[] args) throws InterruptedException {
final Config cfg = new Config();
cfg.setProperty(GroupProperties.PROP_INITIAL_MIN_CLUSTER_SIZE, "2");
Runnable runnable = new Runnable() {
public void run() {
final HazelcastInstance instance = Hazelcast.newHazelcastInstance(cfg);
IMap<Object, Object> map = instance.getMap("map");
for (int i = 0; i < 100; i++) {
map.put(i, i);
System.out.println("put:" + i);
}
}
};
Thread thread1 = new Thread(runnable);
Thread thread2 = new Thread(runnable);
thread1.start();
Thread.sleep(1000);
thread2.start();
}
Please see this thread for more information. Based on the info there, your best bet is to:
make sure you're using a configuration which allows for two machines in the cluster, on the same pc (check out the sample config file attached to that thread)
Run both machines on the same JVM (rather than firing up two separate JVMs)
Are running a fairly recent version (3.1.2 should be fine)
Starting two JVMs on the same physical machine might work sometimes if you make sure they don't have conflicting port settings, but you'll likely run into various problems (ie, i bet they won't be able to properly listen to the same multicast port). I'd advise against that approach.

Jade DispatcherException problem when using remote Containers

I have two virtual machines in a private
cloud, and I want to execute Jade both of them. They can access each
other without problems. I started in one of them the Main Container, and
in the other a Container which would connect to the main. However, I get
a Dispatcher exception when this connection tries to take place:
--------
INFO: Adding node <Container-1> to the platform
Jun 22, 2011 12:54:34 PM jade.core.messaging.MessagingService
clearCachedSlice
INFO: Clearing cache
Jun 22, 2011 12:54:34 PM jade.core.messaging.MessagingService
$CommandTargetSink handleNewSlice
WARNING: Error notifying current information to new Messaging-Slice
Container-1
jade.core.IMTPException: Dispatcher error [nested
jade.imtp.leap.DispatcherException: DispatcherException in remote site.
No skeleton for object-id 3447152]
at jade.imtp.leap.NodeStub.accept(NodeStub.java:91)
at jade.core.messaging.MessagingProxy.addRoute(MessagingProxy.java:257)
at jade.core.messaging.MessagingService
$CommandTargetSink.handleNewSlice(MessagingService.java:993)
at jade.core.messaging.MessagingService
$CommandTargetSink.consume(MessagingService.java:906)
at jade.core.CommandProcessor
$SinksFilter.accept(CommandProcessor.java:253)
at jade.core.Filter.filter(Filter.java:89)
at jade.core.Filter.filter(Filter.java:90)
at jade.core.Filter.filter(Filter.java:90)
at
jade.core.CommandProcessor.processIncoming(CommandProcessor.java:229)
at
jade.core.PlatformManagerImpl.issueNewSliceCommand(PlatformManagerImpl.java:744)
at
jade.core.PlatformManagerImpl.localAddSlice(PlatformManagerImpl.java:445)
at
jade.core.PlatformManagerImpl.localAddNode(PlatformManagerImpl.java:293)
at jade.core.PlatformManagerImpl.addNode(PlatformManagerImpl.java:245)
at
jade.imtp.leap.PlatformManagerSkel.executeCommand(PlatformManagerSkel.java:73)
at jade.imtp.leap.Skeleton.processCommand(Skeleton.java:51)
at
jade.imtp.leap.CommandDispatcher.handleCommand(CommandDispatcher.java:949)
at jade.imtp.leap.JICP.JICPServer
$ConnectionHandler.run(JICPServer.java:439)
Nested Exception:
jade.imtp.leap.DispatcherException: DispatcherException in remote site.
No skeleton for object-id 3447152
at
jade.imtp.leap.CommandDispatcher.checkRemoteExceptions(CommandDispatcher.java:516)
at
jade.imtp.leap.CommandDispatcher.dispatchSerializedCommand(CommandDispatcher.java:418)
at
jade.imtp.leap.CommandDispatcher.dispatchCommand(CommandDispatcher.java:343)
at jade.imtp.leap.NodeStub.accept(NodeStub.java:83)
at jade.core.messaging.MessagingProxy.addRoute(MessagingProxy.java:257)
at jade.core.messaging.MessagingService
$CommandTargetSink.handleNewSlice(MessagingService.java:993)
at jade.core.messaging.MessagingService
$CommandTargetSink.consume(MessagingService.java:906)
at jade.core.CommandProcessor
$SinksFilter.accept(CommandProcessor.java:253)
at jade.core.Filter.filter(Filter.java:89)
at jade.core.Filter.filter(Filter.java:90)
at jade.core.Filter.filter(Filter.java:90)
at
jade.core.CommandProcessor.processIncoming(CommandProcessor.java:229)
at
jade.core.PlatformManagerImpl.issueNewSliceCommand(PlatformManagerImpl.java:744)
at
jade.core.PlatformManagerImpl.localAddSlice(PlatformManagerImpl.java:445)
at
jade.core.PlatformManagerImpl.localAddNode(PlatformManagerImpl.java:293)
at jade.core.PlatformManagerImpl.addNode(PlatformManagerImpl.java:245)
at
jade.imtp.leap.PlatformManagerSkel.executeCommand(PlatformManagerSkel.java:73)
at jade.imtp.leap.Skeleton.processCommand(Skeleton.java:51)
at
jade.imtp.leap.CommandDispatcher.handleCommand(CommandDispatcher.java:949)
at jade.imtp.leap.JICP.JICPServer
$ConnectionHandler.run(JICPServer.java:439)
Jun 22, 2011 12:54:34 PM jade.core.PlatformManagerImpl$1 nodeAdded
INFO: --- Node <Container-1> ALIVE ---
Jun 22, 2011 12:54:34 PM
jade.core.nodeMonitoring.BlockingNodeFailureMonitor run
INFO: PING from node Container-1 exited with exception. Dispatcher error
[nested jade.imtp.leap.DispatcherException: DispatcherException in
remote site. No skeleton for object-id 3447152]
Jun 22, 2011 12:54:34 PM jade.core.PlatformManagerImpl$1 nodeUnreachable
WARNING: --- Node <Container-1> UNREACHABLE ---
Jun 22, 2011 12:54:34 PM jade.core.PlatformManagerImpl
removeTerminatedNode
INFO: --- Node <Container-1> TERMINATED ---
Jun 22, 2011 12:54:34 PM jade.core.messaging.MessagingService
clearCachedSlice
---------
In the other node I get the following:
--------
Jun 22, 2011 12:55:35 PM jade.core.AgentContainerImpl joinPlatform
SEVERE: Some problem occurred while joining agent platform.
jade.core.ServiceException: An error occurred during service booting
[nested java.lang.NullPointerException]
at
jade.core.AgentContainerImpl.bootAllServices(AgentContainerImpl.java:465)
at jade.core.AgentContainerImpl.startNode(AgentContainerImpl.java:408)
at
jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:485)
at jade.core.Runtime.createAgentContainer(Runtime.java:133)
at BookBuyTest2.main(BookBuyTest2.java:25)
Exception in thread "main" java.lang.NullPointerException
at BookBuyTest2.main(BookBuyTest2.java:35)
------
Any ideas about what I am doing wrong?
Thank you very much in advance,
The problem was that in the node I put:
local-host:127.0.0.1
This was solved by putting
local-host: <actual IP of the machine\>
To me, this worked
String[] container = {
"-gui",
"-local-host 127.0.0.1",
"-container",
"Agent1:jogo.agents.Agent1;Agent2:jogo.agents.Agent2" // <- Your custom agents
};
Boot.main(container);

Categories