I to be trying to produce a sample test applications which converts an object to JaxbRepresentation. Yet when I shot to operation this, it provides me one error.

Main.java file

package test_jaxb;import org.restlet.Server;import org.restlet.data.Protocol;public course Main /** *


You are watching: Doesnt contain objectfactory class or jaxb index

param args the command line arguments */ public static void main(String<> args) throws exception Server helloServer = new Server(Protocol.HTTP, 8111, TestResource.class); helloServer.start(); TestResource.java file

package test_jaxb;import org.restlet.ext.jaxb.JaxbRepresentation;import org.restlet.representation.Representation;import org.restlet.resource.ResourceException;import org.restlet.resource.ServerResource;public class TestResource expand ServerResource
Override safeguarded Representation get() litter ResourceException SampleResponse res = new SampleResponse(); res.setMsg("Success"); res.setStatusCode(0); JaxbRepresentation depiction = new JaxbRepresentation(res); return representation; SampleResponse.java file

package test_jaxb;import javax.xml.bind.annotation.XmlElement;import javax.xml.bind.annotation.XmlRootElement;
XmlRootElement(name="Response")public course SampleResponse personal int statusCode; private String msg;


See more: Metro By T-Mobile Kansas City, Mo, Metro Pcs Corporate Store In Kansas City, Mo

XmlElement(name="Msg") windy String getMsg() return msg; windy void setMsg(String msg) this.msg = msg;
XmlElement(name="StatusCode") windy int getStatusCode() return statusCode; public void setStatusCode(int statusCode) this.statusCode = statusCode; When I run this ~ above the server, that throws the adhering to error:

WARNING: Problem producing Marshallerjavax.xml.bind.JAXBException: "test_jaxb" no contain ObjectFactory.class or jaxb.index in ~ com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:119) in ~ sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) in ~ sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) in ~ java.lang.reflect.Method.invoke(Method.java:597) in ~ javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132) in ~ javax.xml.bind.ContextFinder.find(ContextFinder.java:299) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337) in ~ org.restlet.ext.jaxb.JaxbRepresentation.getContext(JaxbRepresentation.java:83) in ~ org.restlet.ext.jaxb.internal.Marshaller$1.initialValue(Marshaller.java:68) in ~ org.restlet.ext.jaxb.internal.Marshaller$1.initialValue(Marshaller.java:64) at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:141) at java.lang.ThreadLocal.get(ThreadLocal.java:131) in ~ org.restlet.ext.jaxb.internal.Marshaller.getMarshaller(Marshaller.java:163) in ~ org.restlet.ext.jaxb.internal.Marshaller.marshal(Marshaller.java:216) in ~ org.restlet.ext.jaxb.JaxbRepresentation.write(JaxbRepresentation.java:527) at org.restlet.representation.WriterRepresentation.write(WriterRepresentation.java:104) at org.restlet.engine.http.connector.Connection.writeMessageBody(Connection.java:873) in ~ org.restlet.engine.http.connector.Connection.writeMessage(Connection.java:818) in ~ org.restlet.engine.http.connector.ServerConnection.writeMessage(ServerConnection.java:334) in ~ org.restlet.engine.http.connector.Connection.writeMessages(Connection.java:954) at org.restlet.engine.http.connector.BaseServerHelper.handleOutbound(BaseServerHelper.java:201) at org.restlet.engine.http.connector.BaseHelper.handleNextOutbound(BaseHelper.java:425) in ~ org.restlet.engine.http.connector.BaseServerHelper.handleInbound(BaseServerHelper.java:174) in ~ org.restlet.engine.http.connector.BaseHelper.handleNextInbound(BaseHelper.java:418) at org.restlet.engine.http.connector.Connection.readMessages(Connection.java:695) in ~ org.restlet.engine.http.connector.Controller$2.run(Controller.java:95) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) in ~ java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619)May 16, 2011 7:05:12 to be org.restlet.ext.jaxb.internal.Marshaller getMarshallerWARNING: can not to situate marshaller.May 16, 2011 7:05:12 to be org.restlet.ext.jaxb.JaxbRepresentation writeWARNING: JAXB marshalling error caught.javax.xml.bind.JAXBException: unable to situate marshaller. In ~ org.restlet.ext.jaxb.internal.Marshaller.getMarshaller(Marshaller.java:166) at org.restlet.ext.jaxb.internal.Marshaller.marshal(Marshaller.java:216) at org.restlet.ext.jaxb.JaxbRepresentation.write(JaxbRepresentation.java:527) in ~ org.restlet.representation.WriterRepresentation.write(WriterRepresentation.java:104) at org.restlet.engine.http.connector.Connection.writeMessageBody(Connection.java:873) at org.restlet.engine.http.connector.Connection.writeMessage(Connection.java:818) in ~ org.restlet.engine.http.connector.ServerConnection.writeMessage(ServerConnection.java:334) at org.restlet.engine.http.connector.Connection.writeMessages(Connection.java:954) at org.restlet.engine.http.connector.BaseServerHelper.handleOutbound(BaseServerHelper.java:201) in ~ org.restlet.engine.http.connector.BaseHelper.handleNextOutbound(BaseHelper.java:425) in ~ org.restlet.engine.http.connector.BaseServerHelper.handleInbound(BaseServerHelper.java:174) at org.restlet.engine.http.connector.BaseHelper.handleNextInbound(BaseHelper.java:418) at org.restlet.engine.http.connector.Connection.readMessages(Connection.java:695) at org.restlet.engine.http.connector.Controller$2.run(Controller.java:95) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619)May 16, 2011 7:05:12 to be org.restlet.ext.jaxb.internal.Marshaller$1 initialValueWARNING: Problem creating Marshallerjavax.xml.bind.JAXBException: "failure" doesnt contain ObjectFactory.class or jaxb.index in ~ com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:119) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) in ~ sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132) in ~ javax.xml.bind.ContextFinder.find(ContextFinder.java:299) in ~ javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372) in ~ javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337) at org.restlet.ext.jaxb.JaxbRepresentation.getContext(JaxbRepresentation.java:83) at org.restlet.ext.jaxb.internal.Marshaller$1.initialValue(Marshaller.java:68) in ~ org.restlet.ext.jaxb.internal.Marshaller$1.initialValue(Marshaller.java:64) at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:141) at java.lang.ThreadLocal.get(ThreadLocal.java:131) at org.restlet.ext.jaxb.internal.Marshaller.getMarshaller(Marshaller.java:163) in ~ org.restlet.ext.jaxb.internal.Marshaller.marshal(Marshaller.java:216) in ~ org.restlet.ext.jaxb.JaxbRepresentation.write(JaxbRepresentation.java:535) at org.restlet.representation.WriterRepresentation.write(WriterRepresentation.java:104) in ~ org.restlet.engine.http.connector.Connection.writeMessageBody(Connection.java:873) in ~ org.restlet.engine.http.connector.Connection.writeMessage(Connection.java:818) in ~ org.restlet.engine.http.connector.ServerConnection.writeMessage(ServerConnection.java:334) at org.restlet.engine.http.connector.Connection.writeMessages(Connection.java:954) in ~ org.restlet.engine.http.connector.BaseServerHelper.handleOutbound(BaseServerHelper.java:201) in ~ org.restlet.engine.http.connector.BaseHelper.handleNextOutbound(BaseHelper.java:425) in ~ org.restlet.engine.http.connector.BaseServerHelper.handleInbound(BaseServerHelper.java:174) in ~ org.restlet.engine.http.connector.BaseHelper.handleNextInbound(BaseHelper.java:418) at org.restlet.engine.http.connector.Connection.readMessages(Connection.java:695) in ~ org.restlet.engine.http.connector.Controller$2.run(Controller.java:95) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) in ~ java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) in ~ java.lang.Thread.run(Thread.java:619)May 16, 2011 7:05:12 to be org.restlet.ext.jaxb.internal.Marshaller getMarshallerWARNING: can not to locate marshaller.May 16, 2011 7:05:12 to be org.restlet.engine.http.connector.Connection writeMessageWARNING: exception while writing the message body.java.io.IOException: can not to locate marshaller. At org.restlet.ext.jaxb.JaxbRepresentation.write(JaxbRepresentation.java:539) at org.restlet.representation.WriterRepresentation.write(WriterRepresentation.java:104) at org.restlet.engine.http.connector.Connection.writeMessageBody(Connection.java:873) at org.restlet.engine.http.connector.Connection.writeMessage(Connection.java:818) in ~ org.restlet.engine.http.connector.ServerConnection.writeMessage(ServerConnection.java:334) in ~ org.restlet.engine.http.connector.Connection.writeMessages(Connection.java:954) in ~ org.restlet.engine.http.connector.BaseServerHelper.handleOutbound(BaseServerHelper.java:201) in ~ org.restlet.engine.http.connector.BaseHelper.handleNextOutbound(BaseHelper.java:425) in ~ org.restlet.engine.http.connector.BaseServerHelper.handleInbound(BaseServerHelper.java:174) in ~ org.restlet.engine.http.connector.BaseHelper.handleNextInbound(BaseHelper.java:418) at org.restlet.engine.http.connector.Connection.readMessages(Connection.java:695) at org.restlet.engine.http.connector.Controller$2.run(Controller.java:95) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) in ~ java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) in ~ java.lang.Thread.run(Thread.java:619)May 16, 2011 7:05:12 am org.restlet.engine.http.connector.ServerConnection writeMessageINFO: An exception occured while creating the responsejava.io.IOException: can not to locate marshaller. At org.restlet.ext.jaxb.JaxbRepresentation.write(JaxbRepresentation.java:539) at org.restlet.representation.WriterRepresentation.write(WriterRepresentation.java:104) in ~ org.restlet.engine.http.connector.Connection.writeMessageBody(Connection.java:873) at org.restlet.engine.http.connector.Connection.writeMessage(Connection.java:818) in ~ org.restlet.engine.http.connector.ServerConnection.writeMessage(ServerConnection.java:334) in ~ org.restlet.engine.http.connector.Connection.writeMessages(Connection.java:954) at org.restlet.engine.http.connector.BaseServerHelper.handleOutbound(BaseServerHelper.java:201) at org.restlet.engine.http.connector.BaseHelper.handleNextOutbound(BaseHelper.java:425) in ~ org.restlet.engine.http.connector.BaseServerHelper.handleInbound(BaseServerHelper.java:174) at org.restlet.engine.http.connector.BaseHelper.handleNextInbound(BaseHelper.java:418) at org.restlet.engine.http.connector.Connection.readMessages(Connection.java:695) in ~ org.restlet.engine.http.connector.Controller$2.run(Controller.java:95) in ~ java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) in ~ java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) in ~ java.lang.Thread.run(Thread.java:619)Please someone help!!!