Menu

Agent creation error

Help
2014-11-25
2015-02-16
  • Matthew Song

    Matthew Song - 2014-11-25

    I use the following to create an agent:-

    CreationInfo ci = new CreationInfo(args);
    IComponentIdentifier cid = cms.createComponent(null, "test/agent/AgentBDI.class", ci, null).get();

    This has worked for several months. I make many changes to AgentBDI since then and never had problem creating the agent.

    Today I get an exception from the createComponent:-

    java.lang.NullPointerException
    at jadex.micro.MicroClassReader.getProxyAnnotation(MicroClassReader.java:1758)
    at jadex.micro.MicroClassReader.getAnnotation(MicroClassReader.java:1632)
    at jadex.bdiv3.BDIClassReader.buildPlanTrigger(BDIClassReader.java:758)
    at jadex.bdiv3.BDIClassReader.createMPlan(BDIClassReader.java:929)
    at jadex.bdiv3.BDIClassReader.getMPlan(BDIClassReader.java:909)
    at jadex.bdiv3.BDIClassReader.fillBDIModelFromAnnotations(BDIClassReader.java:460)
    at jadex.bdiv3.BDIClassReader.read(BDIClassReader.java:178)
    at jadex.bdiv3.BDIClassReader.read(BDIClassReader.java:102)
    at jadex.micro.MicroClassReader.read(MicroClassReader.java:112)
    at jadex.bdiv3.BDIClassReader.read(BDIClassReader.java:130)
    at jadex.bdiv3.BDIModelLoader.doLoadModel(BDIModelLoader.java:61)
    at jadex.commons.AbstractModelLoader.loadModel(AbstractModelLoader.java:281)
    at jadex.bdiv3.BDIModelLoader.loadComponentModel(BDIModelLoader.java:47)
    at jadex.bdiv3.BDIAgentFactory$4.customResultAvailable(BDIAgentFactory.java:196)
    at jadex.bdiv3.BDIAgentFactory$4.customResultAvailable(BDIAgentFactory.java:191)
    at jadex.commons.future.ExceptionDelegationResultListener.resultAvailable(ExceptionDelegationResultListener.java:53)
    at jadex.commons.future.Future.notifyListener(Future.java:590)
    at jadex.bridge.service.component.interceptors.DelegatingFuture.access$801(FutureFunctionality.java:1998)
    at jadex.bridge.service.component.interceptors.DelegatingFuture$1.resultAvailable(FutureFunctionality.java:2095)
    at jadex.bridge.service.component.interceptors.DelegatingFuture$1.resultAvailable(FutureFunctionality.java:2092)
    at jadex.bridge.service.component.interceptors.DecouplingReturnInterceptor$1$1$1.run(DecouplingReturnInterceptor.java:161)
    at jadex.platform.service.cms.AbstractComponentAdapter.executeExternalEntries(AbstractComponentAdapter.java:999)
    at jadex.platform.service.cms.AbstractComponentAdapter.execute(AbstractComponentAdapter.java:693)
    at jadex.platform.service.cms.StandaloneComponentAdapter.execute(StandaloneComponentAdapter.java:58)
    at jadex.commons.concurrent.Executor.code(Executor.java:287)
    at jadex.commons.concurrent.Executor.run(Executor.java:125)
    at jadex.platform.service.execution.AsyncExecutionService$1.run(AsyncExecutionService.java:98)
    at jadex.commons.concurrent.ThreadPool$ServiceThread.run(ThreadPool.java:435)

    I tried updating to latest nightly build, same error message.

    Thanks for your help every time.

     
  • Lars Braubach

    Lars Braubach - 2014-11-25

    Hi,

    throwing a nullpointer exception seems odd and should not happen.

    Could you try to strip down your agent to a minimal version reproducing
    the error?

    From looking at the code I guess it could be a missing @Goal annotation at
    some class that should be goal.

    Best
    Lars

     
  • Matthew Song

    Matthew Song - 2015-02-06

    Thank you for helping in last problem about @Goal annotation.

    I was getting another problem creating agents and so I update yesterday with the latest nightly build. Now I get a new error:-

    java.lang.IncompatibleClassChangeError: class org.objectweb.asm.tree.ClassNode has interface org.objectweb.asm.ClassVisitor as super class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at jadex.bdiv3.ASMBDIClassGenerator.generateBDIClass(ASMBDIClassGenerator.java:103)
    at jadex.bdiv3.ASMBDIClassGenerator.generateBDIClass(ASMBDIClassGenerator.java:82)
    at jadex.bdiv3.BDIClassReader.fillBDIModelFromAnnotations(BDIClassReader.java:625)
    at jadex.bdiv3.BDIClassReader.read(BDIClassReader.java:178)
    at jadex.bdiv3.BDIClassReader.read(BDIClassReader.java:102)
    at jadex.micro.MicroClassReader.read(MicroClassReader.java:112)
    at jadex.bdiv3.BDIClassReader.read(BDIClassReader.java:130)
    at jadex.bdiv3.BDIModelLoader.doLoadModel(BDIModelLoader.java:61)
    at jadex.commons.AbstractModelLoader.loadModel(AbstractModelLoader.java:281)
    at jadex.bdiv3.BDIModelLoader.loadComponentModel(BDIModelLoader.java:47)
    at jadex.bdiv3.BDIAgentFactory$4.customResultAvailable(BDIAgentFactory.java:196)
    at jadex.bdiv3.BDIAgentFactory$4.customResultAvailable(BDIAgentFactory.java:191)
    at jadex.commons.future.ExceptionDelegationResultListener.resultAvailable(ExceptionDelegationResultListener.java:53)
    at jadex.commons.future.Future.notifyListener(Future.java:590)
    at jadex.bridge.service.component.interceptors.DelegatingFuture.access$801(FutureFunctionality.java:1998)
    at jadex.bridge.service.component.interceptors.DelegatingFuture$1.resultAvailable(FutureFunctionality.java:2095)
    at jadex.bridge.service.component.interceptors.DelegatingFuture$1.resultAvailable(FutureFunctionality.java:2092)
    at jadex.bridge.service.component.interceptors.DecouplingReturnInterceptor$1$1$1.run(DecouplingReturnInterceptor.java:161)
    at jadex.platform.service.cms.AbstractComponentAdapter.executeExternalEntries(AbstractComponentAdapter.java:999)
    at jadex.platform.service.cms.AbstractComponentAdapter.execute(AbstractComponentAdapter.java:693)
    at jadex.platform.service.cms.StandaloneComponentAdapter.execute(StandaloneComponentAdapter.java:58)
    at jadex.commons.concurrent.Executor.code(Executor.java:287)
    at jadex.commons.concurrent.Executor.run(Executor.java:125)
    at jadex.platform.service.execution.AsyncExecutionService$1.run(AsyncExecutionService.java:98)
    at jadex.commons.concurrent.ThreadPool$ServiceThread.run(ThreadPool.java:435)

    How do I debug this problem?

     
  • Lars Braubach

    Lars Braubach - 2015-02-06

    Hi Matthew,

    I guess it is just a configuration problem. We updated the asm library version to allow using JDK 8. So, you should check if there is another/older asm jar in the classpath confusing Java.

    Best
    Lars

     
  • Matthew Song

    Matthew Song - 2015-02-06

    Hi Lars,

    Thank you, I find that the nightly build includes:-

    asm-all-5.0.3.jar

    asm-3.3.jar
    asm-commons-3.3.jar
    asm-tree-3.3.jar

    I delete the three old jars and now Jadex runs. They should not be part of the nightly build, maybe?

    Now I getting the same problem creating agents as before the update:-

    java.lang.NullPointerException
    at jadex.bdiv3.BDIAgent.writeField(BDIAgent.java:449)
    at mytest.JadexAgent.__init_expressions_mytest_JadexAgent(JadexAgent.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at jadex.bdiv3.runtime.impl.BDIAgentInterpreter$4.customResultAvailable(BDIAgentInterpreter.java:466)
    at jadex.bdiv3.runtime.impl.BDIAgentInterpreter$4.customResultAvailable(BDIAgentInterpreter.java:438)
    at jadex.commons.future.DelegationResultListener.resultAvailable(DelegationResultListener.java:52)
    at jadex.commons.future.Future.notifyListener(Future.java:590)
    at jadex.commons.future.Future.addResultListener(Future.java:514)
    at jadex.kernelbase.StatelessAbstractInterpreter.init(StatelessAbstractInterpreter.java:737)
    at jadex.micro.MicroAgentInterpreter$1.execute(MicroAgentInterpreter.java:130)
    at jadex.micro.MicroAgentInterpreter.executeStep(MicroAgentInterpreter.java:944)
    at jadex.bdiv3.runtime.impl.BDIAgentInterpreter.executeStep(BDIAgentInterpreter.java:2173)
    at jadex.platform.service.cms.AbstractComponentAdapter.execute(AbstractComponentAdapter.java:742)
    at jadex.platform.service.cms.StandaloneComponentAdapter.execute(StandaloneComponentAdapter.java:58)
    at jadex.commons.concurrent.Executor.code(Executor.java:287)
    at jadex.commons.concurrent.Executor.run(Executor.java:125)
    at jadex.platform.service.execution.AsyncExecutionService$1.run(AsyncExecutionService.java:98)
    at jadex.commons.concurrent.ThreadPool$ServiceThread.run(ThreadPool.java:435)

     
  • Lars Braubach

    Lars Braubach - 2015-02-16

    Hi Matthew,

    thanks for the report. We will check where the old asm comes from and fix it best.

    Do you get the nullpointer with every BDI agent or just with a special one?

    Best
    Lars

     

Log in to post a comment.