Access class from seperate loop

Here's where I'm at. I need at access the data members of the positioner class from the second loop. I cant seem to figure it out.
As you can see... I'm new at LVOOP.
Solved!
Go to Solution.

First quick answer is "the indicator on the outside of the loop will not update until the loop is done.
If inside just prior to SR, sure you can get away with it but you are opening up a situation ripe for a race conditions.
Singlton is the LVOOP answer.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • Generating Ruby Web Service Access Classes from a WSDL

    If you have tried to consume a web service from Ruby you surely have noticed how annoying is to write manually all the Ruby code just to invoke a service with complext input parameters' structure:
    - You have to know what do the input parameters, their structure and type look like;
    - You have to write Ruby classes for them to encapsulate the structures;
    - You have to instantiate these classes and pass the objects to the web service proxy class;
    - You have to interprete the output parameters.
    All this is not impossible of course, but if you are just consumer of the web service and not the developer, if you don't have the exact documentation, you have to read the WSDL description of the service and create the Ruby classes (structures) for the parameters.
    Fortunately there is a small, though handy tool, called <b>wsdl2ruby.rb</b>. It accomplishes all these boring tasks for you.
    In the following example I will try to show you how <b>wsdl2ruby</b> can be used to generate Ruby classes for accessing a SAP NetWeaver web service, called <b>CreditChecker1</b> (a web service for checking if a person is reliable credit consumer).
    To generate the necessary classes we will create a ruby script. Let us name it <b>ws2rgen.rb</b>. Here is what this file looks like:
    # Import the wsdl2ruby library.
    require 'wsdl/soap/wsdl2ruby'
    require 'logger'
    # Callback function for the WSDL 2 Ruby generation options.
    def getWsdlOpt(s)
         optcmd= {}
         s << "Service"
         optcmd['classdef'] = s
         #should work but doesn't, driver name is derived from classname
         #if you specify both it breaks, same thing for client_skelton
         #optcmd['driver'] = s
         optcmd['driver'] = nil
         #optcmd['client_skelton'] = nil
         optcmd['force'] = true
         return optcmd
    end
    # Create logger.
    logger = Logger.new(STDERR)
    # Create WSDL2Ruby object and generate.
    worker = WSDL::SOAP::WSDL2Ruby.new
    worker.logger = logger
    # WSDL file location.
    worker.location = "http://mysapserver:53000/CreditChecker1/Config1?wsdl"
    # Where to generate.
    worker.basedir = "temp"
    # Set options.
    worker.opt.update(getWsdlOpt("Service"))
    # Heat.
    worker.run
    The procedure is straightforward. First we create the WSDL2Ruby object, set its properties <b>location</b> and <b>basedir</b> and then set all other options via the callback function <b>getWsdlOpt()</b>. For further information about these parameters one could consult the source code of wsdl2ruby or contact the developers. Nevertheless the default options are pretty satisfactory. With the last line we start the generation. Two Ruby files will be generated in the <b>temp</b> folder, which is a subfolder of the script's current folder. <b>Please, create the folder "temp" before executing the script.</b>
    This generates two files. The first one is <b>CreditChecker1Wsd.rb</b>, containing the necessary data structures:
    require 'xsd/qname'
    # {urn:CreditChecker1Vi}areReliable
    class AreReliable
      @@schema_type = "areReliable"
      @@schema_ns = "urn:CreditChecker1Vi"
      @@schema_qualified = "true"
      @@schema_element = [["persons", "ArrayOfPerson"]]
      attr_accessor :persons
      def initialize(persons = nil)
        @persons = persons
      end
    end
    # {urn:CreditChecker1Vi}areReliableResponse
    class AreReliableResponse
      @@schema_type = "areReliableResponse"
      @@schema_ns = "urn:CreditChecker1Vi"
      @@schema_qualified = "true"
      @@schema_element = [["response", ["ArrayOfboolean", XSD::QName.new("urn:CreditChecker1Vi", "Response")]]]
      def Response
        @response
      end
      def Response=(value)
        @response = value
      end
      def initialize(response = nil)
        @response = response
      end
    end
    # {urn:CreditChecker1Vi}isReliable
    class IsReliable
      @@schema_type = "isReliable"
      @@schema_ns = "urn:CreditChecker1Vi"
      @@schema_qualified = "true"
      @@schema_element = [["person", "Person"]]
      attr_accessor :person
      def initialize(person = nil)
        @person = person
      end
    end
    # {urn:CreditChecker1Vi}isReliableResponse
    class IsReliableResponse
      @@schema_type = "isReliableResponse"
      @@schema_ns = "urn:CreditChecker1Vi"
      @@schema_qualified = "true"
      @@schema_element = [["response", ["SOAP::SOAPBoolean", XSD::QName.new("urn:CreditChecker1Vi", "Response")]]]
      def Response
        @response
      end
      def Response=(value)
        @response = value
      end
      def initialize(response = nil)
        @response = response
      end
    end
    # {urn:java/lang}ArrayOfboolean
    class ArrayOfboolean < ::Array
      @@schema_type = "boolean"
      @@schema_ns = "http://www.w3.org/2001/XMLSchema"
      @@schema_element = [["boolean", ["SOAP::SOAPBoolean[]", XSD::QName.new("urn:java/lang", "boolean")]]]
    end
    # {urn:com.sap.scripting.test.services.creditchecker.classes}Person
    class Person
      @@schema_type = "Person"
      @@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
      @@schema_element = [["age", "SOAP::SOAPInt"], ["name", "SOAP::SOAPString"], ["purse", "Purse"]]
      attr_accessor :age
      attr_accessor :name
      attr_accessor :purse
      def initialize(age = nil, name = nil, purse = nil)
        @age = age
        @name = name
        @purse = purse
      end
    end
    # {urn:com.sap.scripting.test.services.creditchecker.classes}Purse
    class Purse
      @@schema_type = "Purse"
      @@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
      @@schema_element = [["color", "SOAP::SOAPString"], ["money", "Money"]]
      attr_accessor :color
      attr_accessor :money
      def initialize(color = nil, money = nil)
        @color = color
        @money = money
      end
    end
    # {urn:com.sap.scripting.test.services.creditchecker.classes}Money
    class Money
      @@schema_type = "Money"
      @@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
      @@schema_element = [["amount", "SOAP::SOAPDouble"], ["currency", "SOAP::SOAPString"]]
      attr_accessor :amount
      attr_accessor :currency
      def initialize(amount = nil, currency = nil)
        @amount = amount
        @currency = currency
      end
    end
    # {urn:com.sap.scripting.test.services.creditchecker.classes}ArrayOfPerson
    class ArrayOfPerson < ::Array
      @@schema_type = "Person"
      @@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
      @@schema_element = [["Person", ["Person[]", XSD::QName.new("urn:com.sap.scripting.test.services.creditchecker.classes", "Person")]]]
    end
    The second file is <b>CreditChecker1WsdDriver.rb</b>. In it you can find a generated child class of SOAP::RPC::Driver, containing all methods of this web service, so you don't need to add every method and its parameters to call the web service.
    require 'CreditChecker1Wsd.rb'
    require 'soap/rpc/driver'
    class CreditChecker1Vi_Document < ::SOAP::RPC::Driver
      DefaultEndpointUrl = "http://mysapserver:53000/CreditChecker1/Config1?style=document"
      MappingRegistry = ::SOAP::Mapping::Registry.new
      Methods = [
      def initialize(endpoint_url = nil)
        endpoint_url ||= DefaultEndpointUrl
        super(endpoint_url, nil)
        self.mapping_registry = MappingRegistry
        init_methods
      end
    private
      def init_methods
        Methods.each do |definitions|
          opt = definitions.last
          if opt[:request_style] == :document
            add_document_operation(*definitions)
          else
            add_rpc_operation(*definitions)
            qname = definitions[0]
            name = definitions[2]
            if qname.name != name and qname.name.capitalize == name.capitalize
              ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
                __send__(name, *arg)
              end
            end
          end
        end
      end
    end
    There is a problem with this script, since the <b>Methods</b> array is empty. I suppose it is due to the imports in the SAP NetWeaver WSDL, maybe wsdl2ruby is not mighty enough to handle these WSDL imports. When I succeed in overcoming this, I will post again in this thread to let everybody know.
    Message was edited by: Vasil Bachvarov

    Hi,
    I find Ruby to be really tough to consume SAP WebServices. For simple scenarios like currency conversion may it is good. But for complex scenarios such as Purchase Order entry etc..I found it very annoying to use wsdl2ruby and see that it didnt generate correct proxies.
    Until wsdl2ruby is stable enough to support complex datatypes, authentication etc. my recommendation is to use JRuby and use Java Proxies generated by NW Developer studio until pure Ruby's web service support improves.
    Following link might be of interest w.r.t wsdl2ruby
    http://derklammeraffe.blogspot.com/2006/08/working-with-wsdl2r-soap4r-and-complex.html
    Regards
    Kiran

  • Weird Can not access class from outside package problem

    Hi, I have this problem and it seems the error message is very clear what the problem is but I did make the GeneralTestResult class PUBLIC already. What could be wrong? I did search for it but this is too general and didn't find any solution. Anyone can point out the problem? TIA.
    public abstract class GeneralTestResult
      public static int FAILING_THRESHOLE = 25;
      public abstract String getTestName();
      public abstract boolean isPassed();
      public abstract int getLeftEyeResult();
      public abstract int getRightEyeResult();
      public abstract Calendar getTestDate();
    // in a different file
    package VisionSaver.Tests.TestResults;
    import java.util.*;
    public class AcuityORContrastTestResult extends GeneralTestResult
      private String m_testName;
      private int m_leftEyeVision, m_rightEyeVision;
      private Calendar m_testDate;
    // in a different file
    package VisionSaver.Tests;
    import VisionSaver.Tests.TestResults.*;
    public class Acuity extends VirtualKeyboard implements ActionListener, Runnable, WindowListener
    AcuityORContrastTestResult r = new AcuityORContrastTestResult(...);
    }The compiling error is:
    "Acuity.java": GeneralTestResult() in VisionSaver.Tests.TestResults.GeneralTestResult is not defined in a public class or interface; cannot be accessed from outside package at line 529, column 40

    The GeneralTestResult class is a packaged class. Sorry, when I cut and paste, I didn't copy everything. So here is the complete GeneralTestResult file:
    package VisionSaver.Tests.TestResults;
    import java.util.*;
    public abstract class GeneralTestResult
      public static int FAILING_THRESHOLE = 25;
      public abstract String getTestName();
      public abstract boolean isPassed();
      public abstract int getLeftEyeResult();
      public abstract int getRightEyeResult();
      public abstract Calendar getTestDate();
    }From the compiler's message, it seems like the import is OK. It just won't allow me to access non-public class but my classes here are declared public. Any other ideas? TIA

  • Error accessing class from method

    I am trying to write a method that accesses a class called circle where the user inputs the radius of a circle and the program prints the area, radius and circumference.
    My class is as follows.
    public class Circle
    private double Radius;
    private double PI = 3.14159;
    public void setRadius(double rad)
    Radius = rad;
    public void setPI(double pi)
    PI = pi;
    public double getRadius()
    return Radius;
    public double getPI()
    return PI;
    public double getArea()
    return PI * Radius * Radius;
    public double getDiameter()
    return Radius * Radius;
    public double getCircumferance()
    return 2 * PI * Radius;
    I am not having any areas when compiling the class.
    The method is as follows.
    //IS 115
    //DED01
    //Method for Circle class
    //Larry Piatt
    public class CircleStats
    public static void main(String[] args)
    double number;
    Scanner keyboard = new Scanner(System.in);
    Circle Radius = new Circle();
    Circle Area = new Circle();
    Circle Diameter = new Circle();
    Circle Circumference = new Circle();
    System.out.println("What is the radius of the circle? ");
    number = keyboard.nextDouble();
    number.setRadius(number);
    System.out.println("The area of the circle is "
    + Area);
    System.out.println("The diamter of the circle is "
    + Diameter);
    System.out.println("The circumference of the circle is "
    + Circumference);
    The error that I am seeing are as follows
    ^
    CircleStats.java:28: double cannot be dereferenced
    number.setRadius(number);
    ^
    1 errors
    This is my first attempt at writting a method that calls a class. I am not understanding it very well yet. Any assistance would be greatly appreciated.
    Edited by: tooned on Mar 30, 2008 1:10 PM

    1) your error: You're trying to call a method, setRadius, on the variable, number, which is nothing more than a lowly double primative variable. Better to call the method on your Circle object which here you call "Radius" (please note the Java naming convention: objects should begin with a lower-case letter).
    Also, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code] at the top of your block of code and the tag &#91;/code] at the bottom, like so:
    &#91;code]
      // your code block goes here.
      // note the differences between the tag at the top vs the bottom.
    &#91;/code]or
    {&#99;ode}
      // your code block goes here.
      // note here that the tags are the same.
    {&#99;ode}Your formatted code would look something like so:
    public class Circle
        private double Radius;
        private double PI = 3.14159;
        public void setRadius(double rad)
            Radius = rad;
        public void setPI(double pi)
            PI = pi;
        public double getRadius()
            return Radius;
        public double getPI()
            return PI;
        public double getArea()
            return PI * Radius * Radius;
        public double getDiameter()
            return Radius * Radius;
        public double getCircumferance()
            return 2 * PI * Radius;
    import java.util.Scanner;
    class CircleStats
        public static void main(String[] args)
            double number;
            Scanner keyboard = new Scanner(System.in);
            Circle Radius = new Circle();
            Circle Area = new Circle();
            Circle Diameter = new Circle();
            Circle Circumference = new Circle();
            System.out.println("What is the radius of the circle? ");
            number = keyboard.nextDouble();
            // number.setRadius(number);
            Radius.setRadius(number);
            System.out.println("The area of the circle is " + Area);
            System.out.println("The diamter of the circle is " + Diameter);
            System.out.println("The circumference of the circle is "
                    + Circumference);
    }

  • Accessing Classes From the Main Program:

    Hey Guys if you want to take a crack at this: I'm not sure how to exaclty get the classes read into my program and stuff. So I dunno if not don't worry. And Also ther'es no need to insult me.
    * just copy this into any editor
    import java.io.*;
    import java.text.*;
    class Liststuff
    public class Node
    char info;
    Node next;
    public class listException extends Exception
    public listException(String message)
    super(message);
    class Queue
    private Liststuff.Node front;
    private Liststuff.Node rear;
    public Queue()
    front = null;
    rear = null;
    public boolean isEmpty()
    return (front == null);
    public void insert(char v)
    Liststuff.Node n = new Liststuff.Node();
    n.info = v;
    n.next = front;
    if (rear == null)
    front = n;
    else
    rear.next = n;
    public char Remove() throws Liststuff.listException
    char v;
    if (isEmpty())
    throw new Liststuff.listException("Nothing in OrigQue.");
    else
    v = rear.info;
    rear = rear.next;
    return (v);
    class Stack
    Liststuff.Node top = new Liststuff.Node();
    public Stack()
    top = null;
    public void push(char v)
    Liststuff.Node n = new Liststuff.Node();
    n.info = v;
    n.next = top;
    top = n;
    public char pop() throws Liststuff.listException
    char v;
    if (isEmpty())
    throw new Liststuff.listException("Stack underflow.");
    else
    v = top.info;
    top = top.next;
    return (v);
    public boolean isEmpty()
    return (top == null);
    class Deque
    private Liststuff.Node front = new Liststuff.Node();
    private Liststuff.Node rear = new Liststuff.Node();
    private Liststuff.Node f = new Liststuff.Node();
    public Deque()
    front = null;
    f = null;
    rear = null;
    public void insert(char v)
    Liststuff.Node n = new Liststuff.Node();
    n.info = v;
    n.next = front;
    if (rear == null)
    front = n;
    else
    rear.next = n;
    public char remove(char side) throws Liststuff.listException
    char v;
    if (isEmpty())
    throw new Liststuff.listException("Nothing in OrigQue.");
    else
    f = rear;
    if (side == 'R')
    while (f.next != front)
    f = f.next;
    v = front.info;
    front = f;
    else
    v = rear.info;
    rear = rear.next;
    return (v);
    public boolean isEmpty()
    return (front == rear);
    public class Prog8
    public static void main(String args[]) throws IOException, Liststuff.listException
    String line;
    int i;
    char t;
    Liststuff s = new Liststuff();
    BufferedReader br = new BufferedReader(new FileReader("numbers.txt"));
    line = br.readLine();
    StringCharacterIterator c = new StringCharacterIterator(line);
    while (line != null)
    for (i = 0; i <= c.getEndIndex(); i++)
    Liststuff.Queue Orig = new Liststuff.Queue();
    Liststuff.Stack Evenstk = new Liststuff.Stack();
                   Liststuff.Deque Oddque = new Liststuff.Deque();
                   Liststuff.Queue Final = new Liststuff.Queue();
    t = c.current();
    char v = (t);
    c.next();
    Orig.insert(v);
    line = br.readLine();
    if ((v % 2) == 0)
    Evenstk.push(v);
    else
    Oddque.insert(v);
    Final.insert(Evenstk.pop());
    while (!Oddque.isEmpty())
    Final.insert(Oddque.remove('R'));
    Final.insert(Oddque.remove('L'));
    System.out.print("Original Sequence: ");
    while (!Orig.isEmpty())
    System.out.print(Orig.Remove());
    System.out.print("New Sequence: ");
    while (!Final.isEmpty())
    System.out.print(Final.Remove());
    }

    hi mate
    System.out.print("Original Sequence: ");
    while (!Orig.isEmpty())
    System.out.print(Orig.Remove());
    System.out.print("New Sequence: ");
    while (!Final.isEmpty())
    System.out.print(Final.Remove());
    thats you wacky code remember its insult free comments
    well here the best way to do it
    for Final.insert(Oddque.remove('R'));
    System.out.print("Original Sequence: ");
    while (!Orig.isEmpty())
    System.out.print(Orig.Remove());
    while Final.insert(Oddque.remove('L'));
    System.out.print("New Sequence: ");
    while (!Final.isEmpty())
    System.out.print(Final.Remove());
    else bla bla bla
    hope it cann hep though i dont whats is the problem
    and be clear you question.

  • Urgent: how to really seperate business logic class from data access class

    Hello,
    I've this problem here on my hand and i really need help urgently. so please allow me to thank anyone who replies to this thread =)
    Before i go any futhur, let me present a scenario. this will help make my question clearer.
    "A user choose to view his account information"
    here, i've attempted to do the following. i've tried to seperate my application into 3 layers, the GUI layer, the business logic layer, and the data access layer.
    classically, the GUI layer only knows which object it should invoke, for example in the case above, the GUI would instantiate an Account object and prob the displayAcctInfo method of the Account object.
    here is how my Account class looks like:
    public class Account
    private acctNo;
    private userid;
    private password;
    private Customer acctOwner;
    the way this class is being modelled is that there is a handle to a customer object.
    that being the case, when i want to retrieve back account information, how do i go about retrieveing the information on the customer? should my data access class have knowledge on how the customer is being programmed? ie setName, getName, setAge, getAge all these methods etc? if not, how do i restore the state of the Customer object nested inside?
    is there a better way to archieve the solution to my problem above? i would appriciate it for any help rendered =)
    Yours sincerely,
    Javier

    public class AccountThat looks like a business layer object to me.
    In a large application the GUI probably shouldn't ever touch business objects. It makes requests to the business layer for specific information. For example you might have a class called CustomerAccountSummary - the data for that might come entirely from the Account object or it might come from Account and Customer.
    When the GUI requests information it receives it as a 'primitive' - which is a class that has no behaviour (methods), just data. This keeps the interface between the GUI and business layer simple and makes it easier to maintain.
    When using a primitive there are four operations: query, create, update and delete.
    For a query the gui sets only the attributes in the primitive that will be specifically queried for (or a specialized primitive can be created for this.) The result of a query is either a single primitive or a collection of primitives. Each primitive will have all the attributes defined.
    For a create all of the attributes are set. The gui calls a method and passes the primtive.
    For an update, usually all fields are defined although this can vary. The gui calls a method and passes the primitive.
    For a delete, only the 'key' fields are set (more can be but they are not used.) The gui calls a method and passes the primitive.
    Also keep in mind that a clean seperation is always an idealization. For example verify that duplicate records are not created is a business logic requirement (the database doesn't care.) However, it is much easier and more efficient to handle that rule in the database rather than in the business layer.

  • Can not access the Instance Data of a Singleton class from MBean

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out.
    I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I also have a Singleton Data class (let's call it "SDATA") which provides some data for the MBean to access and calculate some application runtime stuff. Thus during the application startup and then in the application lifecysle, i will be adding data to the SDATA instance.So, this SDATA instance always has the data.
    Now, the problem is that i am not able to access any of the data or data structures from the PerformanceStatistics MBean. if i check the data structures when i am adding the data, all the structures contains data. But when i call this singleton instance from the MBean, am kind of having the empty data.
    Can anyone explain or have hints on what's happening ? Any help will be appreciated.
    I tried all sorts of DATA class being final and all methods being synchronized, static, ect.,, just to make sure. But no luck till now.
    Another unfortunate thing is that, i some times get different "ServicePerformanceData " instances (i.e. when i print the ServicePerformanceData.getInstance() they are different at different times). Not sure whats happening. I am running this application in WebLogic server and using the JConsole.
    Please see the detailed problem at @ http://stackoverflow.com/questions/1151117/can-not-access-the-instance-data-of-a-singleton-class-from-mbean
    I see related problems but no real solutions. Appreciate if anyone can throw in ideas.
    http://www.velocityreviews.com/forums/t135852-rmi-singletons-and-multiple-classloaders-in-weblogic.html
    http://www.theserverside.com/discussions/thread.tss?thread_id=12194
    http://www.jguru.com/faq/view.jsp?EID=1051835
    Thanks,
    Krishna

    I am working against the deadline and i am sweating now. From past few days i have been working on a problem and now its the time to shout out.
    I have an application (let's call it "APP") and i have a "PerformanceStatistics" MBean written for APP. I also have a Singleton Data class (let's call it "SDATA") which provides some data for the MBean to access and calculate some application runtime stuff. Thus during the application startup and then in the application lifecysle, i will be adding data to the SDATA instance.So, this SDATA instance always has the data.
    Now, the problem is that i am not able to access any of the data or data structures from the PerformanceStatistics MBean. if i check the data structures when i am adding the data, all the structures contains data. But when i call this singleton instance from the MBean, am kind of having the empty data.
    Can anyone explain or have hints on what's happening ? Any help will be appreciated.
    I tried all sorts of DATA class being final and all methods being synchronized, static, ect.,, just to make sure. But no luck till now.
    Another unfortunate thing is that, i some times get different "ServicePerformanceData " instances (i.e. when i print the ServicePerformanceData.getInstance() they are different at different times). Not sure whats happening. I am running this application in WebLogic server and using the JConsole.
    Please see the detailed problem at @ http://stackoverflow.com/questions/1151117/can-not-access-the-instance-data-of-a-singleton-class-from-mbean
    I see related problems but no real solutions. Appreciate if anyone can throw in ideas.
    http://www.velocityreviews.com/forums/t135852-rmi-singletons-and-multiple-classloaders-in-weblogic.html
    http://www.theserverside.com/discussions/thread.tss?thread_id=12194
    http://www.jguru.com/faq/view.jsp?EID=1051835
    Thanks,
    Krishna

  • Class not Found when accessing Proxy class from backing bean in VC.

    Hi All,
    I'm attempting to access a class of a webservice(generated as a proxy) within my ADF application and invoke the method within a backing bean of the View Controller(bean scope : backing bean). The proxy has generated an ObjectFactory class among other classes. When I access this Object factory class from within the backing bean, the application throws a Class not found error.
    I don't know where the error lies since I've declared the View Controller of the ADF application dependent on the Proxy and I've imported the class and accessing it within a backing bean. How would you suggest I approach resolveing this.
    JDev : 1.1.1.4
    Thank you.
    Regards
    PP.

    Hello Arun,
    Thank you for suggesting a Data control, but my requirement isn't to drag and drop the method as a button. It's more of a behind the scnes updating data via a database adapter requirement.
    I've resolved the issue. turns out, my deployment archive didn't include the proxy.jpr. Once included it works likea charm.
    Thanks
    PP.

  • Accessing custom classes from JSP

    Hi Guys,
    I am having some problems accessing my custom classes from my JSP.
    1) I've created a very simple class, SimpleCountingBean that just has accessors for an int. The class is in the package "SimpleCountingBean". I compiled this class locally on my laptop and uploaded the *.class file to my ISP.
    2) I've checked my classpath and yes, the file "SimpleCountingBean/SimpleCountingBean.class" is located off of one of the directories listed in the classpath.
    3) When I attempt to use this class in my JSP, via the following import statement:
    import "SimpleCountingBean.*"
    I get the following compile error
    java.lang.NoClassDefFoundError: SimpleCountingBean/SimpleCountingBean
    I'm pretty sure that my classpath is properly setup because when I purposely garble the import statement, I get the "package not found" compile error.
    Do I need to upload some other files in addition to the class file? Any suggestions would of course be appreciated.
    Sonny.

    Trying to get some clearer view.. so don't mind..
    So you uploaded all your .jsp files into your account which is:
    home/sonny
    and it compiles and work. But custom classes doesn't seems to be working, where did you place your classes?
    From my knowledge of tomcat, classes are normally placed in, in this case:
    home/sonny/web-inf/classes
    Maybe it differs from windows enviroment to *nix enviroment.. well, I'm just saying out so if its not the case.. don't mind me.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Accessing a variable defined in one class from another class..

    Greetings,
    I've only been programming in as3 for a couple months, and so far I've written several compositional classes that take MovieClips as inputs to handle behaviors and interactions in a simple game I'm creating. One problem I keep coming upon is that I'd love to access the custom variables I define within one class from another class. In the game I'm creating, Main.as is my document class, from which I invoke a class called 'Level1.as' which invokes all the other classes I've written.
    Below I've pasted my class 'DieLikeThePhishes'. For example, I would love to know the syntax for accessing the boolean variable 'phish1BeenHit' (line 31) from another class. I've tried the dot syntax you would use to access a MovieClip inside another MovieClip and it doesn't seem  to be working for me. Any ideas would be appreciated.  Thanks,
    - Jeremy
    package  jab.enemy
    import flash.display.MovieClip;
    import flash.events.Event;
    import jab.enemy.MissleDisappear;
    public class DieLikeThePhishes
    private var _clip2:MovieClip; // player
    private var _clip3:MovieClip; //phish1
    private var _clip4:MovieClip; //phish2
    private var _clip5:MovieClip; //phish3
    private var _clip6:MovieClip; //phish4
    private var _clip10:MovieClip; // background
    private var _clip11:MovieClip // missle1
    private var _clip12:MovieClip // missle2
    private var _clip13:MovieClip // missle3
    private var _clip14:MovieClip // missle4
    private var _clip15:MovieClip // missle5
    private var _clip16:MovieClip // missle6
    private var _clip17:MovieClip // missle7
    private var _clip18:MovieClip // missle8
    private var _clip19:MovieClip // missle9
    private var _clip20:MovieClip // missle10
    private var _clip21:MovieClip // missle11
    private var _clip22:MovieClip // missle12
    var ay1 = 0;var ay2 = 0;var ay3 = 0;var ay4 = 0;
    var vy1 = 0;var vy2 = 0;var vy3 = 0;var vy4 = 0;
    var phish1BeenHit:Boolean = false;var phish2BeenHit:Boolean = false;
    var phish3BeenHit:Boolean = false;var phish4BeenHit:Boolean = false;
    public function DieLikeThePhishes(clip2:MovieClip,clip3:MovieClip,clip4:MovieClip,clip5:MovieClip,clip6:M ovieClip,clip10:MovieClip,clip11:MovieClip,clip12:MovieClip,clip13:MovieClip,clip14:MovieC lip,clip15:MovieClip,clip16:MovieClip,clip17:MovieClip,clip18:MovieClip,clip19:MovieClip,c lip20:MovieClip,clip21:MovieClip,clip22:MovieClip)
    _clip2 = clip2;_clip3 = clip3;_clip4 = clip4;_clip5 = clip5;_clip6 = clip6;
    _clip10 = clip10;_clip11 = clip11;_clip12 = clip12;_clip13 = clip13;_clip14 = clip14;
    _clip15 = clip15;_clip16 = clip16;_clip17 = clip17;_clip18 = clip18;_clip19 = clip19;
    _clip20 = clip20;_clip21 = clip21;_clip22= clip22;
    _clip3.stage.addEventListener(Event.ENTER_FRAME, onEnterFrame)
    function onEnterFrame(event:Event):void
    vy1+= ay1;_clip3.y += vy1; vy2+= ay2;_clip4.y += vy2;
    vy3+= ay3;_clip5.y += vy3; vy4+= ay4;_clip6.y += vy4;
    if (phish1BeenHit ==false)
    if(_clip3.y >620)
    {_clip3.y = 620;}
    if (phish2BeenHit ==false)
    if(_clip4.y >620)
    {_clip4.y = 620;}
    if (phish3BeenHit ==false)
    if(_clip5.y >620)
    {_clip5.y = 620;}
    if (phish4BeenHit ==false)
    if(_clip6.y >620)
    {_clip6.y = 620;}
    if (_clip11.hitTestObject(_clip3) ||_clip12.hitTestObject(_clip3)||_clip13.hitTestObject(_clip3)||_clip14.hitTestObject(_cl ip3)||_clip15.hitTestObject(_clip3)||_clip16.hitTestObject(_clip3)||_clip17.hitTestObject( _clip3)||_clip18.hitTestObject(_clip3)||_clip19.hitTestObject(_clip3)||_clip20.hitTestObje ct(_clip3)||_clip21.hitTestObject(_clip3)||_clip22.hitTestObject(_clip3))
    _clip3.scaleY = -Math.abs(_clip3.scaleY);
    _clip3.alpha = 0.4;
    ay1 = 3
    vy1= -2;
    phish1BeenHit = true;
    if (_clip11.hitTestObject(_clip4) ||_clip12.hitTestObject(_clip4)||_clip13.hitTestObject(_clip4)||_clip14.hitTestObject(_cl ip4)||_clip15.hitTestObject(_clip4)||_clip16.hitTestObject(_clip4)||_clip17.hitTestObject( _clip4)||_clip18.hitTestObject(_clip4)||_clip19.hitTestObject(_clip4)||_clip20.hitTestObje ct(_clip4)||_clip21.hitTestObject(_clip4)||_clip22.hitTestObject(_clip4))
    _clip4.scaleY = -Math.abs(_clip4.scaleY);
    _clip4.alpha = 0.4;
    ay2 = 3
    vy2= -2;
    phish2BeenHit = true;
    if (_clip11.hitTestObject(_clip5) ||_clip12.hitTestObject(_clip5)||_clip13.hitTestObject(_clip5)||_clip14.hitTestObject(_cl ip5)||_clip15.hitTestObject(_clip5)||_clip16.hitTestObject(_clip5)||_clip17.hitTestObject( _clip5)||_clip18.hitTestObject(_clip5)||_clip19.hitTestObject(_clip5)||_clip20.hitTestObje ct(_clip5)||_clip21.hitTestObject(_clip5)||_clip22.hitTestObject(_clip5))
    _clip5.scaleY = -Math.abs(_clip5.scaleY);
    _clip5.alpha = 0.4;
    ay3 = 3
    vy3= -2;
    phish3BeenHit = true;
    if (_clip11.hitTestObject(_clip6) ||_clip12.hitTestObject(_clip6)||_clip13.hitTestObject(_clip6)||_clip14.hitTestObject(_cl ip6)||_clip15.hitTestObject(_clip6)||_clip16.hitTestObject(_clip6)||_clip17.hitTestObject( _clip6)||_clip18.hitTestObject(_clip6)||_clip19.hitTestObject(_clip6)||_clip20.hitTestObje ct(_clip6)||_clip21.hitTestObject(_clip6)||_clip22.hitTestObject(_clip6))
    _clip6.scaleY = -Math.abs(_clip6.scaleY);
    _clip6.alpha = 0.4;
    ay4 = 3
    vy4= -2;
    phish4BeenHit = true;
    if (_clip3.y > 10000)
    _clip3.x = 1000 +3000*Math.random()-_clip10.x;
    _clip3.y = 300;
    _clip3.alpha = 1;
    _clip3.scaleY = Math.abs(_clip3.scaleY);
    ay1 = vy1 = 0;
    phish1BeenHit = false;
    if (_clip4.y > 10000)
    _clip4.x = 1000 +3000*Math.random()-_clip10.x;
    _clip4.y = 300;
    _clip4.alpha = 1;
    _clip4.scaleY = Math.abs(_clip4.scaleY);
    ay2 = vy2 = 0;
    phish2BeenHit = false;
    if (_clip5.y > 10000)
    _clip5.x = 1000 +3000*Math.random()-_clip10.x;
    _clip5.y = 300;
    _clip5.alpha = 1;
    _clip5.scaleY = Math.abs(_clip5.scaleY);
    ay3 = vy3 = 0;
    phish3BeenHit = false;
    if (_clip6.y > 10000)
    _clip6.x = 1000 +3000*Math.random()-_clip10.x;
    _clip6.y = 300;
    _clip6.alpha = 1;
    _clip6.scaleY = Math.abs(_clip6.scaleY);
    ay4 = vy4 = 0;
    phish4BeenHit = false;
    var missleDisappear1 = new MissleDisappear(_clip11,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear2 = new MissleDisappear(_clip12,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear3 = new MissleDisappear(_clip13,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear4 = new MissleDisappear(_clip14,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear5 = new MissleDisappear(_clip15,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear6 = new MissleDisappear(_clip16,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear7 = new MissleDisappear(_clip17,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear8 = new MissleDisappear(_clip18,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear9 = new MissleDisappear(_clip19,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear10 = new MissleDisappear(_clip20,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear11 = new MissleDisappear(_clip21,_clip3,_clip4,_clip5,_clip6,_clip10);
    var missleDisappear12 = new MissleDisappear(_clip22,_clip3,_clip4,_clip5,_clip6,_clip10);

    I would approach it in much the same way as you would in java, by making getters and setters for all of your class variables.
    Getters being for returning the values, Setters being for setting them.
    So you would make a get function for the variable you want to access ala:
    function get1PhishBeenHit():boolean {
         return this.phish1BeenHit;
    Then to access the value of that variable from outwith the class:
    var result:boolean = ClassInstanceName.get1PhishBeenHit();

  • EJBs accessing protected classes from java classloader

    Hello,
    We are facing a problem with classes isolation. I read from this newsgroup that
    to access a package level class from the base classloader from a bean, the supporting
    classes has to be from the same classloader as the bean. Well I think the only
    way we could do that is to have the *Bean.class in the base classloader, which
    is not what's recommended or move the support classes into the bean's classloader,
    which we cannot do.
    The purpose of this mail is to ask: is it a bug from weblogic server? Will it
    be fixed one day? If not, does it mean that it is impossible to isolate classes
    for local access from public classes?
    Thank you, Khiet.

    Thank you for your reply.
    Hope that one day we will not be obliged to have anything in the main classpath.
    :) Khiet.
    Rob Woollen <[email protected]> wrote:
    Tran T. Khiet wrote:
    Hello,
    We are facing a problem with classes isolation. I read from this newsgroupthat
    to access a package level class from the base classloader from a bean,the supporting
    classes has to be from the same classloader as the bean. Well I thinkthe only
    way we could do that is to have the *Bean.class in the base classloader,which
    is not what's recommended or move the support classes into the bean'sclassloader,
    which we cannot do.All correct.
    The purpose of this mail is to ask: is it a bug from weblogic server?No, it's how java classloaders work.
    Will it
    be fixed one day? If not, does it mean that it is impossible to isolateclasses
    for local access from public classes?You can expect that future versions of WLS will allow the user more
    control over classloaders, but for now you'll need public or protected
    access to cross classloaders.
    -- Rob
    Thank you, Khiet.

  • Accessing Java Classes from Forms

    Is is possible to access a Java class from Forms? I have been
    creating an Active X control that returns a Java object, and from
    that I can call methods on that object, but I would really like
    to do that without having and Active X control in the mix. Any
    suggestions?
    null

    Oracle Developer Team wrote:
    : Robert Nocera (guest) wrote:
    : : Oracle Developer Team wrote:
    : : : hey robert -
    : : : Developer 6.0 provides this ability for web deployment.
    You
    : : can
    : : : insert your own custom Java components into your
    application
    : : and
    : : : they will appear in the application when it is run via the
    : web.
    : : : If you look at the documentation for 6.0, there are a few
    : : : section son Pluggable Java Components and JavaBeans that
    : : : describes what is provided and how you use the interfaces
    : and
    : : : classes we provide.
    : : : A whitepaper on this topic will be posted to the OTN
    : shortly,
    : : as
    : : : well as some samples that illustrate how to go about doing
    : it.
    : : : cheers!
    : : : -Oracle Developer Team-
    : : Thanks for the quick response. Is there any way to access
    : those
    : : classes without being in a web deployment. That's probably
    : not
    : : totally out of the question, but what we had in mind was
    : adding
    : : some Java Functionality (actually connectictivity to some
    EJBs
    : : that we have) to existing forms. Currently there forms are
    : not
    : : deployed in a "web" environment and are just run from the
    : forms
    : : runtime engine.
    : : -Rob
    : hey again robert -
    : there's no easy way (yet!) to call out from forms runtime
    : process to a Java application.
    : We've played around some with creating an ORA_FFI interface to
    : JNI and then wrappering this with PL/SQL code. We've been able
    : to make calling into an EJB running in 8i from a forms runtime
    : work using this approach.
    : Let me know if this is of interest to you and I can post the
    : stuff we've currently got. It's no more than a simple demo and
    : is not complete. It requires quite a bit of manual coding on
    : the PL/SQL side since the interface emulates JNI (FindClass,
    : GetMethodID, CallMethodID, etc.).
    : cheers!
    : -the Oracle Developer Team-
    I'd be interested in this ORA_FFI doc you've been playing with.
    Would you please email it to me or post it.
    null

  • Few basic doubts about accessing AM from backing bean class

    Hi ADF experts,
    I have just started working in ADF Faces.I made a sample search page.My page is attached to a managed backing bean. I have attached command button on my page to a custom method in backing bean class.
    So on, click of button this method is called in backing bean.Now, i have few doubts:
    1)How to get values of various UI beans in this event code?
    2)I am accesing AM , in my method with this code:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext extContext = facesContext.getExternalContext();
    Application app = facesContext.getApplication();
    DCBindingContainer binding = (DCBindingContainer)app.getVariableResolver().resolveVariable(facesContext, "bindings");
    //Accessing AM
    ApplicationModule am = binding.getDataControl().getApplicationModule();
    iS this correct ?
    3) After getting handle of am how to call my custom method in AM Class?there was "invokeMethod" API in application module class in OAF, is there any such method here?
    Please help me.
    --ADF learner.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for ur response Frank, actually I am from OA Framework back ground.It would be great if help us a little with ur valuble thoughts.
    OA Framework also uses bc4j in model layer of framework. We have a requirement where our existing developers from OA Framework have to move to ADF to make a new application where time lines are quite strict.If this would not be possible we will switch to plain jsp and jdbc,but our tech experts say ADF Faces is the best tech.
    In OA Framework, Application Module is key class for all busiess logic and Controller is used for page navigation. So, I m just trying to find the same similarity , where we write we add all event codes in custom action methods in the backing bean class of page, which we consider equivalent to process form request method in Controller class of OAF.
    But there are two things, I still want to know:
    1)While page render, how to call specific AM methods(like setting where clause of certain VOs)
    2)In action methods, the way i described(I found that in one thread only)to access AM, what is wrong in that?Also, I went through
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    where coule of examples use similar approach to access AM from backing bean class and call custom methods of AM(Doing various, deletes etc from VOs).
    3)In these methods can we set any property of beans on the page, I am asking because in OAF, generally we use PPR for js alternatives.But all properties of beans cannot be set in post event.
    Thanks and Regards
    --ADF Learner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Accessing string from other classes

    Sorry if this seems simple to you, but i'm having problems accessing four string that are declared and used in my public class from another class.
    I've tried declaring the strings public but it still says 'cannot resolve symbol' when i try to compile.
    Help much appreciated.
    fightspam

    Yep, heres my code(sorry if it's a bit untidy):
    //Zimmerman M3 email client.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    class where extends JFrame implements ActionListener
         private JLabel path;
         private JTextField pathText;
         private String pathFile;
         private JButton save;
         File outputFile = new File(pathFile);
         public where()
              super("Save Email");     
              Container f=getContentPane();
                   f.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
              f.setBackground(Color.lightGray);
              path = new JLabel("Path: ");
              f.add(path);
              pathText = new JTextField(20);
              f.add(pathText);
              save = new JButton("Save");
              f.add(save);
              this.setSize(300, 100);
         public void actionPerformed(ActionEvent q)
              pathFile = pathText.getText();
              try
                   FileWriter out = new FileWriter(outputFile);
                   out.write(zimmernorm.toFile);
                   out.write(zimmernorm.fromFile);
                   out.write(zimmernorm.subjectFile);
                   out.write(zimmernorm.bodyFile);
                   out.close();
              catch(IOException err)
                   System.exit(0);
    class about extends JFrame
         private JLabel title;
         public about()
              super("About Zimmerman M3");
              Container d=getContentPane();
                   d.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
              d.setBackground(Color.lightGray);
              title = new JLabel("Zimmerman M3 by Louis Goddard, 2003");
              d.add(title);
              this.setSize(246, 62);
    class newmail extends JFrame implements ActionListener
         public static String toFile, fromFile, subjectFile, bodyFile;
         public JTextField To, From, Subject;
         private String toBuffer, fromBuffer, subjectBuffer, bodyBuffer;
         private JButton send, clear;
         private JTextArea Body;
         private JLabel toLabel, fromLabel, subjectLabel;
         private JMenuBar mb;
         private JMenu File, Edit;
         private JMenuItem New, Sender, Copy, Paste, About;
         public newmail()
                    super("New Email");
              Container c=getContentPane();
                   c.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
              c.setBackground(Color.lightGray);
              //<MENU STUFF!!!>     
                   mb = new JMenuBar();
                   File = new JMenu("File");
                   Edit = new JMenu("Edit");
                   New = new JMenuItem("New");
                   Sender = new JMenuItem("Save");
                   Copy = new JMenuItem("Copy");
                   Paste = new JMenuItem("Paste");
                   File.add(New);
                   New.addActionListener(this);
                   New.setActionCommand("1");
                   File.add(Sender);
                   Sender.addActionListener(this);
                   Sender.setActionCommand("2");
                   Edit.add(Copy);
                   Copy.addActionListener(this);
                   Copy.setActionCommand("3");
                   Edit.add(Paste);
                   Paste.addActionListener(this);
                   Paste.setActionCommand("4");
                   mb.add(File);
                   mb.add(Edit);
                   setJMenuBar(mb);
              //</MENU STUFF!!!>     
              toLabel = new JLabel("To:          ");
              c.add(toLabel);
              To = new JTextField(35);
              c.add(To);
              fromLabel = new JLabel("From:     ");
              c.add(fromLabel);
              From = new JTextField(35);
              c.add(From);
              subjectLabel = new JLabel("Subject:");
              c.add(subjectLabel);
              Subject = new JTextField(35);
              c.add(Subject);
              Body = new JTextArea(12,40);
              c.add(Body);
              send = new JButton("Send");
                    c.add(send);
              clear = new JButton("Clear");
                    c.add(clear);
              clear.addActionListener(this);
              clear.setActionCommand("6");
              this.setSize(459, 364);
              public static void main(String []args)
                   JFrame.setDefaultLookAndFeelDecorated(true);
                   new newmail().show();
              public void actionPerformed(ActionEvent e)
                   String s = e.getActionCommand();
                   if (s == ("1"))
                   new newmail().show();
                   else if (s == ("2"))
                   new where().show();
                   toFile = To.getText();
                   fromFile = From.getText();
                   subjectFile = Subject.getText();
                   bodyFile = Body.getText();
                   else if (s == ("3"))
                   bodyBuffer = Body.getSelectedText();
                   toBuffer = To.getSelectedText();
                   fromBuffer = From.getSelectedText();
                   subjectBuffer = Subject.getSelectedText();
                   else if (s == ("4"))
                   Body.setText(bodyBuffer);
                   To.setText(toBuffer);
                   From.setText(fromBuffer);
                   Subject.setText(subjectBuffer);
                   else if (s == ("5"))
                   new about().show();
                   else if (s == ("6"))
                   To.setText("");
                   From.setText("");
                   Subject.setText("");
                   Body.setText("");
    public class zimmernorm extends JFrame implements ActionListener
         public String toFile, fromFile, subjectFile, bodyFile;
         private String toBuffer, fromBuffer, subjectBuffer, bodyBuffer;
         private JMenuBar mb;
         private JMenu File, Help, View;
         private JMenuItem New, About, Inboxmenu, Outboxmenu, Savedmenu;
         public zimmernorm()
                    super("Zimmerman M3");
              Container c=getContentPane();
                   c.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
              c.setBackground(Color.lightGray);
              //<MENU STUFF!!!>     
                   mb = new JMenuBar();
                   File = new JMenu("File");
                   View = new JMenu("View");
                   Help = new JMenu("Help");
                   New = new JMenuItem("New");
                   About = new JMenuItem("About");
                   Inboxmenu = new JMenuItem("Inbox");
                   Outboxmenu = new JMenuItem("Outbox");
                   Savedmenu = new JMenuItem("Saved");
                   File.add(New);
                   New.addActionListener(this);
                   New.setActionCommand("1");
                   Help.add(About);
                   About.addActionListener(this);
                   About.setActionCommand("5");
                   View.add(Inboxmenu);
                   Inboxmenu.addActionListener(this);
                   Inboxmenu.setActionCommand("7");
                   View.add(Outboxmenu);
                   Outboxmenu.addActionListener(this);
                   Outboxmenu.setActionCommand("8");
                   View.add(Savedmenu);
                   Savedmenu.addActionListener(this);
                   Savedmenu.setActionCommand("9");
                   mb.add(File);
                   mb.add(Help);
                   mb.add(View);
                   setJMenuBar(mb);
              //</MENU STUFF!!!>     
              this.setSize(1024, 768);
                    this.setDefaultCloseOperation( EXIT_ON_CLOSE );
              public static void main(String []args)
                   JFrame.setDefaultLookAndFeelDecorated(true);
                   new zimmernorm().show();
              public void actionPerformed(ActionEvent e)
                   String s = e.getActionCommand();
                   if (s == ("1"))
                   new newmail().show();
                   else if (s == ("5"))
                   new about().show();

  • Accessing a Java class from C when class is in a package

    I'm accessign a java class from C using JNI: The JVM exists and I can access the class fine:
    jclass cls; //java class
    cls = (*env)->FindClass(env, "MyClass");
    However when I put the class in a package I can't access it
    cls = (*env)->FindClass(env, "mypackage.MyClass");
    Does anyone know How I can access a java class in a package using JNI.
    Thanks
    ..

    Been a while since I've done anything with JNI, But... Did you try this:
    cls = (*env)->FindClass(env, "mypackage/MyClass");

Maybe you are looking for

  • How to manage a itunes library bigger than 4TB? Help!

    Hi, We are a family big on homesharing and keep all our music/movies/tv shows on one apple id.  Plus we are apple tv addicts and subscribe to lots of tv series and purchase a lot of movies.  The itunes library is now more than 4 TB and has outgrown t

  • Wireless Time Capsule Backup on Separate Network

    Hi Everyone, I work in a office building that requires a colleague and I to use a wireless network all ready set up throughout the building. We are not able to access the hub of this network and there are no hard-lines though the office space. We wou

  • Mac app store still doesn't work properly

    Hi any concern, Thank you before,has been almost 3 week.Yesterday I did Re-install OS X take almost 20 hours and then restart automatic around 6 am.But still when I click (update),(Install),(get) or any buttons doesn't work at all this happen on Mac

  • Enabling JAAS Authorization in BC4J ,getUserPrincipalName()

    The Jdeveloper Help states the following:- Currently, BC4J does not have an authorization framework. However, if your application uses JAAS for authentication, >>you can implement your own authorization. To pass JAAS user information to your authoriz

  • How do you mixdown audio?

    After renedring. How do you mixdown the audio? Please help. Some of my video/audio, depending upon where I upload it to on the net, sounds tinty or slushy. I have tried almost every audio setting to correct this. I have never "mixed down", what is th