473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

XSLT applet.

I have been fighting a problem with writing an XSLT applet for several
days now.

The following code works in a command line application, and in the
applet viewer for provided with IBM eclipse. It fails in any browser,
and in the Java SDK's applet viewer.

The line marked below has an uncaught exception that shows the following
text:

Usually code that works in an application and fails in an applet is the
result of a classpath problem. I am using xalan and xerces in this
case, both of which are in the classpath.

Any suggestions regarding the origins of this problem are welcome.

Thank you,

Ben Jones

----------------------------------------------------------------------
java.lang.ExceptionInInitializerError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at org.apache.xalan.serialize.SerializerFactory.getSe rializer(Unknown
Source)

at
org.apache.xalan.transformer.TransformerImpl.creat eResultContentHandler(Unknown
Source)

at
org.apache.xalan.transformer.TransformerImpl.creat eResultContentHandler(Unknown
Source)

at org.apache.xalan.transformer.TransformerImpl.trans form(Unknown Source)

at org.apache.xalan.transformer.TransformerImpl.trans form(Unknown Source)

at
com.integretechpub.mathmltools.EquationTransformer .appletEquationForm(EquationTransformer.java:109)

at
com.integretechpub.mathmltools.EquationTransformer .init(EquationTransformer.java:334)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.RuntimeException: The resource [ XMLEntities.res ]
could not load: java.net.MalformedURLException: no protocol:
XMLEntities.res
XMLEntities.res java.net.MalformedURLException: no protocol:
XMLEntities.res

at org.apache.xalan.serialize.CharInfo.<init>(Unknown Source)

at org.apache.xalan.serialize.SerializerToXML.<clinit >(Unknown Source)

... 11 more

java.lang.ExceptionInInitializerError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at org.apache.xalan.serialize.SerializerFactory.getSe rializer(Unknown
Source)

at
org.apache.xalan.transformer.TransformerImpl.creat eResultContentHandler(Unknown
Source)

at
org.apache.xalan.transformer.TransformerImpl.creat eResultContentHandler(Unknown
Source)

at org.apache.xalan.transformer.TransformerImpl.trans form(Unknown Source)

at org.apache.xalan.transformer.TransformerImpl.trans form(Unknown Source)

at
com.integretechpub.mathmltools.EquationTransformer .appletEquationForm(EquationTransformer.java:109)

at
com.integretechpub.mathmltools.EquationTransformer .init(EquationTransformer.java:334)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.RuntimeException: The resource [ XMLEntities.res ]
could not load: java.net.MalformedURLException: no protocol:
XMLEntities.res
XMLEntities.res java.net.MalformedURLException: no protocol:
XMLEntities.res

at org.apache.xalan.serialize.CharInfo.<init>(Unknown Source)

at org.apache.xalan.serialize.SerializerToXML.<clinit >(Unknown Source)

... 11 more
----------------------------------------------------------------------

public String appletEquationForm(){
String eqnForm=new String();
eqnForm="thangs";
String xsl=this.getXSLTransform();
String xml=this.mathMLInput;
Source xmlSource=new StreamSource(new StringReader(xml));
Source xslSource=new StreamSource(new StringReader(xsl));
StringWriter eqnWriter=new StringWriter(4096);
StreamResult eqnResult=new StreamResult(eqnWriter);
Result eqnTestResult=new StreamResult(System.out);
javax.xml.transform.TransformerFactory transFact=
javax.xml.transform.TransformerFactory.newInstance ();
StringWriter osw = new StringWriter();
PrintWriter pw = new PrintWriter(osw, false);
try{
javax.xml.transform.Transformer
trans=transFact.newTransformer(xslSource);
//
//-----------------------------------------------------------------------------------------------------
// THIS IS THE LINE THE BLOWS AN UNCAUGHT EXCEPTION
//-------------------------------------------------------------------------------------------------------
trans.transform(xmlSource,new StreamResult(pw));
//StringBuffer sb=eqnWriter.getBuffer();
//eqnForm=sb.toString();
}
catch(TransformerConfigurationException e){
System.out.println("Caught Exception "+e);
e.printStackTrace();
return("<math><matherr/><text>Configuration Exception</text></math>");
}
catch(TransformerException f){
System.out.println("Caught Exception "+f);
f.printStackTrace(System.out);
return("<math><matherr/><text>Configuration Exception</text></math>");
}
return(eqnForm);
}

Jul 20 '05 #1
0 2977

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: nathanlaan | last post by:
This is the stupidest thing I have ever seen. Java 1.2, 1.3, and 1.4.1, and 1.4.2 all define the Applet.getDocumentBase() method differently! How am I supposed to get the directory of the document...
0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
1
by: Charlie Kim | last post by:
Here is gnome applet source of mine. -------------------------------------------------- #!/usr/bin/env python import pydic import gtk import gnome.applet
5
by: Gerald Aichholzer | last post by:
Hello NG, I have an XHMTL-file and would like to replace attribute values using XSLT. The XHTML-file contains the following code: <applet code="MyApplet/MyApplet.class"...
1
by: Tormod Omholt-Jensen | last post by:
Ï need to dynamically insert an applet into a document. In IE 6.0 my code works fine, but there seems to be problems in Opera 7. The page looks like there is allocated space for an applet. ...
8
by: DKM | last post by:
Here are the source code files to a Java applet that utilizes LiveConnect to communicate with Javascript, and the HTML file. The thing works both in IE 6.0 and FireFox 1.4. but with some...
0
by: ankur | last post by:
WHEN I RUN THIS WEB APPLICATION ON Tomcat5.5.9 SERVER MY HttpChatApplet sccessfully Loaded from ChatDispatch but running on some another PC HttpChatApplet not loaded my Coad ...
4
by: tudyfruity18 | last post by:
I'm suppose to write an applet that contains two buttons Investment calculator and Loan Calculator. When the Investment Calculator button is clicked, a frame appears in a new window for calculating...
1
by: sheephead86 | last post by:
Hi, I'm pretty new to java, and I have a small problem involving drawing a rectangle on a java applet.Firstly this is not a plea for someone to help me with this peice of work, I just need pointing...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.