Xalan libraries in 1.4.2
Why in gods name is the xalan library included in the rt.jar.
I can understand that you want to distribute xml parsing and transformation functionality along with your jdk, but why has it to be in the boots path?
Was it not possible to put it in the lib/ext path?
Now we have to do things like -Xbootclasspath/p:"/path to xalan.jar;" just to install a new version of xalan.
Tom.
Read this:
http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html
Similar Messages
-
Hi-
I'm trying to use the latest Xercies/Xalan classes in OC4J 10.1.3 as described in the How-To swap XML Parsers document:
http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
What I can see happening is that the oracle.xml shared library is successfully 'turned off', but the xalan libraries are not added. Instead, the default xml classes that are distributed with the JDK become visible. For instance, using a slightly modified version of the index.jsp page from the how-to, I get this result:
------ Output from JSP page ----------------
TransformerFactory Instance: org.apache.xalan.processor.TransformerFactoryImpl
Transformer Instance: org.apache.xalan.transformer.TransformerIdentityImpl
Transformer Version: Xalan Java 2.4.1 (!!)
What I expect is for that last line to say version 2.7.0, which is the version of the xalan.jar included in my shared library (code to add that line to the how-to shown below).
I suspect what is happening is that the class loader is simply not letting a shared library override a system library - to do that you probably need to place the jar files in system endorsed directory.
Has anyone gotten this how-to to work - actually replacing the XML parser/transform classes with the latest Xalan classes? Are you sure it is seeing the current version you placed in the shared library?
Thanks,
Eric Everman
---- My modified getXSLTDetails() method in the index.jsp page of the how-to -------
<!-- Additional Import -->
<%@ page import="org.apache.xalan.Version" %>
public static String getXSLTDetails()
Transformer transformer=null;
TransformerFactory transformerfactory = TransformerFactory.newInstance();
Version ver = null;
String br = "<" + "br" + ">"; //otherwise the otn forum chocks on the break.
try
transformer = transformerfactory.newTransformer();
ver = (Version) transformer.getClass().forName("org.apache.xalan.Version").newInstance();
String ret_val =
"TransformerFactory Instance: "+transformerfactory.getClass().getName() + br +
"Transformer Instance: "+transformer.getClass().getName() + br;
if (ver != null) {
ret_val = ret_val + "Transformer Version: " + ver.getVersion() + br;
} else {
ret_val = ret_val + "Transformer Version not Available" + br;
return ret_val;
catch (Exception e)
e.printStackTrace();
return e.getMessage();
}--------------------------------------------------------------------Steve - Thanks for responding on this.
The Xalan SQL extension is built into Xalan. The most painless way to try it out is to run it via JEdit: www.jedit.org
JEdit a OS Java application with a fairly painless install process (I'm assuming you already have a current JRE installed). Once its installed, you'll need to install the XSLT plugin - in JEdit goto Plugins | Plugin Manager | Install and pick the XSLT plugin. You'll need the Oracle JDBC classes on your classpath - this can be done by copying the oracle_jdbc4.jar into the [JEdit install directory]/jars directory.
Restart to load that jar and you should be all set.
I included a sample XSLT page at the bottom of this post that is somewhat of a template transform for the SQL extension - its more complicated then it needs to be, but it does some nice things with the results of the query. Save it as a file and make the appropriate changes to the 'datasource' parameter near the top of the file.
Then in JEdit, open the file and make sure the XSLT plugin is visible (Plugins | XSLT | XSLT Processor Toggle - or alternately dock it in the window via global prefs). In the XSLT plugin: Allow the current buffer to be used as the source, Add that same file as a stylesheet via the '+' button, and pick a result file at the bottom. Then click the 'Transform XML' button.
Troubleshooting: I seem to remember having some classpath errors when I tried this on windows, but others have had it work w/o issues. I do remeber that the XSLT plugin had a popup window that gave a pretty good explaintion of the problem, if it occurs. Also, for some reason the XSLT plugin will not create a new file for the output, so its often best to create a file first, then choose it as the output. Of course, you can always run a transformation from the command line or w/in an applicatoin. Full docs on the Xalan SQL extension can be found at: http://xml.apache.org/xalan-j/extensionslib.html#sql
Here is my sample XSLT transform using the SQL extension:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://xml.apache.org/xalan/sql"
xmlns:str="http://exslt.org/strings"
xmlns:xalan="http://xml.apache.org/xalan"
extension-element-prefixes="sql str xalan">
<xsl:output indent="yes"/>
<xsl:param name="driver">oracle.jdbc.OracleDriver</xsl:param>
<xsl:param name="datasource">jdbc:oracle:thin:jqpublic/jqpublic@server_name:1521:dbname</xsl:param>
<xsl:param name="jndiDatasource"><!-- jndi source for production use w/in enterprise environment --></xsl:param>
<xsl:param name="debug">true</xsl:param>
<xsl:variable name="connection" select="sql:new()"/>
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
<!--
The query: You could pass parameters in to this query to build a where clause, but here is a simple example.
Also, its nice to wrap the query with a max row number to prevent huge results.
-->
<xsl:param name="query">
select * from (
SELECT
'One' FIELD_1,
'Two' FIELD_2
FROM DUAL
) where rownum < 100
</xsl:param>
<!-- Essentially, create a XConnection object -->
<xsl:variable name="connection" select="sql:new()"/>
<xsl:template match="/">
<xsl:choose><!-- Connect using JNDI -->
<xsl:when test="$jndiDatasource != ''">
<xsl:if test="not(sql:connect($connection, $jndiDatasource))">
<xsl:message>Failed to connect to db via jndi connection</xsl:message>
<xsl:comment>Failed to connect to db via jndi connection</xsl:comment>
<xsl:if test="$debug = 'true'">
<xsl:copy-of select="sql:getError($connection)/ext-error"/>
</xsl:if>
</xsl:if>
</xsl:when>
<xsl:otherwise><!-- Connect using connection string -->
<xsl:if test="not(sql:connect($connection, $driver, $datasource))">
<xsl:message>Failed to connect to db via driver/url connection</xsl:message>
<xsl:comment>Failed to connect to db via driver/url connection</xsl:comment>
<xsl:if test="$debug = 'true'">
<xsl:copy-of select="sql:getError($connection)/ext-error"/>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<!--
The results of the query. The rowset is brought back in 'streaming' mode,
so its not possible to ask it for the number of rows, or to check for zero
rows. There is a switch to disable streaming mode, but this requires all
rows to be brought into memory.
-->
<xsl:variable name="table" select="sql:query($connection, $query)"/>
<xsl:if test="not($table)">
<xsl:message>Error in Query</xsl:message>
<xsl:copy-of select="sql:getError($connection)/ext-error"/>
</xsl:if>
<page>
<!-- Your xalan environment -->
<xsl:copy-of select="xalan:checkEnvironment()"/>
<!-- Build a bunch of metadata about the rows -->
<meta>
<cols>
<xsl:apply-templates select="$table/sql/metadata/column-header"/>
</cols>
</meta>
<rowset>
<!--
With streaming results, you must use the apply-temmplates contruct,
not for-each, since for-each seems to attempt to count the rows, which
returns zero.
-->
<xsl:apply-templates select="$table/sql/row-set"/>
</rowset>
</page>
<xsl:value-of select="sql:close($connection)"/><!-- Always close -->
</xsl:template>
<xsl:template match="row">
<row>
<xsl:apply-templates select="col"/>
</row>
</xsl:template>
<xsl:template match="column-header">
<col>
<xsl:attribute name="type">
<xsl:value-of select="@column-typename"/>
</xsl:attribute>
<xsl:attribute name="display-name">
<xsl:call-template name="create-display-name"/>
</xsl:attribute>
<xsl:value-of select="@column-name"/>
</col>
</xsl:template>
<!-- Convert column names to proper caps: MY_FIELD becomes My Field -->
<xsl:template name="create-display-name">
<xsl:variable name="col-name">
<xsl:for-each select="str:tokenize(@column-name, '_')">
<xsl:value-of
select="concat(translate(substring(., 1, 1), $lowercase, $uppercase), translate(substring(.,2), $uppercase, $lowercase), ' ')"/>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="substring($col-name, 1, string-length($col-name) - 1)"/>
</xsl:template>
<!-- Creates data columns named 'col' with a column-name attribute -->
<xsl:template match="col">
<col>
<xsl:attribute name="column-name"><xsl:value-of select="@column-name"/></xsl:attribute>
<xsl:value-of select="."/>
</col>
</xsl:template>
</xsl:stylesheet> -
Xalan and EXSLT problems - namespace issue?
Hi all,
I have some code that runs fine when using some older Xalan libraries:
import org.apache.xalan.extensions.ExpressionContext;
import org.apache.xpath.NodeSet;I was trying to upgrade to use the latest libraries (from what I understand are included in the latest version of the JDK):
import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
import com.sun.org.apache.xpath.internal.NodeSet;However when running exactly the same code I get the following exception:
javax.xml.transform.TransformerException: java.lang.NoSuchMethodException: For extension function, could not find method
I think this could be related to EXSLT namespaces or something but am really not sure,
Any help appreciated,Hi all,
I have some code that runs fine when using some older Xalan libraries:
import org.apache.xalan.extensions.ExpressionContext;
import org.apache.xpath.NodeSet;I was trying to upgrade to use the latest libraries (from what I understand are included in the latest version of the JDK):
import com.sun.org.apache.xalan.internal.extensions.ExpressionContext;
import com.sun.org.apache.xpath.internal.NodeSet;However when running exactly the same code I get the following exception:
javax.xml.transform.TransformerException: java.lang.NoSuchMethodException: For extension function, could not find method
I think this could be related to EXSLT namespaces or something but am really not sure,
Any help appreciated, -
Oracle iAS 10.1.3.5.0 Release 3 XALAN XSLT BSF Manager not found
Hello to all,
I have a strange problem.
I have a very well running app under the iAS release 2.
Now I have to go at release 3.
The main problem that I face has to do with the XALAN libraries.
I used to load some templates (XSL) in memory like this:
System.setProperty("javax.xml.transform.TransformerFactory","org.apache.xalan.processor.TransformerFactoryImpl")
InputStream xslInput = new FileInputStream(buf.toString());
Source xslSource = new StreamSource( xslInput );
TransformerFactory factory = TransformerFactory.newInstance();
Templates tempFalseGlobal = factory.newTemplates( xslSource );
This code breaks with the new release.
More specifically it throws an InvocationException and BSFManaget not found. NullPointerException....
I could paste the full stack trace if required.
The error is being raised when I try to execute the transformation
transformer.transform(xml, out);
Thus I tried to use the latest XalanJ 2.7.1 and I have set
System.setProperty("javax.xml.transform.TransformerFactory","org.apache.xalan.xsltc.trax.TransformerFactoryImpl");
This requires changes into my XSLs since the Javascript extensions are not supported by the SUN's implementation.
I tried to comment out all the setProperty statements and I receive the following error:
<Line 1077, Column 92>: XML-22016: (Error) Extension function namespace should s
tart with 'http://www.oracle.com/XSL/Transform/java/'.
I am blocked right now, could you please give me some pointers here how to proceed.
I would like to make the same application to work with no or the minimum changes required.
Thank you in advance,Finally I found the answer.
for a strange reason the classloader in release 3 was not able to find the BSF provider although the bsf.jar was inside the applib.
Thus I have set the
System.setProperty("org.apache.xalan.extensions.bsf.BSFManager","class to load");
Could someone explain me why the application server was not able to locate the class although the iAS release 2 was working fine ?
Thank you. -
I've been trying to do a simple XSLTC transformation using JDK 1.4.2, but I get the following error:
java.lang.IllegalAccessError: class org.apache.xml.dtm.ref.sax2dtm.SAX2DTM2$AncestorIterator cannot access its superclass
org.apache.xml.dtm.ref.DTMDefaultBaseIterators$InternalAxisIteratorBaseI believe this is because of the fact that the JDK files comes with some XML libraries bundled and this clashes with the downloaded Xalan libraries.
I'm just wondering if anybody has managed to do a XSLTC transformation using the JDK 1.4.2. and if they encountered any problems.
Thank you for everything!
GustavoUsing JRE 1.4.x, the Applet that used XSLT, stared giving exception. The reason, the Xalan-Java package (older version)had been included from JDK 1.4 release on-wards. The suggested work around was to use Endrosed mechanism. But how do we use endrosed mechanism for Applets (which uses browser's JRE) ?
-
Issue Invoking 10.1.2 BPEL Process from 10.1.3 Embedded server.
Hi All,
I am trying to connect to BPEL 10.1.2 from 10.1.3 embedded server. When I run following
code in debug it just stays at
Locator locator = new Locator("default","bpel",jndi); line. It does not give any error message.
Please help. Let me know if I am doing anything wrong here.
Thank you.
Jigar
package com.sjrwmd.bpel;
import com.oracle.bpel.client.Locator;
import com.oracle.bpel.client.NormalizedMessage;
import com.oracle.bpel.client.delivery.IDeliveryService;
import java.rmi.RemoteException;
import java.util.Hashtable;
import java.util.Map;
import javax.naming.Context;
public class TestBPEL {
public TestBPEL() {
public static void main(String[] args) {
try{
Hashtable jndi = null;
String ssn = "123456789";
jndi = new Hashtable();
jndi.put(Context.PROVIDER_URL, "ormi://dell17316/orabpel");
jndi.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
jndi.put(Context.SECURITY_PRINCIPAL, "admin");
jndi.put(Context.SECURITY_CREDENTIALS, "welcome");
//jndi.put("dedicated.connection", "true");
String xml = "<ssn xmlns=\"http://services.otn.com\">" + ssn + "</ssn>";
Locator locator = new Locator("default","bpel",jndi);
IDeliveryService deliveryService = (IDeliveryService)locator.lookupService
(IDeliveryService.SERVICE_NAME );
// construct the normalized message and send to collaxa server
NormalizedMessage nm = new NormalizedMessage( );
nm.addPart("payload", xml );
NormalizedMessage res =
deliveryService.request ("CreditRatingService", "process", nm);
Map payload = res.getPayload();
System.out.println( "BPELProcess CreditRatingService executed!" );
System.out.println( "Credit Rating is " + payload.get("payload") );
} catch( com.oracle.bpel.client.ServerException se ){
se.printStackTrace();
} catch (RemoteException e) {
// TODO
}Hi Clemens,
Do don't have to say sorry. It happens sometime. I have remove patch from 10.1.3 and apply back to 10.1.2.
This is my obsetenv.bat file
@REM --------------------------------------------------
@REM ADJUST THESE VARIABLE TO MATCH YOUR ENVIRONMENT
@REM --------------------------------------------------
@REM Where has Orabpel been installed on this machine?
set OB_HOME=C:\OraBPELPM\integration\orabpel
@REM Which is app server going to use on this machine?
set OB_PLATFORM=oc4j_10g
@REM Is there a classpath that you would like Orabpel to add to it's
@REM classpath? We recommend that you append any additional directories
@REM to the environment classpath. For example,
@REM
@REM set MY_CLASSES_DIR=%CLASSPATH%
set MY_CLASSES_DIR=%OB_HOME%\system\classes
set MY_CLASSPATH=%MY_CLASSES_DIR%
set PROXY_SET="[HTTP_PROXY_SET]"
@REM Where has the JDK (supporting 1.4.1 or higher) been installed on
@REM this machine?
set JAVA_HOME=C:\OraBPELPM\jdk
if %PROXY_SET% == "true" goto set_proxy
set OB_JAVA_PROPERTIES=
goto end_set_proxy
:set_proxy
set OB_JAVA_PROPERTIES="-Dhttp.proxySet=true" "-Dhttp.proxyHost=[HTTP_PROXY_HOST]" "-Dhttp.proxyPort=[HTTP_PROXY_PORT]" "-Dhttp.nonProxyHosts=[HTTP_NON_PROXY_HOSTS]"
:end_set_proxy
@REM Where the j2ee applications can be deployed, this environment variable
@REM is application server dependent. The process developers will use this
@REM this env. variable to deploy their J2EE applications
@REM (e.g. .war or .ear files)
set J2EE_APPLICATIONS=C:\OraBPELPM\integration\orabpel\system\appserver\oc4j\j2ee\home\applications
@REM --------------------------------------------------
@REM PLEASE DO NOT UPDATE THE REST OF THIS FILE
@REM --------------------------------------------------
@REM Classpath
set OB_LIB=%OB_HOME%\lib
@REM List of Orabpel and Orabpel related libraries.
set BASE_OB_CLASSPATH=%MY_CLASSPATH%;%JAVA_HOME%\lib\tools.jar;%OB_LIB%\orabpel-common.jar;%OB_LIB%\orabpel-thirdparty.jar;%OB_LIB%\orabpel.jar;%OB_LIB%\orabpel-ant.jar;%OB_LIB%\ant-launcher_1.6.2.jar;%OB_LIB%\ant_1.6.2.jar;%OB_LIB%\oracle_http_client.jar;%OB_LIB%\xmlparserv2.jar;%OB_LIB%\olite40.jar;%OB_LIB%\aqapi.jar;%OB_LIB%\orawsdl.jar;%OB_LIB%\bpm-infra.jar;%OB_HOME%\system\services\lib\bpm-services.jar;%OB_LIB%\bipres.jar;%OB_LIB%\bicmn.jar;%OB_LIB%\uix2.jar;%OB_LIB%\share.jar;%OB_LIB%\regexp.jar
@REM Core java runtime libraries
set JAVA_CLASSPATH=%JAVA_HOME%\jre\lib\rt.jar
@REM The Xerces and Xalan libraries need to loaded via the bootclasspath option
@REM since JDK 1.4 packages an older version of Xalan.
@REM
set BOOT_LIBS=%OB_LIB%\orabpel-boot.jar;%OB_LIB%\connector15.jar
@REM Combined classpath
set OBDK_CLASSPATH=%JAVA_CLASSPATH%;%BASE_OB_CLASSPATH%;%OB_LIB%\j2ee_1.3.01.jar;
set OB_CLASSPATH=%BASE_OB_CLASSPATH%
goto finish
:finish
@REM --------------------------------------------------
@REM END OF FILE
@REM --------------------------------------------------
This is my startorabpel.bat
@echo off
set ECHO=off
call "C:\OraBPELPM\integration\orabpel\bin\obsetenv.bat"
@rem Launch Oracle Lite
@rem
@rem start /d "C:\OraBPELPM\integration\orabpel\bin" /min /realtime start_olite.bat
@rem java -Dorabpel.home=C:\OraBPELPM\integration\orabpel -Doracle.mdb.fastUndeploy=60 -Ddatasource.verbose=true -Djdbc.debug=true -Djms.debug=true -Dtransaction.debug=true -jar oc4j.jar
set OPTS=-Doracle.mdb.fastUndeploy=60 -Doc4j.userThreads=true %OB_JAVA_PROPERTIES%
set MEM_ARGS=-Xms512m -Xmx512m -Xmn300m -XX:MaxPermSize=80m
set JAVA_VM=-server
cd "C:\OraBPELPM\integration\orabpel\system\appserver\oc4j\j2ee\home"
"C:\OraBPELPM\jdk\bin\java" -Xbootclasspath/p:"%BOOT_LIBS%" %JAVA_VM% %MEM_ARGS% -Dorabpel.home=C:\OraBPELPM\integration\orabpel %OPTS% -jar oc4j.jar -verbosity 10
Let me know if you need anything more from me.
Thanks for your help resolving this.
Jigar -
JTextPane and XMLParser and jdk .-) problems
Hi there.
I have a nice problem, which really gives me headaches.
I have an XML editor (working as an applet or as an aplication, using a JTextPane). All worked ok untill jdk1.3 and parts even until jdk1.4. Now 2 big problems appeared.
1.Under jdk1.4.1:
Spaces between lines are awful big. The actual characters are ok, but the cursor is almost twice as the characters. The distance from the bottom of a character and the bottom of the line is pretty big. Now that looked to me as a SpaceBelow or LineSpacing problem. I've tried to set up the SpaceBelow or/and LineSpacing... everything that I've thought it should work. No result. Seems like they have no effect when XMLParser comes in place and sets up the document content (at least i think this is the reason, also i'm not sure). An element tree implemented shows me that this attributes are set to the values I've intended, but no 'visual' effect. Does anyone know ANYTHING about this? Please!
2.Starting from jdk1.3. Doubling of tags.
If the XML editor reads something like <FT>something</FT> from a xml file, it sets in the JTextPane <FT><FT>something</FT></FT>. It's working under jdk1.2 but if I switch to 1.3 or 1.4does something like this. Any idea what's going on? Could it be an unfortunate mix between jdk and xalan libraries?
I REALLY hope that ANYONE of you knows ANYTHING about these!!!
THNX!Hi DrClap.
Well, this would be the best thing to do. The only problem is that those are long time gone. Not really 'gone', but they are not to be found.
There's something about first problem: At the end of starting process, after the parser finished his work, if I come and set the attributes (in the document of the JTextPane, using StyleConstants) with replace set to true, the display is ok but, of course, I loose any style defined in the xml file. That means is not a problem of the JTextPane in jdk 1.4 (at one time I thought it might be a 'mapping' problem of the JTP in 1.4) or?
Because I'm really stuck, I have all kind of strange ideas!!!
Could be "old libraries(for the parser) - new jdk" mixture problem, perhaps? (I've told you!)
THX for your previous response. -
Error while applying stylesheet - XSLT functions
Hi ,
I have a source XML and applying XSLT on source XML. It works fine from the tool stylus studio. but when i apply that transformation using MII,i get below error.
"Error has occurred during XSL transformation Could not compile stylesheet"
My xsl was working fine but i needed to do a date manipulation..so i have used one function which is in name space xs.
So i have added name space on top of xslt document as . xmlns:xs="http://www.w3.org/2001/XMLSchema"
<xsl:variable name="docdate" select="sch:dateTime" />
<xsl:value-of select="adjust-dateTime-to-timezone(xs:dateTime($docdate))"/>
i have attached xml and xslt ( changed extension while attaching to this post since sdn is allowing xsl extension )
Thanks
HariUpdate: Above function looks to be xslt 2.0 function and thats why MII is blowing up the transformation.
So,Question now is can i use EXSLT functions at least in MII? Does MII XSLT processor supports EXSLT function?
If not,is there any way to get that work like Xalan libraries??
Thanks
Hari -
Xalan xslt extension flat file to xml...
anyone used the xsltflat 2.0 to do flat to xml transformation? it does it by using xalan extension...
the packate is com.fs.xalan.extensions.* and test.com.fs.xalan.extensions.*
anyway, it works fine when I do it from command prompt... however when I tried to do it by calling it over Tomcat, the parsing gives me following funny error:
file:///e:/test.xsl; Line 21; Column 92; javax.xml.transform.TransformerException: For extension function, could not find method java.io.FileInputStream.streamIterator([ExpressionContext,] #STRING).
here is the seciton of the xsl file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:stream="com.fs.xalan.extensions.StreamTools"
xmlns:txt="com.fs.xalan.extensions.TextFormatting"
extension-element-prefixes="stream txt">
<lxslt:component prefix="stream" elements="" functions="fileReader tokenize">
<lxslt:script lang="javaclass" src="xalan://com.fs.xalan.extensions.StreamTools"/>
</lxslt:component>
<lxslt:component prefix="txt" elements="" functions="trim ltrim rtrim lpad rpad trunc replace strip stripPunc stripWS upcase downcase">
<lxslt:script lang="javaclass" src="xalan://com.fs.xalan.extensions.StreamTools"/>
</lxslt:component>
<xsl:param name="inputStream" />
<xsl:template match="/">
<Employees>
<xsl:variable name="infile" select="stream:streamIterator($inputStream,' ')" />
<xsl:apply-templates select="$infile/stream/line" />
</Employees>
</xsl:template>
i know for sure the xsl works... there is nothing with wrong with xsl... so i am scratching my head right now...
thanks...Tomcat also uses XML (for the setting files) and thus: ships with an XML processor. My best guess: your application requires some more recent parser, but the Tomcat provided stuff is found first, and used. Maybe the TransformerException was the result of the famous "Sealing violation" or "Nu such method".
To check if this is the problem: make sure that your new xalan.jar file and (optionally) xerces.jar are in pole position in the class path.
If you happen to use Borland JBuilder: there are two places where you set the order of the required libraries: in the main project settings and in the Project, Run, JSP/Servlet, Server Options, button setup. Here, add your own xalan.jar and xerces.jar as well, and put them on top of the list.
a. -
Error with xalan xsltc transformation
Hi Everybody,
I am currently working on a performance enhancement change for my project which uses xsl for jsp html display. Due to some client requirement, we have decided to convert all our xsl stylesheets to XSLTC translet class files. Although I have managed to compile all the stylesheets to java classes, I am getting a strange runtime error for some of the xsl-jsp pages. please kindly help me as I have no clue about this error. It has now become a showstopper issue for my project delivery. I am using Websphere 5.1 jre and xml jar libraries for doing the transform. The tranformation works fine with the default xalan transformer(not xsltc). The XSLTC version is 4.0 .
[2/6/06 17:41:33:979 IST] beb3ed2 WebGroup E SRVE0026E: [Servlet Error]-[(class: com/synergy/xsl/translet/mmtoolb, method: topLevel signature: (Lorg/apache/xalan/xsltc/DOM;Lorg/apache/xml/dtm/DTMAxisIterator;Lorg/apache/xml/serializer/SerializationHandler;)V) Incompatible object argument for method call]: java.lang.VerifyError: (class: com/synergy/xsl/translet/mmtoolb, method: topLevel signature: (Lorg/apache/xalan/xsltc/DOM;Lorg/apache/xml/dtm/DTMAxisIterator;Lorg/apache/xml/serializer/SerializationHandler;)V) Incompatible object argument for method call
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java(Compiled Code))
at java.lang.Class.getConstructor1(Class.java(Compiled Code))
at java.lang.Class.newInstance3(Class.java(Compiled Code))
at java.lang.Class.newInstance(Class.java(Compiled Code))
at org.apache.xalan.xsltc.trax.TemplatesImpl.getTransletInstance(TemplatesImpl.java:345)
at org.apache.xalan.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:374)
at org.apache.xalan.xsltc.trax.TemplatesImplProxy.newTransformer(TemplatesImplProxy.java:106)
at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:570)
at com.synergy.service.XSLTTransformServiceHelper.getTransformer(XSLTTransformServiceHelper.java:296)
at com.synergy.service.XSLTTransformServiceHelper.getTransformer(XSLTTransformServiceHelper.java:243)
at com.synergy.service.XSLTTransformServiceHelper.transform(XSLTTransformServiceHelper.java:155)
at com.synergy.tags.xslt.XSLTTransformTag.doEndTag(Unknown Source)
at org.apache.jsp._mmtoolb._jspService(_mmtoolb.java:2392)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:683)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Compiled Code))
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:61)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Please reply incase you need more information about the error.
Thanks and Regards,
sunil kumar
Polaris software lab ltd
IndiaThe XSLTC version is 4.0Is that the version under which you compiled the classes, or the version in Websphere where you are running the classes? The error message seems to suggest there is some incompatibility happening.
-
Program using Xalan 1.10 doesn't compile
Hi all,
I have to port some server code from Windows to Solaris. Normaly this works fine, but now I have a problem using Xalan 1.10.
Platfrom: SunOS sun4 5.8 Generic_108528-24 sun4u sparc SUNW,Ultra-80
Compiler: Sun C++ 5.7 Patch 117830-07 2006/03/15
By including a Xalan header and compile it with "CC -I/opt/xalan/src -I/opt/xerces/src -library=stlport4 xalan.cpp" I got the errorlist below.
Without stlport4 it compiles. I have to use this library, because I am using boost and I have had only success building the boost stuff with stlport4.
Do I have to modify the Xalan header? Has anybody some suggestions?
Thanks for your help
Arno
Here is the example code:
#include <xalanc/XalanTransformer/XalanTransformer.hpp>
int main ()
return 0;
Here are the error messages from the compiler:
"/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 102: Error: Too many arguments for template std::reverse_iterator<xalanc_1_10::Type*, std::random_access_iterator_tag, xalanc_1_10::Type>.
"/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 1101: Where: While specializing "xalanc_1_10::XalanVector<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>".
"/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 1101: Where: Specialized in non-template code.
"/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 106: Error: Too many arguments for template std::reverse_iterator<const xalanc_1_10::Type*, std::random_access_iterator_tag, const xalanc_1_10::Type>.
"/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 1101: Where: While specializing "xalanc_1_10::XalanVector<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>".
"/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 1101: Where: Specialized in non-template code.
"/opt/xalan/src/xalanc/Include/XalanDeque.hpp", line 186: Error: Too many arguments for template std::reverse_iterator<xalanc_1_10::XalanDequeIterator<xalanc_1_10::XalanDequeIteratorTraits<xalanc_1_10::Value>, xalanc_1_10::XalanDeque<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>>, std::random_access_iterator_tag, xalanc_1_10::Type>.
"/opt/xalan/src/xalanc/XPath/XalanQName.hpp", line 73: Where: While specializing "xalanc_1_10::XalanDeque<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>".
"/opt/xalan/src/xalanc/XPath/XalanQName.hpp", line 73: Where: Specialized in non-template code.
"/opt/xalan/src/xalanc/Include/XalanDeque.hpp", line 190: Error: Too many arguments for template std::reverse_iterator<xalanc_1_10::XalanDequeIterator<xalanc_1_10::XalanDequeConstIteratorTraits<xalanc_1_10::Value>, xalanc_1_10::XalanDeque<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>>, std::random_access_iterator_tag, const xalanc_1_10::Type>.
"/opt/xalan/src/xalanc/XPath/XalanQName.hpp", line 73: Where: While specializing "xalanc_1_10::XalanDeque<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>".
"/opt/xalan/src/xalanc/XPath/XalanQName.hpp", line 73: Where: Specialized in non-template code.
4 Error(s) detected.On Solaris, Posix threads are implemented on top of native threads; the interfaces are different. There are no conflicts between the two libraries or their interfaces. You can mix Posix and native thread usage.
libCstd and STLport are different implementations of the same interface. The size and layout of the standard types are different. The names of the standard functions are the same, but the definitions of those functions are different.
Suppose both parts of the program use the standard string class. One part was compiled for use with libCstd, and creates the libCstd version of a string object. If that object gets passed to the part of the program compiled for use with STLport, it will have a different idea of how the class is defined.
If you link both libCstd and libstdlport to the program, all the standard objects (like cin and cout) and functions (class members and free functions) will have the same names. You wil pick up the version from whichever library is linked first. Calling libCstd function on an STLport object won't work, and neither will the reverse.
Finally, recall that much of the standard library consists of inline functions. The bodies of those functions are embeded in the .o files of your application code. The application code will therefore depend on a particular layout of standard class objects; the layout is different in the two libraries.
We have not made a serious effort to compile BOOST using libCstd -- much of BOOST depends on too many missing features. Some suggestions:
1. You can try experimenting with BOOST configuration macros and see if you can get the code to compile.
2. You could wirte your own version of the BOOST components you are using, removing dependencies on features that are not in libCstd.
3. You could ask the 3rd-party library supplies to provide a version compiled with -library=stlport. -
Getting the following error:
An error occurred during activation of changes, please see the log for details.
[Management:141191]The prepare phase of the configuration update failed with an exception:
Provider org.apache.xalan.processor.TransformerFactoryImpl not found
Note: we have the FOP added to the domain as a shared library with the following libraries:
avalon-framework-cvs-20020806.jar
batik.jar
fop.jar
xalan-2.4.1.jar
xercesImpl-2.2.1.jar
xml-apis.jar
Note: Also, the shared libraries are not displaying referencing applications
Edited by: SK Jennings on Nov 9, 2010 10:25 AM
Added more info.Hi,
I'm getting the same ClassCastException when I try to activate the changes of my EJB application. Were you able to resolve the error you were getting? Please let me know.
Thanks -
Getting the following error:
An error occurred during activation of changes, please see the log for details.
[Management:141191]The prepare phase of the configuration update failed with an exception:
Provider org.apache.xalan.processor.TransformerFactoryImpl not found
Note: we have the FOP added to the domain as a shared library with the following libraries:
avalon-framework-cvs-20020806.jar
batik.jar
fop.jar
xalan-2.4.1.jar
xercesImpl-2.2.1.jar
xml-apis.jar
Note: Also, the shared libraries are not displaying referencing applicationsGetting the following error:
An error occurred during activation of changes, please see the log for details.
[Management:141191]The prepare phase of the configuration update failed with an exception:
Provider org.apache.xalan.processor.TransformerFactoryImpl not found
Note: we have the FOP added to the domain as a shared library with the following libraries:
avalon-framework-cvs-20020806.jar
batik.jar
fop.jar
xalan-2.4.1.jar
xercesImpl-2.2.1.jar
xml-apis.jar
Note: Also, the shared libraries are not displaying referencing applications -
I am using standalone OC4J 10.1.2.0.2 and would want to use Xerces and Xalan in place or Oracle XML parser. I did initialize the container using -Xbootclasspath flag of JRE. but when the application is brought up the transform activty still shows the oracle.xml.jaxp error messages. Our app is built to work with Xerces and Xalan.
Are there any tricks invovled to make Oc4J recognize these libraries and use them ? ThanksI think you can work that within the orion-application.xml file:
<imported-shared-libraries>
<remove-inherited name="oracle.xml"/>
<import-shared-library name="xalan" />
<import-shared-library name="xerces" />
</imported-shared-libraries>
Where you've defined shared-lib entries for the above.
Reference:
http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
I don't know if this is handled in the same way for the version you are dealing with, however. -
Hi all,
which XML libraries (SAX and JDOM) does XI use ?
My issue is to write an sender adapter module that does transformation (from flat file to XML) and to reuse XI libraries for XML message creation (I do not want to include outside libs, such as Xalan and Xerces). More precise: which SAP libraries do I have to enlist in the file application-j2ee-engine.xml ?
Kindest regards and many thanx in advance
Jurica BorozanYou can use SAX and DOM.
For developing you need sapxmltoolkit.jar. You need not add this lib to the application-j2ee-engine.xml as this lib as available by default.
When you use NWDI, then you can use the help there to see the methods.
Regards
Stefan
Maybe you are looking for
-
I tried the suggested solutions including the 'clean install', any help would be most appreciated. I've used the Profile Manager, which is not much use when the browser won't even open to test it. I've also reinstalled twice, installed updates and re
-
I have looked around, quite a bit, haven't found a answer that i've been really looking for... I'm a big gamer, and I run two 17" flatpanel monitors at 1280x1024 on a NVIDIA GeForce GTS250. When I run apps in WINE, it tries pushing each app out in 25
-
Any one have ideas as to how to "lock" limit linux system file system browsing from applications interfaces. We tried a few ideas - 1) rbash - creates issues with the exec function, setting systems into KDE kiosk mode works well with integrated kde a
-
Here is the issue that I am having. I made a 15 sec animation in 3d. I got it to render so that I can play it before trying to save it for web services. I then try to save it for web services and it crashes after a few minutes. I am able to see the b
-
Java plugin won't work in Chrome
Java won't work in Chrome. I have OSX 10.7 on my Macbook Pro, and when I try to update Java, a popup alert is served that the update is only going to work for OSX 10.6. It would be really, really helpful to be able to use Java in my browsers. Any ins