(newbie) Xalan XSLTC problem

Hi all,
I'm using latest versions of jdk and xalan-j, if try to transform the following xml+xsl with XSLTC
<?xml version="1.0" encoding="UTF-8" ?>
<root>
     <XWC:surname xmlns:XWC="http://www.something.it/XWC/2.0">
          Jones
     </XWC:surname>
</root>
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:XWC="http://www.something.it/XWC/2.0">
<xsl:output method="html"/>
<xsl:template match="XWC:*">
     <xsl:element name="{name()}">
          <xsl:apply-templates/>
     </xsl:element>
</xsl:template>
</xsl:stylesheet>
I get the following exception:
ERROR: ''
javax.xml.transform.TransformerException: java.lang.NullPointerException
     at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:604)
     at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:277)
     at it.wecode.jfx.xml.sax.Pipeline.transform(Pipeline.java:20)
     at it.wecode.jfx.test.Main.main(Main.java:74)
Caused by: java.lang.NullPointerException
     at org.apache.xml.serializer.ToHTMLStream.endElement(ToHTMLStream.java:822)
     at org.apache.xml.serializer.ToHTMLStream.endElement(ToHTMLStream.java:1606)
     at xsl.template$dot$0()
     at xsl.applyTemplates()
     at xsl.applyTemplates()
     at xsl.applyTemplates()
     at xsl.transform()
     at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
     at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:597)
     ... 3 more
java.lang.NullPointerException
     at org.apache.xml.serializer.ToHTMLStream.endElement(ToHTMLStream.java:822)
     at org.apache.xml.serializer.ToHTMLStream.endElement(ToHTMLStream.java:1606)
     at xsl.template$dot$0()
     at xsl.applyTemplates()
     at xsl.applyTemplates()
     at xsl.applyTemplates()
     at xsl.transform()
     at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580)
     at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:597)
     at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:277)
     at it.wecode.jfx.xml.sax.Pipeline.transform(Pipeline.java:20)
     at it.wecode.jfx.test.Main.main(Main.java:74)
Exception in thread "main"
It works well usign interpretative Xalan or if I change the output-method to "xml".
Any help will be appreciated!
Giuseppe Moscarella

A clue: it doesn't throw an exception if the output-method is 'xml' instead of 'html'...

Similar Messages

  • Xalan XSLTC  problem

    I've been trying to do a simple XSLTC transformation using JDK 1.4.2, but I get the following error:
    java.lang.IllegalAccessError: class org.apache.xml.dtm.ref.sax2dtm.SAX2DTM2$AncestorIterator cannot access its superclass
    org.apache.xml.dtm.ref.DTMDefaultBaseIterators$InternalAxisIteratorBaseI believe this is because of the fact that the JDK files comes with some XML libraries bundled and this clashes with the downloaded Xalan libraries.
    I'm just wondering if anybody has managed to do a XSLTC transformation using the JDK 1.4.2. and if they encountered any problems.
    Thank you for everything!
    Gustavo

    Using JRE 1.4.x, the Applet that used XSLT, stared giving exception. The reason, the Xalan-Java package (older version)had been included from JDK 1.4 release on-wards. The suggested work around was to use Endrosed mechanism. But how do we use endrosed mechanism for Applets (which uses browser's JRE) ?

  • Error with xalan xsltc transformation

    Hi Everybody,
    I am currently working on a performance enhancement change for my project which uses xsl for jsp html display. Due to some client requirement, we have decided to convert all our xsl stylesheets to XSLTC translet class files. Although I have managed to compile all the stylesheets to java classes, I am getting a strange runtime error for some of the xsl-jsp pages. please kindly help me as I have no clue about this error. It has now become a showstopper issue for my project delivery. I am using Websphere 5.1 jre and xml jar libraries for doing the transform. The tranformation works fine with the default xalan transformer(not xsltc). The XSLTC version is 4.0 .
    [2/6/06 17:41:33:979 IST] beb3ed2 WebGroup E SRVE0026E: [Servlet Error]-[&#40;class: com/synergy/xsl/translet/mmtoolb, method: topLevel signature: &#40;Lorg/apache/xalan/xsltc/DOM&#59;Lorg/apache/xml/dtm/DTMAxisIterator&#59;Lorg/apache/xml/serializer/SerializationHandler&#59;&#41;V&#41; Incompatible object argument for method call]: java.lang.VerifyError: (class: com/synergy/xsl/translet/mmtoolb, method: topLevel signature: (Lorg/apache/xalan/xsltc/DOM;Lorg/apache/xml/dtm/DTMAxisIterator;Lorg/apache/xml/serializer/SerializationHandler;)V) Incompatible object argument for method call
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Class.java(Compiled Code))
         at java.lang.Class.getConstructor1(Class.java(Compiled Code))
         at java.lang.Class.newInstance3(Class.java(Compiled Code))
         at java.lang.Class.newInstance(Class.java(Compiled Code))
         at org.apache.xalan.xsltc.trax.TemplatesImpl.getTransletInstance(TemplatesImpl.java:345)
         at org.apache.xalan.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:374)
         at org.apache.xalan.xsltc.trax.TemplatesImplProxy.newTransformer(TemplatesImplProxy.java:106)
         at org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:570)
         at com.synergy.service.XSLTTransformServiceHelper.getTransformer(XSLTTransformServiceHelper.java:296)
         at com.synergy.service.XSLTTransformServiceHelper.getTransformer(XSLTTransformServiceHelper.java:243)
         at com.synergy.service.XSLTTransformServiceHelper.transform(XSLTTransformServiceHelper.java:155)
         at com.synergy.tags.xslt.XSLTTransformTag.doEndTag(Unknown Source)
         at org.apache.jsp._mmtoolb._jspService(_mmtoolb.java:2392)
         at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:683)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Compiled Code))
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:61)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615)
         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
    Please reply incase you need more information about the error.
    Thanks and Regards,
    sunil kumar
    Polaris software lab ltd
    India

    The XSLTC version is 4.0Is that the version under which you compiled the classes, or the version in Websphere where you are running the classes? The error message seems to suggest there is some incompatibility happening.

  • Xalan-j problem

    Hi all friends!
    pls....i have this problem...
    E:\saxon\db2>java org.apache.xalan.xslt.Process -in usedb.xml -xsl database-access.xsl
    <html>
    <head>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>HR employee listing</title>
    </head>
    <body>
    <h1>HR employee listing</h1>
    <h2>Employees by department</h2>
    </body>
    file:///E:/saxon/db2/database-access.xsl; Line #23; Column #32; XSLT Error (javax.xml.transform.TransformerException): org.apache.xpath.objects.XNodeSet.<i
    nit>(Lorg/w3c/dom/NodeV
    E:\saxon\db2>

    I forgot to mention that I did all the download and edit the classpath as the instruction in apache website.

  • Newbie: Mail Transfer Problems from Mac 10.6.2 to Mac 10.8.2

    I am giving my old macbookpro away (OS 10.6.2) and got a new OS 10.8.2
    How do I transfer my Mail (everything from inbox to sent items) from the old mac os to the new MacbookPro laptop's Mail?
    I am a newbie but uses the Mac's Mail for my business and all emails are important to me.
    Please help me with a step-by-step "idiots" guide. Thanks a lot!!!
    If there's any other info you need from me, let me know. Thanks!

    See How do I set up a new Mac from an old one, its backups, or a PC?

  • Newbie with Distortion Problem, Audigy 2

    Hello all you helpful people,?Seams common problem having spent the last 3 hours reading through the many posts on this subject, have to say the most helpful (easy to follow) was Jeremy's "read this before you post". Good man but unfortunatly it didnt help me. Just bought Aud2 ZS, fitted, run the disk that come with it. All working and i have sound, just that its distorted as though the pre-amp of the card has to higher level going into it. my PC is a P4 3Ghz, 52MB mem,?running XP SP2, and has only just been built so can be trusted as a clean install. I have disbled the on board sound in the bios. (thanks to Jeremy's post mentioned)?Calibration noise is dificult to tell if its distorted, the welcome menu "play?dvd-audio sample (24bit)"?demo thing sounds great, loud, clean and crisp, (I'm listening through?monitor audio cable and some?nice HI-Fi, my nakamichi?amp and Mordant Short floorstanders) so i know it can do it!?playing a audio cd is worse than listening to ripped WMA lossless through either creative's mediasource or windows?media player , but both un-listenable. So what's wrong? gain of the pre-amp after the DAC's? but the demo works? therfore it would appear?related to source, what controls gain with different sources? Drivers??Any help or suggesions greatly recieved. Thankyou in anticipation.

    blackadder,
    Could you decribe the distortion a little more? Is it crackling and popping? If so, search the Forums for "snap crackle pop," and you'll see it's a common symptom with perhaps more than one cause. I haven't had this problem with my A2ZS, so I'm no expert on the various solutions. However, because you haven't gotten a reply yet, I'll offer some initial, simple steps you can try. Muting any playback sources you aren't using will eliminate/reduce crosstalk/bus-noise. Moving the soundcard to a PCI slot far away from the video card has worked for some. Turn your volume sliders down to ~90% rather than 00%. In Speaker Setup, when you run the channel test, are "Front right, front left" etc clear or distorted? Do you get the same distortion using headphones or other speakers?Message Edited by Katman on 0-30-20070:59 AM

  • Newbie DSS theory problem.

    Hey guys im very new to cryptogrophy and I have been writing a small java program to create a digital signature for a given 'txt' document using a private assymetric key. I have also created another small program to verify the signed document. Both programs are using DSS and I have performed all the calculations using BigIntegers.
    My problem is that my DSS.verification program isn't producing the correct 'v' result and I am at a loss as to why!
    Things I have checked:
    1) Both programs produce the same hashed value (using SHA-1) for the message so I am assuming that the message is exactly the same.
    2) I have double checked that the both the private and public key's have been read correctly.
    3) I have double checked that the DSS.verification program is reading the signature exactly as it was produced.
    4) I have verified that all the outputs (files) of the program are exactly as they had been generated.
    So unless I have missed something out this leaves me to think that my formula is not being processed correctly. I am not 100% sure whether I have ported the DSS formula properly into java, can anyone point out any problems in my formula? Particularly s and v because I have to do some manipulation to get the formula to work using BigIntegers.
    All values are BigIntegers and 'hashedValue' is the digested message (SHA-1) converted to a BigInteger
    DSS.Sign
    r = ( g.modPow(k, p) ).mod(q);
    s = (  (  k.modPow(NEGATIVE_ONE, q)  ).multiply(hashedValue)  ).mod(q);
    s = s.add( x.multiply(r) );
    s = s.mod(q); DSS.Verify
    w = s.modPow(NEGATIVE_ONE, q);
    a = (hashedValue.multiply(w)).mod(q);
    b = ( ( r.multiply(w) ).mod(q) );
    v = ( g.modPow(a, p) ).multiply( y.modPow(b, p) );
    v = v.mod(p);
    v = v.mod(q);Here is a sample of my output which may give some clues as to how close (or not) I am??
    r=424312638947657700251206397299565288614405959700
    s=481960089187838014555717597653069349705621725432
    Verifying signature...
    r=424312638947657700251206397299565288614405959700
    v=364193452644066677310533663835034943549826723794
    Thanks a lot for any help you can give!!
    Shanon :)

    Ahhh...
    Thats a good point, I didn't mention it in the above post but when I mentioned that both programs were producing the same hashed value. They are actually being compared as integers and I haven't noticed them being negative but I will have another look.
    Another thing I forgot to mention was that I have also verified that 0 < r < q and 0 < s < q.
    I've had a quick search around the net and the forums but I cant find any examples of a DSS formula being used in java. I'd love to be able to have a look at someones formula to compare it.
    Have you seen any such examples in your travels?
    Shanon :)

  • Newbie with compilation problem

    Hi, I am trying to compile my program, and I have a problem importing a class. When I try to compile, it says:
    package org.apache.axis.encoding does not exist
    encodedImage = org.apache.axis.encoding.Base64.encode(
    I think it is quite likely something to do with the Class Path, but I do not fully understand what the class path is or does exactly? Could some one please explain the Class Path? And do I need to put another line into it?
    Any responses will be very much appreciated.
    Thank you.
    Tim.

    Basically, the classpath allows Java to locate a given class. The class path usually specifies one of two items:
    Start of compiled class directory. So, names will be resolved relative to this classpath entry. If you have a class called com.foo.testing, then whatever directory contains com/foo/testing as a directory structure in the filesystem should be a classpath entry
    External or deployed JAR files. JAR files take the compiled class directory structure (above) and places it in an archive file, like a ZIP file. (Note that a lot of other things will be in the JAR file when you deploy as a web-app, but for now, this is simple enough). Rather than specifying a directory, you have to explicitly locate the JAR file itself. So, if you have a directory of JAR files, you need to specify each one.Your classpath issue seems to me related to the JAR issue. The Apache JAR that you need has to be specified on the classpath. You normally do this by:
    java -cp [classpath entries] [fully-qualified Java class name]
    Note that classpath entries can have multiple classpath items. These are separated by a colon (in Unix/Linux) or a semi-colon (Windows).
    Hope that helps.
    - Saish
    "My karma ran over your dogma." - Anon

  • Newbie with cdrom problems

    After installing the OS from cdrom, I cannot access the cdrom. The /usr/sbin/vold process is running. I cannot find the cdrom drivers in my dev directories. Where do I go to figure out what to do next?

    <pre><h5>
    ** not sure if this would help... </br>
    I've been nashing a problem with VOLD all day today..
    unfortunately, I'm not a guru with Solaris.. ;) Yet...
    </br>
    stop vold
    try manually mounting the cdrom
    </br>
    mount -f hsfs /dev/dsk/c0t2d0 /cdrom
    </br>
    you may have to use a different /dev/dsk combo and I've not figured
    out the c0t2d0 stuff completely yet or how to predict what it would
    be on different systems, or even if it would be different.
    </br>
    In anycase, I would definately like to know if you're able to mount
    manually after vold is stopped (that's what has solved my problem on
    four sun's from sparc's to e250 & e450)
    </br>
    try
    /etc/init.d/volmgt stop
    to stop vold.
    </br>
    if helps drop me a quick note...
    [email protected]
    TTFN !!
    </br>
    -Trebor
    </h5></pre>

  • Newbie with 2 problems

    Hi,
    I'm a newbie on DVDSP 3 trying to use stills for a project. There's one issue regarding this that I can't solve:
    I am trying to make the menu (background) go from black (a black image or DVDSP's option for black frames) via a slow dissolve transition into a still image. I have tried previously making a clip of this in FCP, iMovie, PhotoToMovie and Still Life, but the outcome has been really low quality in all cases. Doing it with still directly in DVDSP seems to be best.
    I have the options for transition set in the menu palette, starting with black and ending in the still, but no go.
    I have also made a slideshow of this and turned it into a track, but don't know how to bring that into the menu - if it's even possible.
    If someone can help regardless of the lousy description above, I would be very grateful.
    The second issue is that the button I placed in the menu doesn't get solid colors (I've used the Apple Panes_Navy50p). When simulating, half of the button is "miscolored". I am probably doing something stupid, but what?
    TIA for help.
    Dan

    We'll probably need more info. When you say...
    I am trying to make the menu (background) go from black
    (a black image or DVDSP's option for black frames)
    via a slow dissolve transition into a still image
    Do you mean "I want a menu that starts black, then gradually fades in the background menu image, and then my button options appear once the background has completely appeared"?
    If so, then you're better off doing it as you first described. You'd create the entire sequence in Final Cut or something else, export it as a QuickTime movie, then encode it to MPEG2, then import it as your background image for your menu. You'd set the menu's Loop point to where your background image has completely faded in: that's the point where your buttons will appear.
    You said you'd gotten "low quality" results when you tried doing this. Describe the issues with your results; also, describe how (or if) you converted your FCP clip to MPEG2. To get the best quality for this type of thing, you would NOT use a DV codec for your FCP sequence. You'd use one of the Apple Uncompressed codecs or the Animation codec... that way you get no compression of the image until you convert to MPEG2.
    Also, you'd be better off using FCP's Export->Using Compressor option to encode your fade-in into MPEG2.
    Can't help with the button as I rarely use the provided Apple Shapes. I'd recommend going with a different shape, or creating your own highlight with a black-on-white overlay graphic.

  • Newbie with software problem

    hi guys
    im new to this site and b/berry phones.
    after finally getting all my settings set up, i have a problem with desktop software...my phone backed up ok, but i cant use any media services...i keep getting this message:
    "media services are not available - media storage is not available - please check that a media card is installed correctly in your blacberry device and that mass storage mode is turned on"
    my settings are all correct, and ive even uninstalled the software and installed it again...still no joy.
    can anybody help please
    thanks in advance
    Solved!
    Go to Solution.

    well, media storage not available is pointing you to an external memory... which means a media card... have you inserted any...??
    .RoCkInG dUdE.
    Trust Your Technolust | Do not PM for any support
    If a solution received, please hit on to show your support.

  • Newbie: Soft Key Problem

    Hey
    Environment:
    Flash Lite 2
    ActionScript 2.0
    When I run this code in the "Generic Phone" emulator, I
    several times presses on the soft keys on the emulator... But the
    words "LEFT" or "RIGHT" isn't written to the Output-window. I
    wonder what in my code are causing this problem... Below is a copy
    of my code...
    // this ActionScript sets your content to be full screen
    fscommand2("FullScreen", true);
    gotoAndStop(1);
    fscommand2("SetSoftKeys", "<<<", ">>>");
    btn_1.onPress = function() {
    gotoAndStop(5);
    btn_2.onPress = function() {
    gotoAndStop(10);
    var myListener
    bject = new Object();
    myListener.onPress = function() {
    if (Key.getCode() == ExtendedKey.SOFT1) {
    trace("LEFT");
    } else if (Key.getCode() == ExtendedKey.SOFT2) {
    trace("RIGHT");
    Key.addListener(myListener);

    Ciao
    try
    myListener.onKeyDown = function()
    instead of
    myListener.onPress = function() {
    Alessandro

  • Newbie Servlet getParameter() Problem!

    Hi there i'm trying to upload a file to a tomcat webserver. I'm using the import com.oreilly.servlet.MultipartRequest and that seems to work fine.
    My problem is that i need to specify the directory to store the file by getting the users name.
    i'm trying to use request.getParameter(user) but this doesn't seem to work. if i get the parameter using the MultipartRequest that works but the problem is that o need to know the user name before i create the MultipartRequest. Heres a copy of my code. if anyone could help i'd REALLY appriciate it!!!
    import com.oreilly.servlet.MultipartRequest;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.*;
    public class fileupload extends HttpServlet
         public void doPost(HttpServletRequest request,HttpServletResponse response)
                       throws ServletException,IOException
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              try
                   String uname      = request.getParameter("user");
                   String pass      = request.getParameter("password");
                   MultipartRequest multi = new MultipartRequest(request, "C:\\tomcat\\webapps\\301\\galleries\\"+uname,10*1024*1024);
                         database db = new database();
                   db.setConnection(); 
                   if(db.login(uname,pass))
                        File uploadedFile = multi.getFile("file");
                        InputStream bis = new BufferedInputStream(new FileInputStream(uploadedFile));
                        bis.close();
    response.sendRedirect("http://localhost:8080/301/unpack_gallery.jsp?file="+uploadedFile.getName());
              catch(IOException ioe)
                   System.out.println(ioe);
    } Many Thanks Tom

    I'm not familiar with the MultipartRequest package but it seems that you cannot go
    easily with that. I think you have few options:
    1) use the MultipartRequest package and provide a temporary filename in constructor.
    Then get the user name and copy the file from the temporary directory to a appropriate
    place with a appropriate name (including the username).
    2) Or use jakarta commons file upload package which does the job for your.
    Take a look at http://jakarta.apache.org/commons/fileupload/

  • Newbie: ActionListener visibility problem

    Hello,
    i'm new to java, and i'm working on a simple small project.
    I've got a problem with the visability of an object.
    Maybe you have a look at my code:
    Used Class
    public class System1T1P extends xyz {
    public void switchOn() {
    // Important READ HERE
    // Important READ HERE
    // Important READ HERE
    System.out.print("old"); // for debug
    // Important READ HERE
    // Important READ HERE
    // Important READ HERE
    public void start() {
    public void update() {
    // has to be implementated
    class TimerListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                 update();
    Timer oTimer = new javax.swing.Timer(1000, new TimerListener());
    }Main Class
    public class GUI_1T1P extends GUI_General {
         // System
         private System1T1P oSys1T1P = new System1T1P() {
              public void update() {
              public void switchOn() {
                   // Important READ HERE
                   // Important READ HERE
                   // Important READ HERE
                   System.out.print("mimi"); // for debug it returns something else
                   // Important READ HERE
                   // Important READ HERE
                   // Important READ HERE
         // Screen Size
         GraphicsEnvironment oGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
         Rectangle oRectangle_ScreenSize = oGraphicsEnvironment.getMaximumWindowBounds();
         // Gui
         JFrame oJFrame;
         JButton oJButton_exit;
         JButton oJButton_on;
         JButton oJButton_running;
         GC_1T1P oGC_1T1P;
         public GUI_1T1P() {
              // Important READ HERE
              // Important READ HERE
              // Important READ HERE
              oSys1T1P.switchOn(); // Returns "mimi" to out
              // Important READ HERE
              // Important READ HERE
              // Important READ HERE
              oJFrame = new JFrame("System 1T1P");
              oJFrame.getContentPane().setLayout(null);
              oJFrame.addWindowListener(new WindowListener() {
                   public void windowClosed(WindowEvent arg0) {}
                   public void windowActivated(WindowEvent e) {}
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
                   public void windowDeactivated(WindowEvent e) {}
                   public void windowDeiconified(WindowEvent e) {}
                   public void windowIconified(WindowEvent e) {}
                   public void windowOpened(WindowEvent e) {}
              oJButton_exit = new JButton("Hide");
              oJButton_exit.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent arg0) {
                        hide(); // works without problems
              oJButton_on = new JButton("Activate");
              oJButton_on.addActionListener( new ActionListener() {
                   public void actionPerformed(ActionEvent arg0) {
                        // IMPORTANT This is the Problem
                        GUI_1T1P.this.oSys1T1P.switchOn(); // returns "old" instead of "mimi"
                        // seems to be a completely diffrent instance of oSys1T1P
                        // oSys1T1P.switchOn(); // returns also "old"
              oJButton_running = new JButton("Run");
              oJButton_running.addActionListener( new ActionListener() {
                   public void actionPerformed(ActionEvent arg0) {
                        // IMPORTANT This is the Problem
                        GUI_1T1P.this.oSys1T1P.start(); // also uses the wrong instance
                        // oSys1T1P.start(); // also uses the wrong instance
              // set positions
              // add elements to window
              // finalize
              oJFrame.pack();
              // init window
         public void hide() {
              oJFrame.setVisible(false);
    }maybe its easy to you but i'm researching for it about two days ...
    thank you for reading and answering.
    Nem

    okay then i ask it in the short way
    public class MyClass extends AbstractClass {
        // System
        private AnyClass objectOfAnyClass = new AnyClass() {       
            public void aFunction() { // this is a redefined function
                 System.out.print("new output"); //This was System.out.print("old output"); before
    void bFunc() {
       objectOfAnyClass.aFunction(); //By calling aFunction here it prints "new output"
            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent arg0) {
                     objectOfAnyClass.aFunction(); // if i call it from here it prints "old output"
    // Part where al is used
    }  My question is simply: why does it print "old output" inside of the actionlistener?
    Thanks and sorry ;(
    Edited by: Nemcija on Nov 12, 2008 5:53 AM

  • Newbie - adf menu Problem

    Hi,
    a i'm facing a new problem binding Menu Generated from adfc-config.xml. My menu XML like this:
    <?xml version="1.0" encoding="windows-1250" ?>
    <menu xmlns="http://myfaces.apache.org/trinidad/menu">
    <itemNode id="itemNode_page1" label="Page 1" action="adfMenu_page1" focusViewId="/page1">
    <itemNode id="itemNode_page11" label="Page 1.1" action="adfMenu_page11" focusViewId="/page11"/>
    <itemNode id="itemNode_page12" label="Page 1.2" action="adfMenu_page12" focusViewId="/page12"/>
    </itemNode>
    <itemNode id="itemNode_page2" label="Page 2" action="adfMenu_page2" focusViewId="/page2">
    <itemNode id="itemNode_page21" label="Page 2.1" action="adfMenu_page21" focusViewId="/page21"/>
    </itemNode>
    <itemNode id="itemNode_page3" label="label_page3" action="adfMenu_page3"
    focusViewId="/page3"/>
    </menu>
    In my page template i put navigationPane with commandNavigationItem. When i ran page instead of getting label i get {menuItem.label} for each level 0.
    Here is code of my page:
    <af:panelGroupLayout layout="scroll"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    id="pt_pgl5">
    <af:navigationPane id="pt_np1" hint="buttons" var="menuInfo"
    value="#{root_menu}">
    <f:facet name="nodeStamp">
    <af:commandNavigationItem text="{menuInfo.Label}"
    id="pt_cni1" action="{menuInfo.doAction}" destination="{menuInfo.destination}" />
    </f:facet>
    </af:navigationPane>
    </af:panelGroupLayout>
    Please help to resolve why i am getting {menuItem.label} instead of label from xml file. When i click any position from menu browser is trying to get {menuItem.destination} instead of, example, page1.
    Thanks

    Ok this problem with Labels. Now i Can see Labels, however doAction works only for last item from menu and in page jspx file i got wornings:
    Reference #{menuInfo.label} not found
    Reference #{menuInfo.doAction} not found
    Reference #{menuInfo.destination} not found
    After doing some tests i found that navigation works only for last element. When I add new element, redirection works only for that element, and stops working element which were last previous.
    Any ideas what i have done wrong in code?
    Thanks

Maybe you are looking for