Load class from XML (Dynamic Dispatch)

I'm continuing my voyage into the realms of LVOOP.....
I have encountered a new problem which I am sure there's a solution to.....
I have a certain hierarchy and I want to implement a single save and load routine for all objects int he hierarchy (located int he parent class of course).
Using the "flatten to XML" I'm able to create some nice XML files with all parent and sibling information saved (as long as the values are non-default of course).
Where I am running into problems is the loading of the data within this XML file.  I want to be able to take an object and basically re-initialise it to the values within the file.  All fine and good I thought, but it doesn't work.
The problem is that when using the VI with Dynamic dispatch inputs, the output of the "Unflatten from XML" is giving me a conflict with the Dynamic dispatch output saying the obejct types do not  necessarily match.  Is it not possible to match the object type on the input and output of the "Unflatten from XML" primitive?
If I try removing the "Dynamic Dispatch" input to a static input, then it only loads the data for the parent class regardless of the actual input class.
Am I doing something silly here or is there no other way to properly load a sibling class from a file using only a method residing within the parent class?  I was hoping I could have a single "Save-Restore" function residing within my parent class to make life easier for me.
Shane.
Message Edited by Intaris on 06-17-2009 05:24 AM
Say hello to my little friend.
RFC 2323 FHE-Compliant

Hi Tst,
Problem is that in order for the cast to yield any useful results, I have to make the inputs and outputs non-Dynamic which results in ONLY the data for the parent class being loaded.
If the inputs and outputs are Dynamic, then a cast will not solve the problem (It could be a grandchild class being cast as a child, thus breaking the dynamic dispatch tables).
The only solution I see is for the "UnFlatten from XML" to RETAIN the true object type.
Either that or use my beautiful solution 
Shane.
Ps I just did a bit of a test of the race condition probabilities.  I ran 100000 tests (100k) with a program stressing both cores AND ram of my machine in parallel and all 100k of 100k iterations worked out OK.  I suppose that lets me think I should be in the range of at least 99.99%....... 
Say hello to my little friend.
RFC 2323 FHE-Compliant

Similar Messages

  • Load data from XML files into BI

    Hi All,
    Can any one guide me through the steps which involve in loading data from XML files into BI?
    Thanks
    Santosh

    Hi James,
    I have followed upto step No: 12 .
    Please could you let me know how to link the XML file on my local drive to BI,
    I am not able to find figure out where to specify the path of the XML file to be loaded into BI.
    Thanks In Advance
    Regards,
    San
    1. Create a Infosource(ZIS), with transfer structure in accordance with the structure in the XML file. (You can open the XML file with MS Excel.This way you can get to know the structure).
    2. Activate the transfer rules.
    3. After activation ;from the Menu Bar , Select Extras>Create BW Datasource with SOAP connection.
    4.Now Activate the Infosurce again, this creates an XML based Datasource(6AXXX...)
    5.These steps would create two sub nodes under the Infosource(ZIS).
    6.Select Myself system and create a data package and execute it run in Init mode(without Data Transfer).
    7. This would create an entry in RSA7(BW delta Queue)
    8. Again create another Delta Infopackage under it, and run it. Now the Datasource(6AXXXXXX..) would turn green in RSA7.
    9.In Function builder(SE37) select your FM( do a search ,F4, on the datasource 6AXXX....) .
    10.Inside this RFC based FM , from the Menu Bar select Utilities>more Utilities>Create Web services>From Function module.
    11.A wizard will guide you through the next steps .
    12.once this is done a Web serrvice would be enabled in WSADMIN. Select your FM and execute it.
    13.From here you can upload the data from XML file into BW delta queue.
    Edited by: Santosh on Nov 30, 2008 2:22 PM

  • Flash does not load information from xml on DMM system

    I have flash file load information from xml file. flash file and xml file i push on IIS server. In presentation i add URL of flash file but flash file not show information.
    I try run URL direct from DMP is ok.
    Flash file write for Flash litte 3.1 and use action script 2.0. DMS system test with DMM version is 5.3 and DMP 4310G.
    Please point where the error and the notes on  flash file use with DMM for my programmer.
    Thanks!

    Hi guy's
    I think I maybe faced with a similar issue.
    I've been working on a flash build that pulls in xml feeds. Everything I have works great so far but I've only been able to test as standalone(Desktop) and in the browser.
    When I tested standalone(Desktop) I did get the flash security popup but once I granted access it worked fine.
    I've never used DMP 4310 before. At this point in time I dont have access to it either. All I know is that my swf will be put on it.
    Can anyone tell me how the DMP 4310 will handle the flash security popup?

  • Unable to load class from JSTL

    Hello. I am using JSTL 1.06 from Jakarta with Tomcat 4.1 on a MacOS X 10.3.9 server. I have a jsp that contains the following:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <jsp:useBean id="validate" class="mypackage.ValidationBean" scope="request">
            <jsp:setProperty name="validate" property="*" />
    </jsp:useBean>
    <c:if test="${validate.valid == false}">
    The input is not valid.
    </c:if>In case it matters, my web.xml file starts out like this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">I have placed jstl.jar and standard.jar in my webapp's WEB-INF/lib directory. However, when I try to load the page, I get this error message:
    org.apache.jasper.JasperException: /myjsp.jsp(60,0) Unable to load class if
    I know that many people have asked similar questions, but in each case, the response was to put jstl.jar and standard.jar in WEB-INF/lib and make sure that you're using the proper URI for the taglib, and I think I have done those things correctly. Any help would be greatly appreciated!

    Thanks for your response! In answer to your questions:
    The JRE is 1.4.2_09. I can't use 1.5 (5.0) without upgrading the OS.
    I haven't tried it on a PC. I might be able to, but it would take me some time to set everything up.
    What follows is taken from Tomcat/logs/localhost_log.2006-10-24.txt. If there is another log file I should be looking in, please let me know. Here is the full stack trace from the log:
    2006-10-24 16:58:40 Could not load TagLibraryValidator class org.apache.taglibs.standard.tlv.JstlCoreTLV: EXCEPTION: org.apache.taglibs.standard.tlv.JstlCoreTLV
    2006-10-24 16:58:40 Could not load TagExtraInfo class org.apache.taglibs.standard.tei.ImportTEI: org.apache.taglibs.standard.tei.ImportTEI
    2006-10-24 16:58:40 Could not load TagExtraInfo class org.apache.taglibs.standard.tei.ForEachTEI: org.apache.taglibs.standard.tei.ForEachTEI
    2006-10-24 16:58:40 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: /myjsp.jsp(59,0) Unable to load class if
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219)
    at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:712)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:804)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:553)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
    at java.lang.Thread.run(Thread.java:552)

  • Loading classes from another jar file

    I've set up my jnpl file so that it references a core jar file (contains main() function). The jnlp also references another jar file (app.jar) which contains class files that I load and instantiate dynamically (using ClassLoader). The core.jar file contains a manifest that includes a reference to app.jar.
    The app works fine when I use "java -jar core.jar" from the command line.
    However, when I wrap the jars using jnlp, I always get a null pointer exception because it cannot find any class that is in the app.jar file. I've tried different strategies, such as trying to load a class file that sits on the server (in a jar file and not in a jar file), but that also fails if I use jnlp (However, it works if I use "java -jar core.jar")
    Any ideas what is going on?

    This is the "OckCore.jar" manifest before signing:
    Manifest-Version: 1.0
    Main-Class: com.Ock.OckCore.OckApp
    Class-Path: . OckMaths.jar
    Created-By: 1.4.0-beta3 (Sun Microsystems Inc.)
    Name: com.Ock.OckCore.OckApp.class
    Java-Bean: FalseThis is the manifest after signing:
    Manifest-Version: 1.0
    Main-Class: com.Ock.OckCore.OckApp
    Created-By: 1.4.0-beta3 (Sun Microsystems Inc.)
    Class-Path: http://hazel/Ock/. http://hazel/Ock/OckMaths.jar
    Name: com/Ock/OckCore/OckApp.class
    SHA1-Digest: KRZmOryizx9o2L61nN+DbUYCgwo=I have removed a load of irrelevant stuff from the "after" manifest to keep it readable.
    note that :-
    The OckApp.class loads normally from webstart and tries to load a class from OckMaths.jar.
    I can prove that OckApp.class does load because it creates a log file when it does.
    The OckApp.class tries to load a class from the OckMaths.jar. This fails if webstart is used but works if OckCore is launched using "java -jar OckCore.jar".
    The jars do exist at the location specified by the manifest.
    The application launches normally if I use "java -Jar OckCore.jar"
    Here is the jnlp file
    <?xml version='1.0' encoding='UTF-8'?>
    <jnlp
         spec="1.0"
         codebase="http://hazel/Ock"
         href="OckMaths.jnlp">
         <information>
              <title>Ock Maths Demo</title>
              <vendor>Rodentware Inc</vendor>
              <description>Demo of a ported app running as a Java Webstart application</description>
              <description kind="short">An app running as a Java Webstart application"></description>
              <offline-allowed/>
         </information>
         <security>
              <all-permissions/>          
         </security>
         <resources>
              <j2se version="1.3"/>
              <jar href="OckCore.jar"/>
              <jar href="OckMaths.jar"/>
         </resources>
         <application-desc main-class="com.Ock.OckCore.OckApp">
    </jnlp> I have also signed the jars outside of a webdirectory. I get the following manifest file:
    Manifest-Version: 1.0
    Main-Class: com.Ock.OckCore.OckApp
    Created-By: 1.4.0-beta3 (Sun Microsystems Inc.)
    Class-Path: . OckMaths.jar
    Name: com/Ock/OckCore/OckApp.class
    SHA1-Digest: KRZmOryizx9o2L61nN+DbUYCgwo=
    note that :-
    The jars do exist at the location specified by the manifest.
    The application launches normally if I use "java -Jar OckCore.jar".
    The application doesn't launch from webstart.
    I've found that cache, but the jar files have been renamed.
    OckCore.jar is anOckCore.jar, etc... so I'm not sure if trying to write a cmdline will work anyway.

  • Load object from xml

    Imagine if you can that I have a XmlLoader class for each object that can be loaded from xml.
    Before I had the xmlLoader code inside the objects but it's better to separate loading from actual object...
    these xmlLoaders needs to be able to set all vars for those objects. How would be the best way to do that?
    Atm I have made all vars with a package scope. but this really opens the object open to all other objects in that package...
    I don't know any other options. so how do you keep your vars safe, but still be able to load them from whatever source(xml, txt)...?

    Apache Digester is good for this sort of thing. It uses setter methods to populate your objects. You could also just use XML Serialization and deserialization. Or, you could go for something like JAXB or XMLBeans, whereby you actually will have classes generated for you from XML Schemas, and instances of those classes can marshall and unmarshall themselves quite easily

  • Load data from xml file in oracle data base

    Hi all,
    I'd like to know if is posible to load data from a file xml into a table of oracle data base through SQL*LOADER, loaded only in a normal column no with type XMLType , for example
    I have a xml file
    <person name="kate" surname="fari" city="new york" >
    <son name="faus" age="18"/>
    <son name="doly" age="10"/>
    </person>
    and I load in table :
    table :person
    column
    name surname city
    kate fari new york
    table : son
    name age
    doly 10
    faus 18
    thank you for your return !!!!!!!!!
    Ninova
    Edited by: user10474037 on 30 mai 2011 08:47
    Edited by: user10474037 on 30 mai 2011 08:48
    Edited by: user10474037 on 30 mai 2011 08:48
    Edited by: user10474037 on 30 mai 2011 08:49
    Edited by: user10474037 on 30 mai 2011 08:50

    Hi
    This May be found at
    SQL Loader to upload XML file

  • Loading data from XML hosted on a site accepted by Apple?

    I'm about to start working on an App that holds the template and code to build the stuff. It gets its level design, variables and other things from an XML hosted on a website/server. The app will also load pictures from the website/server to be displayed in the app. So, what people download is the "shell". Would Apple allow this app into the app store? Considering I've read how they don't allow external code to be loaded into the app, or is this only limited to code inside external swfs?

    I did search before I posted and read only the threads that seemed to cover what I wanted to know. As replies here are rare I decided to read ALL threads I got from my search and actually found one with the answer, sort of, as he doesn't say if he loads variables, which to me is like code , but I hope Apple will be ok with my app loading external stuff through an external xml aswell, like they were for this guy:
    http://forums.adobe.com/message/3868894#3868894
    * I'm loading xml-data and pictures (like icons for other apps) from an external server into the app, to promote our other apps. Works like a charm and apple had no problem with this.

  • Generation of java classes from XML Schema.

    Hi All,
    I am working with JWSDP-2.0 but got stucked.:
    To generate Java classes from an XML Schema with the JAXB ,I need to have following jar file in thils location with this JWSDP-2.0
    <JWSDP>/jaxb/lib/jaxb-api.jar
    <JWSDP>/jaxb/lib/jaxb-impl.jar
    <JWSDP>/jaxb/lib/jaxb-libs.jar
    <JWSDP>/jaxb/lib/jaxb-xjc.jar
    <JWSDP>/jwsdp-shared/lib/namespace.jar
    <JWSDP>/jwsdp-shared/lib/jax-qname.jar
    <JWSDP>/jwsdp-shared/lib/relaxngDatatype.jar
    And here I m not finding as jaxb-libs.jar,namespace.jar and jax-qname.jar on respective location.
    If I m putting these left jar file from another place it is not generating all the classes as at least in number it should be 45 but it is generating merely 5 classes.
    Can any one help me regarding this.
    Regards.
    Shelly.

    These JAXB JAR files are for JAXB 1.0.
    For JAXB 2.0 the following JAR files are required.
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-api.jar
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-impl.jar
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-xjc.jar
    C:\Sun\jwsdp-2.0\jwsdp-shared\lib\activation.jar
    C:\Sun\jwsdp-2.0\sjsxp\lib\jsr173_api.jar
    C:\Sun\jwsdp-2.0\sjsxp\lib\sjsxp.jar

  • Errors generating Java classes from XML schema

    I received the following errors when generating Java classes from the schema located at: http://imsproject.org/xsd/ims_qti_rootv1p1.xsd and http://imsproject.org/xsd/ims_xml.xsd
    XML Spy v4 claims that the schema is well-formed and valid. Could this be a problem with the class generators, or is XML Spy not telling the truth?
    Thanks.
    D:\IMS_QTI\Java>java -classpath .;lib/xmlparserv2.jar;lib/xschema.jar;lib/classgen.jar oracle.xml.classgen.oracg -schema ims_qti_rootv1p1.xs
    d -outputDir src\com\icld\qti -package com.icld.qti -comment
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 235, Column 21>: XSD-2209: (Error) Duplicated definition for: 'attr.view'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 303, Column 21>: XSD-2209: (Error) Duplicated definition for: 'grp.labels'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 1834, Column -12236>: XSD-2209: (Error) Duplicated definition for: 'qtimetadatafield'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 1834, Column -9642>: XSD-2209: (Error) Duplicated definition for: 'typeofsolutionType'
    file:/D:/IMS_QTI/Java/ims_qti_rootv1p1.xsd<Line 2252, Column -3019>: XSD-2026: (Error) Invalid attribute 'use' in element 'attribute'
    Error: Schema Class Generator failed to generate classes. oracle.xml.parser.schema.XSDException: Duplicated definition for: 'attr.view'

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jinyu Wang ([email protected]):
    Which version are you using? I can't reproduce the error with 9.0.2B version.<HR></BLOCKQUOTE>
    Thanks for having a look at the problem. I am using the 9.0.2.0B version with Java 2 Standard Edition Build 1.3.1-b24. The classgen -version option returns 9.0.2.0b-beta - and xmlparserv2.jar and xschema.jar are from the same distribution. Running the corresponding DTD from the same source work fine - I'm just havinf this problem with the XSD. Anything else I should look at?

  • Loading settings from xml and applying

    Hi,
    I've got an xml where im writing certain settings of a application. This is what the xml looks like;
    <?xml version="1.0" encoding="UTF-8" ?>
    - <PTMViewProfile>
    - <viewProfile>
      <testSequences />
      <projectName tag="default" />
    - <tsFrames>
      <tsFrame tag="bvcbvc" maximised="true" />
      <tsFrame tag="bvbv" maximised="true" />
      </tsFrames><projectName tag="default" /> - This is the project name
    - <tsFrames> - These are the JInternalFrames (Instance of tsFrames) for that specific project.
    <tsFrame tag="bvcbvc" maximised="true" />
    <tsFrame tag="bvbv" maximised="true" />
    </tsFrames>
    The project is stored in a directory containing all the tsFrames.
    From the xml i have the code to read and write. But, i want to apply those settings so that when the application is reopened it looks at the xml and opens project and the tsFrames by looking at the xml.
    Can someone please help me with wrting a method that applies those settings and loads the application.

    Hi,
    Thanks for replying!
    I am new to java and i have created the read and write method by using examples from existing code.
    what i want to do is store the elements its reading into an array so that i can use it in another method to do things with it.
    The code below is reading element from xml
    List frame = XMLManager.getListOfNamedChildren(tsFrames, xmlFrameTag);
                   Iterator iterator = frame.iterator();
                   while (iterator.hasNext()) {
                        Element tsFrameElement = (Element) iterator.next();
                        String tag = XMLManager.getAttributeValue(tsFrameElement, "tag");
                        String maximised = XMLManager.getAttributeValue(tsFrameElement, "maximised");
                        storeTsFrame.add(new TSFrameSettings(tag, maximised));I want to use a for each loop to read each line in the xmlFrametag by replacing the while
    can someone help me with this please!

  • Failover to loading classes from codebase?

    The Java Plug-In fails over to loading class files from codebase when the jars specified do not contain the class in question.
    I need this same behavior from Java Web Start -- in part because I'd like to convert some applets and in part because due to customization, reflection, etc, it is not possible for me to force all class files to reside in the jars. Some will only be found in the codebase.
    Is there any way to accomplish this with Java Web Start? Or do we have to use another JNLP implementation? I understand performance is best when the jars are complete, but why did Sun make Java Web Start's behavior so inconsistent. [This is not the only case of this, but I'll keep my other questions/gripes on this matter to other threads.]

    I fully agree with your opinions on the environment variables such as CLASSPATH, PATH etc.
    But my problem is: I want to force the application to load the classes over RMI from the codebase specified by the other machine first before trying to load the classes from its own class path specified by -cp or whatever mechanisms.
    In other words, I want to load the classes remotely instead of locally on the hard drive if the classes with the same names exist locally.

  • Error when loading data from xml file

    Hi,
    I'm trying to load data into a table from XML file using ApEx DATA UNLOAD/LOAD interfaces .
    ApEx version is 3.0.1 .
    I'm getting this error:
    ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00222: error received from SAX callback function
    How to find cause of the error ?
    Janus

    Tkank you for the simple but good advice :)
    unfortunately even google didn't find many answers :
    LPX-00222 + APEX ... NOTHING
    LPX-00222 + ORA- ... 2 pages of something like
    "Examine the additional error messages and take corrective action"

  • Is it possible to load classes from a jar file

    Using ClassLoader is it possible to load the classes from a jar file?

    URL[] u = new URL[1] ;
    u[0] = new URL( "file://" + jarLocation + jarFileName + "/" );
    URLClassLoader jLoader = new URLClassLoader( u );
    Object clsName = jLoader.loadClass( clsList.elementAt(i).toString() ).newInstance();
    I get this error message.
    java.lang.ClassNotFoundException: ExceptionTestCase
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    // "file://" + fileLocation + fileName + "/" This works fine from a browser.
    Is there anything I am missing? Thanks for the reply.

  • Loading URL from XML?

    I have a movie clip in rectangle shape and need add link to that from XML.
    How can I do that?
    this my code
    AS Code:var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("linkNewD2.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, displayHTML);
    function displayHTML(e:Event):void {
                    var xmlData:XML = new XML(e.target.data);
                    var tURL:String = xmlData.Header1.option;
                    targetURL(tURL);
    function targetURL(event:String):void
    var valURL:String = event;
    myMc1.addEventListener(MouseEvent.CLICK, gotoHome);
    function gotoHome(evt:MouseEvent):void
                    var myURL:URLRequest = new URLRequest(URL(valURL));
                    navigateToURL(myURL);
    XML Code:
    <data>
    <Header1>
    <option> http://www.google.com </option>
    </Header1>
    </data>
    Please help me!
    Thanks,
    jafy

    First, never use nested functions - they bring in a lot of troubles.
    Try this code (there are better ways but just to follow your initial approach). This code assumes that myMC1 is MovieClip:
    var xmlLoader:URLLoader = new URLLoader();
    // listeners should be added BEFORE load() is called
    xmlLoader.addEventListener(Event.COMPLETE, displayHTML);
    xmlLoader.load(new URLRequest("linkNewD2.xml"));
    function displayHTML(e:Event):void {
         var xmlData:XML = new XML(e.target.data);
         targetURL(xmlData.Header1.option);
    function targetURL(url:String):void
         myMc1.url = url;
         myMc1.addEventListener(MouseEvent.CLICK, gotoHome);
    function gotoHome(e:MouseEvent):void
         navigateToURL(new URLRequest(MovieClip(e.currentTarget).url));

Maybe you are looking for