0 Replies Latest reply on Sep 8, 2008 4:06 AM by Jan Klasser

    webservice jaxb and custom accessor

    Jan Klasser Newbie


      in our company we use Hibernate/JPA + JbossWS to host create web services (beans annotated with @WebService). Now we get a lot of lazy loading exceptions when the Hibernate entity is serialized, because the persistence context is not any longer available when this takes place.

      Someone had the same problems and found a solution :

      Only I have problems to apply this, because I do not find the correct places to configure JAXB in JBossWS.

      So two things have to be done
      1. set the JAXB marshaller property, only how?

      marshaller.setProperty("com.sun.xml.bind.XmlAccessorFactory", true);

      2. Set a JAXB property like below, but how can I pass JAXB properties in JbossWS?

      properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, true);
      context = JAXBContext.newInstance(new Class[] { ....}, properties);

      Would be great if someone could help