473,785 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Excep tionInInitializ erError

at java.lang.Class .forName0(Nativ e Method)

at java.lang.Class .forName(Unknow n Source)

at org.apache.xala n.serialize.Ser ializerFactory. getSerializer(U nknown
Source)

at
org.apache.xala n.transformer.T ransformerImpl. createResultCon tentHandler(Unk nown
Source)

at
org.apache.xala n.transformer.T ransformerImpl. createResultCon tentHandler(Unk nown
Source)

at org.apache.xala n.transformer.T ransformerImpl. transform(Unkno wn Source)

at org.apache.xala n.transformer.T ransformerImpl. transform(Unkno wn Source)

at
com.integretech pub.mathmltools .EquationTransf ormer.appletEqu ationForm(Equat ionTransformer. java:109)

at
com.integretech pub.mathmltools .EquationTransf ormer.init(Equa tionTransformer .java:334)

at sun.applet.Appl etPanel.run(Unk nown Source)

at java.lang.Threa d.run(Unknown Source)

Caused by: java.lang.Runti meException: The resource [ XMLEntities.res ]
could not load: java.net.Malfor medURLException : no protocol:
XMLEntities.res
XMLEntities.res java.net.Malfor medURLException : no protocol:
XMLEntities.res

at org.apache.xala n.serialize.Cha rInfo.<init>(Un known Source)

at org.apache.xala n.serialize.Ser ializerToXML.<c linit>(Unknown Source)

... 11 more

java.lang.Excep tionInInitializ erError

at java.lang.Class .forName0(Nativ e Method)

at java.lang.Class .forName(Unknow n Source)

at org.apache.xala n.serialize.Ser ializerFactory. getSerializer(U nknown
Source)

at
org.apache.xala n.transformer.T ransformerImpl. createResultCon tentHandler(Unk nown
Source)

at
org.apache.xala n.transformer.T ransformerImpl. createResultCon tentHandler(Unk nown
Source)

at org.apache.xala n.transformer.T ransformerImpl. transform(Unkno wn Source)

at org.apache.xala n.transformer.T ransformerImpl. transform(Unkno wn Source)

at
com.integretech pub.mathmltools .EquationTransf ormer.appletEqu ationForm(Equat ionTransformer. java:109)

at
com.integretech pub.mathmltools .EquationTransf ormer.init(Equa tionTransformer .java:334)

at sun.applet.Appl etPanel.run(Unk nown Source)

at java.lang.Threa d.run(Unknown Source)

Caused by: java.lang.Runti meException: The resource [ XMLEntities.res ]
could not load: java.net.Malfor medURLException : no protocol:
XMLEntities.res
XMLEntities.res java.net.Malfor medURLException : no protocol:
XMLEntities.res

at org.apache.xala n.serialize.Cha rInfo.<init>(Un known Source)

at org.apache.xala n.serialize.Ser ializerToXML.<c linit>(Unknown Source)

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

public String appletEquationF orm(){
String eqnForm=new String();
eqnForm="thangs ";
String xsl=this.getXSL Transform();
String xml=this.mathML Input;
Source xmlSource=new StreamSource(ne w StringReader(xm l));
Source xslSource=new StreamSource(ne w StringReader(xs l));
StringWriter eqnWriter=new StringWriter(40 96);
StreamResult eqnResult=new StreamResult(eq nWriter);
Result eqnTestResult=n ew StreamResult(Sy stem.out);
javax.xml.trans form.Transforme rFactory transFact=
javax.xml.trans form.Transforme rFactory.newIns tance();
StringWriter osw = new StringWriter();
PrintWriter pw = new PrintWriter(osw , false);
try{
javax.xml.trans form.Transforme r
trans=transFact .newTransformer (xslSource);
//
//-----------------------------------------------------------------------------------------------------
// THIS IS THE LINE THE BLOWS AN UNCAUGHT EXCEPTION
//-------------------------------------------------------------------------------------------------------
trans.transform (xmlSource,new StreamResult(pw ));
//StringBuffer sb=eqnWriter.ge tBuffer();
//eqnForm=sb.toSt ring();
}
catch(Transform erConfiguration Exception e){
System.out.prin tln("Caught Exception "+e);
e.printStackTra ce();
return("<math>< matherr/><text>Configur ation Exception</text></math>");
}
catch(Transform erException f){
System.out.prin tln("Caught Exception "+f);
f.printStackTra ce(System.out);
return("<math>< matherr/><text>Configur ation Exception</text></math>");
}
return(eqnForm) ;
}

Jul 20 '05 #1
0 2994

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

Similar topics

1
9524
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 in which the applet is embedded (like Java 1.3) using Java 1.4.2??? http://java.sun.com/products/jdk/1.2/docs/api/java/applet/Applet.html#getDocumentBase() http://java.sun.com/j2se/1.3/docs/api/java/applet/Applet.html#getDocumentBase()
0
9874
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 ********************************** package Celcom.Client;
1
2945
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
2184
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" archive="prog/MyApplet.jar" width="100%" height="99%">
1
4067
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. Printing the size of the document.applets array return as expected 0 before the insertion, and 1 after, in both Opera 7 and IE. However, the applet does not init properly (no painting). Anyone? Regards Tormod Omholt-Jensen
8
3394
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 problems. IE crashes when one refreshes the page or leave the page. This happens only after calling the Java method more than once. It does not crash if the Java method is called just once and then the page is refreshed. FireFox does not crash at all...
0
5663
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 ChatDispatch.java
4
7823
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 future investment values. When you click Loan Calculator button, a frame appears in a separate new window for computong loan payments. Here's my coding: // Lab3.java: import java.awt.*; import java.awt.event.*; import javax.swing.*; ...
1
2388
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 in the right direction. Ok the problem. I am creating a program that ask the user to input a height value, the program will then do a calculation and create a golden ratio width. The type of both the height and the width are double. This is...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10329
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.