WLS6 Updating XALAN + XERCES
Is there an easy way to update the internal versions of XERCES and
XALAN that Weblogic uses?
There are a few bugs in XALAN 1.2 that I would rather not have to deal
with right now.
I created an XML Registry, but I believe this only applies to the XML
Parser and not the XSL Processor.
Any help appreciated.
Thanks.
Dylan Parker
They were renamed because people were doing just what you describe --
replacing the implementation internal to WLS' XML functions. Because we had
not build the product with the new versions of the parser, changing the
implementation would break our product. So, we changed the package names to
protect them.
Michael Girdley
BEA Systems
Learning WebLogic? http://learnweblogic.com
"Barry Dunne" <[email protected]> wrote in message
news:[email protected]...
I think the questions is really why did BEA change the package names ofthe
xalan/xerces classes.
If they had just kept the standard ones everything would have been fine,we
could just have put the new version ahead of it in the classpath.
I had the following problem when I migrated a bean that returned xml from
WL5.1 to WL6.0:
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.apache.xerces.dom.DocumentImpl;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
DocumentImpl doc = (DocumentImpl) db.newDocument();
Doing this I got a ClassCastException when the last line executes, the
newDocument() method returns a
weblogic.apache.xerces.dom.DocumentImpl
but I want an
org.apache.xerces.dom.DocumentImpl
To get around that problem you can tell the Factory which implementationto
use by adding 3 lines of code to the sample above:
String oldXMLFactory =
System.getProperty("javax.xml.parsers.DocumentBuilderFactory");
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
oldXMLFactory);
DocumentImpl doc = (DocumentImpl) db.newDocument();
This will let WebLogic use it's own xml classes internally, and let youuse
xerces1.3 for your own work.
I don't know about xalan as I have not used it but I hope that helps.
Barry.
"Dylan" <[email protected]> wrote in message
news:[email protected]...
Is there an easy way to update the internal versions of XERCES and
XALAN that Weblogic uses?
There are a few bugs in XALAN 1.2 that I would rather not have to deal
with right now.
I created an XML Registry, but I believe this only applies to the XML
Parser and not the XSL Processor.
Any help appreciated.
Thanks.
Dylan Parker
Similar Messages
-
Oracle's XDK positioning vs. xalan/xerces in OC4J
How is Oracle going to position its XDK versus the XML Parser/XSLT Stylesheet processor (Xerces/Xalan) components in OC4J? Are they interoperable?
<cross posted in XML forum>Over time, the Xalan/Xerces will be replaces in OC4J by Oracle XML Components via the JAXP 1.1 support which makes XML Parsers and XSLT processors in Java pluggable.
The Oracle SOAP implementation that comes with IAS 1.0.2.2 already has swapped out Xerces with Oracle XML Parser using Oracle XML Parser's JAXP 1.0 support. -
Xmlparserv2.jar with xerces and xalan
Hello,
I have a Spring/Spring Web Flow application. I also have a separate web application that's using the XML Publisher API to generate reports from RTF files. I am now in the process of merging these two into one application.
The Spring app requires the xerces.jar and xalan.jar JARs in order to parse the various XML files required to configure Spring. The XML Publisher app requires the xmlparserv2.jar JAR in order to parse the XML required for generating reports.
When I have all of these JARs in my one web application, I receive an error when I call the FOProcessor.generate() method. Here it is:
oracle.xml.parser.v2.XMLParseException: Bad character (1).
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:324)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:287)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:292)
at oracle.xml.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:590)
at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:260)
at oracle.apps.xdo.common.xml.XSLTClassic.transform(XSLTClassic.java:200)
at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:174)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1022)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:968)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:209)
at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1561)
at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:951)
I was thinking this was because there was a conflict between xalan, xerces and xmlparserv2, so I removed the xalan and xerces JARs from the classpath. Now I get the following whenever I try to hit one of my spring MVC actions:
DEBUG org.springframework.beans.factory.xml.DelegatingEntityResolver(99) - Attempting to resolve XML Schema [http://www.springframework.org/schema/beans/spring-beans-2.0.xsd] using [org.springframework.beans.factory.xml.PluggableSchemaResolver]
<Line 43, Column 57>: XML-24509: (Error) Duplicated definition for: 'identifiedType'
<Line 60, Column 28>: XML-24509: (Error) Duplicated definition for: 'beans'
<Line 145, Column 34>: XML-24509: (Error) Duplicated definition for: 'description'
<Line 158, Column 29>: XML-24509: (Error) Duplicated definition for: 'import'
<Line 180, Column 28>: XML-24509: (Error) Duplicated definition for: 'alias'
<Line 209, Column 33>: XML-24509: (Error) Duplicated definition for: 'beanElements'
<Line 223, Column 44>: XML-24509: (Error) Duplicated definition for: 'beanAttributes'
<Line 486, Column 43>: XML-24509: (Error) Duplicated definition for: 'meta'
<Line 494, Column 35>: XML-24509: (Error) Duplicated definition for: 'metaType'
<Line 511, Column 27>: XML-24509: (Error) Duplicated definition for: 'bean'
<Line 531, Column 38>: XML-24509: (Error) Duplicated definition for: 'constructor-arg'
<Line 600, Column 51>: XML-24509: (Error) Duplicated definition for: 'property'
<Line 611, Column 36>: XML-24509: (Error) Duplicated definition for: 'lookup-method'
<Line 647, Column 38>: XML-24509: (Error) Duplicated definition for: 'replaced-method'
<Line 684, Column 31>: XML-24509: (Error) Duplicated definition for: 'arg-type'
<Line 711, Column 26>: XML-24509: (Error) Duplicated definition for: 'ref'
<Line 749, Column 28>: XML-24509: (Error) Duplicated definition for: 'idref'
<Line 783, Column 28>: XML-24509: (Error) Duplicated definition for: 'value'
<Line 811, Column 27>: XML-24509: (Error) Duplicated definition for: 'null'
<Line 825, Column 39>: XML-24509: (Error) Duplicated definition for: 'collectionElements'
<Line 842, Column 48>: XML-24509: (Error) Duplicated definition for: 'list'
<Line 853, Column 47>: XML-24509: (Error) Duplicated definition for: 'set'
<Line 862, Column 41>: XML-24509: (Error) Duplicated definition for: 'map'
<Line 869, Column 45>: XML-24509: (Error) Duplicated definition for: 'entry'
<Line 877, Column 45>: XML-24509: (Error) Duplicated definition for: 'props'
<Line 886, Column 26>: XML-24509: (Error) Duplicated definition for: 'key'
<Line 897, Column 27>: XML-24509: (Error) Duplicated definition for: 'prop'
<Line 916, Column 39>: XML-24509: (Error) Duplicated definition for: 'propertyType'
<Line 960, Column 45>: XML-24509: (Error) Duplicated definition for: 'baseCollectionType'
<Line 971, Column 46>: XML-24509: (Error) Duplicated definition for: 'typedCollectionType'
<Line 987, Column 34>: XML-24509: (Error) Duplicated definition for: 'mapType'
<Line 1008, Column 36>: XML-24509: (Error) Duplicated definition for: 'entryType'
<Line 1047, Column 40>: XML-24509: (Error) Duplicated definition for: 'listOrSetType'
<Line 1056, Column 36>: XML-24509: (Error) Duplicated definition for: 'propsType'
<Line 1069, Column 45>: XML-24509: (Error) Duplicated definition for: 'defaultable-boolean'
ERROR org.springframework.web.servlet.FrameworkServlet(229) - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 10 in XML document from class path resource [spring/servlet/sellitem-webflow-config.xml] is invalid; nested exception is oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'
Caused by:
oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:431)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:290)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:287)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:181)
at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:151)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:405)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:357)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:123)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:91)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:294)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:308)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:252)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:221)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:115)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
So it seems like these JARs are incompatible with each other. Is there any way I can use the Oracle DocumentBuilder for my XML Publisher classes and the xerces for the rest of the app?
Thanks,
Leo HartNow one has any advice? :(
-
Xalan-j_2_0_1 xerces-1_3_1 and jdom-b6
I know that people have already posted message regarding xalan, xerces compatability
with weblogic 6.0sp1 but all the fixes suggested don't work when I use jdom!
When using JDOM, if i put xerces before the weblogic_sp.jar then Hotspot will
die with the following error when i start using jdom.
# HotSpot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Error ID: 4F533F57494E13120E43505002D4
if I put xerces after weblogic_sp.jar and before weblogic.jar then xalan gets
a method not found error when I try a to execute transform() on a document. Also,
I tried my transformation outside of weblogic and it worked just fine.
here is the exception when i try to do the transform in weblogic
java.lang.NoSuchMethodError
at org.apache.xpath.patterns.NodeTest.execute(NodeTest.java:403)
at org.apache.xpath.axes.PredicatedNodeTest.acceptNode(PredicatedNodeTest.java:388)
at org.apache.xpath.axes.ChildTestIterator.nextNode(ChildTestIterator.java:193)
at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:428)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2202)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:739)
at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:498)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2202)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2085)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1219)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2942)
at java.lang.Thread.run(Thread.java:484)I could see how that would fail if Weblogic was using the default registry
values of:
DocumentBuilderFactory="weblogic.apache.xerces.jaxp.DocumentBuilderFactoryIm
pl"
SAXParserFactory="weblogic.apache.xerces.jaxp.SAXParserFactoryImpl"
it would find weblogic's internal classes.
But if Weblogic is using an xml registry such as:
DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"
and was starting with the system property of:
..-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.Transf
ormerFactoryImpl ...
Wouldn't JDOM correctly find the org.apache factories instead?
I seem to be having a very similar problem to yours with 6.0 sp2; I'm not
invoking JDOM directly, but I'm using Syslog from protomatter to handle
logging; and Syslog DOES invoke the new SAXBuilder() that you cite. I'm
using xalan 2.1.0 and xerces 1.3.1 placed after the weblogic jars. I also
get a NoSuchMethodError during the transformer.transform, but the same
document is successfully transformed at the command line
TransformerFactory tFactory = TransformerFactory.newInstance();
String xString = xmlDoc.toString() ;
StringReader xmlReader = new StringReader( xString );
StreamSource streamSource = new StreamSource( xmlReader ) ;
Source stylesheet = tFactory.getAssociatedStylesheet( streamSource,
media, title, charset);
Transformer transformer = tFactory.newTransformer(stylesheet);
StreamResult streamResult = new StreamResult( outWriter ) ;
transformer.transform( new StreamSource( new StringReader( xString ) ),
streamResult ) ;
"Eric Van" <[email protected]> wrote in message
news:[email protected]...
>
FIGURED IT OUT!
The problem is that JDOM's SAXBuilder, when used with weblogic, loadsweblogic's
jaxp sax parser, which for some reason doesn't work if the newest xercesis placed
in the classpath before weblogic_sp.jar.
So, to get around this all you have to do is tell JDOM's SAXBuilder to useanother
parser when you create it, preferable one that WORKS!!
I used the one that comes with xerces
new SAXBuilder("org.apache.xerces.parsers.SAXParser")
and it worked fine.
Hope this helps everyone else out.
"Steve Liles" <[email protected]> wrote:
Eric's solution works great if you can get away with always using a
DOMBuilder.
>>
However, I can't always use a DOMBuilder - I need to use the SAXBuilder
in one particular
case where I need to specify the SystemId dynamically as in:
.. SAXBuilder builder = new SAXBuilder(reader, _systemId); ..
There is no DOMBuilder equivalent. Anyone have any suggestions?
cheers,
Steve Liles
"Eric Van" <[email protected]> wrote:
Looks like if you avoid using the org.jdom.input.SAXBuilder and usethe
org.jdom.input.DOMBuilder
instead that the Hotspot error can be avoided. I have a feeling thatthere
is
something else going on here, but OH WELL, NOW IT WORKS.
"Eric Van" <[email protected]> wrote:
I know that people have already posted message regarding xalan, xerces
compatability
with weblogic 6.0sp1 but all the fixes suggested don't work when I
use
jdom!
When using JDOM, if i put xerces before the weblogic_sp.jar then
Hotspot
will
die with the following error when i start using jdom.
# HotSpot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Error ID: 4F533F57494E13120E43505002D4
if I put xerces after weblogic_sp.jar and before weblogic.jar thenxalan
gets
a method not found error when I try a to execute transform() on a
document.
Also,
I tried my transformation outside of weblogic and it worked just fine.
here is the exception when i try to do the transform in weblogic
java.lang.NoSuchMethodError
atorg.apache.xpath.patterns.NodeTest.execute(NodeTest.java:403)
atorg.apache.xpath.axes.PredicatedNodeTest.acceptNode(PredicatedNodeTest.java:
388)
atorg.apache.xpath.axes.ChildTestIterator.nextNode(ChildTestIterator.java:193)
atorg.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.ja
va:428)
atorg.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:193)
atorg.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2202)
atorg.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
739)
atorg.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.ja
va:498)
atorg.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:193)
atorg.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2202)
atorg.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2085)
atorg.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1219)
atorg.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2942)
at java.lang.Thread.run(Thread.java:484) -
Hi,
I'm trying to use Xalan 2.6.1 and Xerces 2.6.2 with Weblogic 8.1SP2, but no result yet...
I found docs on bea website:
http://edocs.bea.com/wls/docs81/pdf/faq.pdf
http://e-docs.bea.com/wls/docs81/xml/xml_admin.html
where I found this:
"Warning: In version 8.1 of WebLogic Server, you can plug in only the following versions of the Apache Xerces parser:
Xerces 2.2.0
Xerces 2.3.0
Xerces 2.4.0
In addition, you can plug in only those versions of the Apache Xalan transformer that are compatible with the preceding versions of the Apache Xerces parser."
I can't find any solution to this?
I tried various option:
- xercesImpl2.6 in the classpath variable
- xalan2.6.2 in the endorsed lib
- registered factory impl names in xml registry
- prefer web-inf set to true
Errors result in following exception:
- NoMethodFound (rhino classes inside weblogic.jar)
- ClassCast (xalan/xerces conflicts)
Any one has suggestions?
Regards
LeonardoAccording to that link your right it is not supported.
Have you tried adding the xerces jars at the beginning of the classpath? -
How does xalan.jar work with jdk1.3.1 and not work with jdk1.4.1
Hi,
i am using java, xalan, xerces for web development. The environment is jdk1.4.1, xerces.jar, xalan.jar. i am facing problem while transforming xml, xsl. Its giving the following error
java.lang.NoSuchMethodError: org.apache.xalan.xslt.Process.getDefaultLiaison()Ljava/lang/String;
at org.apache.xalan.xslt.XSLTEngineImpl.(XSLTEngineImpl.java:367)
at org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor(XSLTProcessorFactory.java:79)
I tried with jdk1.3.1, xalan.jar, xerces.jar. Its working fine. Can anyone tell me what is the problem with jdk1.4.1 ?
Regards
AshokI have the same problem, but the version within SUN seems imcomplete,what version is ?
For example I am using the xsl tag library provided by Apache (I know this now deprecated). In its ApplyTag.java it uses XSLTDataSource this is not in the SUN 1.4 distribution so it falls over. If I add XALAN 1.0.1 it falls over because it on getDefaultLiason() because it starts loading somne classes from rt.jar and some from xalan.jar, how are you meant to override this. -
Problems with xalan migrating from Sun One 7 to Sun One 8.1
Hi!
I'm migrating one application from Sun One 7 to Sun One 8.1, my problem is when I use xalan/xerces to transform XML/XSL appears the following error:
javax.xml.transform.TransformerException: java.lang.NullPointerException
I put my xalan/xerces version in my WEB-INF/lib but I think that the problem is that internally the server use its xalan that is a strange version, because in MANIFEST file put 2.6.0 version but I compared with 2.6.0 of xalan and it's different.
How any idea to solve this?
Thanks in advance
Josep MAs you have an existing portal installation, you will need to have the 9iAS Portal 3.0.8 Upgrade Scripts in order to upgrade to 3.0.8. We expect to have these 3.0.8 upgrade scripts available next week (April 23-27) for download from OTN.
With regards to import/export, Import/Export Utilities currently will ONLY work between portal installations which are at the SAME VERSION LEVEL.
The 3.0.8 upgrade process is an "in-place" upgrade, meaning that it upgrades an existing installation to the 3.0.8 release. You will need to have Portal 3.0.7 on your new box, and then upgrade "in place" to 3.0.8 there. I would advocate also doing a "cold backup" snapshot(backup all database data and log files) of your existing production database files as well.
null -
No need for Xerces jars since Sun includes it in the jvm?
Hey Everybody,
If one would like to use Xerces in a java app, why should they download it from Apache when it's included in Sun's jvm releases as of 1.4?
I noticed that the "rt.jar" in Sun's jvm for Windows contains an apache folder: jdk1.6.0_11\jre\lib\rt.jar\com\sun\org\apache\,
that contains the following apache folders: bcel, regexp, xalan, xerces, xml, xpath
How does one tell what version of Xerces is being released with a particular Sun jvm release? I looked all over the Sun site - it seems they haven't documented that they are using files from Xerces. They even took the trouble of burying the "org/apache" folder down under the "com/sun" folder -- as if to hide the fact that apache is being used....maybe to take credit for it to make it look like the functionality was developed by Sun?
Is there a chance that one could successfully compile java code that has references to Xerces classes where the developer's project does not contain Xerces jars, but instead relies on the Sun bundled xerces classes -- and while that code would compile file, there could exist runtime exceptions due to potential classes from Xerces that Sun did not include in its jvm -- while if the project did include the Xerces jars - there would be no runtime errors?
Thanks!EnNuages wrote:
Hey Everybody,
If one would like to use Xerces in a java app, why should they download it from Apache when it's included in Sun's jvm releases as of 1.4?One reason could be because the apache one is newer and thus is better in some way.
>
I noticed that the "rt.jar" in Sun's jvm for Windows contains an apache folder: jdk1.6.0_11\jre\lib\rt.jar\com\sun\org\apache\,
that contains the following apache folders: bcel, regexp, xalan, xerces, xml, xpath
How does one tell what version of Xerces is being released with a particular Sun jvm release? I looked all over the Sun site - it seems they haven't documented that they are using files from Xerces. They even took the trouble of burying the "org/apache" folder down under the "com/sun" folder -- as if to hide the fact that apache is being used....maybe to take credit for it to make it look like the functionality was developed by Sun?
No.
More likely the choice of location was without thought. Or because they might want to change it or remove it.
Is there a chance that one could successfully compile java code that has references to Xerces classes where the developer's project does not contain Xerces jars, but instead relies on the Sun bundled xerces classes -- and while that code would compile file, there could exist runtime exceptions due to potential classes from Xerces that Sun did not include in its jvm -- while if the project did include the Xerces jars - there would be no runtime errors?No. You can't compile using classes that don't exist. -
Xerces Validation Issues with Honour All schema Locations
Way back in 2009/2010 there was a bug - 284272 - that was never updated with Xerces information about validation. We have a similar issue in Luna and Mars with the WTP validation framework (with Xerxes at the center) and I'm wondering if it's due to Xerces 2.9 or something else.
I'm not a savvy XSD guy, but the issues detailed in 284272 still occur for us with certain schema combinations. We're encountering it specifically with the JBoss/SwitchYard project and the SCA schemas we extend for the SwitchYard runtime.
The following error is displayed in the Problems tab:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'sca:interface.java'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":interface, "http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected. switchyard.xml src/main/resources/META-INF line 7 XML Problem
Can someone revisit 284272 and let me know if this is indeed a Xerxes issue under the covers with the example included in the bug? It's not our example, but has the same general problem.
I just don't want to open a duplicate of 284272 without knowing more about how the Honour All Schema Locations stuff works under the covers and if it is indeed caused by Xerces - indeed if it might be fixed by an update to Xerces further down the line (they're up to 2.11 and there was a 2.9.1 it looks like we might be able to more simply move to if it's fixed there).
Thanks all!
--FitzI think this is the odata4 that you need for 7.3
SCA
ODATACXFEXT11_0-10012140.SCA
SP11 for SAP ODATA4J+CXF-REST LIB 7.30
0
Info
10352
26.02.2014
This might be the only package you need; it might be in your best interest to avoid manually downloading files and rely upon Solution Manager's MOpz feature to query your IdM system and let it track down all the needed packages. -
Hi,
We are porting our application from WLS5.1 to WLS6.0SP2. We
use Apache's Xerces parser for XSLT processing. After starting the server while
loading a page, I get the following error:
javax.xml.transform.TransformerException
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1242)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2942)
at java.lang.Thread.run(Thread.java:484)
java.lang.ArrayIndexOutOfBoundsException
at org.apache.xalan.serialize.SerializerToXML.accum(SerializerToXML.java:1321)
at org.apache.xalan.serialize.SerializerToXML.outputLineSep(SerializerToXML.java:195)
at org.apache.xalan.serialize.SerializerToXML.indent(SerializerToXML.java:2241)
at org.apache.xalan.serialize.SerializerToHTML.startElement(SerializerToHTML.java:559)
at org.apache.xalan.transformer.QueuedStartElement.flush(QueuedStartElement.java:357)
at org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:770)
at org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:279)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:749)
at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:498)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2202)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2085)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1219)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2942)
at java.lang.Thread.run(Thread.java:484)
Has anyone come across this problem and got the solution ?
Regards,
RamkumarThis is correct you can use different 3rd party parsers like crimson or xml4j , by
configuring the xml registry .However using different versions of apache xerces and xalan
other than those shipped can cause compatibility problems and is not supported.
Look at the faq url for details.
http//e-docs.bea.com/wls/docs61/faq/xml.html#740643
It might be possible however to hack this and get it to work.
yeshwant
Simon Spruzen wrote :
If at all possible, you should limit your versions of Xalan and Xerces to those
shipped with WLS (in weblogic.jar and xmlx.jar). So your imports look something
like:
import org.w3c.dom.*;
import weblogic.apache.*; // not org.apache.*
It seems that different versions of Xalan and Xerces ship with different versions
of the org.w3c.dom classes that can be incompatible. You also must also use compatible
versions of Xalan and Xerces together, else all sorts of oddness starts.
(I wish Jakarta would merge the Xalan and Xerces packages into one super-package
and gave it a single name)
If you use the stuff shipped with WLS6.0 and nothing else, everything works fine.
You don't have to use the registry and JAXP if you don't want to, however it's
a nice clean API, providing you agree on what versions of Xalan and Xerces you're
on. I found using JAXP with mixed versions of Xalan/Xerces just made things more
confusing!
WLS6.1 upgrades Xalan and Xerces and drops xmlx.jar. Here's part of a reply from
a support case I've raised in a related area that clears things up:
[Helen - BEA Support - writes:]
"Here is some information that I hope will clarify things a little more :-
The packaging was intended to make sure that customers could use newer versions
of xerces and xalan without causing problems for the built in parser.The org.apache
classes are packaged in xmlx.jar whereas the weblogic.apache classes are packaged
in weblogic.jar.
Originally, we planned to rev the xmlx.jar version of Xerces more often than
the built-in version in WLS. But it turned out that there were compatibility
problems involving the Level 2 DOM classes (org.w3c.dom package), so in
practice people couldn't easily plug in a different version of Xerces than
the one included in weblogic.jar. This problem generally only affects
customers desiring to plug in a different version of Xerces;
Because of the compatibility issue, which is not easily solvable, we have
decided not to support plugging in a different version of Xerces than the one
shipped. Therefore, we have decided to axe xmlx.jar.
Note that for 6.1 it is not possible to use a different version of xerces and
xalan than what is shipped as per
http//e-docs.bea.com/wls/docs61/faq/xml.html#740643"
"Ram Kumar" <[email protected]> wrote:
Hi Kenneth,
Yes, it is already in my classpath before weblogic.jar.
Do I need to use the XML Registry and JAXP API for this to work compulsorily
Regards,
Ramkumar
"Kenneth Chenis" <[email protected]> wrote:
Try putting your xerces.jar file in the classpath before the weblogic.jar
.... that resolved some (not all) of the problems we had with the internal
xerces/parser classes in the weblogic.jar file.
hope this helps,
Kenneth Chenis
ComponenTree Inc.
Data Code Inc.
[email protected]
978-521-5970
"Ram Kumar" <[email protected]> wrote in message
news:[email protected]...
Hi,
We are porting our application from WLS5.1 to WLS6.0SP2. We
use Apache's Xerces parser for XSLT processing. After starting theserver
while
loading a page, I get the following error:
javax.xml.transform.TransformerException
atorg.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1242)
atorg.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2942)
at java.lang.Thread.run(Thread.java:484)
java.lang.ArrayIndexOutOfBoundsException
atorg.apache.xalan.serialize.SerializerToXML.accum(SerializerToXML.java:1321)
atorg.apache.xalan.serialize.SerializerToXML.outputLineSep(SerializerToXML.jav
a:195)
atorg.apache.xalan.serialize.SerializerToXML.indent(SerializerToXML.java:2241)
atorg.apache.xalan.serialize.SerializerToHTML.startElement(SerializerToHTML.ja
va:559)
atorg.apache.xalan.transformer.QueuedStartElement.flush(QueuedStartElement.jav
a:357)
atorg.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandle
r.java:770)
atorg.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.
java:279)
atorg.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
749)
atorg.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.ja
va:498)
atorg.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:193)
atorg.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2202)
atorg.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2085)
atorg.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1219)
atorg.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2942)
at java.lang.Thread.run(Thread.java:484)
Has anyone come across this problem and got the solution ?
Regards,
Ramkumar -
NoSuchMethodError with org.w3c.dom.Node.getTextNode()
Hi,
I got a trouble with this method. I developped my app with Eclipse and jdk 1.5.
I used the endrosed mechanism for updating xalan and xerces in my jre.
Everything works fine on my computer, but as I want to run my app on an other machine, I got this error.
I put a copy of my jre on the other machine and I launch the app from this jre. It seems the endorsed jars are taken in account, but it still doesn't work.
Thanks for your help.I found ths solution.
In my jre was missing the endorsed Dom.jar, found at jaxp.dev.java.net. to overwrite org.w3c.dom standard classes. -
JSP, JSTL and XML Exception
Hi,
I'm using tomcat 5.0.28 with J2SE5, JSP and JSTL. I tried to execute the following example about JSTL and XML.
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
<c:import url="book.xml" var="url" />
<x:parse xml="${url}" var="book" scope="session" />
<x:choose>
</x:choose>
<P>
<B><x:out select="$book/book/title"/></B><BR>
<x:out select="$book/book/author"/><BR>
<x:out select="$book/book/url"/><BR>When I execute the jsp file, the container produces following exception:
javax.servlet.ServletException: org/apache/xpath/XPathException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.xml.xml_005fchoose_jsp._jspService(xml_005fchoose_jsp.java:104)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/apache/xpath/XPathException
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
org.apache.taglibs.standard.tag.common.xml.WhenTag.condition(WhenTag.java:51)
org.apache.taglibs.standard.tag.common.core.WhenTagSupport.doStartTag(WhenTagSupport.java:65)
org.apache.jsp.xml.xml_005fchoose_jsp._jspx_meth_x_when_0(xml_005fchoose_jsp.java:203)
org.apache.jsp.xml.xml_005fchoose_jsp._jspx_meth_x_choose_0(xml_005fchoose_jsp.java:169)
org.apache.jsp.xml.xml_005fchoose_jsp._jspService(xml_005fchoose_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Due to the fact, that org/apache/xpath/XPathException belongs to xalan, i copied the xalan 2.7.0 to the web-inf/lib directory. But this doesn't solve the problem. I'm tried it also with xalan, xerces and jaxp. Again, it doesn't work.
Can anybody help me with this problem?
byeCouple of things, possibly unrelated, but not sure.
You are using JSTL1.0 uris.
With Tomcat5 you can use JSTL1.1, and the Servlet2.4 spec.
You would use the URI: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
and also update your web.xml file to declare itself as version 2.4
You shouldn't need any of the xalan xerces or jaxp classes in web-inf/lib.
xerces is by default found in the [TOMCAT]/common/endorsed directory.
The others should be provided with the standard java API.
I would try with minimal jar files in web-inf/lib
Occasionally if you include files twice in the classpath it will create ClassNotFoundExceptions like this.
Hope this helps,
evnafets -
Plugging XSLT / XML processors into Business Connector 4.7
Hi,
I need to use Xalan 2.6.0 and the associated XML parsers
in the Business Connector.
Does anyone know whether any built-in services or
SAP Adapter services would be negatively impacted by
this change? I have found nothing in the documentation.
(Among the reasons I need to do this are that the
processors in package com.inqmy.lib.jaxp do not seem to
be JAXP 1.2 compliant. Also, they neither respect the
encoding-attribute of <xsl:output>, nor allow to override
it from the outside. When generating HTML, this has
created problems for some clients).
In order to use Xalan/Xerces, one needs to set the
variable PREPENDCLASSES in server.bat to contain
the Xalan jars, and change the value of the configuration
variable watt.xslt.jaxp.properties in the server.cnf file.
The value of this variable is the name of a file in normal
Java properties syntax, which contains values for the
relevant System properties:
javax.xml.transform.TransformerFactory
javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.SAXParserFactory
I'm using BC 4.7 SR2, Core Fix 2, JDK 1.3.1_09 under WinXP
At first glance everything seems to work fine (I can
still use recordToDocument), but I'd like to be sure.
And what about BC 4.6?
-- Sebastian Millies
IDS Scheer AGCheck out this weblog series for starters: /people/tobias.trapp/blog
Then I would suggest you post your question to the ABAP forum. -
XSL transformation with xsl:import generates exceptions
I am using the Schematron's basic XSL file basic-schematron.xsl to validate the XML format of one of our data files. The XSL file looks something like this
================
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias">
<xsl:import href="skeleton1-5.xsl"/>
<xsl:template name="process-prolog">
<axsl:output method="text" />
</xsl:template>
==================
But, the validation fails while trying to run the transformation on my Schematron input file using this basic-schematron.xsl with java.lang.NoSuchMethodError:
======= OUTPUT ============
Markup Error: no match attribute on <key> outside <rule>
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: GregorSamsa.process$dash$root(Lcom/sun/org/apache/xalan/internal/xsltc/DOM;Lcom/sun/org/apache/xml/internal/dtm/DTMAxisIterator;Lcom/sun/org/apache/xml/internal/serializer/SerializationHandler;ILjava/lang/Object;)V
at GregorSamsa.applyTemplates()
at GregorSamsa.applyTemplates()
at GregorSamsa.transform()
at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:594)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:640)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:279)
at com.solipsa.xsdvalidator.XSDValidator.validateSchematron(XSDValidator.java:137)
at com.solipsa.xsdvalidator.XSDValidator.validate(XSDValidator.java:181)
at com.solipsa.xsdvalidator.XSDValidatorUI.jButton1ActionPerformed(XSDValidatorUI.java:244)
at com.solipsa.xsdvalidator.XSDValidatorUI.access$300(XSDValidatorUI.java:21)
at com.solipsa.xsdvalidator.XSDValidatorUI$4.actionPerformed(XSDValidatorUI.java:140)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
============= OUTPUT ==============
I tried the individual JAXP 1.3 for J2SDK 1.4.2 (Using the -Djava.endorsed.dirs JVM param) and tried the JDK 1.5.0_02 which has JAXP 1.3 inbuilt and they all fail.
I tried the above with separate Xalan/Xerces jar files, and then it works fine.
The problem seems to be somthing specific to the JAXP 1.3 environment. I can provide more details, if required. Any help is highly appreciated.One morning your code woke up and found it had been transformed into a giant insect.
But seriously, here's the name of the method that doesn't exist:GregorSamsa.process$dash$rootIs GregorSamsa your class? Maybe your server has an old version of it which is missing that method? (Or: those $ signs look strange to me, maybe they are a mistranslation of some other character?) -
DOM, XML Schema, Java. Confused!!!
Hi all,
Please help me to answer the 3 questions. I'm totally confused.
1. Does DOM allow us to add invalid data based on the XML schema?
2. I have an XML file. I want to use DOM to add, modify and delete nodes from the file, then print out an XML output file. If DOM does not prevent us from adding invalid data, I guess we have to run the validation after the output file is printed out?
3. There are so many parsers, DOM, ... outthere that I am totally confused. Please give me your suggestions. I want to use Java to populate the DOM tree, check the data integrity based on the XML schema as I modify the DOM tree (if possible) or after printing the XML output to a file. What parser should I use? What DOM should I use (DOM or JDOM)? Can I use MS XML parser (because that what my main client uses), DOM, and Java? If so what do I need. I have read 2 books and many sites, but still don't have the answer clear yet.
Very appreciate your help,
Nam.1.
never tried with Schema, with DTD: yes
2.
it is what I did*, which is pretty clumsy: currently AmauryDebou has started another thread on this subject but there's no answer yet.
*in fact I do everything in RAM (no file needed): I ouptut the DOM in a byte array and then reparse it
3.
Xalan/Xerces is pretty standard (they are used in JAXP).
JDOM has a reputation of being faster than DOM - depends on the amount of data you deal with.
if you develop in Java, forget MSXML
if parsing speed is an issue, you can achieve excellent performances with James Clark's XP.
Maybe you are looking for
-
Last sunday i install a window 8 and this window format my all drive & make it 1 drive (DRIVE C). Before all of this i have 5 drive in different size with 1 Bitlocker protect drive. So i try data recovery software to recover my data. i got back all m
-
Sales Order: Item Field Layout
I would like to change the order in which fields of Sales Order Item display in. Basically move some fields forward so client does not need to scroll so far to right to maintain for example Order number. Is there a place in config where you can contr
-
Is there a way to transfer money between stores?
I have money in my mexican account, but I want to change it to my US account, is there a way to do sO??
-
Hi All, I am very new to this community. I was earlier working as a SAP ABAP HR consultant. 6 months Back I did my certification in SAP HCM ECC 6.0 and started working as a techno functional consultant. To explore my self in this new dimensio
-
How could I config a Delivery Notes for a shipping point ?
Hi Experts! I need to config a new delivery notes especially to tie a shipping point and a revenue channel...do you know how to proceed?? Actually, my client already have a delivery note for a shipping point and a revenue channel, but now I need to c