Error "Impossible to load the translet class"; XSLTC

Discussion in 'Java' started by Richard, Nov 20, 2005.

  1. Richard

    Richard Guest


    Do you have any idea of my problem? The undermentioned program does not
    work with Java 1.5.0_05 but worked with Java 1.4. The problem is related
    to XSLTC but perhaps my environment is the problem? (my system is
    Windows XP).

    Thanks in advance for your help.



    import javax.xml.transform.Templates;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;

    public class Main {

    public static void main(String[] args) throws Exception {
    TransformerFactory tfactory = TransformerFactory.newInstance();
    URL urlXSL = Main.class.getResource("zoo.xsl");
    URL urlXML = Main.class.getResource("zoo.xml");
    File fichierXSL = new File(urlXSL.toURI());
    File fichierXML = new File(urlXML.toURI());

    Templates templates =
    tfactory.newTemplates(new StreamSource(fichierXSL));
    Transformer transformer = templates.newTransformer();
    // The following lines have no importance because
    // the problem is at the previous line.

    Error Message:
    Exception in thread "main"
    Chargement impossible de la classe translet 'zoo'.
    (Translation in english: Impossible to load the translet class 'zoo')
    at Main.main(
    Richard, Nov 20, 2005
    1. Advertisements

  2. Richard

    Roedy Green Guest

    Roedy Green, Nov 20, 2005
    1. Advertisements

  3. Richard

    Richard Guest

    Thanks Roedy for your answer but I need to keep my old version of Java 1.4.

    I have launched the java application with the -verbose option and I have
    seen that all the classes come from java 1.5.0_05.

    Do you know someone who had the same problem as me?


    Roedy Green a écrit :
    Richard, Nov 21, 2005
  4. Richard

    Richard Guest

    For developers who will have the same problem as me:

    I have just discovered the reason of my problem: XSLTC does not like the
    big stylesheets!

    So, I will have to choose another library to transform my XML files.

    I don't understand why Sun has chosen such a library, even if it
    provides a quick transformer. My stylesheet is not so big (10 Ko).


    Richard a écrit :
    Richard, Nov 22, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.