How to use class defined by myself?

I am using the wondows xp system. When I try to run my main program which uses some of the classes in the same folder, it keeps on saying can not resolve symbol. Do I need to do some configuration for that so the main program can locate the classes in the same folder? Thanks in advance.
David

Send us the complete error message. Also check for upper/lowercase class names - they are different.
Rafael

Similar Messages

  • How to use user-defined packages in JAX-RPC web service

    I am trying to use Object of my class located in my package in jax-rpc webservice,the code is
    package supercomputer;
    import Hello.*;
    public class SuperImpl implements SuperIF
    public String sendParam(String data)
    Temp ob=new Temp();
    int i=ob.get1(10000);
    return data+"returned by supercomputer";
    Temp is located in Hello package,I have jar the Hello package as Hello.jar and has set its classpath in targets.xml of Ant tool.
    The code compiles well and service is deployed successfully,but when i try to call the service from the client its gives me following error.
    [echo] Running the supercomputer.SuperClient program....
    [java] java.rmi.ServerException: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    [java] at supercomputer.SuperIF_Stub.sendParam(SuperIF_Stub.java:60)
    [java] at supercomputer.SuperClient.main(Unknown Source)
    I dont know if it deploys why it gives error on client side.
    Please tell how to use user-defined packages and class in jax-rpc service code ,i am not talking about passing user-defined parameters i am just talking about making objects of user defined classes in jax-rpc service.I think there is some problem in classpath.
    Please guide me in doing that.
    Thanks,
    Farrukh

    Farrukh,
    I don't know if your error is about a missing class from your custom package, ... what track did you followed to say that?
    To use your package in the implementation of you web service, you should only follow the rules of making a web application: put your package jar in your \lib directory inside WEB-INF/ or your package classes unjared in classes (also in WEB-INF/).
    As I already said, I have doubts that your error should be originated from a missing class from your package, but:
    -try to see the logs (errors?) when you deploy your web service that could give a hint about the problem.
    -try to see if you can access your endpoint through your browser to see if there is a online status
    -display your config/WSDL file, and the steps you did to build your web service.
    regards,
    Pedro Salazar.

  • Need samples how to use classes in WebDynpro

    Hi,
    I Need To simple Samples how to use classes in WebDynpro.
    Regards

    Continued....
    and in the model
    right click->create model
    select the radio button import java bean .
    next ADD jars option will be seen
    Browse the jar on the dekstop.
    now add this model to the used models by right clicking on it.
    Now if you go to Data Modeler.
    You will find the used model.
    From there map to the component controller->view Controller.
    And continue with ur coding.
    Hope this helps you.
    Thanks & Regards,
    Lokesh.

  • How to use user defined object with linked button

    Hi experts
    Can I use user defined table data with linked button. If yes then how. plz give me sample examples.
    Regards
    Gorge

    If you have an UDO in your form, or any other, the FormDataLoad eventhandler should be used.
    Take care, it is not inside the eventhandler.
    for VB:
    Select SBO_APPLICATION in the classes, and select FormDataLoad event
    Private Sub SBO_Application_FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.FormDataEvent
    in C#
    Add a new eventhandler as
    // declaration
    SBO_Application.FormDataEvent += new SAPbouiCOM._IApplicationEvents_FormDataEventEventHandler(ref SBO_Application_FormDataEvent);
    // eventhandler:
    public void SBO_Application_FormDataEvent(ref SAPbouiCOM.BusinessObjectInfo BusinessObjectInfo, out bool BubbleEvent)

  • How to use classes in Actions tab

    Hello guys!
    I'm just a beginner so i'm sorry for my stupid question.I'm developing a game in which movie clips in our case people have their own schedule.I have multiple screens and so i want to be able to set their locations and make them invisible on other screens(rooms)they're not currently at.The trouble is i can't use variables from Actions in my class,neither can i use classes in my Actions.Can anyone tell me how to export classes into Actions code?
    Here is my code:
    var currentlocation;
    var currentscreen;
    if (person.currentlocation!==currentscreen){
    person.visible=false;
    btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
              currentscreen = "classroom";
              classroom.visible = true;
              playroom.visible = false;
    btn_2.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    function fl_MouseClickHandler_2(event:MouseEvent):void
              currentroom = "playroom";
              classroom.visible = false;
              playroom.visible = true;

    Your problem/question is not clear to me.  If you are getting errors you should include the error messages in your posting.
    Could the problem arise from using a variable that is not defined?
    currentroom = "playroom";
    I do not see currentroom defined as a variable anywhere.  There is a currentscene variable though.

  • How to use Class "CL_GUI_CHART_ENGINE" in a abap program ?

    Hi Guys,
    I want to display data in my internal table in the form of a Graph using class "cl_gui_chart_engine".
    I had a look at sample program given by SAP - GRAPHICS_GUI_CE_DEMO but need some help to understand how can we use our own data to be displayed in the graph ? Basically what I am looking for is that where we need to do the changes in creation of XML file so that we can pass our own data ?
    ( perform create_data_demo using l_ixml_data_doc)
    Could you please help me with some sample code or pseudocode ?
    Thanks
    Ashwa

    Thanks Kai,
    I had already done the same thing and got the required output.
    Populate X-Axis ( Categories )
      LOOP AT ITAB.
    Populate Categories
        l_element = p_ixml_doc->create_simple_element(
                  name = 'C' parent = l_categories ).
        l_element->if_ixml_node~set_value( itab-value).
      ENDLOOP.
    Populate Y-Axis ( Values )
      LOOP AT VALUE_TAB.
       l_element = p_ixml_doc->create_simple_element(
                 name = 'S' parent = l_series ).
        l_element->if_ixml_node~set_value( value_tab-value).
      ENDLOOP.
    I am now trying to find the ways to change the default layout of the graph. I guess it should be done in "perform create_custom_demo using l_ixml_custom_doc." . I want that my graph should be displayed as lines instead of bar's.
    Once I achieve this I will share my findings along with sample code with the community.
    I wish I could get some documentation on class "cl_gui_chart_engine" and interfaces like "if_ixml_document".
    Thanks
    Ashwani

  • How to use classes of packages in flex mx:Script/ or mxml/

    Hi.I am just learning Flex using Flex Builder 3 facing one problem,
    Suppose I declare one package with name alert.as
    package
    import mx.controls.Alert;
    public class alert
    public function alertBtn()
    Alert("Hello btn 1");
    Now in want to use the function in mxml that I declared in a package.
    <mx:Button label="btn1" click="alertBtn();"  />
    I have few questions
    1)How to Import the class alert.as in <mx:Script> and where should i store the file alert.as in the directory folder of flex?
    2)How to call the function alertBtn() when btn1 is clicked.
    Thanks so much!
    Regards
    Ankur

    Hi Greg.I think I was not able to clear my problem properly.Let me try this time again.
    What I wanted to do was that in the below written code I have the full access of the id=panel1 in the  script tag .This works properly.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
    import flash.display.Sprite;
    import mx.core.UIComponent;
    private function addChildToPanel():void {
    var circle:Sprite = new Sprite();
    circle.graphics.beginFill(0xFFCC00);
    circle.graphics.drawCircle(0, 0, 20);
    var c:UIComponent = new UIComponent();
    c.addChild(circle);
    panel1.addChild(c);
    ]]></mx:Script>
    <mx:Panel id="panel1" height="100" width="100"/>
    <mx:Button id="myButton" label="Click Me" click="addChildToPanel();"/>
    </mx:Application>
    This above functionality when I tried to do using class Outside the code ,its not working !
    Here is with the package:-
    But suppose I make One package 
    package
    import flash.display.Sprite;
    import mx.core.UIComponent;
    class getPanel extends Sprite
    public function addChildToPanel():void {
    var circle:Sprite = new Sprite();
    circle.graphics.beginFill(0xFFCC00);
    circle.graphics.drawCircle(0, 0, 20);
    var c:UIComponent = new UIComponent();
    c.addChild(circle);
    panel1.addChild(c);
              }//class
                        }//package
    Now in MXML
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
    import getPanel;
    ]]></mx:Script>
    <mx:Panel id="panel1" height="100" width="100"/>
    <mx:Button id="myButton" label="Click Me" click="getPanel.addChildToPanel();"/>
    </mx:Application>
    So My problem is that this code doesnt do anything.
    Neither the addChild function is working in it ,Nor the Panel1 is accessible here.
    Can u pls help me here.
    Thanks
    Ankur

  • How to use class in JSP file?

    Hello All,
    I am new to Jsp.
    In Jsp file,I used class of myself.
    Why,the Constractor seems not working?
    Thanks in advance.

    Hi,
    You can import the class in a jsp file.
    Use <% page import = "">
    and call that class.
    If u want to import a funtion in your class, then u can insert that into scriplets like <%! ..%>
    Hope u got that!
    Artz

  • How to use class.getResource() to create an ImageIcon

    Hi,
    I am well acquainted with creating and using ImageIcon icons using the ImageIcon constructor
    and putting the image file in a folder called Images which is at the same level as the
    bin and src folders.
    I discovered a demo program, LayeredPaneDemo, that uses class.getResource() to create
    an icon and found that in my eclipse version, the icon's image file was not found when
    I used the original getResource() call but the icon was created when I used the ImageIcon
    constructor.
    I posted on JavaRanch and eventually realized that the image file needed to be with the
    .class files, so I moved the Images folder under bin and getResource() works fine and I'm
    happy.
    However, I have three questions for you.
    One poster on JavaRanch told me that it's better to use getResource() rather than the
    ImageIcon constructor for distributing an app (I'm not distributing anything but want
    to do it all correctly).
    Do you agree with that or can I safe keep using the ImageIcon constructor?
    Another poster told me he doesn't think it's safe to leave the image file in bin because
    it might be lost during the build in eclipse and that there is a way to have eclipse copy
    the files to bin during the build which should mean that I can leave the images folder at
    the level of bin and src.
    Do you agree with that?
    If yes, how do I get eclipse to copy the file during the build?
    P.S.
    Before I posted on JavaRanch, I put the Images folder at every level of the project's
    directory as shown in eclipse (which is why I missed the bin folder until JavaRanch
    whacked me upside the head) and getResource() still didn't work.

    The contents of the Java Source folder are compiled if they're source files, copied otherwise (assuming no filter's been put in place to prevent copying), so your images belong under a source folder.

  • How to use classes CL_DOCX_*

    We have a need to use word 2007 OOXML classes  all of which start with CL_DOCX*.
    Basically what we are trying to do is take a DOCX files (File 1 & File 2) saved by MS WORD 2007 application and replace the header of File 1 with the header from File 2.
    The basic functionality described above is working fine. However the same is not working when the header from File 2 has an IMAGE embedded in it.
    We found several  word 2007 OOXML classes  in the system (all of which start with CL_DOCX*), but couldn't find usage for these classes anywhere in the system or SDN or OSS Notes etc.,
    Just wondering whether anyone used these classes in their development environment and whether they can share this information here?
    Any help in this regard is highly appreciated.
    thanks,
    -Sreenath

    Which NetWeaver release are you using? The whole OOXML seems to be evolving within EhPs.
    You'll find examples how to use the framework in the Unit Tests of class CL_DOCX_FORM - so have a look at those classes. For me those test code runs fine.
    Best Regards,
    Tobias

  • How to use class.forName

    I am trying to use Class.forName() from a string which is passed to me as argument.
    Class batchClass = Class.forName(args[1]);
    A jar file contains the class file for the string received above and I have this jar file in the manifest of my executable jar.
    I get a class not found exception when I run my executable jar
    Can some body give pointers..what could possibly be the issue.
    The jar file is in my classpath
    run script
    #!/bin/csh
    java -jar -DDBPROVIDER=NO -DDBUS_ROOT=$DBUS_ROOT -DVTNAME=$VTNAME ./jar/IntraDayDepotPositionBatch.jar MagellanStart IntraDayDepotPositionBatch INPUTFILE LOGFILE
    Exception
    Magellan program starting - program class IntraDayDepotPositionBatch
    Cannot find program class - IntraDayDepotPositionBatch
    IntraDayDepotPositionBatch
    java.lang.ClassNotFoundException: IntraDayDepotPositionBatch
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at com.db.mmrepo.app.IntraDayDepotPositionBatch.MagellanStart.main(Unknown Source)
    Thanks for your time and feedback on this

    actually i tried both...with package name and without package name..
    nothing worked...
    my manifest file also contains the path to the package..so does the classpath

  • How to use classes from an existing outside library ?

    Dear People,
    I added a library to use classes already built.
    In JBuilder7 I went to Tools | ConfigureLibraries
    and added the objectdraw library. At the left when I look in the
    directory structure under User Home is "objectdraw" so I did
    add the library correctly but when I put in the coding a try
    to run it, the error messages say:
    "MakeBox.java": Error #: 200 : <identifier> expected at line 8,
    which is the line : public void MakeBox()
    The entire code is :
    package stan_e_makebox;
    import objectdraw.*;
    import java.awt.*;
    public class MakeBox extends WindowController
    void public MakeBox()
    public void onMousePress(Location point)
    new FilledRect(40,80,30,20,canvas);
    public static void main(String[] args)
    new MakeBox();
    Thank you in advance
    Stan

    oo sorry,
    this is the constructor i assume, so should be
    public MakeBox()

  • How to use class for Translate..codepage/numer format

    In the Unicode context, TRANSLATE... CODEPAGE/NUMBER FORMAT is not allowed.

    this is the class to be used for  Translate…Codepage/number format.statement
    Unicode Error : In the Unicode context, TRANSLATE... CODEPAGE/NUMBER   FORMAT is not allowed.
    Before Unicode
      TRANSLATE T143T-TBTXT FROM CODE PAGE '1100' TO CODE PAGE '1105'.
    After Unicode
       Use class for Translate codepage to codepage.
         Data : g_codepage LIKE tcp0c-charco VALUE '1100'.
    CONSTANTS: c_unicodecp(4) VALUE '1105'.
    PERFORM translate_codepage USING g_codepage
                                     c_unicodecp
                               CHANGING T143T.
    FORM translate_codepage  USING    P_G_CODEPAGE
                                      P_C_UNICODECP
                             CHANGING P_T143T.
      DATA: converter  TYPE REF TO cl_abap_conv_obj.
      DATA: l_out      TYPE string.
      DATA: l_fromcode TYPE cpcodepage.
      DATA: l_tocode   TYPE cpcodepage.
      l_fromcode = P_G_CODEPAGE.
      l_tocode = P_C_UNICODECP.
      CREATE OBJECT converter
        EXPORTING
          incode  = l_fromcode
          miss     = '.'
          broken   = '.'
          use_f1   = 'X'
          outcode  = l_tocode
        EXCEPTIONS
          invalid_codepage = 1
          internal_error   = 2.
      IF sy-subrc <> 0.
        CASE sy-subrc.
          WHEN 1.
            MESSAGE ID 'FES' TYPE 'E' NUMBER '024' RAISING unknown_error.
          WHEN 2.
            MESSAGE ID 'FES' TYPE 'E' NUMBER '024' RAISING unknown_error.
        ENDCASE.
      ENDIF.
      CALL METHOD converter->convert
        EXPORTING
          inbuff         = P_T143T
          inbufflg       = 0
          outbufflg      = 0
        IMPORTING
          outbuff        = l_out
        EXCEPTIONS
          internal_error = 1
          OTHERS         = 2.
      IF sy-subrc <> 0.
        CASE sy-subrc.
          WHEN 1.
            MESSAGE ID 'FES' TYPE 'E' NUMBER '024' RAISING unknown_error.
          WHEN 2.
            MESSAGE ID 'FES' TYPE 'E' NUMBER '024' RAISING unknown_error.
        ENDCASE.
      ENDIF.
      P_T143T = l_out.
    ENDFORM.                    " translate_codepage

  • How to use .class files from jsp

    hi i want to use .class files in my jsp program can any one help me

    so if you are using pacakges here is normal example...
    say you .java code is something like...
    package com.util;
    public Class BeanUtility{
    }place the .class file at WEB-INF/classes/com/util folder if those folders are missing create it and place the .class file there. or pacakage it as a jar file & put it into WEB-INF/lib folder
    Now in jsp you can either use jsp:Usebean tag or use normal scriplets to create an instance of the nessary class...
    here is an example for you
    <%@ page language="java" import="com.util.BeanUtility" %>
    <%
    BeanUtility bn = new BeanUtility();
    %>however,i'd suggest you to make use of JSTL / Inbuilt tag libraries /MVC 2.0 approach for better maintainance & readablity.
    Hope this might help
    REGARDS,
    RaHuL

  • How to use user defined exception class

    Hi all
    I just need som help with creating a user defined exception class.
    Im writing a small/simple text editor.
    My exception class looks like this:
    public class myExcp extends Throwable
         private String message;
         public myExcep(String message)
              this.message = message;
         public void display()
              System.out.println(message);
    I would like to use it when a user tries to open a exe-file instead of a txt file.
    Here is some code from the editor:
    if (e.getSource() == open)
    saveOld();
    if (fc.showOpenDialog(null)== JFileChooser.APPROVE_OPTION)
    readFile(fc.getSelectedFile().getAbsolutePath());           
    saveas.setEnabled(true);                
    So, should I use exception here or at the readFile method?
    readfile:
    private void readFile(String fileName)
    try
    String tmp = fileName.substring(fileName.length() -4, fileName.length());
    if (!tmp.equals(".exe"))
    FileReader r = new FileReader(fileName);
    textarea.read(r, null);
    r.close();
    currentFile = fileName;
    label.setText(currentFile);
    changed = false;
    catch (IOException e)
    JOptionPane.showMessageDialog (this, "Cannot find the file " + fileName);
    Where and how do I use my exception class.
    Do I need to create an instance? Where?
    Should the exception class extend Exception instead?
    Thank you in advance /

    Extend Exception, not Throwable. It's a checked exception that way.
    Follow the Sun coding standards and make that exception class name start with a capital letter.
    When you extend Exception, override all four ctors.
    What's that display method you added? Isn't getMessage() good enough?
    You need to create a new instance just before you throw the exception, of course.
    Sounds like a terrible design, by the way. Exceptions shouldn't be used like "go to" for app logic. They should signal unrecoverable conditions. You can easily recover from the situation you've described simply by displaying a pop-up that tells the user to open only text-readable file types. I think that's a better solution.
    %

Maybe you are looking for

  • Table footer issue in body page of adobe form

    Form has 1 master page and 1 body page. Body page has table within which there is a footer header and detail (2 footers) in the form. My intention is to make footer (both the footers) appear in the last page of the form. For most of the scenarios, fo

  • How to process Excel through JDBC

    Hi, there! In windows,we could build an ODBC Driver for excel,then how to write the sql statment to query and update the content of the excel through JdbcOdbcDriver? I have create an ODBC DataSource named Register,the excel file is RegisterInfo.xls a

  • I've created a Photo Book in iPhoto, it quits uploading halfway through.

    I've spent many days creating a Photo Book using iPhoto and now I'm ready to order it! But twice now it quits halfway through the uploading process. How can I figure out what the problem is? I was really looking forward to see this project as a finis

  • How do i find my ipod

    have lost my iPod can I locate it and how?

  • Jar not loaded Error when deploying weblogic.jar in tomcat

    Hi experts, This time i have one more problem, i have deployed my application in tomcat such that when tomcat starts my java program also gets started, for my java program i had to use a weblogic library which is in "web-inf / lib / weblogic.jar" . b