Hi,

Please, dump here the entire stack of the exception: that provides
info for more precise answers from this forum.

regards

didier

On Jan 6, 8:32 pm, Roi <ezra...@gmail.com> wrote:
> Hi,
> I am using JAXB to serialize objects in app.
> I have this function that i use to generate XML response from objects
> in my app.
>
> public static <T> String Generate(ServerResult<T> result)
>         {
>                 try {
>                         JAXBContext context;
>                         if (result.isData())
>                                 context = 
> JAXBContext.newInstance(ServerResult.class,
> PhotoScoreVote.class);
>                         else
>                                 context = 
> JAXBContext.newInstance(ServerResult.class);
>                         Marshaller marshaller = context.createMarshaller();
>                         StringWriter sw = new StringWriter();
>                         
> marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //
> pretty
>                         marshaller.marshal(result, sw);
>                         return sw.toString();
>                 }
>                 catch (Exception e) {
>                         return "Error";
>                 }
>
>         }
>
> @XmlRootElement(name = "ServerResult")
> public class ServerResult<T> {
>
>         @XmlElement(name = "Exception")
>         private String exception = null;
>
>         @XmlElement(name = "Data")
>         @XmlElementWrapper(name = "Items")
>         private List<T> data = null;
>
>         @XmlElement(name = "Content")
>         private String content = null;
>
>         public ServerResult() { }
>
>         public ServerResult(String content)
>         {
>                 setContent(content);
>         }
>
>         public ServerResult(Exception e)
>         {
>                 setException(e);
>         }
>
>         public ServerResult(List<T> data)
>         {
>                 setData(data);
>         }
>
>         public void setException(Exception exception) {
>                 this.exception = exception.getMessage();
>         }
>
>         public void setData(List<T> data) {
>                 this.data = data;
>         }
>
>         public void setContent(String content) {
>                 this.content = content;
>         }
>
>         public String getException() {
>                 return exception;
>         }
>
>         public List<T> getData()
>         {
>                 return data;
>         }
>
>         public String getContent()
>         {
>                 return content;
>         }
>
>         public boolean isValid()
>         {
>                 return exception != null;
>         }
>
>         public boolean isContent()
>         {
>                 return content != null;
>         }
>
>         public boolean isData()
>         {
>                 return data != null;
>         }
>
> }
>
> When i run on when GAE and not on my computer and the ServerResult
> object has data
> i receive the following error:
> Could not initialize class
> com.sun.xml.bind.v2.runtime.reflect.opt.Injector
>
> Can someone help please?
>
> Thanks,
> Roi

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to