Hello there.
I am in the process of moving an application developped on the beta version
of Websphere Studio Application Developper to the new release version.
My application makes heavy use of Xalan 2.1.0 and xerces 1.4.3, used to
work fine in the beta version of WSAD, but doesn't in the release version.
The failure occurs when I use the TransformerFactory to get a Transformer.
Depending on the tweaking I perform on WSAD myriad of settings, I get
either :
java.lang.ClassCastException: org.apache.xalan.processor.TransformerFactoryImpl
at
javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:148)
at com.eFunds.portal.api.XSL.newTransformer(XSL.java:106)
at com.eFunds.portal.logic.Style.<init>(Style.java:25)
at
com.eFunds.portal.logic.ServiceImpl.getResultAsNode(ServiceImpl.java:261)
at
com.eFunds.portal.logic.SubscriberImpl.pollServices(SubscriberImpl.java:190)
at com.eFunds.portal.logic.HomePage.generateNewDOM(HomePage.java:195)
at
com.eFunds.portal.web.AdvancedPortalServlet.doGet(AdvancedPortalServlet.java:46)
or
java.lang.LinkageError : org/apache/xalan/processor/TransformerFactoryImpl
violates loader constraints
at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplatesHandler(TransformerFactoryImpl.java:451)
at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:762)
at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:687)
at com.eFunds.portal.api.XSL.newTransformer(XSL.java:108)
at com.eFunds.portal.logic.Style.<init>(Style.java:25)
at com.eFunds.portal.logic.ServiceImpl.getResultAsNode(ServiceImpl.java:261)
at
com.eFunds.portal.logic.SubscriberImpl.pollServices(SubscriberImpl.java:190)
at com.eFunds.portal.logic.HomePage.generateNewDOM(HomePage.java:195)
at com.eFunds.portal.web.AdvancedPortalServlet.doGet
Now the second one points to a ClassLoader problem of some sort, probably due
because WSAD uses XML code to load J2EE modules.
Guys on the WSAD user list also said that java.lang.LinkageError could be due
to Xalan/xerces using JINI, but I really don't think that's the case.
Unless there is a genius among you, I doubt you can give me a straight answer
to my problem, but I would really appreciate any ideas/clues you could
provide me on how to investigate this problem.
Thanks.
PS : Here is a bit more data.
1) read
http://www7b.boulder.ibm.com/wsdd/library/techarticles/0112_deboer/deboer.html
to know about J2EE and websphere classLoaders.
2) both my WEB module and my EJB module access Xalan/Xerces through utility
classes (com.eFunds.portal.api.XSL) that are contained in a
jar file that is in the root of the EAR. xalan.jar and xerces.jar are also
in the root of the EAR.