Is it possible to use JAXP in Applet? Really urgeng.

I need to get String output from a DOM Document using JAXP in Applet. I want the entire XML document in one string .I write the code as following,but it doesn't work. Would you help me to point out the mistake I made in it?
Any help would be appreciated,
Thanks.
import java.awt.*;
import javax.swing.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.*;
import javax.xml.transform.dom.DOMSource;
import java.io.*;
import java.io.IOException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import java.util.*;
public class XMLTest extends JApplet {
     String str;
     public void init()
     str="hello";
try
DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
DocumentBuilder db =factory.newDocumentBuilder();
Document m_dDoc = db.newDocument();
Element e1=m_dDoc.createElement("first");
Text tx;
tx=m_dDoc.createTextNode("hi");
e1.appendChild(tx);
m_dDoc.appendChild(e1);
DOMSource doms = new DOMSource(m_dDoc);
Writer out = new StringWriter();
StreamResult result = new StreamResult(out);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();//wrong
transformer.transform(doms,result);
str=result.toString();
catch(Exception e)
e.printStackTrace();
     public void paint(Graphics g)
          g.drawString(str, 50, 60 );
}

The problem is that using the transformer in an applet results in the exception:
The exception is as following:
org.apache.xml.utils.WrappedRuntimeException: Output method is xml could not loa
d output_xml.properties (check CLASSPATH)
at org.apache.xalan.templates.OutputProperties.getDefaultMethodPropertie
s(OutputProperties.java:364)
at org.apache.xalan.templates.OutputProperties.<init>(OutputProperties.j
ava:130)
at org.apache.xalan.transformer.TransformerIdentityImpl.<init>(Transform
erIdentityImpl.java:104)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Tran
sformerFactoryImpl.java:804)
at XMLTest.init(XMLTest.java:36)
at sun.applet.AppletPanel.run(AppletPanel.java:341)
at java.lang.Thread.run(Thread.java:536)
I am still unclear to the cause, when I create a copy of the output_xml.properties file and put it somewhere in your classpathe (I put mine in a jar that the applet loads) you get:
java.lang.ExceptionInInitializerError
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:140)
     at org.apache.xalan.serialize.SerializerFactory.getSerializer(SerializerFactory.java:131)
     at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:232)
     at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:296)
     at com.thalesgroup.mss.infrastructure.xml.SOAPMessage.domDocToString(SOAPMessage.java:180)
     at com.thalesgroup.mss.applets.filemanager.XmlMessages.getFileList(XmlMessages.java:246)
     at com.thalesgroup.mss.applets.filemanager.FileManagerFrame.getFileList(FileManagerFrame.java:575)
     at com.thalesgroup.mss.applets.filemanager.FileManagerFrame.access$2(FileManagerFrame.java:29)
     at com.thalesgroup.mss.applets.filemanager.FileManagerFrame$fileList.run(FileManagerFrame.java:847)
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>(CharInfo.java:202)
     at org.apache.xalan.serialize.SerializerToXML.<clinit>(SerializerToXML.java:292)
     ... 10 more
Which leads me to some questions:
What is XMLEntities.res, and how do I get one?
Does anyone know which version of Xalan and JAXP comes with J2SE 1.4.1?
Why the package "org.apache.xalan.Version" is not in the J2SE 1.4.1 release (and should it be?)

Similar Messages

  • Using javaagents with applets

    Is it possible to use javaagents with applets?
    If it is, how?

    FYI... my environment is:
    Oracle9iAS (9.0.3.0.0)
    JDeveloper (9.0.3.4)

  • JAXP in Applet ?

    Hi !
    I have a small problem (yep, I am pretty new to Java so the possibility that I am doing somethere very stupid is great).
    A have Java class that use JAXP to parse an xml file and this works great, but when I try to convert my class to an applet it no longer works, it compiles ok, but when I run it I get:
    java.lang.NoClassDefFoundError: org/xml/sax/SAXException
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:237)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:579)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:515)
    at sun.applet.AppletPanel.run(AppletPanel.java:293)
    at java.lang.Thread.run(Thread.java:484)
    I have set the classpath to crimson.jar and jaxp.jar just as I did with the non-applet version, but it still does not work:
    Like this:
    set CLASSPATH=v:/blabla/lib/crimson.jar;V:/blabla/lib/jaxp.jar;.
    appletviewer test.html
    I also tried to run the applet in Tomcat, but I get the same error.
    Any ideas ?
    Mikael

    I have searched the forum for any help on this, and I did find a few other posts that have the same problem as me, but so far I have not been able to find a solution to it (I am using JAXP 1.1, 1.0 had a problem with Applets).
    Mikael

  • Can parport be used in a applet?

    I have been trying to get parport to read and write in an applet but have had no success. It works fine at the command line but when used in the applet it stops my applet program when it comes to executing the read function.
    My first idea was keep the parport read and write codes completely seperate from the applet in their own class file and then call the class file to be run. Is this at all possible?
    I have posted the code to see if i can make this clearer
    import parport.ParallelPort;
    class SimpleIO {
    public static void main ( String []args )
    ParallelPort lpt1 = new ParallelPort(0x378); // 0x378 is normally the base address for the LPT1 port
    int aByte;
    aByte = lpt1.read(); // read a byte from the port's STATUS pins
    System.out.println("Input from parallel port: " + aByte);
    aByte = aByte >> 2; // a simple and irrelevant operation
    lpt1.write(aByte); // write a byte to the port's DATA pins
    System.out.println("Output to port: " + aByte);
    //////////////This code above will be kept in its own java file called SIMPLEIO.java////////
    I then want to call and run this code from my applet java file. After some experimenting i think i have found out that you need the
    public static void main ( String []args ) line in the parport code in order for it work properly. What code would i use to call and run this code from the applet file
    Thx for reading my long post and thx to all who try and help me out

    My first idea was keep the parport read and write codes completely seperate from the applet in their
    own class file and then call the class file to be run. Is this at all possible?No. The problem is that applets run in what's called a sandbox which prevents them, and any classes called from them, from doing any local IO.
    This is essential for security, since a web page can run an applet without the user knowing about it, and it could get up to all kinds of mischief.
    You can digitally sign the applet, which will then ask the user for permission to run with reduced restrictions. A quick search of java/sun should turn up some instructions.

  • Can I Use Jce in applet

    Hi all,
    Thanks for everybody first if you look at my question and try to help me to find out the problem.
    I need to write a applet which can let people to use
    the jce's des function to encipher the user's password and
    id from the homepage.
    I write a applet already. It work fine as a application.
    But it doesn't work when I run it as a applet. Does the problem come from the security problem because I need
    to Load a sun_jce provider in a clien machine ?
    Can I use JCE in applet ?
    If it is ok to use jce in developing applet do I need to sign the applet before run it in web and which file I need to sign.
    Btw, I use the archive tag in html file to make user get the whole jce jar file. does it Ok.
    Followin is my source code
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.security.*;
    import sun.misc.*;
    import java.applet.*;
    import java.awt.*;
    public class DesApplet extends Applet{
         public static void main(String[] arg) throws Exception{
              DesApplet des = new DesApplet();
              des.CallDes();
         public void init(){
              CallDes();
         public void paint(Graphics g){
         public CallDes(){
              Cipher desCipher;
              int i;                              
              try{
                   Security.addProvider(new com.sun.crypto.provider.SunJCE());
                   KeyGenerator keygen = KeyGenerator.getInstance("DES");
                   SecretKey desKey = new SecretKeySpec("11111111".getBytes(),"DES");
                   System.out.println("Hello");
                   desCipher = Cipher.getInstance("DES/ECB/NoPadding");
                   desCipher.init(Cipher.ENCRYPT_MODE,desKey);
                   byte[] cleartext = "00000000".getBytes();
                   String value = convert_int_to_hex(cleartext,8);
                   System.out.println("cleartext is:"+value);
                   byte[] ciphertext = desCipher.doFinal(cleartext);
                   value = convert_int_to_hex(ciphertext,8);
                   System.out.println("ciphertext is:"+value);
                   desCipher.init(Cipher.DECRYPT_MODE,desKey);
                   byte[] cleartext1 = desCipher.doFinal(ciphertext);;
                   value = convert_int_to_hex(cleartext1,8);
                   System.out.println("cleartext1 is:"+value);
              }catch(Exception e){System.err.println(e);}
         public String convert_int_to_hex(byte[] value, int len) {
         int i;
         int j;
         byte tmp;
         byte[] temp = new byte[len*2];
         char[] chars = new char[len*2];
         String result = new String();
         for (i=0; i<len; i++)
         if (value[i] < 0)
         temp[i*2] = (byte)((value[i] & 0xF0) >>> 4);
         temp[i*2+1] = (byte)(value[i] & 0x0F);
         else
         temp[i*2] = (byte)(value[i] / 16);
         temp[i*2+1] = (byte)(value[i] % 16);
         for (i=0; i<len*2; i++)
         if (temp[i] > 9)
         chars[i] = (char)(temp[i] - 10 + 65);
         else
         chars[i] = (char)(temp[i] + 48);
         result = result.concat(result.valueOf(chars));
         return result;

    I have a server and a client.
    Server has jdk1.4. client is an applet. I need to encrypt the username and password that are sent from client to the server.
    I am able to encrypt and decrypt using JCE's DES on server side, since jdk1.4 has JCE provider installed by default. Since the applet may be running on any browser which may not have JCE supported. Is it possible for me to send the JCE jar file along with the applet and somehow enable the client applet to encrypt the user name and password and send to server.
    Thanks a lot,
    Gagan.

  • Possible to use RMI to upload client side image files?

    Is it possible to use RMI to upload client side image files? My intent is to allow remote clients to upload a number of small image files (jpg & gif) to a central server DBMS, by modifying a "Customer" object (eg adding a new Image object to a vector of Images?) Is this possible? Any suggestions greatly appreciated :))

    Is it possible to use RMI to upload client side image
    files? One possibility is to implement a serializable image object that you can upload to the server as any other object. When your server receives this serialized image object, just generate a new gif/jpg from it.
    But if your client-program is an applet, the situation is different: how can applet read image-file from users harddrive?
    krera

  • Is it possible to use Magnetic Strip Card in Java Card

    Can Any body knows that is it possible to use magnetic strip card instead of IC MicroProssesor card in Java Card technology ?
    is it possible to write java card applet on magnetic strip card ?
    Please Help me in this topic
    Thanx in advance

    If you mean having a combo of mag stripe and cpu/memory on a card, which support javacard tech, then yes.
    If you mean having a mag stripe only card which supports javacard, then no, it does not support javacard technology. Correct me if I am wrong but a mag stripe only holds a couple of bytes of datd doesn't it? Regardless no way enough for jcre, applets etc.
    Apu

  • Is it possible to LOAD and INSTALL applet during pre-personalization?

    Hi Friends..
    Currently, i use JCOP card
    I want to know the other way to LOAD and INSTALL applet not through CardManager..
    I mean, is it possible to LOAD and INSTALL applet during pre-personalization time?.
    Thanks in advance

    Hi,
    i want to LOAD and INSTALL Applets while pre-personalization phase..
    No, i don't want to defer the LOAD and INSTALL..In the past, we have used the pre-personalisation phase to load KDC keys onto a card and remove the ISK and set issuer specific identifiers (IIN and CIN) etc. You could also load your applet at this time if you wish. You can also load the applets at personalisation.
    How do you plan on doing the personalisation phase? If you were to use a GP scripting environment for example, the CAP files are embedded as a part of the install scripts and only loaded onto a card when you begin executing your personalisation scripts. Since I assume you will be using the small desktop printers mentioned in a different thread, you may be better off integrating the applet loading into your personalisation code (printer integration) so you do not need to double handle cards.
    Actually, is it possible to LOAD and INSTALL applet if we don't authenticate to the CardManager?..There are ways to load and install an applet without explicitly calling INIT UPDATE and EXTERNAL AUTH, but you still need to be authenticated to the card manager, otherwise anyone could manage card content. You can use install tokens and delegated management (which are all outlined in the GO Card Spec).
    Cheers,
    Shane

  • HT5648 Is it possible to use Java 1.6.0_39 on OS X 10.8.2

    Is it possible to use Java 1.6.0_39 on OS X 10.8.2

    Apple has posted (10/22/12) the approved solution for restoring the Java 6 plug-in:
    Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality.

  • Using JMF with applet

    Hello,
    I've got an applet that consumes a lot of CPU. I'm studying to migrate this applet to a pda, but it's not enough cpu for it. I'm reading JMF docs and I decide to generate a movie with the output of an applet. �If it's possible? My idea is to create the movie on the server. I can modify my applet to avoid the use of the applet inheritance and then render the output to an standard movie format. After I will send the movie to the browser
    You can see the applet here. Click on View route 3D under the flash movie.
    http://www.tmb.net/vullanar/en_US/resultatcerca.jsp?tipusrepre=0&origenx=31514.420&origeny=82758.000&descripcioorigen=L1+-ARCDE+TRIOMF&destix=34704.550&destiy=87378.460&descripciodesti=L2+-ARTIGUES-SANTADRI%C0&tipustransport=0&numtransbords=2&tempscaminant=20&velocitatcaminant=1&tipushora=1&dia=27&mes=05&hora=12&minut=22&idioma=en_US&operador=TMB&poblacioorigen=1&poblaciodesti=1
    Thanks in advance,
    David B.

    passionforjava2 wrote:
    ...I have issues with applet unable to transmit voice using JMF. i know it is a security issue. As the error on the console says
    java.lang.RuntimeException: No permission to capture from applets
    Error : Couldn't create DataSourceWhen JMF is installed, it generally offers a checkbox to allow or deny 'capture in applet'. By default it is not checked, and if the user goes with that recommendation, I am not sure that anything will overrule that.
    In a folder iPhone/myphone/What is the URL where we can visit this applet?
    .. i have applet embedded html file along with .jar files with required classed and applet signed. Are you prompted to trust the digitally signed code? You can see the dialog I mean by visiting the applet linked from [http://pscode.org/test/docload/].
    ..Along with that .jar i do have jmf.jar and java.policy.applet file and jmf.properties file . Forget the policy files, they are a waste of time, and completely impractical for end users.

  • Using a java applet as form

    hi there,
    I'm new to programming applets (but not new to java and gui programming).
    Here's my question:
    I would like to use a java applet with a textfield as form input. is this possible?
    I see some several advantages over using standard html textfields and java script. (f.e.: I can set the cursor to any position after changing the text in the field).
    I'm thinking on a solution by my own. Would it be possible to use a java script method to access a property from the applet? so I could use a combination of java applet, html and java script. On the onClick() event I read the actual value from the applet and do some normal post request. Any better suggestions?
    thx
    soa

    I want to write the textfield in java. So I use the applet as form.
    What would be your suggestion?
    Write an applet with an textfield and and getValue() method? So I could create a normal html button and use javascript to write a method wich acces this getmethod. So I could register this method to the onClick() event.

  • It is possible to destroy (kill) an applet?

    Hi, everybody
    It is possible to destroy (kill) an applet like a Frame, as using something like:
    public boolean handleEvent ( Event e){ 
    if (e.id == Event.WINDOW_DESTROY)
    System.exit( 0 );
    I know that this method is used on Frame, to destroy it. Can I use something similar in an applet?

    Here is the only reference in the search data on site here, for "Applet Destroy".
    http://java.sun.com/javaone/sessions/slides/TT09/views10.htm
    Do you mean to end the Applet? as in ending a program?
    Or to get rid of the Applet as in Delete it?
    Sincerely Shadow Cat

  • Is it possible to use wildcards to match cell contents in an if statement?

    I need to return a ID along with some other information on a page by page basis, so that the information comes out linked by position.  I use a couple of loops and if statements to navigate through the document.  I am able to use exact matches of cell contents which is fine when the contents doesn't vary.  But the IDs, though they have a similar pattern, are all different. In a menu driven search, I am able to find what I need with '150^9^9^9^9^9-^9^9^9' But when I try putting this (or any number of [0-9], *, ? combinations) it fails.  Is it possible to use wildcards?  The symbol used for the match (==) makes me suspect that it is not possible and that only literal, exact matches will work.  But I wanted to check with the experts before giving up.
    Thanks
    pcbaz

    Thanks for the input.  You're right, a GREP search is much more efficient.  But what I'm trying to do and the circumstances here don't allow me, I think,  to go that route. I am trying to generate a list of values coming from several textframes on a single page and have them come out so that I can tell which values belong together.
    I'm using an inherited document with masters that were created 'manually';  the index numbering for textframes and tables is random. I navigate through the pages, looping through textframe indices asking ' does this textframe exist?' If so, I ask if it is a table -- if no, it is a simple textframe and I ask about the ID, if yes, I ask if the contents of cell (0,0) (invariant position and contents) are equal to the table I want..  I am sending the ID and other pieces of information from the table to one row of a new table on a new page.  So the ID and other information from a single page are linked by being in the same row.
    I know this a little 'off-normal' -- I'm using the search to navigate through the document and find things by location the way you do with a spreadsheet.  I have devised a work-around that helps me get around the fact that the ID is not invariant.  I create a list of the (exact) IDs from another document, equating them to a variable ('a').  I then loop through the list of IDs and ask if the contents of the textframe is equal to 'a'..This works o.k, unless there happens to be an extra space, a different kind of hyphen, etc. It would be so much easier if I could use the wildcards that work in a menu-driven text or GREP search in script just to ask about the contents of the textframe.
    Thanks again
    pcbaz (Peter BIerly)
    P.S. we have since rewritten the masters so this problem will not exist in the future -- we now know exactly which textframe and/or table indices to refer to to get any particular bits of information and don't need to ask questions about the contents.

  • Is it possible to use a cable with two headphone jacks on either end and an electric guitar adapter to record in Garageband?

    Hey everyone,
    I got my Macbook Air (Mid 2013 model) last month and I want to record my acoustic-electric guitar on Garageband (which came with the Air). 
    I don't want to buy a guitar that has a USB. I have a cable with a 3.5 mm headphone jack on both ends like the one pictured here on this website http://www.bestdealaz.com/item.php?id=628 (i didn't buy it from this site though).
    I connected a 6.3 mm guitar adapter (http://www.ebay.com/bhp/headphone-guitar-adapter) to this cable. Then I connected one end of the cable to my guitar and the other end to the Headphone/Microphone jack on the left side of the MBA.
    I saw how other people were saying to go to System Preferences / Sound and then change audio output to audio input.
    I can't do that. I tried.
    Please help!
    Thank you.

    Hello Massimo Pascucci,
    The issue that you are facing when creating an endpoint with internal loadbalancer is the limitation of not allowing same ports to be listening under a single cloud service. This reason for this is that there is a limitation of only one private IP (Also
    known as the Internal load balanced IP) per cloud service.
    There is also a limitation on the Internal load balancer more than one port to be published per load balancer:
    You can leave your feedback by following the link below:
    https://social.msdn.microsoft.com/Forums/en-US/1805c5a0-3906-4cd6-8561-9802d77e0ae5/is-it-possible-to-use-both-an-ilb-and-an-elb-listening-on-the-same-port-in-the-same-azure-cloud?forum=WAVirtualMachinesVirtualNetwork
    Refer to this article for more information on Internal load balancer:
    http://azure.microsoft.com/blog/2014/05/20/internal-load-balancing/
    Thanks,
    Syed Irfan Hussain

  • I am using a mac mini 2011 an 3gs i phone 2010 macbook white 2008 and a new 2013 apple tv box. When i check info on the cloud I get 'upgrade your operating system to the latest. My question is is it possible to use the icloud system without an upgrade

    I am using a mac mini 2011 an 3gs i phone 2010 macbook white 2008 and a new 2013 apple tv box. When i check info on the cloud I get 'upgrade your operating system to the latest. My question is is it possible to use the icloud system without an upgrade

    iCloud requires OS X 10.7.2.

Maybe you are looking for

  • Bursting in XML Publisher

    Hi All, How to do Bursting in XML Publisher as I am new to XMLP. So anyone can gie me the details step for doing Bursting in XMLP. Regards, Sushant

  • How to trap warning messages generated from the background processing?

    Hi all, Following is my requirement, i want to know whether it can be done and how? The credit management (CM) warning messages generated as a result of the CM background processes, where do the messages go? Can you trap them and include them in an i

  • Project won't load into timeline

    When I click on a specific project to open in the timeline the arrow icon showing the "film reel" (in the bottom left corner) switches directions like it's loading it into the timeline, but I still see everything in my project library. FCPX behaves l

  • Searching of Single Quote( ' ) in DataBase

    How do I use like statement to find a character " ' " ? I used the following syntax select * from table where col1 like '%'%' ; but it gives a error SQL statement not properly ended. So how to search for a single quote( ' ) in a String

  • Black spot on camera and pictures after Denim upda...

    Hi Yesterday I have finaly updated my Lumia 930 with the Denim software.. Today I notice a black spot on the right side of my camera screen. Then I took a picture and the spot is seen on the pictures too.. I have cleaned up the lenses and I can confi