Issue with JSPs with inner classes (bug)

FYI:
Turning on Versioning in the registry (Disable=0) JSPs with inner classes causes the following IllegalAccessException...
This has been confirmed with SP3 and SP4 with our testing...
14/Jan/2002 13:26:24:4] error: Exception: SERVLET-run_failed: Failed in running template: /NASApp/fortune/foo.jsp, java
lang.IllegalAccessError: try to access class jsp.APPS.fortune.foo$foobar from class jsp.APPS.fortune.foo
xception Stack Trace:
ava.lang.IllegalAccessError: try to access class jsp.APPS.fortune.foo$foobar from class jsp.APPS.fortune.foo
at jsp.APPS.fortune.foo._jspService(foo.java:78)
at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
at com.netscape.server.servlet.servletrunner.ServletRunner.callJSP(Unknown Source)
at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callJspCompiler(Unknown Source)
at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUri(Unknown Source)
at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUriRestrictOutput(Unknown Source)
at com.netscape.server.servlet.platformhttp.PlatformRequestDispatcher.forward(Unknown Source)
at com.netscape.server.servlet.jsp.JSPRunner.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)
Looking for work around....
Cheers,
Martin Gee

I do not see why you would use two sorts.
And what is the issue exactly by the way? Errors?
So, the records before the Merge Join need to come sorted, to achieve this simply tick:
Arthur My Blog

Similar Messages

  • Problems with inner classes in JasminXT

    I hava problems with inner classes in JasminXT.
    I wrote:
    ;This is outer class
    .source Outer.j
    .class Outer
    .super SomeSuperClass
    .method public createrInnerClass()V
         .limit stack 10
         .limit locals 10
         ;create a Inner object
         new Outer$Inner
         dup
         invokenonvirtual Outer$Inner/<init>(LOuter;)V
         ;test function must print a Outer class name
         invokevirtual Outer$Inner/testFunction ()V
    .end method
    ;This is inner class
    .source Outer$Inner.j
    .class Outer$Inner
    .super java/lang/Object
    .field final this$0 LOuter;
    ;contructor
    .method pubilc <init>(LOuter;)V
         .limit stack 10
         .limit locals 10
         aload_0
         invokenonvirtual Object/<init>()V
         aload_0
         aload_1
         putfield Inner$Outer/this$0 LOuter;
         return
    .end method
    ;test
    .method public testFunction ()V
         .limit stack 10
         .limit locals 10
         ;get out object
         getstatic java/io/PrintStream/out  java/io/PrintStream;
         aload_0
         invokevirtual java/lang/Object/getClass()java/lang/Class;
         ;now in stack Outer$Inner class
         invokevirtual java/Class/getDeclaringClass()java/lang/Class;
         ;but now in stack null
         invokevirtual java/io/PrintStream/print (Ljava/lang/Object;)V
    .end methodI used dejasmin. Code was equal.
    What I have to do? Why getDeclatingClass () returns null, but in dejasmin code
    it returns Outer class?

    Outer$Inner naming convention is not used by JVM to get declaring class.
    You need to have proper InnerClasses attribute (refer to http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#79996)
    in the generated classes. Did you check using jclasslib or another class file viewer and verified that your .class files have proper InnerClasses attribute?

  • Strange behaviour of JBuilder Plug-In with Inner class

    Hi, I'm using the Kodo 2.5.2 Plug-In with JBuilder 8. I have an inner
    persistent class. It seems that it is necessary to have a zero length file
    named EnclosingClass$InnerClass.java for the build process to work, since
    if I delete this file and run the application it throws an exception
    saying that the Inner class has not an specified field which it really
    has. I don't know if this is a bug of the Kodo implementation or of the
    JBuilder Plug-In.
    Thanks for any help.
    Jaime.

    This is one of the limitations of the JBuilder plugin. Hopefully it
    will be resolved in the next iteration of our plugins for 3.x.
    Jaime De La Jara F. wrote:
    Hi, I'm using the Kodo 2.5.2 Plug-In with JBuilder 8. I have an inner
    persistent class. It seems that it is necessary to have a zero length file
    named EnclosingClass$InnerClass.java for the build process to work, since
    if I delete this file and run the application it throws an exception
    saying that the Inner class has not an specified field which it really
    has. I don't know if this is a bug of the Kodo implementation or of the
    JBuilder Plug-In.
    Thanks for any help.
    Jaime.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Error with inner Classes

    I've a Swing app in wich I've the following code :
    final ComboBoxEditor editor = comboBox.getEditor();
    editor.getEditorComponent().addKeyListener(new java.awt.event.KeyAdapter() {
    public void keyReleased(KeyEvent e) {
    combo_keyReleased(e,editor);
    Runned in a normal way it works, runned via Webstart 1.4.2 it gives me :
    java.lang.ClassFormatError: it/axioma/basic/application/templates/ClWidgetCombo$2 (Illegal Variable name " val$editor")
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.defineClass(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.access$100(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
    etc...
    Could someone explain me why ?
    Is there any workaround ?
    TIA
    Tullio

    There seems to be a problem using final variables with anonymous inner classes under a different classloader, see http://forum.java.sun.com/thread.jsp?forum=38&thread=372291

  • Problems importing a class with inner class

    Why can't I import a class so that I can use an (inner) static member class without naming the enclosing class. Put simply, I have:
    file C:\MyJava\Test\A:
    public class A {
      public static class B { }
    }file C:\MyJava\Test\C
    import A.*;
    public class C { }When I try to compile C (javac -classpath C:\MyJava\Test;. C.java) it fails with C.java:1: package A does not exist

    Class A must be in a package if you wish to import it. If you want to use the inner class, just import somepackage.A. You could then refer to A.B...
    HTH :o)

  • Performance issue with editing classes in 2011

    Maybe this is just an install issue, but....
    In LV 2011, if I attempt to edit the data of an established class (i.e. it has accessors, etc) then I get the Windows 7 whirling cursor indicating that the class is updating; sometimes this takes several minutes for the changes to be applied while other times the system just hangs and I eventually have to kill LV thus creating a hideously time wasting cycle in where I once again attempt to make changes to the class, it hangs, ad infinitum.  Has anyone else seen this?  Is there a work around?
    Cheers, Matt
    Matt Richardson
    Certified LabVIEW Developer
    MSR Consulting, LLC

    No.  I am saying that this is not associated with a project.  A class does not have to be associated with a project.  If you open a .lvclass file you will get a window that looks like a library window where, similar to the library, everything contained in the class namespace will be found.
    I am running LV 2011 on a 32-bit Windows 7 machine with a dual core i5 (2.53 GHz) and 4 Gb of ram.  Performance wise, I am having no issues with any other aspects of LV 2011 (strike that - it does seem to crash more than I desire).  As I said in the above post, this seems to be an issue only when I am trying to change things such as names in a space other than the properties dialog box. 
    I suspect this might be associated with the installation, but I am not positive.  I have attached two classes if you are interested in playing with them.  Basically, I was only trying to change the type and name of the variable tscan in the SMPS class (I included the CPC class due to the dependency of the SMPS, but I am afraid there may be some other dependencies that I can not immediately see).
    Cheers, m
    Matt Richardson
    Certified LabVIEW Developer
    MSR Consulting, LLC
    Attachments:
    DMA Proj.zip ‏506 KB

  • Issue with GregorianCalendar class

    Hi I'm having issues with the GregorianCalender class. I am trying to enable daylight savings time but it doesn't seem to be working properly for. As a test I have taken the difference of time (in milliseconds) between a date where daylight savings causes a shift in time (April 4, 2004 for example). The two sample dates I have chosen are April 5, 2004 and April 4, 2004, ideally the time difference should be 23 hrs (since one hour is lost due to daylight savings) but I am getting 24hrs. I have a sample program in C++ which gives me the correct answer so I know the result am I getting here is wrong. Anybody have any suggestions?
    String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
         if (ids.length == 0)
         System.exit(0);
         // create a Pacific Standard Time time zone
         SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
         // set up rules for daylight savings time
         pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 60 * 60 * 1000, true);
         pdt.setEndRule(Calendar.OCTOBER, 31, Calendar.SUNDAY, 60 * 60 * 1000, false);
         pdt.setDSTSavings( 60*60*1000 );
         GregorianCalendar cal = new GregorianCalendar(2004, 4, 4);
         GregorianCalendar cal1 = new GregorianCalendar(2007, 4, 5);
         cal1.setTimeZone ( pdt );
         cal.setTimeZone( pdt );
    //This values is incorrect
         long diff = cal1.getTimeInMillis() - cal.getTimeInMillis();     
    //I have also tried the following
    String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
         if (ids.length == 0)
         System.exit(0);
         // create a Pacific Standard Time time zone
         SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
         // set up rules for daylight savings time
         pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 60 * 60 * 1000, true);
         pdt.setEndRule(Calendar.OCTOBER, 31, Calendar.SUNDAY, 60 * 60 * 1000, false);
         pdt.setDSTSavings( 60*60*1000 );
         GregorianCalendar cal = new GregorianCalendar(pdt);
         GregorianCalendar cal1 = new GregorianCalendar(pdt);
         cal1.set(2004, 4, 5 );
         cal.set( 2004, 4, 4 );
    //This values is incorrect
         long diff = cal1.getTimeInMillis() - cal.getTimeInMillis();     
    Thanks

    There may be any of several issues:
    Daylight savings time moves from year to year. Maybe last year, it was not on the same week number.
    Daylight savings time officially occurs at 2am. Java date's default to midnight if explicitly initialized. So, try calculating from after 2-3 am, depending on which way time was shifted.- Saish
    "My karma ran over your dogma." - Anon

  • JNDI issue with OracleOCIConnectionPool class

    I have recently installed the Oracle 9i client on a Solaris 8 server to take advantage of the OCI connection pool. I have succesfully created and used the pooling class. I am able to bind the OCI Pool with JNDI without any problems, however, when I perform a lookup on the OCI pool name, I do not seem to get the same object back that is bound. It appears that a new pool is created with every lookup. I know this becuase I watch the open sessions on my oracle server increase by OCIpool.minSize after every call to the context lookup. The server that I am using is Jrun4 and the code is as follows:
    OracleOCIConnectionPool ocipool = new OracleOCIConnectionPool();
    ocipool.setPoolConfig(poolProp);
    initialContext.bind("ociPool", ocipool);
    //at this point there are 5 existing sessions
    OracleOCIConnectionPool newPool = initialContext.lookup("ociPool"));
    //at this point there are 10 existing sessions
    System.out.println( initialContext.lookup("ociPool"));
    //at this point there are 15 existing sessions
    I am completely lost as to why the sessions continue to grow. I have never had this issue with JNDI before. It appears that a new OracleOCIConnectionPool is being created with each lookup, instead of the original pool being used. Any insight is greatly appreciated.

    Hello ,
    Development class/Package is used to save a group of related objects .
    For ex: All MM reports can  use ZMM_XXXX dev class ....
    So check  the module in which u r report / table or Object comes into and provide the respecitve dev class.
    U can also check in TDEVC table to find out the related dev class  .
    Regards

  • Problems with inner classes

    I ran into the following problems when I tried to read into an inner class:
    This is my .jdo file
    <?xml version="1.0"?>
    <jdo>
    <package name="com.globalrefund.jdo.mna">
    <class name="Parameter$Syspar" objectid-class="SysparId">
    <extension vendor-name="kodo" key="table" value="syspar"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="landescode" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="landescode"/>
    </field>
    <field name="waehrungscode">
    <extension vendor-name="kodo" key="data-column"
    value="waehrungscode"/>
    </field>
    </class>
    </package>
    </jdo>
    1.) appidtool does not work for this inner class, I get this stack trace
    C:\users\Bernhard\jbProject\refundManual>appidtool
    src\com\globalrefund\jdo\mna\Parameter$Syspar.jdo
    Generating an application id for type "class
    com.globalrefund.jdo.mna.Parameter$Syspar"...
    Exception in thread "main" java.lang.NullPointerException
    at com.solarmetric.kodo.enhance.ApplicationIdTool.getFile(Unknown
    Source)
    at
    com.solarmetric.kodo.enhance.ApplicationIdTool.writeApplicationId(Unknown
    Source)
    at
    com.solarmetric.kodo.enhance.ApplicationIdTool.writeApplicationId(Unknown
    Source)
    at com.solarmetric.kodo.enhance.ApplicationIdTool.main(Unknown
    Source)
    2.) I tried to use a hand coded inner class as ID class, but id did not work
    (is this not possible ?)
    Exception in thread "main" java.lang.NoSuchMethodError:
    com.globalrefund.jdo.mna.Parameter$SysparId: method <init>()V not found
    at
    com.globalrefund.jdo.mna.Parameter$Syspar.jdoNewObjectIdInstance(Parameter.j
    ava)
    at
    javax.jdo.spi.JDOImplHelper.newObjectIdInstance(JDOImplHelper.java:166)
    at com.solarmetric.kodo.util.ObjectIds.fromPKValues(Unknown Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.createFromResultSet(
    Unknown Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager$2.getResultObject(Un
    known Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.instantiateRow(Unknown
    Source)
    at com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.get(Unknown
    Source)
    at java.util.AbstractList$Itr.next(AbstractList.java:416)
    at com.solarmetric.kodo.runtime.ResultListIterator.next(Unknown
    Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(Un
    known Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(Unknown
    Source)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(Unknown
    Source)
    at com.solarmetric.kodo.query.QueryImpl.executeWithMap(Unknown
    Source)
    at com.solarmetric.kodo.query.QueryImpl.execute(Unknown Source)
    at
    com.solarmetric.kodo.query.QueryImpl$SynchronizedQuery.execute(Unknown
    Source)
    at com.globalrefund.jdo.mna.Parameter.<init>(Parameter.java:71)
    3.) It worked after I moved the ID class into a separate class
    Regards,
    Bernhard

    1.) appidtool does not work for this inner class, I get this stack traceThis is a bug. It will be corrected in the final release of 2.3, due out
    Real Soon Now. Thanks for catching this!
    2.) I tried to use a hand coded inner class as ID class, but id did not work
    (is this not possible ?)
    Exception in thread "main" java.lang.NoSuchMethodError:
    com.globalrefund.jdo.mna.Parameter$SysparId: method <init>()V not foundThis exception is saying that your application ID class does not have a
    no-args constructor. Make sure the id class is a static inner class;
    otherwise Java transparently adds a parent object parameter to each
    constructor, and so the application id class will violoate the JDO constraint
    of having a no-args constructor.

  • Null pointer exception with inner class

    Hi everyone,
    I've written an applet that is an animation of a wheel turning. The animation is drawn on a customised JPanel which is an inner class called animateArea. The main class is called Rotary. It runs fine when I run it from JBuilder in the Applet Viewer. However when I try to open the html in internet explorer it gives me null pointer exceptions like the following:
    java.lang.NullPointerException      
    at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2761)      
    at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2722)      
    at Rotary$animateArea.paintComponent(Rotary.java:251)      
    at javax.swing.JComponent.paint(JComponent.java:808)      
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)      
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)      
    at javax.swing.JComponent._paintImmediately(JComponent.java:4668)      
    at javax.swing.JComponent.paintImmediately(JComponent.java:4477)      
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)      
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)      
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)      
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)      
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)      
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)      
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)      
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)      
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Do inner classes have to be compiled seperately or anything?
    Thanks a million for you time,
    CurtinR

    I think that I am using the Java plugin ( Its a computer in college so I'm not certain but I just tried running an applet from the Swing tutorial and it worked)
    Its an image of a rotating wheel and in each sector of the wheel is the name of a person - when you click on the sector it goes red and the email window should come up (that doesn't work yet though). The stop and play buttons stop or start the animation. It is started by default.
    This is the code for the applet:
    import java.applet.*;
    import javax.swing.JApplet;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.awt.image.*;
    import java.util.StringTokenizer;
    import java.net.*;
    public class Rotary extends JApplet implements ActionListener, MouseListener
    public boolean rotating;
    private Timer timer;
    private int delay = 1000;
    private AffineTransform transform;
    private JTextArea txtTest; //temp
    private Container c;
    private animateArea wheelPanel;
    private JButton btPlay, btStop;
    private BoxLayout layout;
    private JPanel btPanel;
    public Image wheel;
    public int currentSector;
    public String members[];
    public int [][]coordsX, coordsY; //stores sector no. and x or y coordinates for that point
    final int TOTAL_SECTORS= 48;
    //creates polygon array - each polygon represents a sector on wheel
    public Polygon polySector1,polySector2,polySector3, polySector4, polySector5,polySector6,polySector7,polySector8,polySector9,polySector10,
    polySector11,polySector12,polySector13,polySector14,polySector15,polySector16,polySector17,polySector18,polySector19,polySector20,
    polySector21,polySector22,polySector23,polySector24,polySector25,polySector26,polySector27,polySector28,polySector29,polySector30,
    polySector31,polySector32,polySector33,polySector34,polySector35,polySector36,polySector37,polySector38,polySector39,polySector40,
    polySector41,polySector42,polySector43,polySector44,polySector45,polySector46,polySector47,polySector48;
    public Polygon polySectors[]={polySector1,polySector2,polySector3, polySector4, polySector5,polySector6,polySector7,polySector8,polySector9,polySector10,
                      polySector11,polySector12,polySector13,polySector14,polySector15,polySector16,polySector17,polySector18,polySector19,polySector20,
                      polySector21,polySector22,polySector23,polySector24,polySector25,polySector26,polySector27,polySector28,polySector29,polySector30,
                      polySector31,polySector32,polySector33,polySector34,polySector35,polySector36,polySector37,polySector38,polySector39,polySector40,
                      polySector41,polySector42,polySector43,polySector44,polySector45,polySector46,polySector47,polySector48};
    public void init()
    members = new String[TOTAL_SECTORS];
    coordsX= new int[TOTAL_SECTORS][4];
    coordsY= new int[TOTAL_SECTORS][4];
    currentSector = -1;
    rotating = true;
    transform = new AffineTransform();
    //***********************************Create GUI**************************
    wheelPanel = new animateArea(); //create a canvas where the animation will be displayed
    wheelPanel.setSize(600,580);
    wheelPanel.setBackground(Color.yellow);
    btPanel = new JPanel(); //create a panel for the buttons
    btPanel.setLayout(new BoxLayout(btPanel,BoxLayout.Y_AXIS));
    btPanel.setBackground(Color.blue);
    btPanel.setMaximumSize(new Dimension(30,580));
    btPanel.setMinimumSize(new Dimension(30,580));
    btPlay = new JButton("Play");
    btStop = new JButton("Stop");
    //txtTest = new JTextArea(5,5); //temp
    btPanel.add(btPlay);
    btPanel.add(btStop);
    // btPanel.add(txtTest); //temp
    c = getContentPane();
    layout = new BoxLayout(c,layout.X_AXIS);
    c.setLayout(layout);
    c.add(wheelPanel); //add panel and animate canvas to the applet
    c.add(btPanel);
    wheel = getImage(getDocumentBase(),"rotary2.gif");
    getParameters();
    for(int k = 0; k <TOTAL_SECTORS; k++)
    polySectors[k] = new Polygon();
    for(int n= 0; n<4; n++)
    polySectors[k].addPoint(coordsX[k][n],coordsY[k][n]);
    btPlay.addActionListener(this);
    btStop.addActionListener(this);
    wheelPanel.addMouseListener(this);
    startAnimation();
    public void mouseClicked(MouseEvent e)
    if (rotating == false) //user can only hightlight a sector when wheel is not rotating
    for(int h= 0; h<TOTAL_SECTORS; h++)
    if(polySectors[h].contains(e.getX(),e.getY()))
    currentSector = h;
    wheelPanel.repaint();
    email();
    public void mouseExited(MouseEvent e){}
    public void mouseEntered(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
    public void mousePressed(MouseEvent e){}
    public void email()
    try
    URL rotaryMail = new URL("mailto:[email protected]");
    getAppletContext().showDocument(rotaryMail);
    catch(MalformedURLException mue)
    System.out.println("bad url!");
    public void getParameters()
    StringTokenizer stSector;
    String parCoords;
    for(int i = 0; i <TOTAL_SECTORS; i++)
    {               //put member names in applet parameter list into an array
    members[i] = getParameter("member"+i);
    //separate coordinate string and store coordinates in 2 arrays
    parCoords=getParameter("sector"+i);
    stSector = new StringTokenizer(parCoords, ",");
    for(int j = 0; j<4; j++)
    coordsX[i][j] = Integer.parseInt(stSector.nextToken());
    coordsY[i][j] = Integer.parseInt(stSector.nextToken());
    public void actionPerformed(ActionEvent e)
    wheelPanel.repaint(); //repaint when timer event occurs
    if (e.getActionCommand()=="Stop")
    stopAnimation();
    else if(e.getActionCommand()=="Play")
    startAnimation();
    public void startAnimation()
    if(timer == null)
    timer = new Timer(delay,this);
    timer.start();
    else if(!timer.isRunning())
    timer.restart();
    Thanks so much for your help!

  • Please need help with Inner Classes

    Hi! I have the following inner class, but it is not an "explicit" inner class:
    import java.util.*;
    public class EXTERIOR_NOEXPLICITA {
         private Vector i;
         public void llena_Vector(int a){
              i = new Vector();
              for(int z=0;z<=a;z++)
                   i.addElement(""+z);
         public Enumeration test() {
              return new Enumeration(){
                   int item = i.size()-1;
                   public boolean hasMoreElements(){
                        return(item >= 0);
                   public Object nextElement(){
                        if(!hasMoreElements())
                             throw new NoSuchElementException();
                        else
                             return i.elementAt(item--);
    My question is, how can I put it in an explicyt inner class?
    Plese help me! =)
    Raul

    I am not entirely sure what you mean by explicit inner class. If you mean converting your anonymous class into a nested class, then it is quite easy:
    import java.util.*;
    public class EXTERIOR_NOEXPLICITA {
      private Vector i;
      public void llena_Vector(int a) {
        i = new Vector();
        for (int z = 0; z <= a; z++)
          i.addElement("" + z);
      private final class MyEnumeration implements Enumeration {
        int item = i.size() - 1;
        public boolean hasMoreElements() {
          return (item >= 0);
        public Object nextElement() {
          if (!hasMoreElements())
            throw new NoSuchElementException();
          else
            return i.elementAt(item--);
      public Enumeration test() {
        return new MyEnumeration();

  • Trouble with inner class

    jDeveloper 10.1.3.0.4
    i want to see the var Variable into a inner class
    public class myClass extends JFrame{
    int Variable;
    myClass(){
    fuction1();
    private fuction1(){
    jlogonOptionPane.addPropertyChangeListener(new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
    // here, i wan to use Variable
    }// fuction1
    }// myclass
    why i cant see varible into propertyChange ?

    Hi,
    your code isn't complete and misses the jlogonOptionPane definition. If you use
    package adf.sample.view;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    public class MyClass extends JFrame{
    private int mvariable = 2;
    MyClass(){
    function1();
    private void function1(){
    JOptionPane jlogonOptionPane = new JOptionPane();
    jlogonOptionPane.addPropertyChangeListener(new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent e) {
    // here, i wan to use Variable
    }// fuction1
    }// myclass
    set the curser after
    // here, i wan to use Variable
    - hold the ctrl key and press the blank key
    - type mv and you will se mvariable
    Frank

  • Clearing weak references with inner classes

    I have a class which contains several inner classes. During it's lifetime, this object creates several instances of it's internal objects and uses them only internally.
    I also have a single weak reference that links to my object from anywhere external to the program.
    While profiling, I discovered a memory leak. After examining the core dump under jhat, it appears that the only objects linking to this object are that weak reference from the external program and several intantiated inner classes that reference my object via their implicit this$0 field.
    Is this possible? Does mixing inner classes and weak references stop the garbage collector from reclaiming classes?

    Based on the information you provide, I question your assertion that these inner objects are used only internally. The most obvious explanation is that you're leaking them and something else is holding a hard reference to them.

  • Issue with Java Class based DataControls.

    Hi,
    I'm actually working with JDev 11.1.1.3.0.
    And we got a requirement to build a search page which should create a dynamic query. And we are not using ADF BC in this project.
    Instead, writing some ServiceDelegates(Java Classes) which internally calls EJB services to do CRUD operations.
    Finally, created DataControls using these Service Delegates to design UI.
    Now one thing is clear that .... we are using java class based service delegates.
    *Issues
    =======
    1. I have a table with 4 columns, in which 2 columns are of type selectOneChoice.
    2. Now, based on first selectOneChoice selection ... second selectOneChoice should display corresponding values. It is something like this. First select one choice contains all KEYS. Based on the KEY selection second select OneChoice should display VALUES corresponding to the KEY.
    3. I have around 20 KEYS in the first selectOneChoice.
    4. User can add rows to the table as many as they want.
    5. For each row, the first selectOneChoice is same(contains same keys).
    The issue is, For the first time(when user logs into the screen ....) the table will be displayed with one row which contains 2 selectOnechoices and 2 inputText boxes and a ADD button at the end of each row.
    1. User selected a KEY from first selectOneChoice. Hence, second selectOneChoice populates values corressponding to KEY. And user clicked on ADD button.
    2. Now the first row was like that only. And a new Row got added to the table.
    3. In the second row ... Now user selected a different KEY in first selectOneChoice. And the second selctOneChoice displayed values corresponding to KEY selected.
    4. This is also fine. But now, when user tried to click on ADD button to add THIRD ROW ... the table got added with a new row.
    5. Here is the problem.... From here onwards, whenever any new row get added to the table ... the first row's second selectOneChoice values are setting with values of second row's secondSelectOneChoice.
    6. Finally ... what i'm trying to do is, the second selectOneChoice should not get affected/refreshed because of adding a new row.
    If it is not clear ... please share your email address. I can share the sample code with you.
    This is an high priority task given to me.
    Please let me know your comments ASAP.
    Thanks & Regards,
    Kiran Konjeti

    You could try the following to see where the class was loaded from.
    System.out.println(ResourcesAndRatesForm.class.getProtectionDomain().getCodeSource());

  • Issue with a class extending EventHandler MouseEvent

    Hello all,
    I originally had a nested class that was a used for mouseEvents. I wanted to make this it's own class, so I can call it directly into other class objects I have made, but for some reason it isn't working and I'm getting an eror
    here is the code:
    public class MouseHandler implements EventHandler<MouseEvent>
        private double sceneAnchorX;
        private double sceneAnchorY;
        private double anchorAngle;
        private Parent parent;
        private final Node nodeToMove ;
       MouseHandler(Node nodeToMove)
           this.nodeToMove = nodeToMove ;
        @Override
        public void handle(MouseEvent event)
          if (event.getEventType() == MouseEvent.MOUSE_PRESSED)
            sceneAnchorX = event.getSceneX();
            sceneAnchorY = event.getSceneY();
            anchorAngle = nodeToMove.getRotate();
            event.consume();
          else if (event.getEventType() == MouseEvent.MOUSE_DRAGGED)
              if(event.isControlDown())
                  nodeToMove.setRotationAxis(new Point3D(sceneAnchorY,event.getSceneX(),0));
                  nodeToMove.setRotate(anchorAngle + sceneAnchorX -  event.getSceneX());
                  sceneAnchorX = event.getSceneX();
                  sceneAnchorY = event.getSceneY();
                  anchorAngle = nodeToMove.getRotate();
                  event.consume();
              else
                double x = event.getSceneX();
                double y = event.getSceneY();
                nodeToMove.setTranslateX(nodeToMove.getTranslateX() + x - sceneAnchorX);
                nodeToMove.setTranslateY(nodeToMove.getTranslateY() + y - sceneAnchorY);
                sceneAnchorX = x;
                sceneAnchorY = y;
                event.consume();
          else if(event.getEventType() == MouseEvent.MOUSE_CLICKED)
            //  nodeToMove.setFocusTraversable(true);
               nodeToMove.requestFocus();
               event.consume();
                         nodeToMove.setOnKeyPressed((KeyEvent)
    ->{
         if(KeyCode.UP.equals(KeyEvent.getCode()))
             nodeToMove.setScaleX(nodeToMove.getScaleX()+ .1);
             nodeToMove.setScaleY(nodeToMove.getScaleY()+ .1);
             nodeToMove.setScaleZ(nodeToMove.getScaleZ()+ .1);
             System.out.println("kaw");
             KeyEvent.consume();
         if(KeyCode.DOWN.equals(KeyEvent.getCode()))
             if(nodeToMove.getScaleX() > 0.15)
             nodeToMove.setScaleX(nodeToMove.getScaleX()- .1);
             nodeToMove.setScaleY(nodeToMove.getScaleY()- .1);
             nodeToMove.setScaleZ(nodeToMove.getScaleZ()- .1);
             System.out.println(nodeToMove.getScaleX());
             KeyEvent.consume();
         nodeToMove.setOnScroll((ScrollEvent)
                 ->{
             if(nodeToMove.isFocused())
                        if(ScrollEvent.getDeltaY() > 0)
                            nodeToMove.setTranslateZ(10+nodeToMove.getTranslateZ());
                        else
                            nodeToMove.setTranslateZ(-10+nodeToMove.getTranslateZ());
           ScrollEvent.consume();
    }This is the class where I call it.
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.Pane;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.PhongMaterial;
    import javafx.scene.shape.Box;
    * @author Konrad
    public class Display extends Pane
        Box b;
        PhongMaterial pm = new PhongMaterial(Color.GRAY);
        public Display(Double x, Double y,Double width, Double height)
             super();
             b = new Box(width, height,10);
             setPrefSize(width,height);
             relocate(x, y);
             b.setMaterial(pm); 
             b.addEventFilter(MouseEvent.ANY, new MouseHandler(this));
             getChildren().add(b);
    }There is no red dot stating the class doesn't exist, or anything is wrong, but when I run it I get an error.
    here is the error:
    C:\Users\Konrad\Documents\NetBeansProjects\3D\src\3d\Display.java:29: error: cannot find symbol
             b.addEventFilter(MouseEvent.ANY, new MouseHandler(this));
      symbol:   class MouseHandler
      location: class DisplayThis is another class from the one that it was originally "nested" in(sorry if I'm not using correct terms). The other class, as well as this, produce the same error(this one was just smaller and eaiser to use as an example).
    The code is exactly the same.
    Originally I thought that the MouseEvent class wasn't an FX class, so I switched it and thought it worked, tried it on the Display class it didn't, tried it on the first one and yeah still didn't, so not too sure what happened there :(.
    Thanks,
    ~KZ
    Edited by: KonradZuse on Jun 7, 2013 12:15 PM
    Edited by: KonradZuse on Jun 7, 2013 12:38 PM
    Edited by: KonradZuse on Jun 7, 2013 12:39 PM

    Last time that was the issue I was having for a certain case; however this seems to be different, here is the list of imports for each class.
    MouseHandler:
    import javafx.event.EventHandler;
    import javafx.geometry.Point3D;
    import javafx.scene.Node;
    import javafx.scene.Parent;
    import javafx.scene.input.KeyCode;
    import javafx.scene.input.MouseEvent;Display:
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.Pane;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.PhongMaterial;
    import javafx.scene.shape.Box;draw:
    import java.io.File;
    import java.sql.*;
    import javafx.application.Application;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.event.ActionEvent;
    import javafx.geometry.Rectangle2D;
    import javafx.scene.Group;
    import javafx.scene.PerspectiveCamera;
    import javafx.scene.PointLight;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.ListCell;
    import javafx.scene.control.ListView;
    import javafx.scene.control.Menu;
    import javafx.scene.control.MenuBar;
    import javafx.scene.control.MenuItem;
    import javafx.scene.control.TextField;
    import javafx.scene.input.ClipboardContent;
    import javafx.scene.input.DataFormat;
    import javafx.scene.input.DragEvent;
    import javafx.scene.input.Dragboard;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.input.TransferMode;
    import javafx.scene.layout.GridPane;
    import javafx.scene.layout.Pane;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.PhongMaterial;
    import javafx.scene.shape.TriangleMesh;
    import javafx.stage.FileChooser;
    import javafx.stage.FileChooser.ExtensionFilter;
    import javafx.stage.Screen;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    import jfxtras.labs.scene.control.window.Window;
    import org.controlsfx.dialogs.Action;
    import org.controlsfx.dialogs.Dialog;Edited by: KonradZuse on Jun 7, 2013 2:27 PM
    Oddly enough I tried it again and it worked once, but the second time it error-ed out again, so I'm not sure what the deal is.
    then I ended up getting it to work again in the draw class only but when I tried to use the event I get this error.
    J a v a M e s s a g e : 3 d / M o u s e H a n d l e r
    java.lang.NoClassDefFoundError: 3d/MouseHandler
         at shelflogic3d.draw.lambda$5(draw.java:331)
         at shelflogic3d.draw$$Lambda$16.handle(Unknown Source)
         at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
         at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
         at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
         at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
         at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
         at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
         at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
         at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
         at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
         at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
         at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
         at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
         at javafx.event.Event.fireEvent(Event.java:202)
         at javafx.scene.Scene$DnDGesture.fireEvent(Scene.java:2824)
         at javafx.scene.Scene$DnDGesture.processTargetDrop(Scene.java:3028)
         at javafx.scene.Scene$DnDGesture.access$6500(Scene.java:2800)
         at javafx.scene.Scene$DropTargetListener.drop(Scene.java:2771)
         at com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler$3.run(GlassSceneDnDEventHandler.java:85)
         at com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler$3.run(GlassSceneDnDEventHandler.java:81)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(GlassSceneDnDEventHandler.java:81)
         at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(GlassViewEventHandler.java:595)
         at com.sun.glass.ui.View.handleDragDrop(View.java:664)
         at com.sun.glass.ui.View.notifyDragDrop(View.java:977)
         at com.sun.glass.ui.win.WinDnDClipboard.push(Native Method)
         at com.sun.glass.ui.win.WinSystemClipboard.pushToSystem(WinSystemClipboard.java:234)
         at com.sun.glass.ui.SystemClipboard.flush(SystemClipboard.java:51)
         at com.sun.glass.ui.ClipboardAssistance.flush(ClipboardAssistance.java:59)
         at com.sun.javafx.tk.quantum.QuantumClipboard.flush(QuantumClipboard.java:260)
         at com.sun.javafx.tk.quantum.QuantumToolkit.startDrag(QuantumToolkit.java:1277)
         at javafx.scene.Scene$DnDGesture.dragDetectedProcessed(Scene.java:2844)
         at javafx.scene.Scene$DnDGesture.process(Scene.java:2905)
         at javafx.scene.Scene$DnDGesture.access$8500(Scene.java:2800)
         at javafx.scene.Scene$MouseHandler.process(Scene.java:3564)
         at javafx.scene.Scene$MouseHandler.process(Scene.java:3379)
         at javafx.scene.Scene$MouseHandler.access$1800(Scene.java:3331)
         at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1612)
         at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2399)
         at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:312)
         at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:237)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:354)
         at com.sun.glass.ui.View.handleMouseEvent(View.java:514)
         at com.sun.glass.ui.View.notifyMouse(View.java:877)
         at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
         at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
         at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:101)
         at java.lang.Thread.run(Thread.java:724)
    Caused by: java.lang.ClassNotFoundException: shelflogic3d.MouseHandler
         at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:353)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
         ... 50 more
    Exception in thread "JavaFX Application Thread" E..........After the E comes a bunch of random stuff with drag and drop and such (since I'm dragging an item, and then creating it and giving it the event in question).
    Line 331 is                      b.addEventHandler(MouseEvent.ANY, new MouseHandler(b));

Maybe you are looking for