Error running code examples from Training Video

I am currently learning Java and I am using a Java Training series from Sun. There are several code examples that I am having problems running. I am 99.9% sure that my code is correct. That is the code that I have followed along and written.
Here is an example of code that I am trying to run. ( I am on OS X 10.5 BTW )
public class Person
     public int ageYears = 32;
     public void calculateAge()
          int ageDays = ageYears * 365;
          long ageSeconds = ageYears * 365 * 24L * 60 *60;
          long ageMinutes = ageSeconds / 60;
          long ageMilliseconds = ageSeconds * 1000;
          System.out.println("You are " + ageDays +  " days old.");
          System.out.println("You are " + ageSeconds + " seconds old.");
          System.out.println("You are " + ageMinutes + " minutes old.");
          System.out.println("You are " + ageMilliseconds + " milliseconds old.");
}After I create the file (which is named Person.java) I open the terminal and cd to the directory the file is in. In my terminal I first say
javac Person.java
I don't get any errors at all. Then I try to run the program like this.
java Person
When I try this I get the following error
Exception in thread "main" java.lang.NoSuchMethodError: main
I am not sure why I get this error. On the instruction video the instructors code seams to run just fine with out have a main function. The instructor is on Windows and I am not sure if that has anything to do with it or not?
Any thoughts or suggestions would be really helpful.

mswallace wrote:
I am currently learning Java and I am using a Java Training series from Sun. There are several code examples that I am having problems running. I am 99.9% sure that my code is correct. That is the code that I have followed along and written. Trust what the compiler and the JVM say to you.
I am not sure why I get this error. On the instruction video the instructors code seams to run just fine with out have a main function. The instructor is on Windows and I am not sure if that has anything to do with it or not?
Any thoughts or suggestions would be really helpful.So, as the error is asking you, where is the main method that every runnable program must have? This has nothing to do with windows and everything to do with all programs needing a main method to run (even applets where the main method is I believe within the Applet class code).

Similar Messages

  • Error running 9i reports from forms.

    Hi folks,
    i am having problems running 9i reports from a form.
    i have installed Oracle 9iDS on a Win XP machine with 256 MB RAM and a Pentium 1.4Ghz processor.
    i also have a local Oracle 9i database. i have created several reports that i am trying to run from some forms but all efforts to date have failed.
    below is some sample code.
    declare
    v_rid report_object;
    v_rjob varchar2(100);
    v_rptstatus varchar2(100);
    v_jobid varchar2(100);
    BEGIN
    /*get handle to report object itself*/
    v_rid := find_report_object('pbranchlist');
    set_report_object_property(v_rid,REPORT_EXECUTION_MODE,BATCH);
    set_report_object_property(v_rid,REPORT_DESFORMAT,'htmlcss');
    set_report_object_property(v_rid,REPORT_DESTYPE,'CACHE');
    set_report_object_property(v_rid,REPORT_SERVER,'repsrv');
    set_report_object_property(v_rid,REPORT_COMM_MODE,synchronous);
    v_rjob := run_report_object(v_rid);
    v_rptstatus := report_object_status(v_rjob);
    while v_rptstatus in ('RUNNING','OPENING_REPORT','ENQUEUED') loop
         v_rptstatus := report_object_status(v_rjob);
         message(v_rptstatus);
    end loop;
    if v_rptstatus = 'FINISHED' then
         /*display report in browser*/
    --      web.show_document('http://steve:8888/reports/rwservlet/getjobid'||
    --      substr(v_rptsvrjob,instr(v_rptsvrjob,'_',-1)+1)||'?'||'server=repsrv','_blank');
    web.show_document('/reports/rwservlet/getjobid'||substr(v_rjob,instr(v_rjob,'_',-1)+1)||'?'||'server=repsrv','_blank');
    else
         message('error running Report');
    end if;
    end;
    pbranchlist is defined in the form,
    repsrv is a report server i installed and explicitly started.
    on clicking the button to run the above code, i get a message on the browser status bar as follows
    opening http://steve:8888/reports/rwservlet/getjobid11?server=repsrv...
    that's it. it stays like that forever and a progress bar showing the status of the operation gets to the halfway mark and stays there for up to 15 minutes.
    I eventually halted the operation by clicking the stop button of the browser. The form then becomes totally non-responsive with the mouse indicator changing to the hour-glass shape and a small vertical bar moving rapidly back and forth at the bottom of the form window.
    My only recourse then is to explicitly close the browser window.
    I have already configured Reports to run in non single sign-on mode by setting SINGLESIGNON=NO in the rwservlet.properties file.
    Is there anything i have not done properly?
    Thanks in advance.

    Steve,
    can you check the Reports cache directory if the Reports file got created? I would assume yes, but better check.
    Frank

  • Error running batch files from java source file???

    Dear Friends,
    hi,
    this is with response to a doubt i had earlier ,
    i want to run batch files from the java source file ,i tried using this code (here batrun is the batch file name that contains commands to run other java files)
    try
    String [] command = {"c:\\vishal\\finalmain\\batrun"};
    Runtime.getRuntime().exec(command);
    catch(Exception e)
    but i got the following error.
    java.io.IOException: CreateProcess: gnagarrun error= 2
    plz. help me, i tried all combination w/o success,
    in anticipation(if possible give the code after testing)
    Vishal.

    hello there,
    i solved the prob. by using
    cmd /c start filename ,but i need to pass parameters ie
    cmd /c start java "c:/vishal/runfile a b" where a and b are the parameters. but it is not accepting this in Runtime.getRuntime.exec(),
    any solutions ?????????
    regards,
    Vishal

  • Error running the report from Form

    Hi,
    I am try to run the report from the form by using these code of line
    DECLARE
         RPT_OBJECT      REPORT_OBJECT;
         RPT_RUN          VARCHAR2(100);
    BEGIN
    RPT_OBJECT := FIND_REPORT_OBJECT('REPORT7');
    SET_REPORT_OBJECT_PROPERTY(RPT_OBJECT, REPORT_COMM_MODE, SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(RPT_OBJECT, REPORT_DESTYPE, CACHE);
    SET_REPORT_OBJECT_PROPERTY(RPT_OBJECT, REPORT_OTHER,'P_CITYCODE'||:CITYCODE||'PARAMFORM = YES');
    RPT_RUN := RUN_REPORT_OBJECT(RPT_OBJECT);
    END;
    but i m not using any Form server and Report Server i m completly using Oracle9iDS
    It gives the error rep-0110 file not found and
    rep-1070 error while opening and saving the file
    please give me the solution
    Shehzad

    Shehzad,
    this means that Reports Server cannot access the Reports module. You can test this assumption by copying your Reports module into <Oracle Home>\reports\samples\demo. The demo directory is out of the box accessible fro Reports.
    If this allows you to run the Report, then all you need to do is to specify the Reports_Path to include the reports modules.
    btw.: An other reason can be that your Reports contains uncompiled PLSQL, so you may want to check this too.
    Frank

  • Error run a procedure from select sql

    Hi,
    I want run a procedure from a easy sql select.
    I have write this code to run this procedure, but response with a oracle error:
    select [procedure_name](:data1, :data2) as test from dual
    the oracle error is this:
    ORA-00904: "procedurename": invalid identifier
    how to resolve this problem?
    thanks
    Edited by: user10943416 on 12-mag-2010 3.12

    select [procedure_name](:data1, :data2) as test from dualAside from the error Oracle already reported, you can't execute a procedure from a select statement.
    You need to do this:
    SQL> exec procedure_name(:data1, :data2);

  • QuickTime Pro - error copying a segment from a video-stream.

    I got one video-stream running, in QuickTime, has so since the last 10 hours. Also a finished stream from another program. The latter I made a segmented copy from, via QuickTime.
    Copying the file to my desktop started, but just left a small file, rather than 1 hour of video. The window of this copy can't be closed. I have moved this file to the Trash. One stream is still running, it's about a train-trip, minute by minute - Bergen to Oslo - a 100 years anniversary - 'Bergensbanen' in Norway. The other stream, from which I made a segmented copy, is also still at my desktop, accessible - stream has ended. Attempting a new copy, does not solve my pickle.
    I can't close the window of my copied video, in order to make a new one. According to my modem, I'm still receiving video-data, but no video-output, this data is probably from the 'train-video.' I don't want to loose the 'train-video', or the other one, in order to make a new segmented copy of the latter.
    Any input on how to salvage the one stream running, the video of the ended stream, and delete/close the segmented copy, are appreciated.

    Files can be accessed online.
    Internet streams?
    They are never on your computer's hard drive to begin with so there's nothing to save.
    Think of it like a broadcast TV show.
    Streams are only temporarily held in RAM and then only a small part at a time. Whoever provides the media in this form does so because they don't want folks to be able to save it, only watch it.
    What you saved to your desktop was a Reference Movie -it points at a file stored elsewhere, which in this case is a server on the internet.
    http://developer.apple.com/quicktime/qttutorial/streaming.html

  • From training video I cannot open info on video to hear it. Help

    I am trying to go through a training video for a class and when I get to the part where it says listen to video before I go to next step, I click on the icon button that says video, and I don't get any sound. What do I have to do to activate the sound system on my computer? Thanks

    There is a download link on this page:  iPhoto '11 or later: About the Library Upgrader - Apple Support
    iPhoto Library Upgrader 1.1

  • OAS Error with Servelet example from OTN

    I have followed the servelet example
    from OTN Oracle Java Roadmap and it works
    in JDeveloper. THen I followed the steps for
    deployment to OAS and I get the following
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `Java cartridge runtime intialize..., thr_id: 19
    `
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `Notify object content initialized to null`
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `config flag: MAX_HEAP value: 64M
    `
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `config flag: SYSTEM_PROPERTY value: java.naming.factory.initial=oracle.oas.naming.jndi.CartxInitCtxFactory
    `
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `config flag: SYSTEM_PROPERTY value: ORACLE_HOME=e:\oracle\oas
    `
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `config flag: SYSTEM_PROPERTY value: ORAWEB_HOME=e:\oracle\oas\ows\4.0
    `
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `Using Servlet runtime
    `
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `config flag: RUNTIME_MODE value: JSERVLET
    `
    02-22-2000 13:21:43 0 demlwo193 `JAVAWEB` 445 7 0x400fff `CLASSPATH=e:\oracle\oas\ows\4.0\jdk\lib\classes.zip;e:\oracle\oas\ows\4.0\classes\services.jar;e:\oracle\oas\ows\cartx\jweb\classes\jweb.jar;e:\oracle\oas\ows\cartx\jweb\classes\j servlet.jar;e:\oracle\oas\orb\classes\yoj.jar;e:\oracle\oas\ows\4.0\classes\cosnam.jar;e:\oracle\oas\orb\classes\session.jar;e:\oracle\oas\orb\classes\cache.jar;e:\oracle\oas\jdbc\ lib\classes111.zip;e:\oracle\oas\ots\classes\oraclejts.jar;e:\oracle\oas\ots\classes\jtsjdbc.jar;e:\oracle\oas\ows\4.0\classes\ecoapi.jar;e:\oracle\oas\ows\4.0\classes\ejbapi.jar;e :\oracle\oas\ows\4.0\classes\oasdeploy.jar;c:\ctxdemo\DemoDBServelet.jar;c:\jCVS-5.1.1\jcvsii.jar
    `
    02-22-2000 13:21:47 0 demlwo193 `JAVAWEB` 445 0 0x400fff `Exception `
    02-22-2000 13:21:47 0 demlwo193 `JAVAWEB` 445 0 0x400fff `in thread `
    02-22-2000 13:21:47 0 demlwo193 `JAVAWEB` 445 0 0x400fff `"Thread-5"`
    02-22-2000 13:21:47 0 demlwo193 `JAVAWEB` 445 0 0x400fff ` `
    02-22-2000 13:21:47 0 demlwo193 `JAVAWEB` 445 0 0x400fff `Exception happend in executing:oracle.OAS.servlet.servletrunner.main(String[])
    `
    null

    1. Which version of JDK you are using. OAS 4081 is certified for JDK 1.1.6. If you are using JDeveloper3.0 (JDK 1.2.2), please change over to JDeveloper3.0 (JDK 1.1.8).
    2. Similarly, which version of JVM is used with OAS. You may have to edit your wrb.app to make necessary changes.
    Jayakumar
    null

  • Error running child packages from parent package - Error 0xC0011008

    Hey...
    I am running a parent SSIS package (running sp2, 9.0.3042) that calls several child packages.
    On our development server, we now cannot run this because we get 1 or more of these errors:
    "Error 0x80004003 while preparing to load the package. Invalid pointer  .  "
    "Error 0xC0011008 while preparing to load the package. Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.  .  "
    It is not occuring on the same packages.  It varies every time it is run.
    I can run every one of the child packages individually, using the same login ID that the parent is executed under.
    The parent package works fine on my local machine and other servers running the same version of SSIS.  Just not on this server.
    Does anyone have any ideas???
    Thanks
    BobP

    I have the same error with no parent child package relationship. I have changed the "Max Concurrent Executables" in each package from -1 to 10 and got  no change.  My code is below:
    List
    <string> fileList = new List<string>();
    private
    void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
    //this.fileList.Add(checkedListBox1.SelectedValue.ToString().Trim());
    this.fileList.Add("name");
    private
    void button1_Click(object sender, EventArgs e)
    string @fileName;
    foreach (string str in fileList)
    @fileName = str;
    string pkgLocation;
    Microsoft.SqlServer.Dts.Runtime.
    Application app;
    DTSExecResult pkgResults_Sql;
    pkgLocation =
    @"C:\" + @fileName + ".dtsx";
    app =
    new Microsoft.SqlServer.Dts.Runtime.Application();
    Package pkgIn = new Package();
    pkgIn = app.LoadPackage(pkgLocation,
    null);
    pkgResults_Sql = pkgIn.Execute();

  • Exception running STRUTS examples from JAKARTA...

    Hi,
              I'm looking into the JAKARTA STRUTS framework for JSP. I saw the message
              from Kevin X. about problems he has. I've downloaded service pack 5 and I
              get the following error message:
              javax.servlet.jsp.JspException: Missing resources attribute
              org.apache.struts.action.MESSAGE
              at
              org.apache.struts.taglib.MessageTag.doStartTag(MessageTag.java:360)
              at jsp_servlet._logon._jspService(_logon.java, Compiled Code)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              , Compiled Code)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              , Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:760)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:707)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              Manager.java:251)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:369)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:269)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              Code)
              Does anyone knows what's up with this?
              Thanks in advance.
              Regards,
              HC.
              

              As promised, here is the latest from Bea Customer Support....
              Kevin, <load-on-startup> is not honored by WebLogic Server 5.1.0. It is scheduled to be implemented in our next major release. I will check on the feasability of adding this feature to a 5.1.0 service pack, but in the meantime, I wonder if you can accomplish what you need by setting up a startup class <http://www.weblogic.com/docs51/classdocs/API_startup.html>?
              "kevinx" <[email protected]> wrote:
              >
              >Bea is looking into this as I've filed a support request. I will post the solutions, if available. In the mean time, you can subscribe to struts user group mailing list to get some inspiration. Unfortunately, no one has an easy solution for running Strats on Weblogic.
              >
              >Kevin
              >
              >"Henry Chin" <[email protected]> wrote:
              >>Hi,
              >> I'm looking into the JAKARTA STRUTS framework for JSP. I saw the message
              >>from Kevin X. about problems he has. I've downloaded service pack 5 and I
              >>get the following error message:
              >>
              >>javax.servlet.jsp.JspException: Missing resources attribute
              >>org.apache.struts.action.MESSAGE
              >> at
              >>org.apache.struts.taglib.MessageTag.doStartTag(MessageTag.java:360)
              >> at jsp_servlet._logon._jspService(_logon.java, Compiled Code)
              >> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              >> at
              >>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              >>, Compiled Code)
              >> at
              >>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              >>, Compiled Code)
              >> at
              >>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              >>l.java:760)
              >> at
              >>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              >>l.java:707)
              >> at
              >>weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              >>Manager.java:251)
              >> at
              >>weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:369)
              >> at
              >>weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:269)
              >>
              >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              >>Code)
              >>
              >>Does anyone knows what's up with this?
              >>Thanks in advance.
              >>Regards,
              >>HC.
              >>
              >>
              >
              

  • Errors running converted application (from applet)

    I've converted some codes (applet) into an application. When I run the application, I can see the GUI, but the application reports error as follows:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at swarmCanvas.paint(Swarm.java:192)
         at sun.awt.RepaintArea.paint(RepaintArea.java:298)
         at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:196)
         at java.awt.Component.dispatchEventImpl(Component.java:2663)
         at java.awt.Component.dispatchEvent(Component.java:2497)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
    What I see is only the GUI less the animation that occurs when it was an applet. Could anyone offer me any suggestions or help? Thanks a lot.

    Here's my codes, many thanks:
    * Swarm.class
    * This is the major class of the swarm animation. The Swarm class is
    * responsible for initialising and coordinating the Flock, swarmCanvas,
    * and swarmPanel classes.
    * @see Flock.class
    * @see Bird.class
    * @see Barrier.class
    * @author Duncan Crombie
    * @version 2.02, 20 September 1997
    import java.awt.*;
    public class Swarm extends java.applet.Applet implements Runnable {
    Thread animator; // animation thread
    swarmCanvas arena; // display canvas
    swarmPanel controls; // control panel
    static int NUMBLUE = 15, NUMRED = 5, MAXPOP = 20;
    static double SPEED = 5.0;
    static int TURN = 15, MINDIST = 30, MAXDIST = 60;
    boolean paused = false;
    public void init() { // initialise applet components
    arena = new swarmCanvas();
    controls = new swarmPanel(NUMBLUE, NUMRED, MAXPOP);
    setLayout(new BorderLayout());
    add("Center", arena); // add canvas to applet at 'Center'
    add("South", controls); // add panel to applet at 'South'
    arena.requestFocus();
    public void start() { // start thread when applet starts
    if (animator == null) {
    animator = new Thread(this);
    animator.start();
    public void stop() { // stop thread when applet stops
    if (animator != null) {
    animator.stop();
    animator = null;
    public void run() {
    boolean flocking = false;
    while (true) {
    if (!flocking && arena.unpacked) { // once canvas component is unpacked
    Bird.setBoundaries(arena.w, arena.h); // set swarm boundaries
    arena.flock = new Flock(NUMBLUE, NUMRED, SPEED, TURN, MINDIST, MAXDIST);
    flocking = true;
    } else if (flocking) {
    Bird.setBoundaries(arena.w, arena.h);
    if (!paused)
    arena.flock.move(); // animate the flock
    arena.repaint(); // update display
    try {
    Thread.sleep(20); // interval between steps
    } catch (InterruptedException e) {}
    public boolean handleEvent(Event ev) { // check for control panel actions
    if (ev.id == Event.ACTION_EVENT && ev.target == controls.reset) {
    resetApplet(); // reset button pressed in controls
    return true;
    if (ev.id == Event.ACTION_EVENT && ev.target == controls.pause) {
    paused = !paused; // toggle paused status
    controls.pause.setLabel((paused) ? "Continue" : "Pause");
    return true;
    if (ev.target == controls.sbRed) {
    if (ev.id == Event.SCROLL_LINE_UP)
    arena.flock.removeBird(Color.red); // remove a red Bird from flock
    else if (ev.id == Event.SCROLL_LINE_DOWN)
    arena.flock.addBird(new Bird(Color.red)); // add a red Bird
    return true;
    if (ev.target == controls.sbBlue) {
    if (ev.id == Event.SCROLL_LINE_UP)
    arena.flock.removeBird(Color.blue); // remove a blue Bird from flock
    else if (ev.id == Event.SCROLL_LINE_DOWN)
    arena.flock.addBird(new Bird(Color.blue)); // add a blue Bird
    return true;
    return super.handleEvent(ev); // pass on unprocessed events
    public boolean keyDown(Event e, int x) { // check for key press
    boolean shiftKeyDown = ((e.modifiers & Event.SHIFT_MASK) != 0);
    if (shiftKeyDown) {
    if (x == Event.DOWN) Flock.minDISTANCE -= 5; // less separation
    if (x == Event.UP) Flock.minDISTANCE += 5; // more separation
    if (x == Event.LEFT) Flock.maxDISTANCE -= 5; // lower detection
    if (x == Event.RIGHT) Flock.maxDISTANCE += 5; // higher detection
    Barrier.minRANGE = Flock.minDISTANCE;
    Barrier.maxRANGE = Flock.maxDISTANCE;
    } else {
    if (x == Event.DOWN) Bird.maxSPEED -= 1.0; // slower
    if (x == Event.UP) Bird.maxSPEED += 1.0; // faster
    if (x == Event.LEFT) Bird.maxTURN -= 5; // less turning
    if (x == Event.RIGHT) Bird.maxTURN += 5; // more turning
    return true; // all key events handled
    public void resetApplet() {
    arena.flock = new Flock(NUMBLUE, NUMRED, SPEED, TURN, MINDIST, MAXDIST);
    controls.sbBlue.setValue(NUMBLUE); // initialise scrollbars
    controls.sbRed.setValue(NUMRED);
    * swarmPanel.class
    * A Panel holding two scrollbars and two buttons for controlling the
    * Swarm applet.
    * @see Swarm.class
    * @author Duncan Crombie
    * @version 2.01, 20 September 1997
    class swarmPanel extends Panel { // class defines applet control panel
    Button reset, pause;
    Scrollbar sbBlue = new Scrollbar(Scrollbar.HORIZONTAL);
    Scrollbar sbRed = new Scrollbar(Scrollbar.HORIZONTAL);
    Label label1, label2;
    * The construction method creates and adds control panel components
    swarmPanel(int numRed, int numBlue, int maxBoid) {
    setLayout(new GridLayout(2, 3)); // define 2 x 3 grid layout for controls
    label1 = new Label("Blue #");
    label1.setFont(new Font("Dialog", Font.PLAIN, 12)); add(label1);
    label2 = new Label("Red #");
    label2.setFont(new Font("Dialog", Font.PLAIN, 12)); add(label2);
    reset = new Button("Reset"); add(reset);
    sbBlue.setValues(numRed, 1, 0, maxBoid);
    add(sbBlue);
    sbRed.setValues(numBlue, 1, 0, maxBoid);
    add(sbRed);
    pause = new Button("Pause");
    add(pause);
    * swarmCanvas.class
    * A Canvas for displaying the Flock and Swarm parameters.
    * @see Swarm.class
    * @author Duncan Crombie
    * @version 2.01, 20 September 1997
    class swarmCanvas extends Canvas {
    Flock flock;
    Image offScrImg;
    boolean unpacked = false;
    int w, h;
    /* Double buffered graphics */
    public void update(Graphics g) {
    if (offScrImg == null || offScrImg.getWidth(this) != w || offScrImg.getHeight(this) != h)
    offScrImg = createImage(w, h);
    Graphics og = offScrImg.getGraphics();
    paint(og);
    g.drawImage(offScrImg, 0, 0, this);
    og.dispose();
    public void paint(Graphics g) {
    Dimension d = this.preferredSize();
    if (!unpacked) {
    this.w = d.width;
    this.h = d.height;
    unpacked = true;
    g.setColor(Color.white);
    g.fillRect(0, 0, w, h); // draw white background
    g.setColor(Color.black); // set font and write applet parameters
    g.setFont(new Font("Dialog", Font.PLAIN, 10));
    g.drawString("Bird Speed: " + Bird.maxSPEED, 10, 15);
    g.drawString("Bird Turning: " + Bird.maxTURN, 10, 30);
    g.drawString("Minimum Distance: " + Flock.minDISTANCE, 10, 45);
    g.drawString("Maximum Distance: " + Flock.maxDISTANCE, 10, 60);
    flock.display(g); // draw Flock members
    if (this.w != d.width || this.h != d.height)
    unpacked = false;
    public boolean mouseDown(Event ev, int x, int y) {
    int radius = Barrier.maxRANGE;
    boolean top, bottom;
    flock.addBird(new Barrier(x, y)); // place Barrier at click coordinates
    top = (y < radius);
    bottom = (y > h-radius);
    if (x < radius) { // if left
    flock.addBird(new Barrier(w + x, y));
    if (top) flock.addBird(new Barrier(w + x, h + y));
    else if (bottom) flock.addBird(new Barrier(w + x, y - h));
    } else if (x > w-radius) { // if right
    flock.addBird(new Barrier(x - w, y));
    if (top) flock.addBird(new Barrier(x - w, h + y));
    else if (bottom) flock.addBird(new Barrier(x - w, y - h));
    if (top) flock.addBird(new Barrier(x, h + y));
    else if (bottom) flock.addBird(new Barrier(x, y - h));
    return true;
    ===================================================================
    * Bird.class
    * This class defines the appearance and behaviour of a Bird object.
    * @see Swarm.class
    * @see Flock.class
    * @see Barrier.class
    * @author Duncan Crombie
    * @version 2.02, 21 September 1997
    import java.awt.*;
    class Bird {
    int iX, iY, iTheta;
    Color cFeathers;
    static int arenaWIDTH, arenaHEIGHT; // canvas dimensions
    static double maxSPEED; // speed of Bird
    static int maxTURN; // maximum turn in degrees
    Bird(int x, int y, int theta, Color feath) {
    iX = x;
    iY = y;
    iTheta = theta;
    cFeathers = feath;
    Bird(Color feath) {
    this((int)(Math.random() * arenaWIDTH),
    (int)(Math.random() * arenaHEIGHT),
    (int)(Math.random() * 360),
    feath);
    public void move(int iHeading) {
    int iChange = 0;
    int left = (iHeading - iTheta + 360) % 360;
    int right = (iTheta - iHeading + 360) % 360;
    if (left < right)
    iChange = Math.min(maxTURN, left);
    else
    iChange = -Math.min(maxTURN, right);
    iTheta = (iTheta + iChange + 360) % 360;
    iX += (int)(maxSPEED * Math.cos(iTheta * Math.PI/180)) + arenaWIDTH;
    iX %= arenaWIDTH;
    iY -= (int)(maxSPEED * Math.sin(iTheta * Math.PI/180)) - arenaHEIGHT;
    iY %= arenaHEIGHT;
    public void display(Graphics g) { // draw Bird as a filled arc
    g.setColor(this.cFeathers);
    g.fillArc(iX - 12, iY - 12, 24, 24, iTheta + 180 - 15, 30);
    public int getDistance(Bird bOther) {
    int dX = bOther.getPosition().x-iX;
    int dY = bOther.getPosition().y-iY;
    return (int)Math.sqrt(Math.pow(dX, 2) + Math.pow(dY, 2));
    static void setBoundaries(int w, int h) {
    arenaWIDTH = w;
    arenaHEIGHT = h;
    public int getTheta() {
    return iTheta;
    public Point getPosition() {
    return new Point(iX, iY);
    public Color getFeathers() {
    return cFeathers;
    =================================================================
    * Flock.class
    * This class creates and coordinates the movement of a flock of Birds.
    * @see Swarm.class
    * @see Bird.class
    * @see Barrier.class
    * @author Duncan Crombie
    * @version 2.02, 21 September 1997
    import java.util.Vector;
    import java.awt.*;
    class Flock { // implement swarming algorithm on flock of birds
    private Vector vBirds;
    static int minDISTANCE, maxDISTANCE;
    Flock(int nBlue, int nRed, double speed, int turn, int minDist, int maxDist) {
    vBirds = new Vector(5, 5);
    for (int i=0; i < nBlue + nRed; i++)
    addBird(new Bird((i < nBlue) ? Color.blue : Color.red));
    Bird.maxSPEED = speed;
    Bird.maxTURN = turn;
    Barrier.minRANGE = minDISTANCE = minDist;
    Barrier.maxRANGE = maxDISTANCE = maxDist;
    public void addBird(Bird bird) { // add Bird to vector
    vBirds.addElement(bird);
    synchronized void removeBird(Color col) { // remove Bird from vector
    for (int i=0; i < vBirds.size(); i++) { // loop through vector of Birds
    Bird bTemp = (Bird)vBirds.elementAt(i);
    if (bTemp.getFeathers() == col) { // search for Bird of given colour
    vBirds.removeElementAt(i); // if found, remove Bird..
    break; // ..and stop searching
    * The move function simply tells each Bird in the Vector vBirds to move
    * according to the resultant Point of generalHeading.
    synchronized public void move() {
    for (int i=0; i < vBirds.size(); i++) {
    Bird bTemp = (Bird)vBirds.elementAt(i);
    bTemp.move(generalHeading(bTemp));
    * The display function simply draws each Bird in the Vector vBirds at its
    * current position.
    public void display(Graphics g) { // display each Bird in flock
    for (int i=0; i < vBirds.size(); i++) {
    Bird bTemp = (Bird)vBirds.elementAt(i);
    bTemp.display(g);
    public Point sumPoints(Point p1, double w1, Point p2, double w2) {
    return new Point((int)(w1*p1.x + w2*p2.x), (int)(w1*p1.y + w2*p2.y));
    public double sizeOfPoint(Point p) {
    return Math.sqrt(Math.pow(p.x, 2) + Math.pow(p.y, 2));
    public Point normalisePoint(Point p, double n) {
    if (sizeOfPoint(p) == 0.0) return p;
    else {
    double weight = n / sizeOfPoint(p);
    return new Point((int)(p.x * weight), (int)(p.y * weight));
    * The generalHeading function determines the point a Bird will turn towards
    * in the next timestep. The Bird b checks for all Birds (other than self)
    * that fall within the detection range. If the Bird is of a different colour
    * or closer than the separation distance then they are repulsed else the
    * Birds are attracted according to the flocking algorithm.
    private int generalHeading(Bird b) {
    if (b instanceof Barrier) return 0;
    Point pTarget = new Point(0, 0);
    int numBirds = 0; // total of Birds to average
    for (int i=0; i < vBirds.size(); i++) { // for each Bird in array
    Bird bTemp = (Bird)vBirds.elementAt(i); // retrieve element i
    int distance = b.getDistance(bTemp); // get distance to Bird
    if (!b.equals(bTemp) && distance > 0 && distance <= maxDISTANCE) {
    * If the neighbour is a sibling the algorithm tells the boid to align its
    * direction with the other Bird. If the distance between them differs from
    * minDISTANCE then a weighted forces is applied to move it towards that
    * distance. This force is stronger when the boids are very close or towards
    * the limit of detection.
    if (b.getFeathers().equals(bTemp.getFeathers())) { // if same colour
    Point pAlign = new Point((int)(100 * Math.cos(bTemp.getTheta() * Math.PI/180)), (int)(-100 * Math.sin(bTemp.getTheta() * Math.PI/180)));
    pAlign = normalisePoint(pAlign, 100); // alignment weight is 100
    boolean tooClose = (distance < minDISTANCE);
    double weight = 200.0;
    if (tooClose) weight *= Math.pow(1 - (double)distance/minDISTANCE, 2);
    else weight *= - Math.pow((double)(distance-minDISTANCE) / (maxDISTANCE-minDISTANCE), 2);
    Point pAttract = sumPoints(bTemp.getPosition(), -1.0, b.getPosition(), 1.0);
    pAttract = normalisePoint(pAttract, weight); // weight is variable
    Point pDist = sumPoints(pAlign, 1.0, pAttract, 1.0);
    pDist = normalisePoint(pDist, 100); // final weight is 100
    pTarget = sumPoints(pTarget, 1.0, pDist, 1.0);
    * In repulsion the target point moves away from the other Bird with a force
    * that is weighted according to a distance squared rule.
    else { // repulsion
    Point pDist = sumPoints(b.getPosition(), 1.0, bTemp.getPosition(), -1.0);
    pDist = normalisePoint(pDist, 1000);
    double weight = Math.pow((1 - (double)distance/maxDISTANCE), 2);
    pTarget = sumPoints(pTarget, 1.0, pDist, weight); // weight is variable
    numBirds++;
    if (numBirds == 0) return b.getTheta();
    else // average target points and add to position
    pTarget = sumPoints(b.getPosition(), 1.0, pTarget, 1/(double)numBirds);
    int targetTheta = (int)(180/Math.PI * Math.atan2(b.getPosition().y - pTarget.y, pTarget.x - b.getPosition().x));
    return (targetTheta + 360) % 360; // angle for Bird to steer towards
    ======================================================================
    * Barrier.class
    * This class creates and coordinates the movement of a flock of Birds.
    * @see Swarm.class
    * @see Flock.class
    * @see Bird.class
    * @author Duncan Crombie
    * @version 2.01, 21 September 1997
    import java.awt.*;
    class Barrier extends Bird {
    static int minRANGE, maxRANGE;
    Barrier(int x, int y) {
    super(x, y, 0, Color.black); // position Barrier and define color as black
    public void move(int dummy) {
    // do nothing
    public void display(Graphics g) { // paint Barrier
    g.setColor(Color.black);
    g.fillOval(this.iX-5, this.iY-5, 10, 10);
    g.setColor(Color.gray); // paint separation circle
    g.drawOval(this.iX-minRANGE, this.iY-minRANGE, 2*minRANGE, 2*minRANGE);
    g.setColor(Color.lightGray); // paint detection circle
    g.drawOval(this.iX-maxRANGE, this.iY-maxRANGE, 2*maxRANGE, 2*maxRANGE);
    =====================================================================
    import java.awt.*;
    import java.awt.event.*;
    public class SwarmFrame extends Frame implements ActionListener {
    public SwarmFrame() {
    super("Flocking Bird");
    MenuBar mb = new MenuBar();
    setMenuBar(mb);
    Menu fileMenu = new Menu("File");
    mb.add(fileMenu);
    MenuItem exitMenuItem = new MenuItem("Exit");
    fileMenu.add(exitMenuItem);
    exitMenuItem.addActionListener(this);
    Swarm swarmApplet = new Swarm();
    add(swarmApplet, BorderLayout.CENTER);
    swarmApplet.init();
    public void actionPerformed(ActionEvent evt) {
    if(evt.getSource() instanceof MenuItem) {
    String menuLabel = ((MenuItem) evt.getSource()).getLabel();
    if(menuLabel.equals("Exit")) {
    dispose();
    System.exit(0);
    =====================================================================
    import java.awt.*;
    public class SwarmApplication {
    public static void main(String[] args) {
    Frame frame = new SwarmFrame();
    frame.setBounds(10, 10, 600, 400);
    frame.setVisible(true);

  • 500 Internal Server Error running SRList.jsp from ADFBC_tutorial (OTN)

    Hello!
    I am running through the JDeveloper totorial (ADFBC_tutorial) posted on OTN. I have gone as far as Chapter 5 but when I run the SRList.jsp page, I get the 500 Internal Server Error:
    I have had no issues running through the tutorial in the design time but when I run the app I get the following error:
    Error Details are as:
    java.lang.NullPointerException     at javax.faces.webapp.UIComponentTag.isValueReference(UIComponentTag.java:336)     at oracle.adfinternal.view.faces.taglib.AttributeTag.doStartTag(AttributeTag.java:84)     at app.SRList._jspService(_SRList.java:109)     [app/SRList.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.3.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:287)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)     at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)     at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)     at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)     at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)
    Also, I tried to run the application in debug mode and this is what I find:
    1. Unable to find source file for the package oracle.adfinternal.view.faces.application, filename ViewHandlerImpl.java
    2. Unable to find source file for the package oracle.adfinternal.view.faces.webapp, filename AdfFacesFilterImpl.java
    Am I missing any libraries?
    Thanks!

    Hi,
    if you used a starter workspace then make sure that the adf-faces-impl.jar file and the jsf-impl.jar file in the WEB-INF/lib directory of the ViewLayer project is from the JDeveloper build you use. In JDeveloper you find the adf-faces-impl.jar in the JDeveloper jlib directory and the jsf-impl.jar in the jsf-ri directory
    Frank

  • Error running ODI scenario from batch file

    Hello, everyone!
    I am loading data into Essbase 11.1.2 from MS SQL Server views using ODI 11.1.1.5.0 and Local agent. I created an interface which runs ok if launched manually from ODI.
    Then I created the scenario named MyScenario for this interface and updated odiparams.bat file in *...\agent\bin* folder as follows:
    set SECU_DRIVER=weblogic.jdbc.sqlserver.SQLServerDriver
    set SECU_URL=jdbc:weblogic:sqlserver://<ServerName>:1433;databaseName=<DatabaseName>
    set SECU_USER=<UserName for Master Repository>
    set SECU_PASS=<encoded password for MasterRepository UserName>
    set ODI_USER=SUPERVISOR
    set ODI_PASS=<encoded password for SUPERVISOR>
    set WORK_REPOSITORY=<Work Repository name>
    Then I created the batch file in which I wrote: *...\agent\bin>startscen MyScenario 001 GLOBAL 5*
    However the scenario is not executed with the following error message:
    ERROR ODI-1132 Agent Internal encountered a warning: ODI-1414: Error connecting to agent Internal: a JDBC error occurs while connecting to the master repository. Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Exception occurred while getting connection: oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource: java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
    I will be very grateful for any hints!

    A fundamental clarification : where is your master repository database located ? Is it on SQL Server as well ?
    The MS SQL Server connection that you mentioned in the SECU_DRIVER, SECU_URL should point to the MR database.
    Is the server name in SECU_URL a Fully Qualified domain name or just an IP Address reachable from localhost ?
    startscen will spawn a new instance of local agent.
    startcmd will reuse an existing agent (not local).
    Not sure why your local agent is getting a Network Connection Error.

  • Error running HAL routine from a perl cgi script via a browser

    Hi,
    I'm getting an error while trying to run a HAL routine from a perl- cgi initiated from a web browser. Perl-Cgi script runs fine when run from command line.
    07/23/2010|183648|N/A|Info|N/A|Analytic Services Adapter Log File Started
    07/23/2010|183648|AppName/Plan2|Info|Connect|Method Started
    07/23/2010|183648|AppName/Plan2*|Error|Connect|java.lang.UnsatisfiedLinkError: no HssJNIDriver950 in java.library.path*
    07/23/2010|183648|AppName/Plan2|Error|Connect|Method Ended - Connect completed with exceptions.
    07/23/2010|183648|N/A|Info|N/A|Analytic Services Adapter Log File Ended
    I've added the following env. variables in Apache server's httpd.conf file
    SetEnv ARBORPATH "E:\\Hyperion\\products\\Essbase\\EssbaseClient"
    SetEnv APS_HOME "E:\\Hyperion\\products\\Essbase\\aps"
    SetEnv ESSLANG "English_UnitedStates.Latin1@Binary"
    SetEnv EASPATH "E:\\Hyperion\\products\\Essbase\\eas\\server"
    SetEnv HYPERION_HOME "E:\\Hyperion"
    SetEnv ESSBASEPATH "E:\\Hyperion\\products\\Essbase\\EssbaseClient"
    SetEnv EAS_HOME "E:\Hyperion\products\Essbase\eas\console"
    SetEnv CLASSPATH "E:\\Vignette\\V7\\vbis\\Hyperion\\EssbaseAdapter"
    SetEnv PATH "E:\\Hyperion\\common\\ADM\\9.5.0.0\\Essbase\\9.5.0.0\\bin;E:\\Vignette\\V7\\vbis\\Hyperion\\EssbaseAdapter\\adm;C:\\Program Files (x86)\\Java\\jre1.5.0_17\\bin\\;E:\\Hyperion\\products\\Essbase\\EssbaseClient\\bin;E:\\Hyperion\\products\\Essbase\\EssbaseClient;E:\\Hyperion\\common\\CSS\\9.5.0.0\\bin;E:\\Hyperion\\products\\Essbase\\eas\\console\\bin;"
    Any pointers would be appreciated.
    Thanks in Advance!!

    Vipul,
    Vipul Sanghvi wrote:
    I am facing problem in running a Perl CGI Script on Weblogic
    Application
    Server
    I set the CGIServlet Property in the Weblogic Properties file as
    weblogic.httpd.register.cgi-bin=weblogic.servlet.CGIServlet
    weblogic.httpd.initArgs.cgi-bin=\
    cgiDir=/weblogic/myserver/public_html/cgi-bin,\
    *.pl=/bin/perl.exe,\It shouldn't end with ,\ right?
    Was it a mistake?
    -Kumar
    >
    I installed the Perl on my system and put the perl exe in the bin
    directory
    of the Weblogic App Server. But I am getting the error "failed to
    execute
    the test.pl ". Where test.pl is a simple test perl script.
    APP server ver is WLE5 Beta[att1.html]

  • Errors running PHP examples

    I have built DB XML on my Linux box.
    [ctucker@fedora dbxml_testing]$ uname -a
    Linux fedora.chilternnetworks.local 2.6.17-1.2174_FC5 #1 SMP Tue Aug 8 15:30:44 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux
    I can run the dbxml CLI examples successfully.
    I have built the PHP API with no obvious errors, following the guidelines in "http://dev.sleepycat.com/resources/faq_show.html?id=130", but there is obviously something wrong. For example, now I have loaded the two PHP modules (db4 and dbxml), I get a PHP Notice I did not see before:
    [ctucker@fedora dbxml_testing]$ php -v
    PHP Notice: Constant DB_LOCK_DEADLOCK already defined in Unknown on line 0
    PHP 5.1.4 (cli) (built: May 8 2006 08:35:26)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
    Also, the PHP examples fail, for example:
    [ctucker@fedora dbxml_testing]$ php 01.php
    PHP Notice: Constant DB_LOCK_DEADLOCK already defined in Unknown on line 0
    PHP Warning: xmlmanager::createcontainer(): St9bad_alloc in /home/ctucker/Desktop/dbxml_testing/01.php on line 5
    PHP Fatal error: Call to a member function putDocument() on a non-object in /home/ctucker/Desktop/dbxml_testing/01.php on line 6
    with similar results for other examples.
    Any suggestions for solving these problems will be welcome.

    I had the same problem, and finally I got with the solution.
    This is an error caused on configure:27200
    config.log says that pthread is not found:
    configure:27163: gcc -o conftest -g -O2 -L/usr/local/dbxml-2.2.13/install/lib conftest.c -ldb -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm 1>&5
    /usr/local/dbxml-2.2.13/install/lib/libdb.so: undefined reference to `pthread_condattr_setpshared'
    /usr/local/dbxml-2.2.13/install/lib/libdb.so: undefined reference to `pthread_mutexattr_destroy'
    /usr/local/dbxml-2.2.13/install/lib/libdb.so: undefined reference to `pthread_mutexattr_setpshared'
    /usr/local/dbxml-2.2.13/install/lib/libdb.so: undefined reference to `pthread_mutexattr_init'
    /usr/local/dbxml-2.2.13/install/lib/libdb.so: undefined reference to `pthread_mutex_trylock'
    collect2: ld returned 1 exit status
    configure: failed program was:
    #line 27152 "configure"
    #include "confdefs.h"
    #include "/usr/local/dbxml-2.2.13/install/include/db.h"
    Just comment these two lines (configure:27197)
    LDFLAGS=$old_LDFLAGS
    LIBS=$old_LIBS
    and add this one:
    THIS_LIBS="pthread"
    it worked for me.
    ldd `which php`
    linux-gate.so.1 => (0x00145000)
    libcrypt.so.1 => /lib/libcrypt.so.1 (0x03850000)
    librt.so.1 => /lib/librt.so.1 (0x0038c000)
    libdb-4.3.so => /usr/local/dbxml-2.2.13/install/lib/libdb-4.3.so (0x008bc000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00d7e000)
    libresolv.so.2 => /lib/libresolv.so.2 (0x00118000)
    libm.so.6 => /lib/libm.so.6 (0x00c45000)
    libdl.so.2 => /lib/libdl.so.2 (0x00c6c000)
    libnsl.so.1 => /lib/libnsl.so.1 (0x00101000)
    libxml2.so.2 => /usr/lib/libxml2.so.2 (0x03bd1000)
    libc.so.6 => /lib/libc.so.6 (0x00b10000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00a20000)
    /lib/ld-linux.so.2 (0x00af3000)
    However, it still appears the DB_LOCK_DEADLOCK .. :(
    Best,
    /Enric

Maybe you are looking for

  • Need help restoring Windows 8 Single Language and updating to 8.1

    To cut a very long story short, I have 2 PC's from different manufacturers. One is mine and the other is a friend's. Both came with Genuine OEM Windows 8 Single Language preinstalled. When attempting to update my PC to 8.1 from 8.0, it failed to boot

  • Can't make PDFs suddenly

    I have a 12 month direct-debit contract for Adobe Reader XI with 10 months still to go. Today suddenly I can't create PDF files from my documents. Instead it keeps giving me a message offering me Acrobat XI Pro Trial 30 Days Free and won't go away. A

  • How to avoid duplicated customer ref. no when create new sales order?

    Hi, In my company, we need input customer ref. no when create a new sales order, but I found there was no any validation to avoid input a existed number. Can somebody show me how to add some check function on this filed? thanks.

  • Source Control Packages

    Can anyone recommend a good source control software package that integrates well with oracle forms/reports and the financial applications?

  • Spinning Ball & Disk Utility

    When getting spinning ball is using disk utility-verify & repair okay ? Plus how often can one use disk utility ?