HEADS-project / training

Training material to get started with the HEADS technologies
10 stars 16 forks source link

Missing classes when compiling Kevoree HelloWorld #10

Closed kehusa closed 9 years ago

kehusa commented 9 years ago

When running HelloWorld example following exception occurs:

C:\Users\KnutEilif\HeadsIde\workspace\training\2.Kevoree_Basics\1.HelloWorld\jav
a> mvn kev:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Kevoree :: helloworld 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- org.kevoree.tools.mavenplugin:5.1.4:run (default-cli) @ helloworld --
-
00:00 INFO: Bootstrap Kevoree node : node0, version 5.1.4
00:00 INFO: Resolved 25 typeDefinitions from Kevoree Registry http://registry.ke
voree.org/v5/ (HelloWorld/0.0.1-SNAPSHOT,JavaNode/5.0.4-SNAPSHOT,JavaNode/5.0.5,
JavaNode/5.1.2,JavaNode/5.0.7-SNAPSHOT,JavaNode/5.1.1-SNAPSHOT,JavaNode/5.1.1,Ja
vaNode/5.2.2-SNAPSHOT,JavaNode/5.0.4,JavaNode/5.1.0,JavaNode/5.2.3-SNAPSHOT,Java
Node/5.1.2-SNAPSHOT,JavaNode/5.2.1-SNAPSHOT,JavaNode/5.0.3,JavaNode/5.0.6-SNAPSH
OT,JavaNode/5.2.2,JavaNode/5.0.8-SNAPSHOT,JavaNode/5.0.3-SNAPSHOT,JavaNode/5.0.5
-SNAPSHOT,JavaNode/5.1.3,JavaNode/5.2.1,JavaNode/5.1.4-SNAPSHOT,JavaNode/5.0.7,J
avaNode/5.2.0,JavaNode/5.0.6)
00:00 WARN: Try to select snapshot in best effort mode for org.kevoree.example.H
elloWorld
00:00 INFO: Resolving ............. /packages[org]/packages[kevoree]/packages[li
brary]/packages[java]/deployUnits[hashcode=,name=org.kevoree.library.java.javaNo
de,version=5.2.2]
00:00 INFO: Resolved in 0ms
00:00 INFO: JavaNode, changing LOG level to INFO
00:00 INFO: Starting node type of node0
00:00 ERROR: Error while creating instance HelloWorld
java.lang.ClassNotFoundException: org.kevoree.example.HelloWorld
        at org.kevoree.kcl.impl.FlexyClassLoaderImpl.loadClass(FlexyClassLoaderI
mpl.java:111)
        at org.kevoree.kcl.impl.FlexyClassLoaderImpl.loadClass(FlexyClassLoaderI
mpl.java:22)
        at org.kevoree.bootstrap.kernel.KevoreeCLKernel.createInstance(KevoreeCL
Kernel.java:172)
        at org.kevoree.library.java.command.AddInstance.run(AddInstance.java:98)

        at java.lang.Thread.run(Thread.java:744)
00:00 ERROR: Inconsistency in typeDefinition
{"class":"org.kevoree.ComponentType@name=HelloWorld,version=0.0.1-SNAPSHOT","nam
e":"HelloWorld","abstract":"false","version":"0.0.1-SNAPSHOT","deployUnits":["/p
ackages[org]/packages[kevoree]/packages[sample]/deployUnits[hashcode=,name=hello
world,version=0.0.1-SNAPSHOT]"],"superTypes":[],"dictionaryType":[
{"class":"org.kevoree.DictionaryType@20004215231418391615188","generated_KMF_ID"
:"20004215231418391615188","attributes":[
{"class":"org.kevoree.DictionaryAttribute@greetMessage","datatype":"STRING","def
aultValue":"Hello, world!","name":"greetMessage","fragmentDependant":"false","op
tional":"true","state":"false","genericTypes":[]}
]}
],"metaData":[
{"class":"org.kevoree.Value@java.class","name":"java.class","value":"org.kevoree
.example.HelloWorld"}
],"required":[
{"class":"org.kevoree.PortTypeRef@hello","noDependency":"false","name":"hello","
optional":"true","ref":[],"mappings":[]}
],"provided":[]}

00:00 ERROR: Error while adding instance myComp
java.lang.NullPointerException
        at org.kevoree.library.java.wrapper.KInstanceWrapper.setTargetObj(KInsta
nceWrapper.java:69)
        at org.kevoree.library.java.wrapper.WrapperFactory.wrap(WrapperFactory.j
ava:40)
        at org.kevoree.library.java.command.AddInstance.run(AddInstance.java:99)

        at java.lang.Thread.run(Thread.java:744)
00:00 WARN: Error during execution of AddInstance myComp
00:00 WARN: JavaSENode is aborting last update...
00:00 INFO: Remove instance /nodes[node0]/components[myComp]
00:00 WARN: JavaSENode update aborted in 32 ms
00:00 INFO: End deploy result=false-32
00:00 INFO: Bootstrap completed
00:23 INFO: Stopping Kevoree
00:23 INFO: Stopping node type of node0
00:23 INFO: Kevoree core stopped
00:23 INFO: Stopped.
barais commented 9 years ago

It works for me. Can you confirm you use windows or linux?

Which JVM do you use (JVM 8 ?)

Can you try in cleaning all kevoree artefacts in your .m2

Regards

kehusa commented 9 years ago

Environment: Windows 8.1 java -version java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Deleted all org.kevoree in.m2 and tried again, still same result :-(

maxleiko commented 9 years ago

Can you try with a JDK 8 ?

kehusa commented 9 years ago

Hi,

Issue is solved :-) The POM declared the GruopID org.kevoree.sample while the code asked for org.kevoree.example. Changed GroupID to org.kevoree.example in POM and checked in.