tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Broadhead <matthew.broadh...@nbmlaw.co.uk.INVALID>
Subject Re: java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager
Date Tue, 17 Jul 2018 11:03:22 GMT
thanks Jean-Louis.  i tried excluding xalan maven artifact from the pom 
but then FOP doesn't work.  i might try to create a reproducer using 
tomee webapp archetype if possible

On 17/07/18 12:46, Jean-Louis Monteiro wrote:
> This usually indicates you have the same class loaded into 2 different
> classloaders which makes them different.
> In this scenario, I would check if you don't have duplicate xalan jars in
> tomee/lib and in the WEB-INF/lib of your application.
>
> Hope it helps
>
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
>
> On Tue, Jul 17, 2018 at 2:06 AM, Matthew Broadhead <
> matthew.broadhead@nbmlaw.co.uk.invalid> wrote:
>
>> i have a couple of problems...
>>
>> i have not been able to upgrade from TomEE 7.0.3 to 7.0.4 or 7.0.5 due to
>> the error (it works fine in 7.0.3)
>> java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault
>> cannot be cast to org.apache.xml.dtm.DTMManager
>>
>> which occurs when i run the following code for Apache FOP
>> ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
>> URL filepath = classLoader.getResource(xslPath);
>> Reader xsl = new InputStreamReader(filepath.openStream());
>> TransformerFactory transformerfactory = TransformerFactory.newInstance();
>> StreamSource ssXsl = new StreamSource(xsl);
>> Templates templates = transformerfactory.newTemplates(ssXsl);
>> Transformer transformer = templates.newTransformer();
>> StringReader reader = new StringReader(xml);
>> StringWriter writer = new StringWriter();
>> transformer.transform(new StreamSource(reader), new StreamResult(writer));
>> out = writer.toString();
>> writer.close();
>> reader.close();
>>
>> My new problem is that I am using 7.0.5 in development and this code
>> (using a CXF webClient) works perfectly.
>> Collection<? extends Integer> leadids = webClient.accept(MediaType.APP
>> LICATION_JSON).getCollection(Integer.class);
>> List<Integer> leadids_ = new ArrayList<>(leadids);
>>
>> But when I deployed it to 7.0.3 it does not work.  Is there any way to
>> slurp some JSON formatted like this
>> [1,2,3,4]
>>
>> I tried creating a wrapper like below but it didn't match
>> public class listWrapper {
>>      private List<Integer> list;
>>      // ...
>> }
>>


Mime
View raw message