Help on using Proxy Class  ???

The proxy class that i am using currently not detecting (and not using ) my proxy .server
I am using Naviscope proxy server on port 81 .
Following is my code snippet:
psvm (String a[] ){
try {
Proxy proxy = new Proxy(Proxy.Type.SOCKS,
                                   new InetSocketAddress("127.0.0.1", 81 )
               Socket socket = new Socket(proxy);
               System.out.println("Connecting...");
               socket.connect(new InetSocketAddress("http://google.com", 81);
               if (socket.isConnected() )
                    System.out.println("Connectoed");
               else
                    System.out.println("Not connected");
               socket.close() ;
catch(Exception ioe){
     ioe.printStackTrace();
The error is InvalidArgumentType when proxy type is other than Socks ...
There is no error on setting as Socks server type , but no activity in my Server.
Morever my proxy server is a Http one .. and works well with Firefox , IE ,Opera !!!
Can someone help me out.. pls
Thx in advance ...

The compiler I'm using is showing errors in these areas of the code. I've read the tutorials and still can't get it. They syntax for the scanner must be in the wrong format??
the input.readLine appears incorrect below.
  public void actionPerformed(ActionEvent evt) {
    System.out.print("Talk to me " +name+ " : ");
    try {
        jLabel1.setText(input.readLine());
    } catch (IOException ioe) {
      jLabel1.setText("Ow! You pushed my button");
      System.err.println("IO Error: " + ioe);
    }and also here...
the input is showing errors
  /** Initialise and Scan input Stream */
  private void selectInput() {
    input = new Scanner(new InputStreamReader(System.in));
   /**int i = sc.nextInt(); */
  }Thanks

Similar Messages

  • Error occures while Sap R/3 sytem triggers XI message (using proxy class)

    <b>Error occures while Sap R/3 sytem triggers XI message (using proxy class)</b>
    1- I prepared message in XI side
    2- I used sproxy transaction in R/3 side and generate proxy class
    3- I used necessary methods in Abap program in R/3 side
    4- Somethimes, message does not work and generate error like below
    What must I do to solve this problem.  Thanks
    <u><b>Error message (Reported in SXMB_MONI in Sap R/3 side)</b></u><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:ErrorHeader xmlns:SAP="http://sap.com/exchange/MessageFormat">
      <SAP:Context />
      <SAP:Code p1="112" p2="HTTPIO_PLG_ICM_CONNECT_FAILED-Fehlermeldung beim Senden der Daten." p3="" p4="">HTTP.HTTP_CLIENT_SEND_FAILED</SAP:Code>
      <SAP:Text language="TR">Error during http send: Error code: 112 Error text: HTTPIO_PLG_ICM_CONNECT_FAILED-Fehlermeldung beim Senden der Daten.</SAP:Text>
      </SAP:ErrorHeader>

    Hi,
    Check thiss
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    Error no 2
    Regards
    Aashish Sinha
    PS : Reward points if helpful

  • How to set username and password when using Proxy class for SOCKS5?

    Hi all,
    I use the proxy class for SOCKS5, so need to set username and password, I don't find where can I set the value. whether the API support it.
    Thanks in advance!

    System.getProperties().put("proxySet", "true");That does nothing. Remove.
    System.getProperties().put("proxyHost", getProxyHost());
    System.getProperties().put("proxyPort", getProxyPort());You should be setting socks.proxyHost and socks.proxyPort here.
    System.setProperty("java.net.socks.username", getSOCKSUsername());
    System.setProperty("java.net.socks.password", getSOCKSPassword());
    Authenticator.setDefault(new ProxyAuth(getSOCKSUsername(), getSOCKSPassword()));You either need the first two lines or the third, not both. See the last link posted above.
    1. After I set the value, I connect internet by proxy, how the proxy server knows the values?Because Java tells it during the SOCKS handshake.
    2. In my app, I just set the values in the system properties, then JVM does remaining work? Remaining work is not concerned?Should be OK unless you have to connect to a different SOCKS proxy from the same JVM, but that kind of thing is problematic anyway due to the curious Authenticator design which is set globally, not per connection as you might expect.

  • Help for using java class in forms 9i

    hi
    i have been trying to use java class in forms9i but unable to execute ,i have encountered exceptions,for which exception handlers have been declared like ora_java.java_error and exception_thrown but failed to handle run time errors , i have tried all ways from my side.
    my java class returns a simple string
    i need help on various work arounds
    thanks in advance
    yash

    sir
    i have written a simple java class which returns a string hello imported using a java importer in forms 9i
    and i call my class in when button press trigger
    i have also imported java.lang.Exception for my exception handlers,i have no compile errors,but when i run my forms i get run time error and my exception handlers fail to trap it . ihave no idea how to proceed .
    should i use bean area in form and call the class using fbean from custom item rigger if so please explain
    can i get sample code example for calling a java class methods from forms.
    thanks
    yash

  • Help with using Scanner Class

    Hi there - I'm a newbie to Java and may have posted this in the wrong forum previously.
    I am trying to modify a program so instead of using a BufferReader, a scanner class will be used. It is basically a program to read in a name and then display the variable in a line of text.
    Being new to Java and a weak programmer, I am getting in a mess with this and missing something somewhere. I don't think I'm using scanner in the correct way.
    Any help or pointers would be good. There are 2 programs of code being used. 'Sample' and 'Run Sample'
    Thanks in advance.
    Firstly, this program will run named 'Sample'
    <code>
    * Sample.java
    * Class description and usage here.
    * Created on 15 October 2006
    package internetics;
    * @author John
    * @version 1.2
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    // import com.ralph.*;
    public class Sample extends JFrame
    implements java.awt.event.ActionListener{
    private JButton jButton1; // this button is for pressing
    private JLabel jLabel1;
    private String name;
    /** Creates new object ChooseFile */
    public Sample() {
    initComponents();
    name = "";
    selectInput();
    public Sample(String name) {
    this();
    this.name = name;
    private void initComponents() {
    Color bright = Color.red;
    jButton1 = new JButton();
    jLabel1= new JLabel();
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    exitForm(evt);
    getContentPane().setLayout(new java.awt.GridLayout(2, 1));
    jButton1.setBackground(Color.white);
    jButton1.setFont(new Font("Verdana", 1, 12));
    jButton1.setForeground(bright);
    jButton1.setText("Click Me!");
    jButton1.addActionListener(this);
    jLabel1.setFont(new Font("Verdana", 1, 18));
    jLabel1.setText("05975575");
    jLabel1.setOpaque(true);
    getContentPane().add(jButton1);
    getContentPane().add(jLabel1);
    pack();
    public void actionPerformed(ActionEvent evt) {
    System.out.print("Talk to me " name " : ");
    try {
    jLabel1.setText(input.readLine());
    } catch (IOException ioe) {
    jLabel1.setText("Ow! You pushed my button");
    System.err.println("IO Error: " + ioe);
    /** Exit this Application */
    private void exitForm(WindowEvent evt) {
    System.exit(0);
    /** Initialise and Scan input Stream */
    private void selectInput() {
    input = new Scanner(new InputStreamReader(System.in));
    /**int i = sc.nextInt(); */
    /** Getter for name prompt */
    public String getName() {
    return name;
    /** Setter for name prompt */
    public void setName(String name) {
    this.name = name;
    * @param args the command line arguments
    public static void main(String args[]) {
    new Sample("John").show();
    </code>
    and this is the second program called 'RunSample will run.
    <code>
    class RunSample {
    public static void main(String args[]) {
    new internetics.Sample("John").show();
    </code>

    The compiler I'm using is showing errors in these areas of the code. I've read the tutorials and still can't get it. They syntax for the scanner must be in the wrong format??
    the input.readLine appears incorrect below.
      public void actionPerformed(ActionEvent evt) {
        System.out.print("Talk to me " +name+ " : ");
        try {
            jLabel1.setText(input.readLine());
        } catch (IOException ioe) {
          jLabel1.setText("Ow! You pushed my button");
          System.err.println("IO Error: " + ioe);
        }and also here...
    the input is showing errors
      /** Initialise and Scan input Stream */
      private void selectInput() {
        input = new Scanner(new InputStreamReader(System.in));
       /**int i = sc.nextInt(); */
      }Thanks

  • Please help to use my class in a JSP

    Hi
    Please could someone help me i've started a new job and need to create like a "Add to shortlist" functionality to their website.
    I have created a class to create a cookie using the offerid specific to that page which is done in the doGet() method.
    Now, the problem is that i don't know how to basically make the cookie be created when the button is pressed.
    I have thought of using <jsp:useBean> and putting my class in there but don't know how to call the doGet() method, if you know what i mean.
    Otherwise i've thought of doing the cookie creating in the JSP but then also i don't know how to make by the click of a button, it creates a cookie with that offerid.
    PLEASE help!? If you need more info pls let me know,
    Btw i am new to this so sorry if this sounds stupid, but thanks in advance for ANY help!

    There is only one thing to do in your case: hit the books and learn how to properly program servlets and JSPs - until you know at least the very basics (clicking a button and "doing something" falls in that category), it will be impossible to guide you to anything productive. I've seen it happen before many times; an answer is given, the answer is not understood and then the demand for "sample code" pops up, after which it all goes downhill fast.
    I always recommend this free online book, because it is quite good:
    [http://pdf.coreservlets.com/|http://pdf.coreservlets.com/]
    If you buckle down, you should be able to get things up and running in a few days. Good luck!

  • Need help in using Runtime class

    Hi all,
    I am facing problem with JRE versions of websphere and SUN JRE. Let me explain my problem.
    We have an application working fine in websphere, Now my organization wants to migrate this app to websphere. This application downloads some set of jar files to the client side when the user hits the server with some url. These jar files starts th swing based application in the client side , at the same it will try to communicate with EJB's deployed in the server(Now websphere) to get the data for menus and trees in the swing application. Because of different JRE in the websphere commucation problems like class cast exception are happening. Now we are downloading the the Websphere JRE to the client side and trying to start the application with the downloaded JRE(Even it is not required in case of weblogic in the exiting application also they are downloading the sun JRE). Here the problem starts for me. The execute method of Process class is not able to detect the main class. The waitFor method is returning non zero value. Here is my method.
    Can anybody guess what's wrong going on with this code.
    public Process spawnProcess(String szSpawnCommand) throws
    Exception
              szSpawnCommand = "C:\\ccc\\JRE\\bin\\javaw.exe com.att.suite.client.SuiteAppManager";
              System.out.println("starting processs "+szSpawnCommand);
    Process oProcess = null;
    try
    // oProcess = Runtime.getRuntime().exec(szSpawnCommand);
         Runtime rt = Runtime.getRuntime();
         System.out.println("Got runtime.....");
         oProcess = rt.exec("c:/ccc/JRE/bin/java com.att.suite.client.SuiteAppManager");
         //oProcess.waitFor();
    //oProcess = rt.exec("c:/ccc/JRE/bin/javaw -version");
    catch (Exception ex)
    // Throw an exception with the reason why the process
    // couldn't be spawned
    // The original message here confused end users - almost always
    // occurs due to lack of memory and we cannot determine actual
    // reason OS failed to spawn a process.
    // Changed to correct LCR MR#: 437
    // throw new Exception("Unable to spawn process with command: \"" +
    // szSpawnCommand + "\".\nSystem Reason: " + ex.getMessage());
    /*throw new Exception("You have insufficient memory to " +
    "launch this program. \nPlease quit some other " +
    "applications and try again.");*/
         System.out.println("In oProcess.... ");
    ex.printStackTrace();
    // Wait for a second to give the new process a chance
    // to run properly
    try
    Thread.sleep(1000);
    catch (Exception ex)
    final DataInputStream oProcStdOutStream = new DataInputStream(
    oProcess.getInputStream());
    final DataInputStream oProcStdErrStream = new DataInputStream(
    oProcess.getErrorStream());
    Thread oProcStdOutStreamThread = new Thread()
    public void run()
    try
    String szLine = null;
    while ((szLine = oProcStdOutStream.readLine()) != null)
    System.out.println("[FromProc1] " + szLine);
    catch (Exception ex)
         System.out.println("In oProcStdOutStream");
    ex.printStackTrace();
    oProcStdOutStreamThread.start();
    Thread oProcStdErrStreamThread = new Thread()
    public void run()
    try
    String szLine;
    while ((szLine = oProcStdErrStream.readLine()) != null)
    System.out.println("[FromProc2] " + szLine);
    catch (Exception ex)
    ex.printStackTrace();
    oProcStdErrStreamThread.start();
    // See if the process is still running properly
    int nProcessExitValue = 0;
    try
    nProcessExitValue = oProcess.exitValue();
         // nProcessExitValue = oProcess.waitFor();
         System.out.println("nProcessExitValue : "+nProcessExitValue);
    catch (Exception ex)
    // This means that the process is still running which
    // we'll consider a good sign.
    nProcessExitValue = 0;
    System.out.println("In nProcessExitValue");
    ex.printStackTrace();
    // Check the process exit value
    if (nProcessExitValue != 0)
    // Throw an exception with the return value of the spawned
    // process.
    // The original message here confused end users - almost always
    // occurs due to lack of memory and we cannot determine actual
    // reason OS failed to spawn a process.
    // Changed to correct LCR MR#: 437
    // throw new Exception("Unable to spawn process with command: \"" +
    // szSpawnCommand + "\".\nProcess Exit Value: " +
    // nProcessExitValue);
    throw new Exception("You have insufficient memory to " +
    "launch this program. \nPlease quit some other " +
    "applications and try again.");
         //System.out.println("In nProcessExitValue!=0");
    Here is the error :
    starting processs C:\ccc\JRE\bin\javaw.exe com.att.suite.client.SuiteAppManager
    Class loaded...
    Got runtime.....
    nProcessExitValue : 1
    [FromProc2] The java class is not found: com/att/launch/jre/Sample
    java.lang.Exception: You have insufficient memory to launch this program.
    Please quit some other applications and try again.
         at com.att.launch.jre.LaunchApp.spawnProcess(LaunchApp.java:525)
         at com.att.launch.jre.LaunchApp.spawnCJAS(LaunchApp.java:366)
         at com.att.launch.jre.LaunchApp.main(LaunchApp.java:171)
    Please help me, I am struggling with this problem from the long time. Or can any body suggest different way to solve this problem instead of downloading the JRE to the client side.
    Bhaskar

    Hi ,
    I am facing problem with JRE versions of websphere and SUN JRE. Let me explain my problem.
    We have an application working fine in websphere, Now my organization wants to migrate this app to websphere. This application downloads some set of jar files to the client side when the user hits the server with some url. These jar files starts th swing based application in the client side , at the same it will try to communicate with EJB's deployed in the server(Now websphere) to get the data for menus and trees in the swing application. Because of different JRE in the websphere commucation problems like class cast exception are happening.
         Now we are downloading the the Websphere JRE to the client side and trying to start the application with the downloaded JRE(Even it is not required in case of weblogic in the exiting application also they are downloading the sun JRE).
    Here the problem starts for me. The execute method of Process class is not able to detect the main class. The waitFor method is returning non zero value. Here is my method.
    Can anybody guess what's wrong going on with this code
    public Process spawnProcess(String szSpawnCommand) throws
    Exception
              System.out.println("starting processs "+szSpawnCommand);
    Process oProcess = null;
    try
         Runtime rt = Runtime.getRuntime();
         System.out.println("Got runtime.....");
         oProcess = rt.exec("c:/ccc/JRE/bin/java com.att.suite.client.SuiteAppManager");
    catch (Exception ex)
    throw new Exception("You have insufficient memory to " +
    "launch this program. \nPlease quit some other " +
    "applications and try again.");      
    // Wait for a second to give the new process a chance
    // to run properly
    try
    Thread.sleep(1000);
    catch (Exception ex)
    final DataInputStream oProcStdOutStream = new DataInputStream(oProcess.getInputStream());
    final DataInputStream oProcStdErrStream = new DataInputStream(oProcess.getErrorStream());
    Thread oProcStdOutStreamThread = new Thread()
    public void run()
    try
    String szLine = null;
    while ((szLine = oProcStdOutStream.readLine()) != null)
    System.out.println("[FromProc1] " + szLine);
    catch (Exception ex)
         System.out.println("In oProcStdOutStream");
    ex.printStackTrace();
    oProcStdOutStreamThread.start();
    Thread oProcStdErrStreamThread = new Thread()
    public void run()
    try
    String szLine;
    while ((szLine = oProcStdErrStream.readLine()) != null)
    System.out.println("[FromProc2] " + szLine);
    catch (Exception ex)
    ex.printStackTrace();
    oProcStdErrStreamThread.start();
    // See if the process is still running properly
    int nProcessExitValue = 0;
    try
    nProcessExitValue = oProcess.exitValue();
         // nProcessExitValue = oProcess.waitFor();
         System.out.println("nProcessExitValue : "+nProcessExitValue);
    catch (Exception ex)
    // This means that the process is still running which
    // we'll consider a good sign.
    nProcessExitValue = 0;
    System.out.println("In nProcessExitValue");
    ex.printStackTrace();
    // Check the process exit value
    if (nProcessExitValue != 0)
    throw new Exception("You have insufficient memory to " +
    "launch this program. \nPlease quit some other " +
    "applications and try again.");
    Here is the error :
    starting processs C:\ccc\JRE\bin\javaw.exe com.att.suite.client.SuiteAppManager
    Class loaded...
    Got runtime.....
    nProcessExitValue : 1
    [FromProc2] The java class is not found: com/att/launch/jre/Sample
    java.lang.Exception: You have insufficient memory to launch this program.
    Please quit some other applications and try again.
         at com.att.launch.jre.LaunchApp.spawnProcess(LaunchApp.java:525)
         at com.att.launch.jre.LaunchApp.spawnCJAS(LaunchApp.java:366)
         at com.att.launch.jre.LaunchApp.main(LaunchApp.java:171)
    Please help me, I am struggling with this problem from the long time. Or can any body suggest different way to solve this
    problem instead of downloading the JRE to the client side.
    Bhaskar

  • Need help with using selected class with includes...

    Hi guys,
    I'm using PHP includes for my site and in the header include I have my main navigation - so it's drawn in to whatever page the user goes to from header.php.
    I want to have a 'selected' <li> class for the navigation so the relevant button is highlighted depending on which page/section the user is on...
    How would I go about implementing it into header.php - is there a way I can put a bit of PHP in each of the pages to make the appropiate <li> in header.php use the 'selected' class?
    Thank you and I hope to hear from you.
    SM

    I'm sure there will be an easier way than this for PHP but if you give each menu item a class, you can then give each <body> a different id (or class) to determine where the user is.
    Eg:
    CSS
    nav li.menu_home a{style here} /* class is 'menu_home' for home menu item */
    #home nav li.menu_home a{style here} /* the id of 'home' is added to the body tag on the home page, <body id="home"> */
    HTML
    <body id="home">
    <!-- navigation include -->
    <nav>
    <ul>
    <li class="menu_home"><a href="">Home</a></li>
    </ul>
    </nav>
    <!-- end navigation include -->
    </body>
    Or you could try searching for a javascript method.

  • ABAP business system vs. 2 integration systems - using proxy

    Hi guys,
    is it possible to use one abap ECC with 2 PI systems and using proxy classes for both PIs?
    Thanks

    Hi Alakov,
    This is not possible. In a SAP environment, u can have one Integration Server (which is XI/PI) and the rest backend systems act as Application systems.
    These backend application systems point to a single Integration Server using rfc destination (create in sm59). for ex: ECC points to PI from sxmb-adm -> Integration Engine Configuration. Here you set the ECC/backend system as Application system and provide the rfc destn of corresponding Integration Server (ex: dest://INTEGRATION_SERVER_DX1)
    If you have to use 2 PI, then you have to switch between the connections all the time which is obviously not feasible.
    Souvik

  • How can I call a ABAP proxy class from BADI? PLease help

    hi Experts,
        I have a scenario where I have to call a ABAP proxy class from a BADI. How can I do this? Does anybody has sample code for the same?
    Please help.
    Thanks
    Gopal

    Hi,
       You can call a method of a class from BADI. Here are the steps.
       1) In the BADI implementation create a object for the proxy class.
       2) Call the Execute_Synchronous method.
        You can define a BADI by using SE18 and you can implement it by using SE19.
    Sample code...
    ================================================
      METHOD ZIF_EX_VBADI~CONVERTUPPER.
      DATA: OBJ TYPE REF TO ZTESTCLASS.
      DATA: IT_DATA  TYPE ZIN_MT,
                IT_RES   TYPE ZOUT_MT,
                SEXCEPTION TYPE REF TO CX_AI_SYSTEM_FAULT.
      TRY.
          CREATE OBJECT OBJ
             EXPORTING
                 LOGICAL_PORT_NAME = 'TESTPORT'.
      CATCH CX_AI_SYSTEM_FAULT INTO SEXCEPTION.
      ENDTRY.
    ENDMETHOD.
    ================================================
    Thanks,
    Vivek LR

  • Proxy class creation using wsdl

    Hi Everyone
    There is a web service already running and what i have is the wsdl of that web service. How do i create the proxy classes for this webservice using the JWSDP
    Please help its urgent. Or atleasst direct me to any links for this query. Any help is welcome
    Thanks in advance
    Maria

    Edit a file named config.xml :
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration
    xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl location="http://{path}/{serviceName}?WSDL"
    packageName="client">
    </wsdl>
    </configuration>
    and try this command : xrpcc -client config.xml
    It will generate all the client-side classes.
    Finally, write a client that accesses to these classes.
    package client;
    import javax.xml.rpc.Stub;
    public class Client {
    public static void main(String[] args) {
    try {
              Stub stub = createProxy();
              stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,args[0]);
              CITClientIF_Stub cl = (CITClientIF_Stub)stub;
              result=cl.Method(...);
    } catch (Exception ex) {
    ex.printStackTrace();
    private static Stub createProxy() {
    return (Stub)(new MyCIT_Impl().getCITClientIFPort());

  • I don't found "used model" after I imported proxy class from CAF

    Dear Everyone,
    I built up CAF knowledge skill by do follow the document in SDN and I've tried connect CAF and web dynpro together. This's document that I learned.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/504540a4-fd0d-2a10-7c8e-c88289cf6457
    and I found some problem. as you see in Page 22. after I import proxy classes. I have to found something in used model popup as same as Page 23 , but I don't found anything in "selected model" popup and I check in "Used DCs". It has classes that same in Page 21.
    Can someone help me? Thank you in advance.
    Amnart.

    Dear Ayyapparaj and Everyone,
    Yes, I did. and I saw something will be my mistake.when I create new project. Do the domain has to be "SAP xApps" because I usually doesn't change it ( default is "Basis" )?
    I follow this document 3 times, but it still doesn't have classes in "used model" popup.
    Can you help me?Thank you in advance.
    Amnart.

  • Help using scanner class to count chars in file

    Hi all, I am learning Java right now and ran into a problem. I need to use the Scanner class to accurately count the number of chars in a file including the line feed chars 10&13.
    This what I have and it currently reports a 201 byte file as having 194 chars:
         File file = new File(plainFile);
         Scanner inputFile = new Scanner(file);
         numberOfChars = 0;
         String line;
         //count characters in file
         while (inputFile.hasNextLine())
              line = inputFile.nextLine();
              numberOfChars += line.length();
    I know there are other ways using BufferedReader, etc but I have to use Scanner class to do this.
    Thanks in advance!

    raichle wrote:
    Wow guys, thanks for the help! I've got a RTFMWell, what's wrong to have a look at the API docs for the Scanner class?
    and directions that go against the specs I said.Is that so strange to suggest a better option? What if I ask a carpenter "how do I build a table with a my stapler?". Should I give the man an attitude if he tells me I'd better use a saw and hammer?
    I'm also aware that it "eats" those chars and obviously looking for a way around that.
    I've looked through the java docs, but as I said, I'm new to this and they're difficult to understand. The class I am auditing req's that this be done using Scanner, but I don't see why you demand an explanation.
    Can anybody give me some constructive help?Get lost?

  • Needs help.....Please about using different classes

    I don't know how to use differenet classes.
    Please tell me how to write class to suit Start. This stuff me up. Please .... help me
    <<My program>>
    //Start
    public class Start
    {  private Artist[] Artists;
    private Record[] records;
    private Person[] Manager;
    private TextMenu makeMenu = new TextMenu();
    public static void main(String[] args)
         Start studio = new Start();
    studio.menu();
    public Start()
    {  //Person.Manager(ManagerName,HouseNumber,StreetNumber,PhoneNumber)
         Manager = new Person[1];
         Manager[0] = new Person("Yangfan",88,"Young ST",11118888);
         //Artist(GroupID,ArtistName,HouseNumber,StreetNumber,PhoneNumber)
         Artists = new Artist[5];
    Artists[0] = new Artist(1,"Backstreet Boys",58,"Music ST",99998888);
    Artists[1] = new Artist(2,"Santana",68,"Music ST",99998899);
    Artists[2] = new Artist(3,"Macy Gray",78,"Music ST",55558888);
    Artists[3] = new Artist(4,"Ricky Martin",88,"Music AVE",77778888);
    Artists[4] = new Artist(5,"Did Rock",55,"Music Road",66667777);
    //Record(RecordingID,RecordName,Artist,StartTime,FinishTime,RecordingDate,GuestArtist1,GuestArtist2)
    records = new Record[6];
    records[0] = new Record(1,"I want it that way",Artists[0],11,12,"05/08/2001",Artists[1],Artists[3]);
    records[1] = new Record(2,"Smooth",Artists[1],11,12,"05/08/2001",Artists[1],"");
    records[2] = new Record(3,"Do something",Artists[2],11,"05/08/2001",Artists[3],"");
    records[3] = new Record(4,"Livin La Vida Loca",Artists[3],11,12,"05/08/2001",Artists[1],Artists[3]);
    records[4] = new Record(5,"Bawitdaba",Artists[4],11,13,"05/08/2001",Artists[1],"");
    records[5] = new Record(6,"The one",Artists[0],11,14,"05/08/2001",Artists[1],"");
    public void menu()
    {  String[] choices = {">>>List Manager Details",">>>List All Artist Names",">>>List An Artist Telephone-Number",">>>Show Details For One Recording",">>>Add A New Recording",">>>List The Recording Costs For All Artists",">>>List Artist's Reocording",">>>Exit Program"};
    while (true)
    {  switch (makeMenu.getChoice(choices))
    {  case 1: showAllArtists();
    break;
    case 2: showAllRecords();
    break;
    case 3: System.exit(0);
    break;
    case 4: System.exit(0);
    break;
    case 5: System.exit(0);
    break;
    case 6: System.exit(0);
    break;
    case 7: System.exit(0);
    break;
    case 8: System.exit(0);
    break;
    default:
    public void showAllArtists()
    {  int numArtists = Artists.length;
    for(int i = 0; i < numArtists; i++)
    {  Artists[i].displayArtistDetails();
    public void showAllRecords()
    {  for (int i = 0; i < records.length; i++)
    {  System.out.println();
    records.printRecordDetails();
    <<Assignment>>
    Due - midnight, Wednesday August 22nd
    This assignment will test your knowledge of Java programming using classes, encapsulation and javadoc.
    The base requirements
    Write a complete Java class to manage a Digital Recording Studio. The studio wants to keep a list of all Artists that use the studio and also wishes to keep track of all Recordings that have been made. An important function of the program is to calculate the time spent making a recording and charge the Artist for the time used.
    You must create at least the following classes, Start, Studio, Person, Artist, Recording, Address. You may create other classes if needed as well
    Start will contain main(), create one instance of a Studio and execute a Menu of commands to test your code. Studio should contain a studio name, an array of Artist and an array of Recording plus the studio manager (a Person). Each Artist should contain the name of the group and an Address. Each Person will have a name and a home address. Each recording will have a Title (usually song title), an Artist (only one), and a list of guestArtist (they are Artist�s but will not receive royalties) the number of the CD the recording is stored on (numbers are numerical and recordings are saved on CD-R), plus the recording start and finish times for the recording session (suggest you use Java Date class � refer to the API). An Address will contain, house number (integers only), a street name and a telephone number. There is no need to store city and country.
    To enter a set of data for testing your program � main() should call a method in the Start class that will fill in a set of values by creating objects and filling in values by calling methods in each class. This is the ONLY method allowed to be longer than 1 page long � normally we would read the data from a file but there are no O-O principles that can be learnt with simply filling in data values. It is suggested to create say at least 4 Artist�s and 6 Recordings (at least one with 1 guest Artist and one with 2 guestArtist�s)
    A menu for testing your program should be provided (it is suggested to put the Menu into a separate class as you need at least 3 menus). While other commands are possible, only the following ones will receive marks.
    Menu commands needed are
    List the Managers name, address and telephone number
    List all Artist Names
    List an Artist telephone number (a sub menu showing valid Artist�s is required)
    Show all details for one Recording ( sub menu of valid Recordings will be needed and remember there can be more than one guestArtist)
    Add a new Recording, user will need to be prompted for all details.
    List the recording costs for all Artists � show each Artist on a separate line with their name and total amount, charge for using the studio is $1000 per hour or part thereof, example for a 1 hour and 10 minute recording the Artist will be billed for 2 hours.
    List all the Recording�s one Artist has worked on (sub menu of Artists needed), the list should show whether they were the Artist or a guestArtist
    Exit program
    Use fixed sizes for arrays, suggest 20 is suitable for all arrays. Java can handle dynamic data structures (where the number of elements can grow or shrink), but that is beyond a first assignment.
    Do NOT make ANY methods static - this defeats the Object Oriented approach and will result in ZERO marks for the entire assignment.
    Data MUST be encapsulated, this means that all the data relating to an object are to be stored INSIDE an object. None of the data detail is to be globally available within your program - hence do not store Artist names in either Studio or Recordings � just store a reference instead. Do NOT create ID numbers for Artists, you should use References instead � for many students this will be the hardest part as you have to use Objects, not program in a C style to solve the problem. Note that if there are any non-private data in classes then zero will given for marks for encapsulation.
    Good programming style is expected (see web page or lecture notes). In particular, you must use javadoc to generate a set of html pages for your classes. Make sure you use the special javadoc style comments in your source code. Marks will be granted for both using javadoc and also for including sensible javadoc comments on each class and each public method.
    What to Hand In
    Read the turnin page, basically the .java files, a readme.txt to tell the marker which file the program starts from plus the javadoc (html) files. Do NOT send .class files (if you do send these we will delete them and recompile your program), do NOT compress with gtar, tar, zip or use any other tool on your files. Turnin automatically compresses all your files into a single archive for us to mark.
    The simplest way to turnin all your files is to place all files in one directory then just use the *.* wildcard to turn in all files within that one directory.
    You must turnin all files that are not part of Java 1.3. In particular, you are allowed (actually encouraged) to use EasyIn or SavitchIn but should include the one you use in the files you submit. It is STRONGLY suggested that you copy all the files into another directory, test it works there by compiling and executing then turnin files from that directory. A common problem is students adding comments at the last minute then not testing if it still compiles. The assignment will be marked as submitted � no asking later for leniency because you added comments at the last minute and failed to check if it still worked.
    If the tutors are unable to compile your submission, they will mark the source code but you will lose all the execution marks. Sorry, but it is your responsibility to test then hand in all files.
    Comments
    For CS807 students, this program should be fairly easy if it was to be programmed in C (you would use several struct). The real art here is to change over to programming objects. Data is contained in an object and is not global. This idea is essential to using Java effectively and is termed encapsulation. Instead of using function(data), you use objectName.method( ). Effectively you switch the data and functions around, the data has a method (function) attached to it, not the other way around as in C (where you have a function and send data to it).
    While there will be some marks for execution, the majority of the marks will be given for how well you write your code (including comments and documentation) and for how well you used O-O principles. Programs written in a C style with most of the code in one class or using static will receive ZERO marks regardless of how well they work.
    You are responsible for checking your turnin by reading the messages turnin responds with. Failure to read these messages will not be an acceptable excuse for submitting an incorrect assignment. About 2% of assignments sent to turnin are unreadable (usually empty) and obtain 0.
    Late submissions
    Late submissions will only be accepted with valid reasons for being late. All requests for assignment extensions must be made via email to the lecturer. Replies for acceptance or refusal will made by email. Instant replies are unrealistic (there is usually a flood of queries into my mail box around assignment due dates) and the best advice is to ask at least 4 days in advance so that you will have a reasonable chance of getting a timely reply and allow yourself enough time to submit something on time if the extension is not granted.
    ALL late submissions will be marked LAST and will NOT be sent to tutors for marking until all other assignments have been marked. As an example, if you submit late and your assignment is not yet marked by the time assignment 2 is due then it will be pushed to the end of the marking pile as the assignments that were submitted on time for assignment 2 will take priority.
    If you make a second submission after the submission date, only the first submission will be marked. We will not mark assignments twice! You can update your submission BEFORE the submission date if you need to - this will just overwrite the first submission. The latest time for a late submission is 5pm on the Wednesday after the due date. This is because, either a solution will be handed out at that lecture or details of the assignment will be discussed at the lecture. I cannot accept any assignment submissions after that time for any reason at all including medical or other valid reasons. For those who are given permission to be later than the maximum submission time � a different assignment will be handed out. Remember, if you decide to submit late you are VERY UNLIKELY to receive feedback on your assignments during semester.
    Assignments will be removed from turnin and archived elsewhere then forwarded to tutors for marking on the morning after the assignment is due. A different tutor will mark each of your assignments � do not expect the tutor you see at the tutorials to be your marker.
    Marks will be returned via email to your computer science yallara account � ideally within 2 weeks. I will send marks out when I receive them so do not send email asking where your marks are just because a friend has theirs. If you want your email forwarded to an external account, then place a valid .forward file into your yallara account. The Help Desk on level 10 can assist you in setting this up if you do not know how to do it.

    I have seen other people who have blatantly asked for
    other people to do their homework for them, but you
    are the first person I've seen to actually cut and
    paste the entire assignment as it was handed to you.
    Amazing.
    Well, unlike some of the people you're talking about, it seems like zyangfan did at least take a stab at it himself, and does have a question that is somewhat more sepcific that "please do this homework for me."
    Zyangfan,
    marendoj is right, though. Posting the entire assignment is kind of tacky. If you want to post some of it to show us what you're trying to do, please trim it down to the essential points. We don't need to see all the instructor's policies and such.
    Anyway, let me see if I understand what you're asking. You said that you know how to write the code, but only by putting it all in one class, is that right? What part about using separate classes do you not understand? Do you not know how to make code in one class aware that the other class exists? Do you not know how code in class A can call a method in class B?
    Please be a bit more specifice about what you don't understand. And at least try using multiple classes, then when you can't figure out why something doesn't work, explain what you did, and what you think should have happened, and what did happen instead.
    To get you started on the basics (and this should have been covered in your course), you write the code for two classes just like for one class. That is, for class A, you create a file A.java and compile it to A.class. For class B, you create a file B.java and compile it to B.class. Given how rudimentary you question is, we'll skip packages for now. Just put all your class files in the same directory, and don't declare packages in the .java files.
    To call a method in class B from code that's in class A, you'll need an object of class B. You instantiate a B, and then call its methods.
    public class B {
      int count;
      public B() { // constructor
      public void increment() {
        count++;
    public class A {
      public static void main(String args[]) {
        B b = new B();
        b.increment();
    }Is this what you were asking?

  • Help: forcing use of proxy in j2me and getting value of gateway IP address

    hi everyone,
    #1
    Has anyone tried forcing the use of a proxy for a midlet? If so how did you do this? I was able to connect to a url through the emulator (ktoolbar) by changing the proxy settings under the edit-->preferences on ktoolbar but I want to make sure that my midlet enforces the use of a proxy to connect to a http url (so that I'll know it still uses the proxy even if it is already using a real java-enabled phone).
    somebody suggested to me to take a look at http://java.sun.com/j2me/docs/html/docs/Running.html
    I've tried the instructions from the url but it seems like its just the configuration you run when you test it in your emulator. Similar to changing the preferences on ktoolbar to use a proxy.
    This is what I did:
    I tried changing the config to a working proxy, compiled my midlet, download it into my java-enabled phone and tested if it can connect to a backend server. The result: I was able to get a reply from the backend, however, when I changed the configuration to a non-working proxy, I still get a reply from the backend server. This leads me to believe that the midlet uses the current internet connection profile on the phone.
    If this is the case, then that means I am dependent on the phone settings and I could not change/force the midlet to use the current connection with a proxy server I defined. I've searched the internet and have seen sample codes to use proxy servers when connecting to the intenet but they are not for j2me applications (so far). Is this a limitation of j2me? maybe there is really no way to connect using a proxy defined in an application since there is no api for it? Correct me if I'm wrong though. Is there a workaround for this?
    #2
    Another problem that I am trying to solve is to get the value of the gateway IP address defined on the phone when it connects to the internet. Is this possible? If so, how?
    Any ideas will be very much appreciated. thanks to all.
    -jess

    hi,
    does anyone have an answer to this? hope you can help. thanks again.

Maybe you are looking for

  • How do yo remove the Sense UI

    I should have played with the phone more in the store.  Got it for my daughter and the interface is so unintuitive "even to her" I would like to know how to remove it, disable it and go to a stock Android interface.  The home page is one big icon/wid

  • 401:Unauthorised error

    Hi All i uasually get this 401: Unauthorised error. and when i remove the anonymous role from jazn.xml it works fine. i think that anonymous role causes issue. is it so?...if not what could be the issue? Thanks Edited by: AdfNew-b on May 18, 2012 5:1

  • Data Manager prompt

    BPC 7.5 NW SP11 Question: Can i have the data manager prompt give parent node selection by default instead of only base members I have product dimension with ProductLine as parent node and Product Item as base member. In one of our process we have a

  • HOW TO ADD SOUND

    any help will be greatly appreciated, thanks!!! jane again

  • JNDI: Can't find Class com.sun.jndi.nis.NISCtxFactory

    Hi I searched this forum for similar problems .. and I also found some, but this questions were either not be answered or not detailed enough. Now to my question. I've got a Java File that I imported to Oracle (I use it from PL/SQL). This Java File c