TreeCellRenderer class problem...

I am building an AIM-like chat program. When a user sets an away message, I want to display the leaf icon for the user's node. The current code somewhat works, but there are 2 problems:
1) I have to manually click on the users name or collapse/expand the tree to have the icon show up.
2) the icon shows up, but the name is run off (only the ... is shown for the name) - the node length seems to be very shrot when an icon is displayed. Without the icon, the node can have text as long as it wants and go the width of the tree.
Here is the current code I have (unimportant stuff taken out to shorten it up):
      * Gets the cell renderer for the current object
      * in the tree.
     public Component getTreeCellRendererComponent(
                              JTree tree,
                              Object value,
                              boolean sel,
                              boolean expanded,
                              boolean leaf,
                              int row,
                              boolean hasFocus) {
          super.getTreeCellRendererComponent(tree, value, sel,
                                 expanded, leaf, row,
                                 hasFocus);
          // if we are at the root, take away the icons and set
          // the appropriate font.
          if (!leaf) {
               setClosedIcon( null );
               setOpenIcon( null );
               setToolTipText( null );
               setFont( new Font( "SansSerif", Font.BOLD, 14 ) );
          // we are at a leaf, so set the tooltip to be the username and
          // set the appropriate font.
          else {
               // make sure we are not at the root
               if ( !value.toString().equals( "Users" ) ) {
                    // if the client has an away message, set the icon to a note icon
                    if ( clientTreeObj.getJCC().getClientAwayMessage( value.toString() ).length() > 0 ) {
                         setIcon( getLeafIcon() );
                                        // this next line causes a mass of errors...                    
                                        //((DefaultTreeModel)tree.getModel()).nodeChanged((DefaultMutableTreeNode)tree.getPathForRow(row).getPathComponent(row) );
                                        // this next line causes flickering
                         //tree.fireTreeExpanded( tree.getPathForRow( row ) );
                    else {
                         setIcon( null );
                         //tree.fireTreeExpanded( tree.getPathForRow( row ) );
                    // set the tooltiptext to include the username and the online time
                    String tooltip = " " + value.toString() + '\n' + "   Online time:" + '\t';
                    setToolTipText( tooltip );
                    setFont( new Font( "SansSerif", Font.PLAIN, 14 ) );
          return this;
     } // end getTreeCellRendererComponent

I have been playing around with this... it seems that the setIcon and setLeafIcon are giving different results. Sometimes the setIcon will allow the text+icon to fully appear, othertimes it won't, but setLeafIcon seems to always have problems showing hte name. the way the code is now, it "kinda" works, but has these undesirable effects. Any idea?

Similar Messages

  • Creating a triangle using polygon class problem, URGENT??

    Hi i am creating a triangle using polygon class which will eventually be used in a game where by a user clicks on the screen and triangles appear.
    class MainWindow extends Frame
         private Polygon[] m_polyTriangleArr;
                       MainWindow()
                              m_nTrianglesToDraw = 0;
             m_nTrianglesDrawn = 0;
                             m_polyTriangleArr = new Polygon[15];
                             addMouseListener(new MouseCatcher() );
            setVisible(true);
                         class MouseCatcher extends MouseAdapter
                             public void mousePressed(MouseEvent evt)
                  Point ptMouse = new Point();
                  ptMouse = evt.getPoint();
                if(m_nTrianglesDrawn < m_nTrianglesToDraw)
                                int npoints = 3;
                        m_polyTriangleArr[m_nTrianglesDrawn]
                      = new Polygon( ptMouse[].x, ptMouse[].y, npoints);
    }When i compile my code i get the following error message:
    Class Expected
    ')' expectedThe two error messages are refering to the section new Polygon(....)
    line. Please help

    Cannot find symbol constructor Polygon(int, int, int)
    Can some one tell me where this needs to go and what i should generally
    look like pleaseI don't think it is a good idea to try and add the constructor that the compiler
    can't find. Instead you should use the constructor that already exists
    in the Polygon class: ie the one that looks like Polygon(int[], int[], int).
    But this requires you to pass two int arrays and not two ints as you
    are doing at the moment. As you have seen, evt.getPoint() only supplies
    you with a single pair of ints: the x- and y-coordinates of where the mouse
    button was pressed.
    And this is the root of the problem. To draw a triangle you need three
    points. From these three points you can build up two arrays: one containing
    the x-coordinates and one containing the y-coordinates. It is these two
    arrays that will be used as the first two arguments to the Polygon constructor.
    So your task is to figure out how you can respond to mouse presses
    correctly, and only try and add a new triangle when you have all three of its
    vertices.
    [Edit] This assumes that you expect the user to specify all three vertices of the
    triangle. If this isn't the case, say what you do expect.

  • Calling method from another class problem

    hi,
    i am having problem with my code. When i call the method from the other class, it does not function correctly?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Dice extends JComponent
        private static final int SPOT_DIAM = 9; 
        private int faceValue;   
        public Dice()
            setPreferredSize(new Dimension(60,60));
            roll(); 
        public int roll()
            int val = (int)(6*Math.random() + 1);  
            setValue(val);
            return val;
        public int getValue()
            return faceValue;
        public void setValue(int spots)
            faceValue = spots;
            repaint();   
        @Override public void paintComponent(Graphics g) {
            int w = getWidth(); 
            int h = getHeight();
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setColor(Color.WHITE);
            g2.fillRect(0, 0, w, h);
            g2.setColor(Color.BLACK);
            g2.drawRect(0, 0, w-1, h-1); 
            switch (faceValue)
                case 1:
                    drawSpot(g2, w/2, h/2);
                    break;
                case 3:
                    drawSpot(g2, w/2, h/2);
                case 2:
                    drawSpot(g2, w/4, h/4);
                    drawSpot(g2, 3*w/4, 3*h/4);
                    break;
                case 5:
                    drawSpot(g2, w/2, h/2);
                case 4:
                    drawSpot(g2, w/4, h/4);
                    drawSpot(g2, 3*w/4, 3*h/4);
                    drawSpot(g2, 3*w/4, h/4);
                    drawSpot(g2, w/4, 3*h/4);
                    break;
                case 6:
                    drawSpot(g2, w/4, h/4);
                    drawSpot(g2, 3*w/4, 3*h/4);
                    drawSpot(g2, 3*w/4, h/4);
                    drawSpot(g2, w/4, 3*h/4);
                    drawSpot(g2, w/4, h/2);
                    drawSpot(g2, 3*w/4, h/2);
                    break;
        private void drawSpot(Graphics2D g2, int x, int y)
            g2.fillOval(x-SPOT_DIAM/2, y-SPOT_DIAM/2, SPOT_DIAM, SPOT_DIAM);
    }in another class A (the main class where i run everything) i created a new instance of dice and added it onto a JPanel.Also a JButton is created called roll, which i added a actionListener.........rollButton.addActionListener(B); (B is instance of class B)
    In Class B in implements actionlistener and when the roll button is clicked it should call "roll()" from Dice class
    Dice d = new Dice();
    d.roll();
    it works but it does not repaint the graphics for the dice? the roll method will get a random number but then it will call the method to repaint()???
    Edited by: AceOfSpades on Mar 5, 2008 2:41 PM
    Edited by: AceOfSpades on Mar 5, 2008 2:42 PM

    One way:
    class Flintstone
        private String name;
        public Flintstone(String name)
            this.name = name;
        public String toString()
            return name;
        public static void useFlintstoneWithReference(Flintstone fu2)
            System.out.println(fu2);
        public static void useFlintstoneWithOutReference()
            Flintstone barney = new Flintstone("Barney");
            System.out.println(barney);
        public static void main(String[] args)
            Flintstone fred = new Flintstone("Fred");
            useFlintstoneWithReference(fred); // fred's the reference I"m passing to the method
            useFlintstoneWithOutReference();
    {code}
    can also be done with action listener
    {code}    private class MyActionListener implements ActionListener
            private Flintstone flintstone;
            public MyActionListener(Flintstone flintstone)
                this.flintstone = flintstone;
            public void actionPerformed(ActionEvent arg0)
                //do whatever using flinstone
                System.out.println(flintstone);
        }{code}
    Edited by: Encephalopathic on Mar 5, 2008 3:06 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need HELP with objects and classes problem (program compiles)

    Alright guys, it is a homework problem but I have definitely put in the work. I believe I have everything right except for the toString method in my Line class. The program compiles and runs but I am not getting the right outcome and I am missing parts. I will post my problems after the code. I will post the assignment (sorry, its long) also. If anyone could help I would appreciate it. It is due on Monday so I am strapped for time.
    Assignment:
    -There are two ways to uniquely determine a line represented by the equation y=ax+b, where a is the slope and b is the yIntercept.
    a)two diffrent points
    b)a point and a slope
    !!!write a program that consists of three classes:
    1)Point class: all data MUST be private
    a)MUST contain the following methods:
    a1)public Point(double x, double y)
    a2)public double x ()
    a3public double y ()
    a4)public String toString () : that returns the point in the format "(x,y)"
    2)Line class: all data MUST be private
    b)MUST contain the following methods:
    b1)public Line (Point point1, Point point2)
    b2)public Line (Point point1, double slope)
    b3)public String toString() : that returns the a text description for the line is y=ax+b format
    3)Point2Line class
    c1)reads the coordinates of a point and a slope and displays the line equation
    c2)reads the coordinates of another point (if the same points, prompt the user to change points) and displays the line equation
    ***I will worry about the user input later, right now I am using set coordinates
    What is expected when the program is ran: example
    please input x coordinate of the 1st point: 5
    please input y coordinate of the 1st point: -4
    please input slope: -2
    the equation of the 1st line is: y = -2.0x+6.0
    please input x coordinate of the 2nd point: 5
    please input y coordinate of the 2nd point: -4
    it needs to be a diffrent point from (5.0,-4.0)
    please input x coordinate of the 2nd point: -1
    please input y coordinate of the 2nd point: 2
    the equation of the 2nd line is: y = -1.0x +1.0
    CODE::
    public class Point{
         private double x = 0;
         private double y = 0;
         public Point(){
         public Point(double x, double y){
              this.x = x;
              this.y = y;
         public double getX(){
              return x;
         public double setX(){
              return this.x;
         public double getY(){
              return y;
         public double setY(){
              return this.y;
         public String toString(){
              return "The point is " + this.x + ", " + this.y;
    public class Line
         private double x = 0;
         private double y = 0;
         private double m = 0;
         private double x2 = 0;
         private double y2 = 0;
         public Line()
         public Line (Point point1, Point point2)
              this.x = point1.getX();
              this.y = point1.getY();
              this.x2 = point2.getX();
              this.y2 = point2.getY();
              this.m = slope(point1, point2);
         public Line (Point point1, double slope)
              this.x = point1.getX();
              this.y = point1.getY();
         public double slope(Point point1, Point point2)//finds slope
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
    public class Point2Line
         public static void main(String[]args)
              Point p = new Point(3, -3);
              Point x = new Point(10, 7);
              Line l = new Line(p, x);
              System.out.println(l.toString());
    }My problems:
    I dont have the right outcome due to I don't know how to set up the toString in the Line class.
    I don't know where to put if statements for if the points are the same and you need to prompt the user to put in a different 2nd point
    I don't know where to put in if statements for the special cases such as if the line the user puts in is a horizontal or vertical line (such as x=4.7 or y=3.4)
    Edited by: ta.barber on Apr 20, 2008 9:44 AM
    Edited by: ta.barber on Apr 20, 2008 9:46 AM
    Edited by: ta.barber on Apr 20, 2008 10:04 AM

    Sorry guys, I was just trying to be thorough with the assignment. Its not that if the number is valid, its that you cannot put in the same coordinated twice.
    public class Line
         private double x = 0;
         private double y = 0;
         private double m = 0;
         private double x2 = 0;
         private double y2 = 0;
         public Line()
         public Line (Point point1, Point point2)
              this.x = point1.getX();
              this.y = point1.getY();
              this.x2 = point2.getX();
              this.y2 = point2.getY();
              this.m = slope(point1, point2);
         public Line (Point point1, double slope)
              this.x = point1.getX();
              this.y = point1.getY();
         public double slope(Point point1, Point point2)//finds slope
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
    public class Point2Line
         public static void main(String[]args)
              Point p = new Point(3, -3);
              Point x = new Point(10, 7);
              Line l = new Line(p, x);
              System.out.println(l.toString());
    }The problem is in these lines of code.
    public double slope(Point point1, Point point2) //if this method finds the slope than how would i use the the two coordinates plus "m1" to
              double m1 = (point1.getY() - point2.getY())/(point1.getX() - point2.getX());
              return m1;
         public String toString()
              double temp = this.x- this.x2;
              return this.y + " = " +temp + "" + "(" + this.m + ")" + " " + "+ " + this.y2;
              //y-y1=m(x-x1)
         }if slope method finds the slope than how would i use the the two coordinates + "m1" to create a the line in toString?

  • Could not find the main class - Problem with Webservice-Access

    Hello Everybody,
    I'm having serious Problems with accessing a WebService (Tomcat-Axis) per executable jar-File.
    I constructed a simple GUI with 3 Textboxes 1 Button and 1 Resultbox.
    I use eclipse so it was no Problem to simple generate the Backgroundclient by Processing the .wsdl-File of the WS.
    Now I do this:
    Head_tServiceLocator serviceLocator = new Head_tServiceLocator();
    Head_t service = serviceLocator.getRPCCall();
    RPCCallSoapBindingStub Head_t = (RPCCallSoapBindingStub) service;and use the Webservice like an Object.
    All this works very well.
    Now the Problem:
    Head_t service = serviceLocator.getRPCCall();this Line has to throw a ServiceException.
    If i add a try-catch Block to Process the Message JAVA tells me after i exported to JAR (with Manifest-stuff and so on) and double Click on the JAR the following :
    Could not find the main Class - Program will exit.
    And if i add a throws Declaration to the Methodheader it tells me:
    Fatal Exception Occured - Program will exit
    But if i Comment out that Line at least the GUI is being displayed (so it DOES find the main-Class). But then of course the Webservice won't be accessed.
    All the JARs needed (axis.jar, commons-discovery.jar and so on) are in the same Directory as the Webservice-Client.jar
    Please Help me.
    Greets,
    Zap

    I am not done any typing mistake while creating the jar file i already followed the suggestion that you have mentioned but still the same error .
    This is my MANIFEST.MF file created under META-INF folder
    Manifest-Version: 1.0
    Class-Path: qtjambi-4.4.3_01.jar qtjambi-win32-msvc2005-4.4.3_01.jar
    Created-By: 1.5.0 (Sun Microsystems Inc.)
    Main-Class: Ui_MainWindow
    When i extracted the app.jar following this i got
    1. META-INF folder inside that MAINFEST.MF file the contents i have already placed above
    2. qtjambi-4.4.3_01.jar
    3. qtjambi-win32-msvc2005-4.4.3_01.jar
    4. Ui_MainWindow.class
    Please tell me whats wrong in that i can also give you the app.jar file please let me know the email id ..

  • StringTokenizer class problem with strings in double quotes

    Hello Technocrats,
    I have a problem with tokenizing following string enclosed in (). (abc," India, Asia", computer engineer). My separator is ",", thus StringTokenizer class gives me 4 tokens namely abc, "India, Asia" and computer engineer. But I require that String in double quotes should be a single token. How to achieve this using StringTokenizer class? Or is there any other way?
    Thanks in advance.

    Try
    String[] str="abc,\" India, Asia\",computer engineer".split(",",1);
              for(String s: str)
                   System.out.println(s);
              }Thanks.

  • Error loading class problem with applet (Newbie)

    Hi,
    I am new to Java applets. I try to display a simple sample. I put this into html file: <APPLET codebase="classes" code="NewApplet.class" width=350 height=200></APPLET>
    And it always appears one problem:
    Error loading class: NewApplet
    java.lang.NoClassDefFoundError
    java.lang.ClassNotFoundException: NewApplet
         at com/ms/vm/loader/URLClassLoader.loadClass
         at com/ms/vm/loader/URLClassLoader.loadClass
         at com/ms/applet/AppletPanel.securedClassLoad
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    Can anybody help please? Thanks in advance.

    Now I am able to load the applet on MAC OS X 10.4.11. This is due to network issue.
    Now my problem with the applet functionality. My applet will display the map image. Applet contains the navigation arrow keys at the top left of my applet. These keys will be used to navigate through the map.
    The problem is while user using the navigation buttons, the image got squash and stretch.
    This is happened only on MAC OS X 10.4.11 and Its working fine on PC and MAC OS X 10.5.5.
    Please anyone help in this regard. Thanks in advance.

  • AbsoluteTime class problem

    Hi.
    I have a problem with the AbsoluteTime class.
    When i create an AbsoluteTime object, the time it represents is 0ms 0ns.
    I have Sun JRTS 2.2 and Ubuntu 8.04.

    Sorry, submitted to early.
    I am trying to understand the following code
    class node
        int  index;                                     // of this node
        int  x_loc;                                     // units right
        int  y_loc;                                     // units down
        node next;                                      // in list
    }I understand the first three variables, bu the line node next; confuses me. Am i correct in beleiveing that it creates a new node called next? If this is the case wouldn't it then create another node called next and so on etc...

  • Importing Java class problem!

    Hello
    I have problem by Importing java class into form. When I select in Forms Builder from menu: Programs/Import Java Classes it returns error: PDE-UJI001 JVM not able to create!
    Can someone know what I must do to fix that problem?
    Thanks, Chrity

    It is a shame because it, probably, contains no special 1.5 new instruction at all.
    Maybe it would be possible to try replacing the current JDK/JRE of your <ORACLE_HOME>/jdk installation after a safe backup of course.
    You probably have a very little chance that it works, and it also won't be supported.
    Francois

  • Abstract Class Problem

    HI, I have 4 classes and the hierarchy of those classes is as follows:
    DBCachedRecord
    |
    ServiceHeader
    |
    ServiceHeader22, ServiceHeader25
    I made ServiceHeader abstract and ServiceHeader22 and ServiceHeader25 need to call constructors of DBCachedRecord. When i do super(..), I got the error Constructor cannot find in ServiceHeader.
    There are few static methods as well in each of the class which I want to access those. And I have a method getService in ServiceHeader which decides which serviceHeader to use (either 22 or 25).
    I found this really a hard one and I cannot find a solution yet. Would anybody help me in resolving this scenario.
    Thanks

    When i do super(..), I got the error
    Constructor cannot find in ServiceHeader.So what is your question? You believe the compiler, right? You need to either add the constructor you want to call, or call a constructor that already exists. Keep in mind the default constructor thing - if you don't know what I'm talking about then that may be the problem.
    There are few static methods as well in each of the
    class which I want to access those. And I have a
    method getService in ServiceHeader which decides which
    serviceHeader to use (either 22 or 25).Generally having a superclass know anything about its subclasses is a bad design. Consider making these methods non-static and overriding them in the subclasses. IMO this is OK to do even if they don't use non-static data, in order to get the appropriate class-specific behavior. Others may disagree though, I don't know.

  • Inner Class Problem - I think...

    Ok here's my problem. I have two classes, one is a servlet, the other implements Runnable. The first class called Job starts a new thread with using the second class, JobItem.
    I created a simple object in the Job classes called lineItem. This is just a collection of Strings that make up a record of the Job run. I created in Job when I need to do things at the record level, and it works great. However, I want to use the same object in JobItem. I thought I could just create another a new instance of lineItem like this:
         Job.listItem list = new Job.listItem();But I get an error: java.lang.NoSuchMethodError: com.jobconsole.web.Job$listItem: method <init>()V not foundI'm sure I am violating some OO rule, or am I really missing an init function? If so what do I put in said init function? Thanks.
    Ross

    The method name <init> is a special method name that is used to refer to the a constructor for a class. If this is a runtime error (which it looks like it is) then what is happening is that some code is trying to call a constructor that doesn't exist. This generally happens when you make a change in one class and don't recompile classes that depend upon it. Try recompiling all of your source, and make sure there are no old copies of class files lying around.

  • Document class problem

    I'm working out of Colin Moock's Essential ActionScript 3.0
    and I get this message when I try to save my file: "A definition
    for the document class could not be found in the classpath, so one
    will be automatically generated in the SWF file upon export." The
    document class is set to zoo.VirtualZoo
    My .fla file sits on the desktop. Also on the desktop, there
    is a folder named zoo. Within this folder named zoo there are
    several .as files, one of the is named VirtualZoo.as
    Even when I try to run the completed file that he provides I
    get this same message. I'm running MacOS10.4.11, using Flash CS3,
    and have already reset all of my ActionScript settings within my
    preferences.
    Here's the link to the files:
    http://moock.org/eas3/examples/moock_eas3_examples/virtualzoo_Flash_authoring/
    Any help would be much appreciated,
    Joe

    I tried it from you're link and it still gave me the same
    problem. Do you think that I've changed some setting? Is there a
    way to completely reset all the defaults in flash? This sucks.
    Joe

  • Desktop class problem

    The code below does nothing. No file opened, no exception thrown, no output.
    What can I do to discover the problem?
    It does indeed execute the desktop.open(file) line.
    Using JDK 1.16.0_81
    File file = new File(pathAndFileString); // an existing text file
    if (Desktop.isDesktopSupported()) {
         Desktop desktop = Desktop.getDesktop();
         if (desktop.isSupported(Desktop.Action.OPEN )) {
              try {
                   desktop.open(file);
              } catch (IOException e1) {
                   e1.printStackTrace();
         else {
              System.out.println("Desktop.Action.OPEN not supported");
    else {
         System.out.println("Desktop not supported");
    }

    package desktopdemo;
    import java.awt.Desktop;
    import java.io.File;
    import java.io.IOException;
    public class MyDesktopDemo {
         public MyDesktopDemo() {
              // have tried .txt, .rtf, .pptx all with no effect
              String pathAndFileString = "C:\\my.pptx";
              File file = new File(pathAndFileString);
              if (Desktop.isDesktopSupported()) {
                   Desktop desktop = Desktop.getDesktop();
                   if (desktop.isSupported(Desktop.Action.OPEN )) {
                        try {
                             System.out.println("desktop.open(" + pathAndFileString + ")"); // gets here
                             desktop.open(file); // but nothing happens
                        } catch (IOException e1) {
                             e1.printStackTrace();
                   else {
                        System.out.println("Desktop.Action.OPEN not supported");
              else {
                   System.out.println("Desktop not supported");
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new MyDesktopDemo();
    }

  • Oracle blob class problem

    Hello again.
    I have the following code:
    java.sql.ResultSet resultSetForUpdate = stat.executeQuery("select picture from some_table where some_id=" + someId + " for update");
    java.sql.Blob blob = resultSetForUpdate.getBlob(1);
    // here is some code that types the class of the blob
    logger.info("blob class is: "+blob.getClass());
    now the problem is that the class returned with blob.getClass is different on 2 portals... on 1 portal I get oracle.sql.BLOB (this is the expected result) but on the other I get com.inqmy.services.dbpool.remote.RemoteBlobImpl
    does anyone have any idea why this is happening and how can I do so that I always get the oracle.sql.BLOB class?
    more information: both portal installations are ep6 sp2 with (I think) identical patch levels (35 if I remember correctly). the database they access is the same one. the dbpool definitions (in visual administrator) look similar.
    thanks in advance.
    silviu.

    Thanks for taking the time to look at this.
    No, it is the same driver on both servers. The driver is the oracle driver oracle.jdbc.OracleDriver provided by Oracle themselves.
    This is not it...
    Could there be some path problem? The server on which it works fine is a windows machine, whereas the server where it doesnt work is a solaris machine, I think (not windows for sure).
    Message was edited by: Silviu Lipovan Oanca

  • Weblogic startup class: problem calling EJB's

    Has anyone ever experienced a problem in using a startup class (registered in weblogic.properties)
    and tried to lookup and use an EJB in the same application?
    Basically, I have a startup class which registers to receive messages from an
    MQ queue, and when it receives a message, it tries to do a lookup of a bean and
    use it, but I receive a 'NullPointerException'.
    I'm running Weblogic 5.1
    (I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my app isn't using
    6 or EJB 2.0)
    Thanks...

    Can you post weblogic.log? Are you sure that EJB was deployed successfully.
    Also comment the PROVIDER_URL in initial context and see if that solves the problem
    Viresh Garg
    BEA Systems
    shaun wrote:
    The exception is simply a 'NullPointerException' coming from the startup class
    (I don't have the old log file or I would include the trace here.). Basically,
    when my startup class receives a call to the onMessage(...) method (from listening
    for messages), it looks up an EJB on the server, through the InitialContect class
    and gets a 'null' returned back, thereby throwing the NullPointerException.
    If anyone else is successful in having a startup class which can lookup and call
    an EJB within the same Weblogic server, please help.
    Thanks again....
    Viresh Garg <[email protected]> wrote:
    Can you post the exception stack trace? Also what exactly are you doing
    in startup class.
    Viresh Garg
    Principal Developer Relations Engineer
    BEA Systems
    Shaun wrote:
    Has anyone ever experienced a problem in using a startup class (registeredin weblogic.properties)
    and tried to lookup and use an EJB in the same application?
    Basically, I have a startup class which registers to receive messagesfrom an
    MQ queue, and when it receives a message, it tries to do a lookup ofa bean and
    use it, but I receive a 'NullPointerException'.
    I'm running Weblogic 5.1
    (I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my appisn't using
    6 or EJB 2.0)
    Thanks...

Maybe you are looking for

  • Result element of Container Operation

    Hi Guys,     When I was learning the workflow template of "Absence Notification", I have a question with the step 'Container Operation'. The result element 'Flag' can be selected from the workflow container when using F4,but I can't find the 'Flag' i

  • Please Wait While Windows Configures OVIMPlatform

    Hello and happy New Year to everyone. My problem as you read in the subject is common. Can someone tell me exactly what to do to remove this thing? I cannot install/uninstall anything. Attachments: Problem.jpg ‏266 KB

  • How to set new extreme with old extreme

    how do I set up a gen 3 airport extreme using ethernet wire to newest extreme just bought it yesterday, not set up yet)  to extend  wireless network to far side of house

  • How do I delete folders in Thunderbird?

    I want to delete folders in Thunderbird and nothing seems to work. How do I do it?

  • Scheduled recording of internet channels failing.

    Hi all Have been having an issue with scheduled recordings on Discovery, Nat Geo etc - When the scheduled recording of a single programme or series is due to start, the banner at the top of the screen shows it is recording the programme, but by and l