MaDKit forum

Welcome All !
Please, use explicit topic names when creating new threads. Thanks.

You are not logged in.

#1 2013-11-21 11:56:52

Fixit
Member
Registered: 2013-11-21
Posts: 3

Problems with the first launch for begginers

Greetings!
Nice to write to you.
The problem is  happening while we're trying to start an agent like "Hello world"
We start like that:
In Main java class
new Madkit("--launchAgents","pack1.Myclass1;");
Where the "pack1.MyClass1" is ur example "http:/ /www.m adkit.net/tutorials/html/hello_world/index.html"

And after compilation we see these errors:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at madkit.kernel.MadkitKernel.<init>(Unknown Source)
	at madkit.kernel.Madkit.<init>(Unknown Source)
	at Main.main(Main.java:5)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.NullPointerException
	at madkit.kernel.KernelAddress.<clinit>(Unknown Source)
	... 8 more

Please help, cuz we're just starting learning Java and Agents sad
Thanks for your advices!
info:
IntelliJ IDEA 12.0
Windows7x64

Offline

#2 2013-11-21 12:43:57

fmichel
Administrator
From: Montpellier
Registered: 2009-03-24
Posts: 176
Website

Re: Problems with the first launch for begginers

Hi,

I was not able to reproduce this error.
Few questions :
- Are you using MDK 5.0.3 ?
- What is your OS ?

Also, the simpliest way of launching a single agent is to use

	public static void main(String[] args) {
	 executeThisAgent(); //just a convenient way of launching one instance of this agent
	 }

within your agent class (this particular idiom won't work elsewhere)

Could you please try it and tell me if that solves your issue ?
Anyway I am also interested in a zip of your project to give it a try.
Thanks.

Offline

#3 2013-11-21 13:31:39

Fixit
Member
Registered: 2013-11-21
Posts: 3

Re: Problems with the first launch for begginers

Yep, I'm using MDK 5.0.3 ;
OS is Win7x64 ;
Yep again, i know about this way to lunch a single agent, but
What we should do next?
I suppose that i misunderstand something important about Agent programming , and exactly their structure.
I have a Java project which contains:
1)Main Class
2)Package with Agent Class
http://www.filedropper.com/tryherder

Offline

#4 2013-11-21 15:17:48

fmichel
Administrator
From: Montpellier
Registered: 2009-03-24
Posts: 176
Website

Re: Problems with the first launch for begginers

Fixit wrote:

Yep, I'm using MDK 5.0.3 ;
OS is Win7x64 ;

OK this bug may be OS related (I will check).
In the mean time, could you please test with the 5.0.2 version, I think that it will solve your problem for now

Fixit wrote:

Yep again, i know about this way to lunch a single agent, but
What we should do next?

Well, everything can be envisaged. Most people simply launch a single agent, the launcher, that in turn launches all the application agents which are needed (go ahead with the tutorials and then check the demos source code)

Fixit wrote:

I suppose that i misunderstand something important about Agent programming , and exactly their structure.

Not at all, it just a matte rof getting started correctly.

Fixit wrote:

I have a Java project which contains:
1)Main Class
2)Package with Agent Class
http://www.filedropper.com/tryherder

Offline

#5 2013-11-21 15:49:14

Fixit
Member
Registered: 2013-11-21
Posts: 3

Re: Problems with the first launch for begginers

fmichel wrote:

OK this bug may be OS related (I will check).
In the mean time, could you please test with the 5.0.2 version, I think that it will solve your problem for now

Thank you, it solved my problem.

And thanks for so fast replies smile

Offline

Board footer