0

The version of web logic is 12c.

So we were having the double & issue with the JaxBMasheller so we defined our own CharacterEscapeHandler, to essentially do nothing:

 marshaller.setProperty(CharacterEscapeHandler.class.getName(),
        new CharacterEscapeHandler() {
          @Override
          public void escape(char[] ch, int start, int length, boolean isAttVal, 
                             Writer out)   throws IOException {
                               out.write(ch, start, length);
          }
 });

This works great in Jetty, where we do most of our testing. However once we deploy this to a local weblogic instance, we get exceptions:

java.lang.IllegalArgumentException: Xml Marshalling Exception at com.hilton.api.ws.view.xml.XmlViewRenderer.renderMergedOutputModel(XmlViewRenderer.java:101) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)

Any ideas would be welcome. Thanks in advance.

Pete B.
  • 3,188
  • 6
  • 25
  • 38
  • 1
    Which version of WebLogic are you using? Can you post the complete stack trace? Does it contain any `org.eclipse.persistence.jaxb` references? – bdoughan Jun 21 '13 at 13:53
  • @BlaiseDoughan TY for looking at this. The version of weblogic is 12c, The only reference to persistence is: Caused by: javax.xml.bind.PropertyException: name: com.sun.xml.bind.marshaller.CharacterEscapeHandler value: xxx.api.ws.marshaller.xml.jaxb.JaxbMarshaller$2@1aa21bc at org.eclipse.persistence.jaxb.JAXBMarshaller.setProperty(JAXBMarshaller.java:590) at xxx.api.ws.marshaller.xml.jaxb.JaxbMarshaller.marshal(JaxbMarshaller.java:139) Is that enough? – Pete B. Jun 21 '13 at 13:57
  • Well, if you test with Jetty, you can certainly deploy to production on Jetty as well. My guess is you have some extra dependency that is unneeded on Weblogic, last I used it (years ago) they had a tendency to bundle javax api's with their implementations, so you may have a conflict there. – jesse mcconnell Jun 21 '13 at 14:39

1 Answers1

1

WebLogic 12.1.1 contains EclipseLink JAXB (MOXy) as the default JAXB (JSR-222) provider (see: http://blog.bdoughan.com/2011/12/eclipselink-moxy-is-jaxb-provider-in.html). That version of EclipseLink did not support the CharacterEscapeHandlerExtension, this support was added in EclipseLink 2.4.0 (see: http://blog.bdoughan.com/2012/06/eclipselink-24-release-available-for.html). Here are instructions for including a newer version of EclipseLink in WebLogic:

bdoughan
  • 147,609
  • 23
  • 300
  • 400