The error message suggests to me that there is no class ObjectFactory, or not where it ought to be, for JAXB to be happy. If you JAXB-annotate your Java classes by hand, you&#39;ll also have to write an ObjectFactory.java.<br>
<br>A little info can be found in my <a href="http://jaxb.java.net/tutorial/section_6_2_4-The-Object-Factory-XmlRegistry-XmlElementDecl.html#The%20Object%20Factory:%20XmlRegistry,%20XmlElementDecl">JAXB tutorial</a>. Also, you could apply xjc to an XML Schema to learn how it&#39;s done ;-)<br>
<br>-W<br><br><br><div class="gmail_quote">On 2 August 2011 19:11, kkelleyjr <span dir="ltr">&lt;<a href="mailto:karl.kelley.jr@gmail.com">karl.kelley.jr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Update:<br>
<br>
<br>
So I have the following as code that I found in a blog by salaboy...<br>
<br>
List&lt;String&gt; myDomainClasses = new ArrayList&lt;String&gt;();<br>
myDomainClasses.add(&quot;com.test.TestFact&quot;);<br>
<br>
<br>
// I need to create a JAXB context including my domain classes<br>
// to be able to create a JAXB representation to send to the server<br>
<br>
JAXBContext jaxbContext =<br>
DroolsJaxbContextHelper.createDroolsJaxbContext(myDomainClasses, null);<br>
<br>
TestFact test = new TestFact();<br>
<br>
<br>
<br>
// Once I get my object I need to create<br>
// some commands to execute on the server<br>
// Here I include a reference to the session that<br>
// I define in my Knowledge Context Profile<br>
<br>
List&lt;Command&gt; listOCommand = new ArrayList&lt;Command&gt;();<br>
listOCommand.add(new InsertObjectCommand(test, &quot;testFact&quot;));<br>
<br>
BatchExecutionCommand cmd = CommandFactory.newBatchExecution(listOCommand,<br>
&quot;ksession1&quot;);<br>
<br>
// Once I get all I need to send to the server,<br>
// I need to use the JAXB context<br>
// to obtain the JAXB representation.<br>
<br>
StringWriter xmlReq = new StringWriter();<br>
javax.xml.bind.Marshaller marshaller = jaxbContext.createMarshaller();<br>
marshaller.setProperty(&quot;jaxb.formatted.output&quot;, true);<br>
marshaller.marshal(cmd, xmlReq);<br>
<br>
// I create a HTTPClient to interact with the<br>
// server via REST (HTTP POST)<br>
<br>
DefaultHttpClient httpClient = new DefaultHttpClient();<br>
<br>
HttpParams params = new BasicHttpParams();<br>
params.setParameter(ClientPNames.DEFAULT_HOST, &quot;localhost&quot;);<br>
<br>
//Print the JAXB xml that we will send to the server<br>
System.out.println(xmlReq.toString());<br>
<br>
// Send the Commands JAXB representation to the server for execution<br>
HttpPost postMethod = new<br>
HttpPost(&quot;<a href="http://localhost:8080/MyService/kservice/rest/execute" target="_blank">http://localhost:8080/MyService/kservice/rest/execute</a>&quot;);<br>
<br>
HttpParams p = new BasicHttpParams();<br>
p.setParameter(&quot;command&quot;,  xmlReq.toString());<br>
postMethod.setParams(p);<br>
<br>
HttpResponse response = httpClient.execute(postMethod);<br>
<br>
System.out.println(response);<br>
<br>
<br>
Now I had to change a few things from the blog but it should be basically<br>
the same as the post... I get the following exception...<br>
<br>
1872701 [http-8080-1] ERROR processor.DefaultErrorHandler  - Failed delivery<br>
for exchangeId: 839c6b11-3c2a-4106-9118-56417edfbab1. Exhausted after<br>
delivery attempt: 1 caught: java.io.IOException: &quot;null&quot; doesnt contain<br>
ObjectFactory.class or jaxb.index<br>
java.io.IOException: &quot;null&quot; doesnt contain ObjectFactory.class or jaxb.index<br>
        at org.apache.camel.util.IOHelper.createIOException(IOHelper.java:80)<br>
        at org.apache.camel.util.IOHelper.createIOException(IOHelper.java:72)<br>
        at<br>
org.apache.camel.converter.jaxb.JaxbDataFormat.unmarshal(JaxbDataFormat.java:151)<br>
        at<br>
org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:51)<br>
<br>
<br>
Thanks for any advice on this matter...<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Insert-a-fact-into-drools-server-from-a-web-application-or-java-application-tp3214229p3219571.html" target="_blank">http://drools.46999.n3.nabble.com/Insert-a-fact-into-drools-server-from-a-web-application-or-java-application-tp3214229p3219571.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>