Correct way to compile packages

Hi
I have been following a tutorial which requires that i create classes in a package.
I can compile with the -classpath option fine
However when I attempt to run the program I get an exception basically saying the class is not found. When i removed all the package statements from all the files it run fine. This lead me to believe that when attempting to run the program | am not passing the correct syntax to run my package with the -classpath option. Even when i follow the syntax example from the help i just get all the options displayed again as if i have the syntax wrong.
Does anyone have an example or any pointers?
Many thanks in advance

Thanks for the reply you've really clarifyed somethings for me
The first concept to understand is the compiler's use
of Classpath. javac uses the Classpath to find
already-compiled classes that the source code refers
to.I knew this...
If your source code doesn't use any other
classes, then the compiler doesn't need to find any,
so any Classpath will work - the compiler doesn't use
it. So source code might successfully compile no
matter how you set the classpath, (but won't run if
the jvm can't find the class).
This i didnt realise. The classes are all empty and refer to no other classes. Because they complied i thought i had the classpath syntax correct and the path to these classes was successfully added to the classpath.
If the source code refers to another class, the
compiler uses the Classpath to look for the compiled
class. The path to the .class file is
classpath_directory + [package_name] +
class_name.class. (I'll ignore jar files for now.)
Assuming your .class files are in e:\divelog and
package divelog, for javac to find a class in your
package, e:\ must be in the classpath when the javac
command is invoked to compile source code that refers
to a class inside the divelog package.I Am not too clear on this, when you say e:\ must be in the class path is that because it is the package root?
if my directory structure was:
e:\somedirectory\mypackages\myclass
would have to be in the class path like:
e:\
or e would need to be part of the class path like this:
e:\somedirectory\mypackage
I assumed that you need to add the package path but not the root drive or any non java folders above that package folder.
You can put your main method class in the divelog
directory, but I suggest that if you do you should
make it part of the package with the package divelog;
statement.the package statement has been added to divelog.java
Thanks for your replies guys, I am slowly getting it. Sorry if i seem a bit thick headed its just that i like to try an understand a concept completley

Similar Messages

  • Correct way of using Packages in the application

    Hi,
    I would like to know if there is any performance loop hole if i use old developed packages in my current project?
    Will there be any problems with the oracle memory structures like lib cache,dict cache and buffer cache?
    Example:
    I have Packages A,B,C,D
    Now i will develop package E, in package E, i want to utilize the old developed business librarys i.e A,B,C,D in E
    i.e PACKAGE E AS
    BEGIN
    A.method();
    B.method();
    C.Method();
    D.Method();
    END;
    If there will be the performance problems can i develop the same functionality which is there in the previous one in the existing package?
    Thanks!!
    VJ

    Hello VJ,
    that's what packages are made for: to be reused. On the other hand, if you use only a small part of the code in the "old" packages it might be useful to extract this code, but only for maintainance reasons. Any developer will be glad if he doesn't have to search 5000 lines of code only to maintain the 100 lines that are used.
    So in my opinion the question is: will the procedures/functions of the old packages have to be kept in sync for more then one application, than just reuse them. Do you use most of the code in the packages then just reuse them. If you use only a small part of the code then consider extracting it, but only for maintainance reasons.
    Or does old mean that the packages are inefficient? Otherwise they are not old but as young as ever.
    Regards
    Marcus

  • What's the easiest way to compile a servlet?

    What on earth is the easiest way to compile a servlet? I have ant and I know how to use it, but there has to be an easier way. I write my programs in Textpad and it'll only spit out errors when i try to compile:
    C:\projects\WEBDEV\merchandiseServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    C:\projects\WEBDEV\merchandiseServlet.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    C:\projects\WEBDEV\merchandiseServlet.java:15: cannot resolve symbol
    symbol : class HttpServlet
    location: class merchandiseServlet
    public class merchandiseServlet extends HttpServlet
    ^
    C:\projects\WEBDEV\merchandiseServlet.java:21: cannot resolve symbol
    symbol : class HttpServletRequest
    location: class merchandiseServlet
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    ^
    C:\projects\WEBDEV\merchandiseServlet.java:21: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class merchandiseServlet
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    ^
    C:\projects\WEBDEV\merchandiseServlet.java:22: cannot resolve symbol
    symbol : class ServletException
    location: class merchandiseServlet
                        throws ServletException, IOException {
    ^
    I have my JAVA_HOME variable set to C:\j2sdk1.4.1_01 and my J2EE_HOME set to C:\j2sdkee1.3.1 and that is exactly where each are installed. How would a person compile a servlet say.. on the command line? It seems there would be an easier way than having to do a build file and all that. Any help would be greatly appreciated. I've written a lot of stuff that works great but for some reason this stuff is giving me fits. thanks in advance

    C:\projects\WEBDEV>javac -classpath "C:\j2sdk1.4.1_01\bin; C:\j2sdkee1.3.1\bin;
    C:\j2sdkee1.3.1\lib\j2ee.jar" merchandiseServlet.java
    merchandiseServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    merchandiseServlet.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    I got 7 total errors that time, more than before, all of them dealing with packages in the j2ee. The classpath is 100% correct for the way I installed everything; I have checked it about three hundred times. Could htere be some other small detail I missed?

  • What is the correct way to add styling to drag-and-drop created calendars?

    I have a working instance of a rich client calendar. I generated the view with the required fields (start, stop, provider, ...), put it into the App Module, and dragged it onto a JSF page to create a calendar.
    Next I created an activityScope object in a class called CalendarBean (no inheritance)
    Class CalendarBean()
    private HashMap<Set<String>, InstanceStyles> activityColorMap;
    +..+
    +public CalendarBean() {+
    super();
    activityColorMap = new HashMap<Set<String>, InstanceStyles>();
    HashSet setEd = new HashSet<String>();
    HashSet setLen = new HashSet<String>();
    setEd.add("Work");
    setLen.add("Home");
    activityColorMap.put(setEd, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityColorMap.put(setLen, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.RED));
    +}+
    +}+
    Next, I linked this up as a backing bean and associated the ActivityStyles of CalendarBean to it:
    +#{backingBeanScope.calendarBean.activityColorMap}+
    I populated some records in the database with properties "Work" and "Ed', but they show default blue.
    As I understand it, I need to do something with the getTags() method of the underlying CalendarActivity class, but I'm not quite sure how to do that.
    Took a stab at creating a class, CalendarActivityBean, that extended CalendarActivity, and pointed all the CalendarActivity references I had to the new class, but it didn't seem to fire (in debug), and I got into trouble, when inserting records, with
    public void calendarActivityListener(CalendarActivityEvent calendarActivityEvent) {
    currActivity = (CalendarActivityBean) calendarActivityEvent.getCalendarActivity();
    being an illegal cast
    What is the correct way to add provider-based styling to drag-and-drop create calendars?
    Ed Schechter

    A colleague of mine was kind enough to solve this:
    The calendar has ActivityStyles property = #{calendarBean.activityStyles}
    CalendarBean looks something like this:
    package com.hub.appointmentscheduler.ui.schedule;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Set;
    import oracle.adf.view.rich.util.CalendarActivityRamp;
    import oracle.adf.view.rich.util.InstanceStyles;
    +public class CalendarBean {+
    private HashMap activityStyles;
    private String dummy;
    +public CalendarBean() {+
    +// Define colors+
    activityStyles = new HashMap<Set<String>, InstanceStyles>();
    HashSet setPending = new HashSet<String>();
    HashSet setArrived = new HashSet<String>();
    HashSet setApproved = new HashSet<String>();
    HashSet setCompleted = new HashSet<String>();
    setApproved.add("APPROVED");
    setPending.add("PENDING");
    setArrived.add("ARRIVED");
    setCompleted.add("COMPLETED");
    activityStyles.put(setApproved, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.GREEN));
    activityStyles.put(setPending, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityStyles.put(setArrived, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.PLUM));
    activityStyles.put(setCompleted, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.LAVENDAR));
    +}+
    +public void setactivityStyles(HashMap activityStyles) {+
    this.activityStyles = activityStyles;
    +}+
    +public HashMap getactivityStyles() {+
    return activityStyles;
    +}+
    +}+
    Now, go into the Bindings tab on the calendar page, double click the calendar binding, and specify the column you've defined as the calendar's Provider in the Tags dropdown.
    Should show colors.

  • Trouble with compiling packages

    I ve posted this in other forums but most of the soultions that i got was problamatic. if there is a way to compile a application which has 3 or 4 sub packages without using any other tools other than what comes with jdk that's what im looking for
    itried what was in this post but that didnt work
    http://forum.java.sun.com/thread.jspa?threadID=541081&messageID=2622943
    Thanks in advance

    The other thread has the right answers if you're using a real operating system like a unix variety.
    If you're using Windows, you can improve the situation by using cygwin. That will give you access to a tool like find (unix find) so you'll be able to do something like
    find . -name \*java > @files
    java @filesor
    java `find . -name \*java`But seriously, the best solution is to use a build tool like Ant or Make. You can use Ant on Windows.
    Windows isn't really designed for small independant tools (e.g., getting work done) like unix is. You're supposed to use a big monolithic application, one at a time. Once you've learned enough Java that you are developing larger applications like this, and if you insist on using Windows, then either get cygwin, or download an IDE like Eclipse.

  • Compiling packages problem???

    Thanks for checking this out, noticed there hadn't been a similar compiling question for
    at least 40 pages, so figured I should contribute!!
    I am trying to compile a package class with six other classes added as part of the
    same package and instantiated withing tabbed panes within the first class.
    info
    JDK: j2sdk1.4.0-beta3
    path: path=c:\windows;c:\windows;c:\windows\command\j2sdk1.4.0-beta3\bin
    Folder/directory : c:\Divelog
    javac is accessed by: c:\j2sdk1.4.0-beta3\bin\javac
    package: divelog
    file: DiveLog.java
    -public class DiveLog extends JFrame
    six other files are Welcome.java, Diver.java, Dives.java, Statistics.java, Website.java,
    Resources.java
    -all are started with the package divelog; declaration
    - all are called within a populateTabbedPane() in the DiveLog file and class.
    all .java files can be seen when I enter c:\Divelog>dir
    problem:
    entering c:\j2sdk1.4.0-beta3\bin\javac DiveLog.java
    returns six errors of type : cannot resolve symbol
    symbol: class Welcome
    location: class divelog.Divelog
    new Welcome
    I understand that this is not the way to compile a package so tryed lots of different
    things as suggested by the troubleshooting tutorial, the most effective are
    c:\j2sdk1.4.0-beta3\bin\javac -classpath c:\Divelog.divelog.java
    " \javac -classpath c:\Divelog.divelog
    \javac -classpath c:\Divelog
    all of these pause for about 5 seconds then returns to the c:\Divelog> (as if there
    were no errors)
    enter dir to see if they have been compiled, and there is no .class versions of these
    files.
    entering
    c:\j2sdk1.4.0-beta3\bin\javac -classpath c:\Divelog\ DiveLog.java or \ Divelog or \
    Divelog.DiveLog
    (with the space after the \ ) returns the six error messages above.
    I am positive there is something very simple I am missing, could someone please help
    me out, It would be greatly appreciated, I really like this java programming, but when
    you run into a hurdle like this, It gets very frustrating. Thanks alot in advance!!!

    Thanks alot eric, I spent about 15 hours trying to work that out. Tthat helped alot I have a couple of quick follow up questions
    1. in the classpath \divelog/*.java what does the /*.java do is that the call for the entirity of the divelog
    package.
    2. all of the six sub classes (welcome, Resources, etc) all compiled and are now in the directory of the
    c:\Divelog>
    except that the main class/file DiveLog will not itself, and is not listed as a DiveLog.class,
    there is still only a DiveLog.java even thought the others in the package all have become .class.
    Is there any way I can compile this one file on it's own, or how do I get it to compile into a .class file??
    3. to run the application would I then enter
    c:\Divelog>c:\j2sdk1.4.0-beta3\bin\java -classpath \divelog.?
    Once again, I really appreciate your help, that was great!

  • AUR has a bug in the way it versions packages. [WORKED AROUND]

    If you check out my PKGBUILD in the AUR (http://aur.archlinux.org/packages.php?ID=29410), you'll notice its version on the page is "smooth-tasks-pkgver.txt", while the ${pkgver} variable in its PKGBUILD is "wip_2009_09_13".  `smooth-tasks-pkgver.txt' is a file the PKGBUILD uses to temporarily store the correct ${pkgver} of the package (not its mercurial revision), which is then used to update the arch package and PKGBUILD.
    It was an experiment to see how I could manipulate makepkg's standard versioning scheme to reflect the actual author's package version rather than the mercurial revision, and it works!  AUR just seems to have an issue with the way it parses the PKGBUILD.
    I figured it would be best to discuss this on the forums before filing an actual bug report.
    EDIT: changed the title from "... names packages" to "... versions packages", and edited the post body to correct my original misconception the bug lies in how the AUR names packages, and not versions them.
    Last edited by deltaecho (2009-09-13 21:48:06)

    I don't understand your logic, what is `[ 1 ]' for?  It reminds me of the pieces of code I occasionally come across that look something like:
    if (true) {
    /* Do something here */
    I reckon it makes since to someone, I've just never understood the logic behind such blocks.
    The above snippet of code is one way of creating a block comment within Bash scripts, since whatever is located between the `EOF' tags is piped to nowhere (and thus isn't displayed); by placing a block comment at the end of the PKGBUILD containing an explicit ${pkgver} declaration, I am able to dictate to the AUR what the package version should be, and still have the segment of code ignored by `makepkg' when the script is executed.
    EDIT: Unless, you mean to use something like `(( 0 ))', which Bash will evaluate to false and thus ignore the proposition.  That would indeed make since, but, in my opinion, isn't really any clearer than my implementation.
    Last edited by deltaecho (2009-09-13 23:22:10)

  • Ok, does anyone know the correct way to do this

    Hi all
    would someone beable to explain the correct way of attaching dynamic text to a rotaing menu so that the text moves with the image as it rotates,
    I am now being told that in order to have dynamic text rotate/move I have to embed the font, by placing a text field on the stage outside my flash area and then set embedFonts property to true, and then apply a textformat.
    first, is this the correct way of doing it?
    second, can someone please explain(by breaking down into steps, as I am a newbie) how I go about setting embedFonts property to true and applying a textformat.
    what I have created;
    1.)I created a movieclip called 'textHolder' inside this has two dynamic text fields called 'headerText'  & 'bodyText'  <<<<< IS THIS CORRECT?
    2.)I have an xml file which will load the text in as well as the images with the rotating menu, see below;  <<<IS THIS CORRECT????
    <?xml version="1.0" encoding="utf-8"?>
    <data>
      <image name="image 1" path="img/img1.jpg"
        textHolder.headerText="Sunset"
        textHolder.bodyText="The hour of night is near, as the skies get blood-filled" />
    <data>
    3.What I am missing is what script I need for the main.as file, can anyone help here?
    so to break down.
    I have a rotating menu that is driven by xml, that loads images on the menu. I would also like to load text to the left of each image, and have the text be fixed with the image as it rotates.
    I can post the as, but I would like to know if the above is correct first, if you would like to see the main script please say.
    I have attached a jpg layout to give you an idea as to what I am trying to explain. can someone please help!!!!!!!!!
    (this is my previous post: http://forums.adobe.com/thread/463213?tstart=0  but I feel its got lost a little along the way)

    MY CURRENT SCRIPT, CAN YOU SEE HOW TO ATTACH THE TEXT WITH THE IMAGE?
    package 
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.net.URLLoaderDataFormat;
    import soulwire.ui.CircleMenu;
    public class Main extends Sprite
      //————————————————————————————————————————————— CLASS MEMBERS  VALUE
      public var circleMenu:      CircleMenu;
      public var xmlLoader:      URLLoader;
      //——————————————————————————————————————————————— CONSTRUCTOR
      public function Main()
      circleMenu = new CircleMenu( 300, 32, 14 );
      circleMenu.x = 150;
      circleMenu.y = 300;
      addChildAt( circleMenu, 0 );
      // Use URLLoader to load XML
      xmlLoader = new URLLoader();
      xmlLoader.dataFormat = URLLoaderDataFormat.TEXT;
      // Listen for the complete event
      xmlLoader.addEventListener(Event.COMPLETE, onXMLComplete);
      xmlLoader.load(new URLRequest("data.xml"));
      /*for (var i:int = 0; i < 20; i++)
        // MyMenuItem can be a symbol from your library
        // or any class which extends DisplayObject!
        var item:MyMenuItem = new MyMenuItem();
        item.txt.text = 'Menu Item ' + (i + 1);
        item.txt.mouseEnabled = false;
        item.buttonMode = true;
        item.addEventListener( MouseEvent.CLICK, onMenuItemClick );
        circleMenu.addChild( item );
      circleMenu.currentIndex = 4;*/
      // Enable the mouse wheel
      stage.addEventListener( MouseEvent.MOUSE_WHEEL, onMouseWheel );
      // Set up the UI
      ui.spacingSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.radiusSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.minAlphaSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.minScaleSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.scaleSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.itemsSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.spacingSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.radiusSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.minAlphaSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.minScaleSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.scaleSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.itemsSlider.dispatchEvent( new Event( Event.CHANGE) );
      //———————————————————————————————————————————— EVENT HANDLERS
      private function onXMLComplete(event:Event):void
      // Create an XML Object from loaded data
      var data:XML = new XML(xmlLoader.data);
      // Now we can parse it
      var images:XMLList = data.image;
      for(var i:int = 0; i < images.length(); i++)
        // Get info from XML node
        var imageName:String = images[i].@name;
        var imagePath:String = images[i].@path;
      //  var textInfo:TextInfo = new TextInfo(); 
    //      textInfo.headerText.text = images[i].@headerText; <<<<THIS IS WHAT i HAVE TRIED, GET ERRORS SO COMMENTED OUT
    //    textInfo.bodyText.text = images[i].@bodyText;
    //    addChild(textinfo);
                  //textInfo.x=120;
        //textInfo.y=300;
        var sp:Sprite=new Sprite();    <<<<<<<< THIS IS SCRIPT JUST ADDED
        var tf:TextField=new TextField();
        tf.wordWrap=true;
        tf.width=200;
        var ldr:Loader=new Loader();
        addChild(sp);
        sp.addChild(tf);
        sp.addChild(ldr);
        ldr.x=tf.width+10;
        // Load images using standard Loader
        var loader:Loader = new Loader();
        // Listen for complete so we can center the image
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImageComplete);
        loader.load(new URLRequest(imagePath));
        // Create a container for the loader (image)
        var holder:Sprite = new Sprite();
        holder.addChild(loader);
        // Same proceedure as before
        holder.buttonMode = true;
        holder.addEventListener( MouseEvent.CLICK, onMenuItemClick );
        // Add it to the menu
        circleMenu.addChild(holder);
      private function onImageComplete(event:Event):void
      var img:Loader = event.currentTarget.loader;
      img.content["smoothing"] = true;
      img.x = -(img.width/2);
      img.y = -(img.height/2);
      private function onMouseWheel( event:MouseEvent ):void
      event.delta < 0 ? circleMenu.next() : circleMenu.prev();
      private function onMenuItemClick( event:MouseEvent ):void
      circleMenu.scrollToItem( event.currentTarget as DisplayObject );
      private function onSliderChange( event:Event ):void
      switch( event.currentTarget )
        case ui.spacingSlider:
        circleMenu.angleSpacing = event.currentTarget.value;
        break;
        case ui.radiusSlider:
        circleMenu.innerRadius = event.currentTarget.value;
        break;
        case ui.minAlphaSlider:
        circleMenu.minVisibleAlpha = event.currentTarget.value;
        break;
        case ui.minScaleSlider:
        circleMenu.minVisibleScale = event.currentTarget.value;
        break;
        case ui.scaleSlider:
        circleMenu.activeItemScale = event.currentTarget.value;
        break;
        case ui.itemsSlider:
        circleMenu.visibleItems = event.currentTarget.value;
        break;

  • Correct way to handle an exception in a constructor?

    Hi I was wondering if anyone could tell me if I implemented my code correctly. It compiles and runs fine, I'm just wondering if there is a more efficient or better way to do this.
         static Cabin cabinTest;
    public static void main(String[] args)
              testEquals();
              testCompareTo();
              try
                   cabinTest = new Cabin(5, 2, true);
              catch(Exception e)
                   System.out.println("Invalid Input");
    public Cabin (int cabinNumber, int rooms, boolean kitchen) throws Exception
              super("C" + cabinNumber, rooms==1 ? ONE_ROOM_RATE : TWO_ROOM_RATE,
                     rooms==1? ONE_ROOM_GUESTS : TWO_ROOM_GUESTS);
                   this.rooms = rooms;
                   this.kitchen = kitchen;
              

    Thanks for your response.
    I think I have done all I can do as far as what you pointed out. This is a class assignment so I am working with code and instructions I have been given.
    The teacher said the constructor throws Exception. Here is the UML she provided for the constructor of the class she had us write.
    +Cabin(in cabinNumber: int, in rooms: int,
             in kitchen: boolean) throws ExceptionAnd, this is simple test code :)
    Thanks again

  • Attn - The correct way to connect to the repository

    From iFS Product Management.
    Many people appear to be having trouble connecting to the repository and are using the wrong API calls to do. The recommended API calls changed between beta and production. For the production release here is the correct way to connect:
    1. Four pieces of information are need to connect to the repository
    1. The iFS User Name
    2. The iFS User's password
    3. The properties file to be used
    4. The database password of the user who owns the iFS Schema
    This is different from the beta where the database password was hardcoded into the properties file.
    Note that any TNSNAMES information is still containing in the databaseURL entry in the properties file.
    package ifs.demo.samples;
    import oracle.ifs.beans.*;
    import oracle.ifs.common.*;
    import java.util.Locale;
    public class ConnectionTester extends Object {
    public static LibrarySession testConnection()
    throws IfsException
    LibraryService service = new LibraryService();
    CleartextCredential me = new CleartextCredential("gking","ifs");
    ConnectOptions connect = new ConnectOptions();
    connect.setLocale(Locale.getDefault());
    connect.setServiceName("IfsDefault");
    connect.setServicePassword("manager");
    return service.connect(me,connect);
    public static void main(String[] args)
    try {
    LibrarySession ifs = testConnection();
    ifs.disconnect();
    } catch (IfsException e) {
    IfsException.setVerboseMessage(true);
    e.printStackTrace();
    Note that in this example "gking" is the iFS user name, "ifs" is the gking user's ifs password. "manager" is the password of the database user who owns the iFS Schema.
    "IfsDefault" is the server properties file that describes the ifs connection. This file is in called "IfsDefault.properties" and is located in the package oracle.ifs.server.properties". This means that the folder that contains the 'oracle' folder that is the root of this package must be referenced in the class path when running this example.
    Note, if you use the older, 3 argument form of the connect you will get an unable to connect exception as the iFS will not have the Schema Password.
    null

    When I run the example below on Solaris (after setting the CLASSPATH etc., I get a oracle.ifs.common.IfsException: IFS-21008: Login Failure
    oracle.ifs.common.IfsException: IFS-10170: Invalid name/credential.
    (I am providing all 4 pieces of information for connecting)
    When using the web interface the same userid and password work fine (system/manager).
    Please help.....
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mark_d_Drake ():
    From iFS Product Management.
    Many people appear to be having trouble connecting to the repository and are using the wrong API calls to do. The recommended API calls changed between beta and production. For the production release here is the correct way to connect:
    1. Four pieces of information are need to connect to the repository
    1. The iFS User Name
    2. The iFS User's password
    3. The properties file to be used
    4. The database password of the user who owns the iFS Schema
    This is different from the beta where the database password was hardcoded into the properties file.
    Note that any TNSNAMES information is still containing in the databaseURL entry in the properties file.
    package ifs.demo.samples;
    import oracle.ifs.beans.*;
    import oracle.ifs.common.*;
    import java.util.Locale;
    public class ConnectionTester extends Object {
    public static LibrarySession testConnection()
    throws IfsException
    LibraryService service = new LibraryService();
    CleartextCredential me = new CleartextCredential("gking","ifs");
    ConnectOptions connect = new ConnectOptions();
    connect.setLocale(Locale.getDefault());
    connect.setServiceName("IfsDefault");
    connect.setServicePassword("manager");
    return service.connect(me,connect);
    public static void main(String[] args)
    try {
    LibrarySession ifs = testConnection();
    ifs.disconnect();
    } catch (IfsException e) {
    IfsException.setVerboseMessage(true);
    e.printStackTrace();
    Note that in this example "gking" is the iFS user name, "ifs" is the gking user's ifs password. "manager" is the password of the database user who owns the iFS Schema.
    "IfsDefault" is the server properties file that describes the ifs connection. This file is in called "IfsDefault.properties" and is located in the package oracle.ifs.server.properties". This means that the folder that contains the 'oracle' folder that is the root of this package must be referenced in the class path when running this example.
    Note, if you use the older, 3 argument form of the connect you will get an unable to connect exception as the iFS will not have the Schema Password.<HR></BLOCKQUOTE>
    null

  • New programmer- how do i compile package members?

    im learning java using sams teach yourself java in 21 days. its really good compared to other ive tried but i was having a problem on day 6. i couldnt compile package members successfully. i didnt undestand the book instruction so instead of compiling this way:
    C:\noam\java> c:\java\jdk1.5.0_06\bin\javac classname.java
    i did it this way:
    C:\java\noam\org\cadenhead\ecommerce> c:\java\jdk1.5.0_06\bin\javac classname.java
    this worked but other classes inside the package could not recognize this class, though classes outside the package could.
    how do i compile package members?
    thnx!

    I solved the problem...! I have no idea how but it worked this time!
    thnx anyway for everybody who tried to help!

  • The correct ways to create a helper functions in C++

    Hi there
    I have many functions which I use in my projects from different classes.
    Which is the most correct ways to create a helper functions.
    Thanks

    1) Split your project into different versatile sub-modules each handle by an object. The module should be reusable later on.
    2) Each module or class should be declared on separate .hpp and .cpp files. ( for reusability and portability ) 
    3)Make each module as much self contained as possible(independent) . That way you can reduce unnecessary linking with other files and reduce dependency on helper files. Compiling and working on only one module at a time will be easier and faster.
    4)When your code is better organize , coding will more systematic, less error prone, easy debugging and more fun in programming.
    For example in my project I create classes like
        i) CDatabaseManager - to take care of SQL database
        ii)CPlaylistManager - to deal with complex playlist
       iii)CGraphicManager - to deal with graphic overlay over video
       and so on.
    Thanks. I would like to know how organize it ? Is it right to write helper function in namespace or class ? And is it right to make
    static functions ?

  • Correct way to upgrade from LP 8 to 9 with all the extra content?

    I know that Apple has moved around the default folders for Apple Loops and extra audio content with different versions of Logic. When upgrading from a full install of LP8 to LP9, what is the correct way to do that. I'm worried I may get duplicate Apple Loops etc.
    Should I just run the installer and install all 9 discs to the default settings, or do I need to pay attention to which folders the extra audio content goes? I'm seeing a scenario where the Jam Packs from LP8 are in a different folder than the default for LP9 and so will get installed a second time.

    Thank you for your reply. So the jam Packs are identical to LP8? Then I can skip thoseI have a pretty good idea of where the actual files are located. So I should be able to figure it out.
    How can I the make sure that every file on the disk is actually in the loop browser , and to avoid duplicates? Over the years as directories have been changed for GB and LP, it's been quite confusing, especially since I already had some Jam Packs and also Soundtrack Pro and corresponding Loops before they became part of LP and some other Loop packages. Is it really as easy as deleting everything in the Loop Browser and then dragging all the folders from the HD in there?

  • Correct way to stream audio

    Pardon my ignorance. I have tried to search the forums, but the search box on this site hasn't got the possibility to limit the search to only this forum.
    My question is simple: If I capture audio from the microphone on my computer using a TargetDataLine and want to stream it over the internet to some other computer with some other software somewhere, what is the correct way to do so?
    Alternative 1: I create a ByteArrayOutputStream and a ServerSocket
    Alternative 2: I missed something in the documentation and should actually have constructed some other Line object connecting to an outgoing port on the computer.
    Thanks for any help

    rebol wrote:
    Pardon my ignorance. I have tried to search the forums, but the search box on this site hasn't got the possibility to limit the search to only this forum.You're fine...Ignorance is what forum questions are all about ;-) No point asking a question you already know the answer to...
    My question is simple: If I capture audio from the microphone on my computer using a TargetDataLine and want to stream it over the internet to some other computer with some other software somewhere, what is the correct way to do so?JavaSound doesn't have any way to do this. You do have a bunch of options about how to go about doing it, though...
    Alternative 1: I create a ByteArrayOutputStream and a ServerSocketThat would certainly work, but there are a handful of problems with it.
    (1) ServerSocket = TCP, and TCP = resends dropped packets. If you resend dropped packets, your stream will progressively get further and further behind "real-time" because every resent packet will add some delay that will never be made up.
    (2) This is probably going to take up a fair bit of bandwidth if you're capturing decent quality audio.
    So you'd definately want to use UDP instead to avoid the delay thing. Problem there is...
    (1) UDP packets aren't guarenteed to be delivered in order, so you'll want to drop the out of order packets.
    Actually, there's a method out there that's widely used to send media across a network that's implemented in UDP that's called RTP (Real-time Protocol). RTP is implemented in an add-on package for Java called JMF (Java Media Framework).
    With JMF, you can capture audio, transcode it into a different transmission-friendly RTP format, send it over the network, receive it on the other end, and play it using the built-in JMF player object. And if you're just wanting to do RTP and Sound, you can do it all just by including an extra JAR file.

  • What is the correct way to destory a Thread?

    Just wondering what is the correct way to destroy a thread? I am currently using the stop() method, but i noticed that it has been depreciated (along with other methods used to destroy a thread) when i looked at the thread documentation. Since this is so, then how can one correctly destroy a thread? Thanks in advance for the help.

    There is an awful lot of bad advice in this thread about what null does. Please in future check on your own with working code before offering up misguided and very wrong advice. Particularly when your advice contradicts that previously given.
    Please compile and run the following
    public class Test implements Runnable{
      public static void main(String args[])throws Exception{
        Test test = new Test();
        Thread t= new Thread(test);
        t.start();
        // have delay wait a few seconds to demonstrate
        Thread.sleep(3000);
        System.out.println("Setting reference to thread to null");
        t = null; // what does this do?
        // jack all
        System.out.println("Exiting main");
      public void run(){
        while(true){
          System.out.println("Hello from test thread!");
          try{ Thread.sleep(750); }catch(InterruptedException iDontCareAboutThis){}
    }This will output the following
    C:\>java Test
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Setting reference to thread to null
    Exiting main
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!
    Hello from test thread!And continues on endlessly. Setting the reference to null is NOT an answer to this problem.

Maybe you are looking for

  • Time Machine Recovery (after data recovery)

    Several months ago, Disk2 and Disk3 in my 2007 MacPro 1,1 (OSX 10.7.5) became unreadable by the computer. To make matters worse, the Time Machine external backup became equally as unreadable. All at the same time! Drive 1, with the operating system,

  • RE: (forte-users) Escript - Loading distrib from specifiednode ?

    JP, you can't do it. As says the help file on loaddistrib, : "The distribution to be loaded is in the FORTE_ROOT/appdist/<envname> directory hierarchy on the node running escript." So, you have to run escript on the server or the node having the dist

  • Ordering a product on the Online Apple store and delivering it in the Apple store instead of home.

    Hello, I'm about to buy a Macbook pro with an upgraded configuration for my birthday. And here http://store.apple.com/hk/buy-mac/macbook-pro   you can see in the section "Configure to Order" that upgraded configuration can be made only at the Apple O

  • 10.4.6 causes BAD problems on powerBook G4's

    I downloaded the 10.4.6 upgrade and now I have a serious problem when I close my computer lid and put it to sleep. It now shuts down on it's own. This NEVER happened until I downloaded this upgrade. I spoke with someone else with the same problem. We

  • R12 FSG Report - Budget Setups

    Our requirement is to create a monthly and a quarterly fsg report for each cost center which will give the actual,budget, variance & variance as columns and all the budgeted accounts as rows. Right now in our current budget setup, We have only one ye