title: helloworld on Kie Server version 6.4.0
body: <p>I am currently evaluating KIE Server without using KIE Workbench. 
  The scenario am evaluating is, </p>
  
  <p>1) A third party will give me a drl file its value object (VO which will be used inside drl). I need to create a kjar or jar programmatically through a standard maven project structure and also create a container for that artifact and store it in maven repo.<br>
  2) When i receive a request for execution along with the input data, against that artifact, through <code>REST</code> call, i need to execute the above created container with that input data.</p>
  
  <p>I followed the examples <a href="https://stackoverflow.com/questions/34194475/helloworld-on-kie-workbench-and-kie-server-version-6-3-0">this</a> and <a href="https://stackoverflow.com/questions/32960098/helloworld-using-drools-workbench-kie-server">this</a></p>
  
  <p>to do a simple "HelloWorld" project.</p>
  
  <p><strong>POM.XML</strong></p>
  
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;demo&lt;/groupId&gt;
  &lt;artifactId&gt;Hello&lt;/artifactId&gt;
  &lt;version&gt;1&lt;/version&gt;
  &lt;packaging&gt;kjar&lt;/packaging&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.kie&lt;/groupId&gt;
          &lt;artifactId&gt;kie-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;6.4.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
          &lt;artifactId&gt;maven-archiver&lt;/artifactId&gt;
          &lt;version&gt;3.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt;
          &lt;artifactId&gt;plexus-archiver&lt;/artifactId&gt;
          &lt;version&gt;3.4&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.kie&lt;/groupId&gt;
              &lt;artifactId&gt;kie-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;6.4.0.Final&lt;/version&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p><strong>HelloWorld.java</strong></p>
  
  <pre><code>package demo;
  
  public class HelloWorld implements java.io.Serializable {
  
  static final long serialVersionUID = 1L;
  
  private java.lang.String message;
  
  public HelloWorld()
  {
  }
  
  public java.lang.String getMessage()
  {
      return this.message;
  }
  
  public void setMessage(java.lang.String message)
  {
      this.message = message;
  }
  
  public HelloWorld(java.lang.String message)
  {
      this.message = message;
  }
  
  } 
  </code></pre>
  
  <p><strong>HelloWorld.drl</strong></p>
  
  <pre><code>package demo;
  
  import demo.HelloWorld;
  
  rule "hello"
  
  when 
      HelloWorld(message == "Joe");
  then
      System.out.println("Hello Joe!");
  end
  </code></pre>
  
  <p><strong>kmodule.xml</strong></p>
  
  <pre><code>&lt;kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"&gt;
  
      &lt;kbase name="demo" packages="demo"&gt;
          &lt;ksession name="demo.session"/&gt;
      &lt;/kbase&gt;
  
  &lt;/kmodule&gt;
  </code></pre>
  
  <p>Used simple maven project structure:</p>
  
  <pre><code>Hello
   |
   |
   |--src
   |  |--- main
   |          |--java
   |          |   |---demo
   |          |         |
   |          |         |-- HelloWorld.java
   |          |
   |          |--resources
   |                  |
   |                  |--demo
   |                  |   |
   |                  |   |-- HelloWorld.drl
   |                  |
   |                  |--META-INF
   |                          |
   |                          |--kmodule.xml
   |
   |-- pom.xml
  </code></pre>
  
  <p>I am able to create a container 'HelloworldContainer' for that above maven proj structure with the <code>GroupId: demo, Artifact: Hello, version: 1</code></p>
  
  <p>But when i try to execute it as below, getting internal server error
  URI:
      <a href="http://localhost:8080/kie-server/services/rest/server/containers/instances/HelloworldContainer" rel="nofollow noreferrer">http://localhost:8080/kie-server/services/rest/server/containers/instances/HelloworldContainer</a></p>
  
  <p><strong>Headers:</strong></p>
  
  <pre><code> Content-Type: application/xml,
      Authorization: Basic UWRtaWLkuTW5hZG1pbg==,
      X-KIE-ContentType: XSTREAM
  </code></pre>
  
  <p><strong>Body:</strong></p>
  
  <pre><code>&lt;batch-execution&gt;
      &lt;insert out-identifier="helloworld" return-object="true"&gt;
          &lt;demo.HelloWorld&gt;
              &lt;message&gt;Joe&lt;/message&gt;
          &lt;/demo.HelloWorld&gt; 
      &lt;/insert&gt;
      &lt;fire-all-rules/&gt;
      &lt;/batch-execution&gt;
  </code></pre>
  
  <p><strong>Error Stack trace:</strong></p>
  
  <pre><code>java.lang.IncompatibleClassChangeError: com.google.common.collect.Maps and com.google.common.collect.Maps$TransformedValuesMap disagree on InnerClasses attribute
  java.lang.Class.getDeclaringClass0(Native Method)
  java.lang.Class.getDeclaringClass(Class.java:1101)
  sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.&amp;lt;init&amp;gt;(ParameterizedTypeImpl.java:52)
  sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:95)
  sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)
  sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)
  sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
  sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:85)
  java.lang.reflect.Field.getGenericType(Field.java:237)
  com.thoughtworks.xstream.mapper.AnnotationMapper.processTypes(AnnotationMapper.java:212)
  com.thoughtworks.xstream.mapper.AnnotationMapper.processAnnotations(AnnotationMapper.java:164)
  com.thoughtworks.xstream.XStream.processAnnotations(XStream.java:1971)
  com.thoughtworks.xstream.XStream.processAnnotations(XStream.java:1982)
  org.kie.server.api.marshalling.xstream.XStreamMarshaller.&amp;lt;init&amp;gt;(XStreamMarshaller.java:86)
  org.kie.server.api.marshalling.MarshallerFactory.getMarshaller(MarshallerFactory.java:37)
  org.kie.server.services.impl.KieContainerInstanceImpl.getMarshaller(KieContainerInstanceImpl.java:111)
  org.kie.server.services.drools.DroolsKieContainerCommandServiceImpl.callContainer(DroolsKieContainerCommandServiceImpl.java:59)
  org.kie.server.remote.rest.drools.CommandResource.manageContainer(CommandResource.java:72)
  </code></pre>
  
  <p>I am able to successfully deploy Kie Server 6.4.0 using the link <a href="http://mswiderski.blogspot.in/2015/10/installing-kie-server-and-workbench-on.html" rel="nofollow noreferrer">http://mswiderski.blogspot.in/2015/10/installing-kie-server-and-workbench-on.html</a></p>
  
  <p>Server is starting fine except this one 'SEVERE' issue.</p>
  
  <pre><code>org.kie.server.services.impl.KieServerImpl.&lt;init&gt; Error when initializing server extension of type jBPM KIE Server extension
  java.lang.RuntimeException: Unable to create EntityManagerFactory due to [PersistenceUnit: org.jbpm.domain] Unable to build EntityManagerFactory
  at       org.kie.server.services.jbpm.JbpmKieServerExtension.build(JbpmKieServerExtension.java:524)
  at org.kie.server.services.jbpm.JbpmKieServerExtension.init(JbpmKieServerExtension.java:155)
  at org.kie.server.services.impl.KieServerImpl.&lt;init&gt;(KieServerImpl.java:108)
  at org.kie.server.services.impl.KieServerLocator.&lt;clinit&gt;(KieServerLocator.java:20)
  at org.kie.server.services.Bootstrap.contextInitialized(Bootstrap.java:50)
  at 
  ...
  Caused by: javax.naming.NameNotFoundException: Name     [jboss/datasources/ExampleDS] is not bound in this Context. Unable to find     [jboss].
  at org.apache.naming.NamingContext.lookup(NamingContext.java:816)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
  at org.apache.naming.SelectorContext.lookup(SelectorContext.java:140)
  at javax.naming.InitialContext.lookup(InitialContext.java:415)
  at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:65)
  ... 33 more
  </code></pre>
  
  <p>and other series of WARNINGS even though <code>org.sonatype.guice</code> is available in my m2 repo</p>
  
  <pre><code>26-Sep-2016 11:37:21.346 WARNING [localhost-startStop-1]     org.kie.server.services.drools.DroolsKieServerExtension.createContainer Unable     to create instance of type org.sonatype.guice.asm.MethodVisitor due to     org.sonatype.guice.asm.MethodVisitor
  26-Sep-2016 11:37:21.352 WARNING [localhost-startStop-1]     org.kie.server.services.drools.DroolsKieServerExtension.createContainer Unable     to create instance of type org.sonatype.guice.asm.FieldVisitor due to     org.sonatype.guice.asm.FieldVisitor
  26-Sep-2016 11:37:21.357 WARNING [localhost-startStop-1]     org.kie.server.services.drools.DroolsKieServerExtension.createContainer Unable     to create instance of type org.sonatype.guice.asm.Type due to     org.sonatype.guice.asm.Type
  26-Sep-2016 11:37:21.363 WARNING [localhost-startStop-1]     org.kie.server.services.drools.DroolsKieServerExtension.createContainer Unable     to create instance of type org.sonatype.guice.asm.ClassWriter due to     org.sonatype.guice.asm.ClassWriter
  26-Sep-2016 11:37:21.368 WARNING [localhost-startStop-1]     org.kie.server.services.drools.DroolsKieServerExtension.createContainer Unable     to create instance of type org.sonatype.guice.asm.Edge due to     org.sonatype.guice.asm.Edge
  </code></pre>