Webservicecontext always being returned as null.. help needed

Hi,
I am trying to get the WebServiceContext below in the webservice below (JAX-WS), but i think the resource injection isnt working.
I am using oracle enterprise pack for eclipse, weblogic 11g server.
Need help with what i am doing wrong. Do i need to configure something else
Thank you
Code always prints "error1" in the console (so webservice context always null).
package test;
import javax.annotation.Resource;
import javax.jws.WebService;
import javax.xml.ws.WebServiceContext;
@WebService
public class Hello
@Resource private WebServiceContext wsContext;
public int getCounter()
if(wsContext == null)
System.out.println("Error");
else
System.out.println("Success");
return 1;
}

Hello,
Unfortunately, I wasn't able to reproduce your problem. However, I'll talk about my setup:
1. Created a Web Service Project: File->New->Web Service Project
2. Created a 11gR1(10.3.5) Runtime
3. Created the WebService exactly as above.
4. Right Clicked the WebService and Selected RunAs->Run On Server
Once the WebLogic Test Client is Launched Selected the getCounter method.
Is your execution similar? Any additional info ie pertinent logs etc may help in getting things going.
You shouldn't need any addition setup to access the WebServiceContext and have it correctly injected other than being invoked by the client side correctly.
Thanks, Chris

Similar Messages

  • BottomCount with LastPeriod dealing with NULLs help needed

    I am trying to get the bottom 5 firms for the current period and then comparing it to the previous period.
    I am having difficulty removing the nulls from the current period without excluding the previous period altogether.
    The query is
    with
    MEMBER [Measures].[Name] AS
    ( Axis ( 1 ).Item ( 0 ).Item ( 0 ) .Hierarchy .CurrentMember.Name )
    SELECT
    [Measures].[Amount] ,
    [Measures].[Name]
    } ON COLUMNS,
    BottomCount (
    Filter (
    Except ( [Dim IFA Details].[Parent Key].[Adviser Group].Members, [Dim IFA Details].[Parent Key].[Adviser Group].Unknown)
    , not isempty([Measures].[Amount]) )
    , 5
    , ( [Measures].[Amount], [Dim Date].[Fiscal].[Fiscal Year].&[FY 13/14] , [Dim Income Range].[Hierarchy].[Range ID].&[2])
    ) * LastPeriods ( 2, [Dim Date].[Fiscal Year].[Fiscal Year].&[FY 13/14] ) ON ROWS
    FROM [Income and Emails Cube]
    where
    [Dim Income Range].[Hierarchy].[Range ID].&[2]
    The null filter checks for all periods, so I am still getting nulls for the specific period I am looking at. If I try and specify the period in the filter, then last 2 periods doesnt work and I only get the current year results.
    How can I get around this?
    Regards
    Jon

    This seems to work:
    WITH MEMBER [Measures].[Name] AS
      ( Axis ( 1 ).Item ( 0 ).Item ( 0 ) .Hierarchy .CurrentMember.Name )    
    SELECT
    {  [Measures].[Amount] ,  [Measures].[Name]  } ON 0,
    [Dim IFA Details].[Parent Key].[Adviser Group].Members *
    LastPeriods ( 2, [Dim Date].[Fiscal].[Fiscal Year].&[FY 13/14] ) ON 1
    FROM (
      SELECT [Measures].[Amount] ON 0,
      ( BottomCount (
        Filter (
          Except ( [Dim IFA Details].[Parent Key].[Adviser Group].Members, [Dim IFA Details].[Parent Key].[Adviser Group].Unknown ),
          NOT IsEmpty ( [Measures].[Amount] )
        5,
        ( [Measures].[Amount] , [Dim Income Range].[Hierarchy].[Range ID].&[2])
      [Dim Date].[Fiscal].[Fiscal Year].Members
       ) ON 1
      FROM [Income and Emails Cube]
      WHERE ( [Dim Date].[Fiscal Year].[Fiscal Year].&[FY 13/14], [Dim Income Range].[Hierarchy].[Range ID].&[2] )
    Is this the best way to solve it?
    Jon

  • Help. HTMLDocument.getElement(id) doesn't work, return me null.

    i think the method getElement(String id) would get me the whole tag with the specific id, but it returns me null value. The following is my html and a test program. What's wrong with it? Please Help. Thank you very much.
    here is my boo.html file
    <html>
    <body>
    <p id=abc> hello </p>
    </body>
    </html>
    here is my little test program
    import javax.swing.JEditorPane;
    import javax.swing.text.Element;
    import javax.swing.text.html.HTMLDocument;
    import javax.swing.text.html.HTMLEditorKit;
    import javax.swing.text.html.StyleSheet;
    public class Boo{
    private JEditorPane editorpane = new JEditorPane();
    private HTMLDocument doc;
    public Boo(){
         try{
    editorpane.setPage(getClass().getResource("boo.html"));
    } catch (Exception e) {e.printStackTrace();}
         doc = (HTMLDocument) editorpane.getDocument();
         System.out.println(doc);
         Element el = doc.getElement("abc");
         System.out.println(el);
    public static void main(String[] args) {
    Boo bo = new Boo();
    System.exit(0);
    here is the result:
    ey@troy:/work/ey> java -version
    java version "1.5.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
    Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
    ey@troy:/work/ey> java Boo
    javax.swing.text.html.HTMLDocument@b753f8
    null

    thanks hiwa, i saw you replied my thread from javaworld as well.
    and i tried your code, which utilises a JFrame to make my program a GUI program. but it turns out still not working, still return me null value.
    and i tried the following code, which will definitely return me the right thing:
    try{
              editorpane.setPage("file:///work/ams/bightml.html");
                 doc = (HTMLDocument) editorpane.getDocument();
          } catch (Exception e) {e.printStackTrace();}
         System.out.println(doc);
         Element el = null;
         el = doc.getElement("D");
            int i=0;
         while (el == null){
              try{
                   Thread.sleep(i*500);
                   el = doc.getElement("D");
                   } catch (Exception e) {e.printStackTrace();}
                    i++;       
         System.out.println(el);From the code, the "bightml.html" is an html file which has a table with 1000 lines. and i tagged some of the <td> with IDs. i found out it will take more time for the program to locate the tag towards the end of the html.
    And i also find out: in the following codes, if you make the thread sleep some time after the first line, the result of the second line will give you more:
          doc = (HTMLDocument) editorpane.getDocument();
          System.out.println(doc.getText(0, doc.getLength()));and this also make me think, the " doc = (HTMLDocument) editorpane.getDocument();" is not thread save as well.
    anyone knows something about this?
    oh, did i mention my machine? it's a P4 2.4G running under Suse 9.1 with java 1.5.0_01.
    Thanks.

  • I don't know if this is a Firefox problem so I ask, When printing how come it always prints so small I nearly need a magnafing glass? Is this caused by something else I may have set incorrectly? help please, from a very satisfied Firefox user

    I don't know if this is a Firefox problem so I ask, When printing how come it always prints so small I nearly need a magnifying glass? Is this caused by something else I may have set incorrectly? help please, from a very satisfied Firefox user

    This only happens when I'm in my browser. Ex. when I'm on a site and I decide I like what I see and want to print it text that is, my printer always prints tiny. When I'm in Microsoft Word for ex. I print it and it looks like what I expect. So I don't know if somehow my printer got set to print tiny when on the web. If you can help me I would be most appreciative. Thanks again for your response.

  • HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS

    HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS IN ADVANCE

    try this website this should help you http://helpme.viber.com/index.php?/Knowledgebase/List/Index/1/iphone

  • Help needed in linked lists...

    I have been working on this computer assignment lately but I still don't understand linked lists yet..I did an assignment on array based implementation and now I am supposed to do the same thing in linked list implementation..
    I need help on how to change this into a linked list implementation..any help would be appreciated. Thank you..below is the code for the array based implementation..the only thing that needs change here is after where is says Array-based implementation of the ADT list.
    public class ListArrayBasedDriver {
      public static void main(String [] args) {
        ListArrayBased myGroceryList = new ListArrayBased();
        myGroceryList.add(1,"milk");
        myGroceryList.add(2,"eggs");
        myGroceryList.add(3,"butter");
        myGroceryList.add(4,"pecans");
        myGroceryList.add(5,"apples");
        myGroceryList.add(6,"bread");
        myGroceryList.add(7,"chicken");
        myGroceryList.add(8,"rice");
        myGroceryList.add(9,"red beans");
        myGroceryList.add(10,"sausage");
        myGroceryList.add(11,"flour");
        printList(myGroceryList); //print out original List
        System.out.print("numItems is now: " + myGroceryList.size() + "\n");
        System.out.println("adding juice for 5th item...");
        myGroceryList.add (5, (Object) "juice");  //add juice
        System.out.println("item 5 is: " + myGroceryList.get(5)); //get position 5
        printList(myGroceryList);
        System.out.print("numItems is now: " + myGroceryList.size() + "\n");
        System.out.println("removing juice...");
        myGroceryList.remove (5); //remove item at position 5
        printList(myGroceryList);
        System.out.print("numItems is now: " + myGroceryList.size() + "\n");
      public static void printList(ListArrayBased myList)
            //method prints a list, numbering the values,  e.g, "1.  milk" .... "5.  juice".... etc.
            int i;
            for(i=1; i <= myList.size(); i++)
                String tempString = new String((String)myList.get(i));
                System.out.println(i+" "+ tempString);
    // Array-based implementation of the ADT list.
    class ListArrayBased {
        private static final int MAX_LIST = 50;
        private Object items[];  // an array of list items
        private int numItems;  // number of items in list
        public ListArrayBased()
        // creates an empty list
             items = new Object[MAX_LIST];
             numItems = 0;
        }  // end default constructor
        public boolean isEmpty()
          return (numItems == 0);
        } // end isEmpty
        public int size()
           return numItems;
        }  // end size
        public void removeAll()
          // Creates a new array; marks old array for
          // garbage collection.
          items = new Object[MAX_LIST];
          numItems = 0;
        } // end removeAll
        public void add(int index, Object item) throws  ListIndexOutOfBoundsException
          if (numItems > MAX_LIST)
            throw new ListException("ListException on add");
        }  // end if
          if (index >= 1 && index <= numItems+1)
            // make room for new element by shifting all items at
            // positions >= index toward the end of the
            // list (no shift if index == numItems+1)
            for (int pos = numItems; pos >= index; pos--) {
              items[translate(pos+1)] = items[translate(pos)];
          } // end for
          // insert new item
          items[translate(index)] = item;
          numItems++;
          else
          {  // index out of range
            throw new ListIndexOutOfBoundsException(
             "ListIndexOutOfBoundsException on add");
          }  // end if
        } //end add
        public Object get(int index) throws ListIndexOutOfBoundsException
          if (index >= 1 && index <= numItems)
            return items[translate(index)];
          else 
          {  // index out of range
            throw new ListIndexOutOfBoundsException(
              "ListIndexOutOfBoundsException on get");
          }  // end if
        } // end get
        public void remove(int index) throws ListIndexOutOfBoundsException
          if (index >= 1 && index <= numItems)
            // delete item by shifting all items at
            // positions > index toward the beginning of the list
            // (no shift if index == size)
                for (int pos = index+1; pos <= size(); pos++) {
                    items[translate(pos-1)] = items[translate(pos)];
          }  // end for
          numItems--;    
          else
          {  // index out of range
            throw new ListIndexOutOfBoundsException("ListIndexOutOfBoundsException on remove");
          }  // end if
        } // end remove
        private int translate(int position) {
        return position - 1;
       } // end translate
    }  // end ListArrayBased
    class ListException extends RuntimeException
      public ListException(String s)
        super(s);
      }  // end constructor
    }  // end ListException
    class ListIndexOutOfBoundsException
                extends IndexOutOfBoundsException {
      public ListIndexOutOfBoundsException(String s) {
        super(s);
      }  // end constructor
    }  // end ListIndexOutOfBoundsException

    Could someone check for me if this will work and if it doesn't what I need to do to make it work..Thanks...
    public class ListArrayBasedDriver {
      public static void main(String [] args) {
        ListArrayBased myGroceryList = new ListArrayBased();
        myGroceryList.add(1,"milk");
        myGroceryList.add(2,"eggs");
        myGroceryList.add(3,"butter");
        myGroceryList.add(4,"pecans");
        myGroceryList.add(5,"apples");
        myGroceryList.add(6,"bread");
        myGroceryList.add(7,"chicken");
        myGroceryList.add(8,"rice");
        myGroceryList.add(9,"red beans");
        myGroceryList.add(10,"sausage");
        myGroceryList.add(11,"flour");
        printList(myGroceryList); //print out original List
        System.out.print("numItems is now: " + myGroceryList.size() + "\n");
        System.out.println("adding juice for 5th item...");
        myGroceryList.add (5, (Object) "juice");  //add juice
        System.out.println("item 5 is: " + myGroceryList.get(5)); //get position 5
        printList(myGroceryList);
        System.out.print("numItems is now: " + myGroceryList.size() + "\n");
        System.out.println("removing juice...");
        myGroceryList.remove (5); //remove item at position 5
        printList(myGroceryList);
        System.out.print("numItems is now: " + myGroceryList.size() + "\n");
      public static void printList(ListArrayBased myList)
            //method prints a list, numbering the values,  e.g, "1.  milk" .... "5.  juice".... etc.
            int i;
            for(i=1; i <= myList.size(); i++)
                String tempString = new String((String)myList.get(i));
                System.out.println(i+" "+ tempString);
    // Linked List-based implementation of the ADT list.
    class ListNode
         //class to represent one node in a list
         class ListNode
              //package access members; List can access these directly
              Object data;
              ListNode nextNode;
              //contructor creates a ListNode that refers to object
              ListNode( Object object)
                   this( object, null );
              } //end ListNode one-argument constructor
              //constructor creates ListNode that refers to
              // Object and to the next ListNode
              ListNode ( Object object, ListNode node)
                   data = object;
                   nextNode = node;
              // end ListNode two-argument contructor
              //return reference to data in node
              Object getObject()
                   return data; // return Object in this mode
              //return reference to next node in list
              ListNode getNext()
                   return nextNode; // get next node
              } // end method getNext
    } //end class ListNode
    //class List Definition
    public class List
         private ListNode firstNode;
         private ListNode lastNode;
         private String name; // string like " list " used in printing
         //contructor creates empty List with " list " as the name
         public List()
              this(" list ");
         } //end List no-arguement constructor
    //contructor creates an empty list with a name
    public List( String listName )
         name = listname;
         firstNode = lastNode = null;
    } //end List no-arguement contructor
    //insert Object at front of List
    public void insertAtFront ( object insertItem )
         if ( isEmpty() ) //firstNode and lastNode refer to same object
              firstNode = lastNode = newListNode( insertItem );
         else // firstNode refers to new node
              firstNode = new ListNode ( insertItem, firstNode );
    } // end method insertAtFront
    // insert Object at end of List
    public void insert AtBack ( Object insertItem )
         if ( isEmpty() ) //firstNode and lastNode refer to same object
              firstNode = new ListNode ( insertItem );
         else // firstNode refers to new node
         firstNode = new ListNode (insertItem, firstNode );
    } // end method insertAtFront
    // insert Object at end of List
    public void insertAtBack ( Object insertItem )
         if ( isEmpty() ) //firstNode and LastNode refer to same Object
              firstNode = lastNode = new ListNode ( insertItem );
         else // lastNode = lastNode.nextNode = new ListNode ( insertItem );
    } // end method insertAtBack
    //remove first node from List
    public Object removeFromFront() throws EmptyListException
         if( isEmpty() ) //throw exception if list is empty
         throw new EmptyListException( name );
         object removedItem = firstNode.data; //retrieve data being removed
    // update references firstNode and lastNode
    if (firstNode == lastNode )
         firstNode =lastNode = null;
    else
         firstNode = firstNode.nextNode;
         return removedItem; // return removed node data
    } //end method removeFromFront
    //remove last node from List
    Public Object removeFromBack() throws EmptyListException
         If ( isEmpty() ) // throw exception if list is empty
              throw new EmptyListException( name );
         Object removedItem = lastNode.data; // retrieve data being removed
         // update references firstNode and lastNode
         If ( firstNode == lastNode )
              firstNode = lastNode = null;
         else // locate new last node
              ListNode current = firstNode;
              // loop while current node does not refer to lastNode
              while ( current.nextNode != lastNode )
                   current = current.nextNode;
              lastNode = current; // current is new lastNode
              current.nextNode = null;
         } // end else
         return removedItem; // return removed node data
    } // end method removeFromBack
    // determine whether list is empty
    public boolean isEmpty()
         return firstNode == null; // return true if list is empty
    }     // end method isEmpty
    //output List contents
    public void print()
         if (isEmpty() )
              System.out.printf(�Empty %s\n�, name );
              return;
         System.out.printf(�The %s is: �, name );
         ListNode current = firstNode;
         //while (current != null )
              System.out,printf(�%s �, current.data );
              current = current.nextNode;
         } //end while
         System.out.println( �\n� );
    } //end method print
    } end class List

  • ValueList JSF Wrapper design help needed...

    I need some help here....
    I am trying to write a JSF wrapper for valuelist (http://valuelist.sourceforge.net) which would use the backend integration already contained in ValueList to leverage as a JSF component.
    In traditional implementation ValueListInfo could be reconstructed from request parameters. I am unclear how I can reconstuct ValueListInfo in the JSF way. I need a way to get the current page number the datatable is attempting to display to the procedure that returns the datamodel.
    Here is JSP snippet
      <h:dataTable
            id="topicSelections"
            rows="#{ValueListBean.topicSelectionsRowsPerPage}"
            value="#{ValueListBean.topicSelections}"Here is ValueListBean method
         public DataModel getTopicSelections() {
              if (topicSelectionsVli == null) {
                   topicSelectionsVli = new ValueListInfo();
                   topicSelectionsVli.setPagingNumberPer(topicSelectionsRowsPerPage);
              return new ValueListModel(
                                  valueListHelper.getValueListHandler().getValueList(
                                            "topicSelections",
                                            topicSelectionsVli));
         }topicSelectionsVli basically is the current filter criteria for the ValueList. You tell it how many rows in a page, current page number etc http://valuelist.sourceforge.net/apidocs/net/mlw/vlh/ValueListInfo.html and it gets a valuelist for the currently displayed page.
    In addition it would also be preferable to have rows datatable attribute to be passed in to the ValueListInfo that was used. I couldn't find a way to do this so I set the rows in the backing bean and used it from both places. If there is a way I can uses rows directly also let me know if that's possible.

    I have coded something that works the problem now is that there are 2 trips being made to db because in each request the model needs to be assigned to the datatable component and I can't see a way to tell model the current parameters so I can initialize with those parameters instead. Is there a way to do this short of making backing bean a session bean? Also I couldn't tell a way to cause wrap procedure to run after all the IoC injections have occured. Here is the code.
           <managed-bean>
           <managed-bean-name>TopicSelections</managed-bean-name>
           <managed-bean-class>com.bcbsma.jsf.model.ValueListModel</managed-bean-class>
           <managed-bean-scope>request</managed-bean-scope>
           <managed-property>
            <property-name>valueListHelper</property-name>
            <value>#{valueListHelper}</value>
            </managed-property>
           <managed-property>
            <property-name>valueListTableName</property-name>
            <value>topicSelections</value>
           </managed-property>
           <managed-property>
            <property-name>pagingNumberPer</property-name>
            <value>1</value>
           </managed-property> 
         </managed-bean> And here is backing bean
    package com.bcbsma.jsf.model;
    import java.util.Iterator;
    import javax.faces.FacesException;
    import javax.faces.model.DataModel;
    import javax.faces.model.DataModelEvent;
    import javax.faces.model.DataModelListener;
    import net.mlw.vlh.ValueList;
    import net.mlw.vlh.ValueListInfo;
    import net.mlw.vlh.web.mvc.ValueListHandlerHelper;
    * @author jztb88
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class ValueListModel extends DataModel {
         private ValueListHandlerHelper valueListHelper;
         private String valueListTableName;
         private ValueListInfo valueListInfo;
         private Iterator valueListIter;
         public void setValueListHelper(
                   ValueListHandlerHelper valueListHelper) {
              this.valueListHelper = valueListHelper;
          * @param valueListTableName The valueListTableName to set.
         public void setValueListTableName(String valueListTableName) {          
              this.valueListTableName = valueListTableName;     
          * @param pagingNumberPer The pagingNumberPer to set.
         public void setPagingNumberPer(int pagingNumberPer) {
              if (valueListInfo == null) {
                   valueListInfo = new ValueListInfo();               
              valueListInfo.setPagingNumberPer(pagingNumberPer);
            setWrappedData(valueListHelper.getValueList(valueListTableName,valueListInfo));
          * @return Returns the pagingNumberPer.
         public int getPagingNumberPer() {
              return valueListInfo.getPagingNumberPer();
         * <p>Construct a new {@link ValueListModel} with no specified
         * wrapped data.</p>
         public ValueListModel() {
              super();
        // ------------------------------------------------------ Instance Variables
        // The current row index (zero relative)
        private int index = -1;
        // The list we are wrapping
        private ValueList valueList;
         * <p>Return <code>true</code> if there is <code>wrappedData</code>
         * available, and the current value of <code>rowIndex</code> is greater
         * than or equal to zero, and less than the size of the list.  Otherwise,
         * return <code>false</code>.</p>
         * @exception FacesException if an error occurs getting the row availability
         public boolean isRowAvailable() {
            if (valueList == null) {
                 return (false);
            } else if ((index >= 0) && (index < getRowCount())) {
                return (true);
            } else {
                return (false);
         * <p>If there is <code>wrappedData</code> available, return the
         * length of the list.  If no <code>wrappedData</code> is available,
         * return -1.</p>
         * @exception FacesException if an error occurs getting the row count
         public int getRowCount() {
            if (valueList == null) {
                 return (-1);
            return (valueList.getValueListInfo().getTotalNumberOfEntries());
         * <p>If row data is available, return the array element at the index
         * specified by <code>rowIndex</code>.  If no wrapped data is available,
         * return <code>null</code>.</p>
         * @exception FacesException if an error occurs getting the row data
         * @exception IllegalArgumentException if now row data is available
         *  at the currently specified row index
         public Object getRowData() {
            if (valueList == null) {
                 return (null);
            } else if (!isRowAvailable()) {
                throw new IllegalArgumentException();
            } else {
                return (valueList.getList().get(index % valueListInfo.getPagingNumberPer()));
         * @exception FacesException {@inheritDoc}    
         public int getRowIndex() {
            return (index);
         * @exception FacesException {@inheritDoc}
         * @exception IllegalArgumentException {@inheritDoc}
         public void setRowIndex(int rowIndex) {
              if (rowIndex < -1) {
                   throw new IllegalArgumentException();
              int old = index;
              index = rowIndex;
              if (valueList == null) {
                   return;
              DataModelListener[] listeners = getDataModelListeners();
              if ((old != index) && (listeners != null)) {
                   Object rowData = null;
                   if (isRowAvailable()) {
                        int oldPage = valueListInfo.getPagingPage();
                        valueListInfo.setPagingPageFromRowNumber(index);
                        int newPage = valueListInfo.getPagingPage();
                        if (oldPage != newPage) {
                           valueList = valueListHelper.getValueList(valueListTableName,valueListInfo);
                        valueListInfo.setFocusedRowNumberInTable(index);
                        rowData = getRowData();
                   DataModelEvent event = new DataModelEvent(this, index, rowData);
                   int n = listeners.length;
                   for (int i = 0; i < n; i++) {
                        if (null != listeners) {
                             listeners[i].rowSelected(event);
         * (non-Javadoc)
         * @see javax.faces.model.DataModel#getWrappedData()
         public Object getWrappedData() {
    return (this.valueList);
    * @exception ClassCastException if <code>data</code> is
    * non-<code>null</code> and is not a <code>List</code>
         public void setWrappedData(Object data) {
    if (data == null) {
    valueList = null;
    setRowIndex(-1);
    } else {
    valueList = (ValueList) data;
    index = -1;
    //setRowIndex(0);
    Here is the jsp stuff
      <h:dataTable
            style="width:250"
            styleClass="disp"
            id="topicSelections"
             rows="#{TopicSelections.pagingNumberPer}"
            value="#{TopicSelections}"
            var="contactUsTopic"
      >

  • HELP need OEM driver

    RE: DRIVER for Audigy Gateway OEM Model# SB0095 Manuf. 1/9/03
    Creative doesn't archive OEM drivers and Gateway is no longer.
    Would anyone have the sound card driver for Gateway 500x series, specifically Model # MFATXPNT Manufacturer Part Number: YKT500XP04 ?
    Better yet, help all by posting whereabouts of any OEM drivers. Sure with Creative supported their (OEM) product.
    Thanks

    No Thanks, being back from the dead zone.
    Don't trust the above. Don't trust the driver supplier linked up with creative. INFECTION most likely from those.
    If it helps someone, MY EXPERIENCE (the long form):
    Poor & resurrecting an old computer without original discs, a few remaining drivers were needed for a Gateway which is no longer. Should have been satisfied without sound or should have maybe spent the $30 for replacement knock-off original CDs. WARNING: Do NOT use any offers of Free because they get paid by advertisers who reap from infected computers, or else they sell the clean-up under a different company. Anyhow, infected by the poison that opens new tabs in any browser, tabs with advertising and/or fronts for even more infections. Plus pop-up ads were appearing everywhere in massive amounts. It was also running the CPU at a build-up to full capacity, eventually allowing just a few actions before clogged. The infection was being controlled through the browsers based on when they were shut-down, CPU usage went to near 0. Also, unplugging the connection to the network, eventually slowed the actions, at least at first. I think the infection was building self-support capabilities. I do believe it was even conducting some partial re-starts because occasionally icons would leave & return. The infection needed more than a browser opening, but a selection or two. There was also some re-directs happening initially or it could have been all new openings, not sure. The ultimate source of the infection is unknown and the possibility list includes: ______________ . Let’s just say any January 2015 offers for free downloads, drivers, or fixes for sound hardwares and keywords audigy 0035 kX 10k2 Audio Realtec AC/’97 Audio Creative Labs driver detective drivermax PCIe GBE FE Audio Codec SBAX_ _0011 _0017 kX Project and did I mention Driver Detective thread.php?t=706277 etc. Multimedia Sound Controller on a Gateway 500X series.
    SOLUTION: Dumped everything downloaded, uninstalled nearly every program but old, sure, & basic stuff. In program files, trashed everything left behind- mostly empty folders. Had no add-ons or such in the browsers to delete. Uninstalled and re-installed browsers several times. Took notes of any hints, especially the tab names as they opened by themselves. Uninstalled the sound hardwares that were using the drivers that brought the infection, and also some sound software I believe they required. Did come across one which for some reason I thought was an .exe but not labeled as such, but didn’t realize until reading later that that was significant, wishing I had its name noted now. DIDN’T WORK, but good basis anyway.
    Time to use SYSTEM RECOVERY to set things back 2 weeks. It worked!! At least for a day now. Repeated uninstall/ re-install of browsers & cleaned up the mess of files taken out of folders, etc. (seemed to put all files created in last two weeks onto the desktop). I should have backed those up separately when they were all grouped, before I impatiently re-filed them.
    Basically running XP SP3 with all but the last few updates which wreak havoc promoting re-purchasing new windows. Can’t afford any protection software nor could afford any cleaning software. Haven’t had any problems, but I keep to the basic needs and am grateful for those. Greed got me- the greed for sound and having more. The culprit is always greed for personal gain, not unlike those who created or allowed me to have the infection. Karma will get all of us, more than tou know. Evidence is right here as I am back up & running while others are getting what they deserve, if not now, they will and you’ll be oh so sorry. Good thing is, its not too late to save yourselves.

  • Macbook Pro story... Win to Mac user Help needed!!

    I have been a windows user for many a year now, always satisfied with the OS but never pleased. Too many things go wrong with windows and I hate all the system registry bull. That and the dreaded viruses and popups.
    I have spent a couple of years now looking across the water at you mac users, since my brother purchased his mac mini I have been droolling over the design and look of the macs. When Apple released the Intel based machines I pricked my ears up hoping that Vista would support EFI so I could dual boot. This was dashed when it was anounced that Vista would stick with BIOS.
    I was back to square one then. You see I wanted the design of mac and the stability of OSX with the backup of windows. Being a school teacher I need windows to sync with the interactive whiteboards and other kids based programs.
    My prayers were finally answered when apple released Boot Camp. It was beyond my dreams that apple would take such a bold step and open up there computers to the likes of me.
    So after hours of pondering and reading through the posts on this forum I finally took the plunge, rushed down to my apple store in Brum and with the educational discount walked away with a Macbook for £1636.68. I was pleased and poohing myself at the same time having spent that kind of money (being a student teacher means money is tight!).
    So I got the thing home and was amazed at its design and looks, it truely is a fantastic looking machine. Turning it on for the first time I was very apprehensive, all the posts about whine and heat had made me very nervous. After going through the setup and taking half an hour to get my WIFI working I finally started to play with it.
    The whine was there and the heat, two things that I had been dreading, the heat did not bother me one bit. It was hot, very hot in places, but how often do you touch the bar across the top of the keyboard? I think this is a good place to allow the heat to disipate, I have worked on laptops where your blood starts to boil beacause the area where your plams rest is so hot. The whine did annoy me, it seems so strange that my computer made more noise when is was not doing anything compared to when it was. The photobooth fix worked perfectly which I figured i could live with until a proper fix is released. Plus I have read that windows does not have this problem so it must be software related.
    As I was going skiing for a week i figured it would be ideal for me to take my computer to get to grips with OSX. Thats what I did and can I tell you that I was more than impressed, I really did not understand the comment people (including my bro) mad,e, 'it just works'. Until I spent a day using it, programs open up seamlessly and you can have several high powered programs running at the same time with no lag at all, fascinating.
    I came back from holiday (last saturday) loving my new machine and ready to install boot camp plus start transferring my old files. Then, and this is where it gets interesting, I read a couple of posts about apple's Higher Education site and the amazing discounts it gives.
    I can tell you that right now I am pretty ****** off, before i bought my mac I intentionally asked the guys in store if there was any way I could get a macbook for cheaper, online or anywhere. I was told that the maximum discount i could get was 8% off the comp and 17.5% off applecare. Now I discover that if i had purchased through my uni, I could have got 15% off my Macbook and applecare for only £60! Can you see why I'm a touch upset?
    Any ideas on what I can do? I have had the computer for less than 14 days, I love it to bits and don't really want to take it back, plus if I do will I be charged a restocking fee? It seems it would still be cheaper to do this but what do you guys think? thanks for your help.
    The reason for the long post is i wanted to get across how pleased I am with my macbook pro and OSX, if anyone has any doubts to buying one don't they are fantastic and OSX is a breath of fresh air, just remember the Higher Education store online if you are a student!

    Another update guys.
    Went into the apple store in Birmingham, UK, which is where I bought it. I explained the situation calmly and they were very sorry for the misunderstanding. They instantly said that they could not match the offer that found on the higher education store.
    The option I had was to keep the machine or they would give me a full refund, even though I had had it for over a week and it had a scratch on the case! Was a little shocked that I was not charged a restocking fee! Anyway, now I have no mac at all and it will take a couple of days for the money to go back on my card. I was very sad to see it go, I had really grown attached to it and am now stuck on windows again!
    Can I just say what fantastic service apple provide, I love the idea of simply taking your computer into the store to get a fix rather than Dell which is online only.
    Now I have a problem, I like the new 17" but think it will be too big to lug from home to school, I would like the dual layered superdrive though. Do I wait for the macbook pro update? Will they come down in price as the 17" is cheaper than a matching 15"?
    Help!

  • Urgent help needed in jtable

    PLEASE could someone help me look at this and see why the color of my data in a jtable cell is niot turning red when I press enter
    THX
    package mintest;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.table.*;
    import com.borland.jbcl.layout.*;
    import java.awt.color.*;
    import javax.swing.event.*;
    import java.awt.Image;
    import javax.swing.ImageIcon;
    import javax.swing.AbstractButton;
    import javax.swing.JButton;
    import java.awt.datatransfer.*;
    import javax.swing.BorderFactory;
    import javax.swing.border.Border;
    import javax.swing.border.TitledBorder;
    import javax.swing.border.EtchedBorder;
    import java.io.*;
    import java.awt.print.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import javax.swing.BorderFactory;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.border.Border;
    import javax.swing.table.TableCellRenderer;
    import java.awt.Color;
    import java.awt.Component;
    import javax.swing.table.DefaultTableCellRenderer;
    public class VeckoSchema extends JPanel
    private boolean DEBUG = false;
    JTabbedPane tabbedPane;
    Color rgdcolor2= new Color (0,153,255); //Definiera f?rgen f?r schema-,projekt- och l?nehuvudflikarna
    Color rgdcolor1= new Color (0,102,255);
    Color rgdcolor3= new Color (51,204,255); //Definiera f?rgen f?r schema-,projekt- och l?nehuvudflikarna
    Color rgdcolor= new Color (0,0,153);
    Color rgdcolor4= new Color (153,153,153);
    JList list;
    DefaultListModel listModel = new DefaultListModel();
    ImageIcon icon= new ImageIcon ("D:\\Dokument\\Skolarbete\\Examens projekt\\JAVA\\minTest\\Bakgrundsbild2.jpg");
    ImageIcon icon1= new ImageIcon ("D:\\Dokument\\Skolarbete\\Examens projekt\\JAVA\\minTest\\Save16.gif");
    ImageIcon icon2= new ImageIcon ("D:\\Dokument\\Skolarbete\\Examens projekt\\JAVA\\minTest\\printer2.gif");
    JButton spara;
    JButton Ok_knapp = new JButton();
    JPanel panel7;
    TitledBorder title;
    Border blackline;
    JTable table = new JTable(new MyTableModel());
    int x;int y;
    Object data1;
    //ColorRenderer renderer;
    Color mincellColor= Color.red;
    TableCellRenderer Renderer;
    public VeckoSchema() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception
    this.setBackground(rgdcolor2);
    this.setLayout(null);
    //Skapa tabellen
    //JTable table = new JTable(new MyTableModel());
    table.setPreferredScrollableViewportSize(new Dimension(500, 70));
    JScrollPane scrollPane = new JScrollPane(table);
    scrollPane.setBounds(30, 40, 1000, 600);//(avst?nd fr?n v?nster sidan 49, avst?nd fr?n norr 39, bredd 144, h?jd 38));
    this.add(scrollPane);
    //TableCellRenderer weirdRenderer = new WeirdRenderer();
    table.setCellSelectionEnabled(true);
    table.requestFocus(true);
    table.getInputMap().put(KeyStroke.getKeyStroke(
    KeyEvent.VK_ENTER, 0),
    "check");
    table.getActionMap().put("check", new AbstractAction() {
    public void actionPerformed(ActionEvent e) {
    try {
    System.out.println("BINGO");
    x= table.getSelectedColumn() ;
    y= table.getSelectedRow() ;
    //System.out.println("markerad kolumn ?r" + table.getSelectedColumn()) ;
    //System.out.println("markerad Rad ?r" + table.getSelectedRow()) ;
    // table.setColumnSelectionAllowed(true);
    data1 = table.getModel().getValueAt(
    table.getSelectedRow(),
    table.getColumnModel().getColumn(
    table.getSelectedColumn()).getModelIndex());
    System.out.println("markerad text inneh?ller" + data1);
    x= table.getSelectedColumn() ;
    y= table.getSelectedRow() ;
    /* table.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() {
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus, int row, int column)
    System.out.println("hejsan hoppsan markerad text inneh?ller" + data1);
    Component cell =super.getTableCellRendererComponent(table, value, isSelected,hasFocus, row, column);
    if (row == y && column == x ) {
    System.out.println("rad"+y);
    System.out.println("column"+x);*/
    //cell.setFont(new java.awt.Font("Dialog", 0, 20));
    /* cell.setForeground(Color.red);
    else
    cell.setForeground(null);
    return cell;
    // ColorRenderer centerRenderer = new ColorRenderer();
    // Use renderer on a specific column
    /* TableColumn column = table.getColumnModel().getColumn(
    table.getColumnModel().getColumn(
    table.getSelectedColumn()).getModelIndex()
    column.setCellRenderer( centerRenderer );
    table.setDefaultRenderer(String.class, centerRenderer);*/
    class table extends JTable {
    ColorRenderer multiRenderer=new ColorRenderer();
    table(MyTableModel tm)
    super(tm);
    public TableCellRenderer getCellRenderer(int row,int col) {
    if (row == y && col == x) return multiRenderer;
    else return super.getCellRenderer(row,col);
    catch(Exception x) {
    x.printStackTrace();
    class MyTableModel extends AbstractTableModel {
    String[] columnNames = {"",
    "M?NDAG",
    "TISDAG",
    "ONSDAG",
    "TORSDAG",
    "FREDAG",
    "L?RDAG",
    "S?NDAG"};
    Object[][] data = {
    {"Anna Svensson","", "","Eji Eze", "","","",""},
    {"","", "","", "Christopher ?kesson","Eji Eze","",""},
    {"","", "","", "","Sara Eggert","",""},
    {"Eji Eze","", "","", "","","",""},
    {"Stefan Wielsel","", "","", "","","",""},
    {"","", "","", "","","Anna Persson","Markus Nilsson"},
    {"","Markus Nilsson", "Malin Mejby","", "","","",""},
    {"","Stefan Wiesel", "","", "","","",""},
    {"","Anna Svensson", "","", "","","",""},
    public int getColumnCount() {
    return columnNames.length;
    public int getRowCount() {
    return data.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int row, int col) {
    return data[row][col];
    /* Denna metod g?r det m?jligt att ?ndrar i tabellen*/
    public boolean isCellEditable(int row, int col) {
    if (col < 8) {
    return false;
    } else {
    return true;
    /*Denna metod g?r s? ?ndringarna som g?rs i en viss cell inte f?rsvinnar d? man l?mnar cellen*/
    Object[][] value = {              {"Chiji Eze"},
    int row= 3;
    int col = 4;
    public void setValueAt(Object value, int row, int col) {
    /* if (DEBUG) {
    System.out.println("Setting value at " + row + "," + col
    + " to " + value
    + " (an instance of "
    + value.getClass() + ")");
    data[row][col] = value;
    fireTableCellUpdated(row, col);
    /* if (DEBUG) {
    System.out.println("New value of data:");
    printDebugData();
    /* private void printDebugData() {
    int numRows = getRowCount();
    int numCols = getColumnCount();
    for (int i=0; i < numRows; i++) {
    System.out.print(" row " + i + ":");
    for (int j=0; j < numCols; j++) {
    System.out.print(" " + data[i][j]);
    System.out.println();
    System.out.println("--------------------------");*/
    /*class MyCellColor extends DefaultTableCellRenderer
    public MyCellColor()
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus, int row, int column)
    JLabel result = null;
    if(isSelected && value != null)
    result = new JLabel(value.toString());
    result.setOpaque(true);
    result.setForeground(Color.blue);
    System.out.println("Result "+result.getText());
    System.out.println("Color is "+result.getForeground());
    return result;
    /* public TableCellRenderer getCellRenderer (int row, int column)
    //seulement pour la premiere colonne
    if (column == 0)
    return Renderer;
    // sinon le Renderer par d?faut
    return super.getCellRenderer (row, column);
    class ColorRenderer extends JTextArea implements TableCellRenderer{ //DefaultTableCellRenderer
    Color testfarg;
    public ColorRenderer( ){
    testfarg= Color.red;
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
    System.out.println("hejsan hoppsan markerad text inneh?ller" + data1);
    //Component cell =super.getTableCellRendererComponent(table, value, isSelected,hasFocus, row, column);
    if(row==y && column == x)
    setForeground(testfarg);
    else
    setBackground(null);
    return this;

    You really need to study this tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    After you have read it, take a look at this example, and tweak it to suit your needs:
    import javax.swing.table.*;
    import javax.swing.*;
    public class Test {
      public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.getContentPane().add(new JScrollPane(new JTable(new MyTableModel())));
        frame.pack();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    class MyTableModel extends AbstractTableModel {
      private String columnNames[] = new String[] {
          "Name", "Checked"
      private Class columnClasses[] = new Class[] {
          String.class, Boolean.class
      private Object data[][] = new Object[][] {
          { "One", Boolean.TRUE },
          { "Two", Boolean.FALSE },
          { "Three", Boolean.FALSE },
          { "Four", Boolean.TRUE },
      public int getColumnCount() {
        return columnNames.length;
      public int getRowCount() {
        return data.length;
      public Object getValueAt(int rowIndex, int columnIndex) {
        return data[rowIndex][columnIndex];
      public Class getColumnClass(int columnIndex) {
        return columnClasses[columnIndex];
      public String getColumnName(int columnIndex) {
        return columnNames[columnIndex];
      public boolean isCellEditable(int rowIndex, int columnIndex) {
        if (columnIndex == 1)
          return true;
        else
          return false;
      public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
        data[rowIndex][columnIndex] = aValue;
    }

  • Help needed in solving a problem, thanks. Code Attached..

    Hello All
    I am facing a problem working with Berkely DB 4.5.20. I am trying to search in the database whether the key is already present or not. It is working fine with Microsoft Visual Studio but when i use the same code with Code::Blocks editor and MinGW compiler. It is not workig fine.
    The code for searching the key is*****
    bool CDbProject::IsKeyIndexAvailable(ProjectKey ProKey, UINT DataIndex)
    int ret=0;
    Dbc *cursorp;
    bool flag=false;
    cursor(NULL, &cursorp, 0);
    //set the key
    Dbt key(&ProKey, sizeof(ProKey));
    Dbt data;
    //search the database for the key.
    ret = cursorp->get(&key, &data, DB_SET);
    //ret = cursorp->get(&key, &data, DB_NEXT); //Rohit
    if (!ret)
    { //if found check if the index is same
    do
    ProjectDataDetail *myProjDetails;
    myProjDetails = (ProjectDataDetail*)data.get_data();
    if (myProjDetails->uIndex==DataIndex)
    flag = true;
    break;
    } while (cursorp->get(&key, &data, DB_NEXT_DUP) == 0); //Loop all the duplicate
    if (cursorp != NULL)
    cursorp->close();
    return flag;
    And the function to save the data in the database is *******
    int CDbHandler::Put(void* pKey, size_t nKeyLen, void* pData, size_t nDataLen)
         int ret = 0;
         Dbt key(pKey, nKeyLen);
         Dbt data(pData, nDataLen);
    ret = put(NULL, &key, &data, DB_NODUPDATA);
    if (ret==-30996)
    ret = ERR_PROJECT_KEY_DATA_ALREADY_EXISTS;
    return ret;
    Please help...
    Thanks in advance,,,
    Message was edited by:
    user610238

    Thanks for the reply Sandra
    I try to tell what is happening in the search key function, If still not possible, then i will try to create a stand alone application...
    bool CDbProject::IsKeyIndexAvailable(ProjectKey ProKey, UINT DataIndex)
    int ret=0;
    Dbc *cursorp;
    bool flag=false;
    cursor(NULL, &cursorp, 0);
    //set the key
    Dbt key(&ProKey, sizeof(ProKey));
    Dbt data;
    //search the database for the key.
    // SANDRA......If i use DB_SET,as you can see below. It is not able to find the key at all. BUt if i use DB_NEXT, then it is able to find the first key only everytime with the data also (Even if i am looking for some other key, it will find the first key saved always..)
    ret = cursorp->get(&key, &data, DB_SET);
    //ret = cursorp->get(&key, &data, DB_NEXT); //Rohit
    if (!ret)
    { //if found check if the index is same
    do
    ProjectDataDetail *myProjDetails;
    myProjDetails = (ProjectDataDetail*)data.get_data();
    if (myProjDetails->uIndex==DataIndex)
    flag = true;
    break;
    } while (cursorp->get(&key, &data, DB_NEXT_DUP) == 0); //Loop all the duplicate
    if (cursorp != NULL)
    cursorp->close();
    return flag;
    }

  • Grus help needed in finding the queries with Cartesian  joins

    Hi
    I have a reporting tool in which users are allowed to put the joins on the views and add some sub queries that produces a Cartesian product. Is there any tool or way that I can stop the execution of those query before it is being executed for example
    Step 1 ) user creates a query
    step2 ) user submits it
    step 3) by any tool or any check if Cartesian join is found the query execution is stopped and notify the user that the query is not good if no problem executes the query.
    I really need help in step 3. I am on 9i release2.
    Any help or suggestions will be highly appreciated.

    I Agree with Gasparotto, you should limit the resource consume.
    You must understand that cartesian join, isn´t always a BAD guy, sometimes you need it.
    If your developers are in trouble with handle the join , think about NATURAL JOIN, may be it helps you
    Regards
    Helio Dias

  • Urgent help needed in Checkbox in JTable

    I am trying to put a checkbox in the JTable. The value from the database is a string . The column name is checked. I want if hte value in the database is "yes" the column should be checked and if it is "no" it should not be checked or vice versa( if i check it, in database it should update the value as yes).
    I have the following code, it does not work. I try to click and it does not get clicked, Do you have anys suggestions P;ease help.
    if (checked == null)
    TableColumn column = table.getColumn("Checked");
    checked = new JCheckBox();
    // column.setCellRenderer(new CheckedBox());
    column.setCellEditor(new DefaultCellEditor(checked));
    checked.addItemListener(new ItemListener() {
    public void itemStateChanged(ItemEvent event)
    isChecked = checked.isSelected();
    class CheckedBox extends JCheckBox implements TableCellRenderer
    public CheckedBox()
    setHorizontalAlignment(JRadioButton.CENTER);
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus, int row, int column)
    setEnabled(((Boolean)value).booleanValue());
    return this;

    You really need to study this tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    After you have read it, take a look at this example, and tweak it to suit your needs:
    import javax.swing.table.*;
    import javax.swing.*;
    public class Test {
      public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.getContentPane().add(new JScrollPane(new JTable(new MyTableModel())));
        frame.pack();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    class MyTableModel extends AbstractTableModel {
      private String columnNames[] = new String[] {
          "Name", "Checked"
      private Class columnClasses[] = new Class[] {
          String.class, Boolean.class
      private Object data[][] = new Object[][] {
          { "One", Boolean.TRUE },
          { "Two", Boolean.FALSE },
          { "Three", Boolean.FALSE },
          { "Four", Boolean.TRUE },
      public int getColumnCount() {
        return columnNames.length;
      public int getRowCount() {
        return data.length;
      public Object getValueAt(int rowIndex, int columnIndex) {
        return data[rowIndex][columnIndex];
      public Class getColumnClass(int columnIndex) {
        return columnClasses[columnIndex];
      public String getColumnName(int columnIndex) {
        return columnNames[columnIndex];
      public boolean isCellEditable(int rowIndex, int columnIndex) {
        if (columnIndex == 1)
          return true;
        else
          return false;
      public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
        data[rowIndex][columnIndex] = aValue;
    }

  • Help needed:Printing HTML file using javax.print

    Hi
    I am using the following code which i got form the forum for rpinting an HTML file.
    The folllowing code is working fine, but the problem is the content of HTML file is not getting printed. I am geeting a blank page with no content. What is the change that is required in the code? ALso is there any simpler way to implement this. Help needed ASAP.
    public boolean printHTMLFile(String filename) {
              try {
                   JEditorPane editorPane = new JEditorPane();
                   editorPane.setEditorKit(new HTMLEditorKit());
                   //editorPane.setContentType("text/html");
                   editorPane.setSize(500,500);
                   String text = getFileContents(filename);
                   if (text != null) {
                        editorPane.setText(text);                    
                   } else {
                        return false;
                   printEditorPane(editorPane);
                   return true;
              } catch (Exception tce) {
                   tce.printStackTrace();
              return false;
         public String getFileContents(String filename) {
              try {
                   File file = new File(filename);
                   BufferedReader br = new BufferedReader(new FileReader(file));
                   String line;
                   StringBuffer sb = new StringBuffer();
                   while ((line = br.readLine()) != null) {
                        sb.append(line);
                   br.close();
                   return sb.toString();
              } catch (Exception tce) {
                   tce.printStackTrace();
              return null;
         public void printEditorPane(JEditorPane editorPane) {
                   try {
                        HTMLPrinter htmlPrinter = new HTMLPrinter();
                        htmlPrinter.printJEditorPane(editorPane, htmlPrinter.showPrintDialog());
                   } catch (Exception tce) {
                        tce.printStackTrace();
         * Sets up to easily print HTML documents. It is not necessary to call any of the setter
         * methods as they all have default values, they are provided should you wish to change
         * any of the default values.
         public class HTMLPrinter {
         public int DEFAULT_DPI = 72;
         public float DEFAULT_PAGE_WIDTH_INCH = 8.5f;
         public float DEFAULT_PAGE_HEIGHT_INCH = 11f;
         int x = 100;
         int y = 80;
         GraphicsConfiguration gc;
         PrintService[] services;
         PrintService defaultService;
         DocFlavor flavor;
         PrintRequestAttributeSet attributes;
         Vector pjlListeners = new Vector();
         Vector pjalListeners = new Vector();
         Vector psalListeners = new Vector();
         public HTMLPrinter() {
              gc = null;
              attributes = new HashPrintRequestAttributeSet();
              flavor = null;
              defaultService = PrintServiceLookup.lookupDefaultPrintService();
              services = PrintServiceLookup.lookupPrintServices(flavor, attributes);
              // do something with the supported docflavors
              DocFlavor[] df = defaultService.getSupportedDocFlavors();
              for (int i = 0; i < df.length; i++)
              System.out.println(df.getMimeType() + " " + df[i].getRepresentationClassName());
              // if there is a default service, but no other services
              if (defaultService != null && (services == null || services.length == 0)) {
              services = new PrintService[1];
              services[0] = defaultService;
         * Set the GraphicsConfiguration to display the print dialog on.
         * @param gc a GraphicsConfiguration object
         public void setGraphicsConfiguration(GraphicsConfiguration gc) {
              this.gc = gc;
         public void setServices(PrintService[] services) {
              this.services = services;
         public void setDefaultService(PrintService service) {
              this.defaultService = service;
         public void setDocFlavor(DocFlavor flavor) {
              this.flavor = flavor;
         public void setPrintRequestAttributes(PrintRequestAttributeSet attributes) {
              this.attributes = attributes;
         public void setPrintDialogLocation(int x, int y) {
              this.x = x;
              this.y = y;
         public void addPrintJobListener(PrintJobListener pjl) {
              pjlListeners.addElement(pjl);
         public void removePrintJobListener(PrintJobListener pjl) {
              pjlListeners.removeElement(pjl);
         public void addPrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.addElement(psal);
         public void removePrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.removeElement(psal);
         public boolean printJEditorPane(JEditorPane jep, PrintService ps) {
                   if (ps == null || jep == null) {
                        System.out.println("printJEditorPane: jep or ps is NULL, aborting...");
                        return false;
                   // get the root view of the preview pane
                   View rv = jep.getUI().getRootView(jep);
                   // get the size of the view (hopefully the total size of the page to be printed
                   int x = (int) rv.getPreferredSpan(View.X_AXIS);
                   int y = (int) rv.getPreferredSpan(View.Y_AXIS);
                   // find out if the print has been set to colour mode
                   DocPrintJob dpj = ps.createPrintJob();
                   PrintJobAttributeSet pjas = dpj.getAttributes();
                   // get the DPI and printable area of the page. use default values if not available
                   // use this to get the maximum number of pixels on the vertical axis
                   PrinterResolution pr = (PrinterResolution) pjas.get(PrinterResolution.class);
                   int dpi;
                   float pageX, pageY;
                   if (pr != null)
                        dpi = pr.getFeedResolution(PrinterResolution.DPI);
                   else
                        dpi = DEFAULT_DPI;
                   MediaPrintableArea mpa = (MediaPrintableArea) pjas.get(MediaPrintableArea.class);
                   if (mpa != null) {
                        pageX = mpa.getX(MediaPrintableArea.INCH);
                        pageY = mpa.getX(MediaPrintableArea.INCH);
                   } else {
                        pageX = DEFAULT_PAGE_WIDTH_INCH;
                        pageY = DEFAULT_PAGE_HEIGHT_INCH;
                   int pixelsPerPageY = (int) (dpi * pageY);
                   int pixelsPerPageX = (int) (dpi * pageX);
                   int minY = Math.max(pixelsPerPageY, y);
                   // make colour true if the user has selected colour, and the PrintService can support colour
                   boolean colour = pjas.containsValue(Chromaticity.COLOR);
                   colour = colour & (ps.getAttribute(ColorSupported.class) == ColorSupported.SUPPORTED);
                   // create a BufferedImage to draw on
                   int imgMode;
                   if (colour)
                        imgMode = BufferedImage.TYPE_3BYTE_BGR;
                   else
                        imgMode = BufferedImage.TYPE_BYTE_GRAY;
                   BufferedImage img = new BufferedImage(pixelsPerPageX, minY, imgMode);
                   Graphics myGraphics = img.getGraphics();
                   myGraphics.setClip(0, 0, pixelsPerPageX, minY);
                   myGraphics.setColor(Color.WHITE);
                   myGraphics.fillRect(0, 0, pixelsPerPageX, minY);
                        java.awt.Rectangle rectangle=new java.awt.Rectangle(0,0,pixelsPerPageX, minY);
                   // call rootView.paint( myGraphics, rect ) to paint the whole image on myGraphics
                   rv.paint(myGraphics, rectangle);
                   try {
                        // write the image as a JPEG to the ByteArray so it can be printed
                        Iterator writers = ImageIO.getImageWritersByFormatName("jpeg");
                        ImageWriter writer = (ImageWriter) writers.next();
                                       // mod: Added the iwparam to create the highest quality image possible
                        ImageWriteParam iwparam = writer.getDefaultWriteParam();
                        iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT) ;
                        iwparam.setCompressionQuality(1.0f); // highest quality
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        ImageOutputStream ios = ImageIO.createImageOutputStream(out);
                        writer.setOutput(ios);
                        // get the number of pages we need to print this image
                        int imageHeight = img.getHeight();
                        int numberOfPages = (int) Math.ceil(minY / (double) pixelsPerPageY);
                        // print each page
                        for (int i = 0; i < numberOfPages; i++) {
                             int startY = i * pixelsPerPageY;
                             // get a subimage which is exactly the size of one page
                             BufferedImage subImg = img.getSubimage(0, startY, pixelsPerPageX, Math.min(y - startY, pixelsPerPageY));
                                                 // mod: different .write() method to use the iwparam parameter with highest quality compression
                             writer.write(null, new IIOImage(subImg, null, null), iwparam);
                             SimpleDoc sd = new SimpleDoc(out.toByteArray(), DocFlavor.BYTE_ARRAY.JPEG, null);
                             printDocument(sd, ps);
                             // reset the ByteArray so we can start the next page
                             out.reset();
                   } catch (PrintException e) {
                        System.out.println("Error printing document.");
                        e.printStackTrace();
                        return false;
                   } catch (IOException e) {
                        System.out.println("Error creating ImageOutputStream or writing to it.");
                        e.printStackTrace();
                        return false;
                   // uncomment this code and comment out the 'try-catch' block above
                   // to print to a JFrame instead of to the printer
                   /*          JFrame jf = new JFrame();
                             PaintableJPanel jp = new PaintableJPanel();
                             jp.setImage( img );
                             JScrollPane jsp = new JScrollPane( jp );
                             jf.getContentPane().add( jsp );
                             Insets i = jf.getInsets();
                             jf.setBounds( 0, 0, newX, y );
                             jf.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
                             jf.setVisible( true );*/
                   return true;
              * Print the document to the specified PrintService.
              * This method cannot tell if the printing was successful. You must register
              * a PrintJobListener
              * @return false if no PrintService is selected in the dialog, true otherwise
              public boolean printDocument(Doc doc, PrintService ps) throws PrintException {
                   if (ps == null)
                   return false;
                   addAllPrintServiceAttributeListeners(ps);
                   DocPrintJob dpj = ps.createPrintJob();
                   addAllPrintJobListeners(dpj);
                   dpj.print(doc, attributes);
                   return true;
              public PrintService showPrintDialog() {
                   return ServiceUI.printDialog(gc, x, y, services, defaultService, flavor, attributes);
              private void addAllPrintServiceAttributeListeners(PrintService ps) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < psalListeners.size(); i++) {
                   PrintServiceAttributeListener p = (PrintServiceAttributeListener) psalListeners.get(i);
                   ps.addPrintServiceAttributeListener(p);
              private void addAllPrintJobListeners(DocPrintJob dpj) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < pjlListeners.size(); i++) {
                   PrintJobListener p = (PrintJobListener) pjlListeners.get(i);
                   dpj.addPrintJobListener(p);
              // uncomment this also to print to a JFrame instead of a printer
              /* protected class PaintableJPanel extends JPanel {
                   Image img;
                   protected PaintableJPanel() {
                        super();
                   public void setImage( Image i ) {
                        img = i;
                   public void paint( Graphics g ) {
                        g.drawImage( img, 0, 0, this );
    Thanks
    Ram

    Ram,
    I have had printing problems too a year and a half ago. I used all printing apis of java and I still find that it is something java lacks. Now basically you can try autosense. To check whether your printer is capable of printing the docflavor use this PrintServiceLookup.lookupPrintServices(flavor, aset); . If it lists the printer then he can print the document otherwise he can't. I guess that is why you get the error.
    Regards,
    Kevin

  • Explain plan cardinallity is way off compared to actual rows being returned

    Database version 11.2.0.3
    We have a small but rapidly growing datawarehouse which has OBIEE as its front end reporting tool. Our DBA has set up a automatic stats gathering method in OEM and we can see that it run and gathers stats on stale objects on a regular basis. So we know the statistics are upto date.
    In checking some slow queries I can see that the cardinality being reported in explain plans is way off compared to what is actually being returned.
    For example the actual number of rows returned are 8000 but the cardinality estimate is > 300,000.
    Now as per an Oracle White paper(The Oracle Optimizer Explain the Explain Plan) having "multiple single column predicates on a single table" can affect cardinality estimates and in case of our query that is true. Here is the "WHERE Clause section" of the query
    SQL> select D1.c1  as c1,
      2         D1.c2  as c2,
      3         D1.c3  as c3,
      4         D1.c4  as c4,
      5         D1.c5  as c5,
      6         D1.c6  as c6,
      7         D1.c7  as c7,
      8         D1.c8  as c8,
      9         D1.c9  as c9,
    10         D1.c10 as c10,
    11         D1.c11 as c11,
    12         D1.c12 as c12,
    13         D1.c13 as c13,
    14         D1.c14 as c14,
    15         D1.c15 as c15,
    16         D1.c16 as c16
    17    from (select D1.c4 as c1,
    18                 D1.c5 as c2,
    19                 D1.c3 as c3,
    20                 D1.c1 as c4,
    21                 D1.c6 as c5,
    22                 D1.c7 as c6,
    23                 D1.c2 as c7,
    24                 D1.c8 as c8,
    25                 D1.c9 as c9,
    26                 D1.c10 as c10,
    27                 D1.c9 as c11,
    28                 D1.c11 as c12,
    29                 D1.c2 as c13,
    30                 D1.c2 as c14,
    31                 D1.c12 as c15,
    32                 'XYZ' as c16,
    33                 ROW_NUMBER() OVER(PARTITION BY D1.c2, D1.c3, D1.c4, D1.c5, D1.c6, D1.c7, D1.c8, D1.c9, D1.c10, D1.c11, D1.c12 ORDER BY D1.c2 ASC, D1.c3 ASC, D1.c4 ASC, D1.c5 ASC, D1.c6 ASC, D1.c
    ASC, D1.c8 ASC, D1.c9 ASC, D1.c10 ASC, D1.c11 ASC, D1.c12 ASC) as c17
    34            from (select distinct D1.c1 as c1,
    35                                  D1.c2 as c2,
    36                                  'CHANNEL1' as c3,
    37                                  D1.c3 as c4,
    38                                  D1.c4 as c5,
    39                                  D1.c5 as c6,
    40                                  D1.c6 as c7,
    41                                  D1.c7 as c8,
    42                                  D1.c8 as c9,
    43                                  D1.c9 as c10,
    44                                  D1.c10 as c11,
    45                                  D1.c11 as c12
    46                    from (select sum(T610543.GLOBAL1_EXCHANGE_RATE * case
    47                                       when T610543.X_ZEB_SYNC_EBS_FLG = 'Y' then
    48                                        T610543.X_ZEB_AIA_U_REVN_AMT
    49                                       else
    50                                        0
    51                                     end) as c1,
    52                                 T536086.X_ZEBRA_TERRITORY as c2,
    53                                 T526821.LEVEL9_NAME as c3,
    54                                 T526821.LEVEL1_NAME as c4,
    55                                 T577698.PER_NAME_FSCL_YEAR as c5,
    56                                 T577698.FSCL_QTR as c6,
    57                                 T31796.X_ZEBRA_TERRITORY as c7,
    58                                 T31796.X_OU_NUM as c8,
    59                                 T664055.TERRITORY as c9,
    60                                 T536086.X_OU_NUM as c10,
    61                                 T526821.LEVEL4_NAME as c11
    62                            from W_INT_ORG_D        T613144 /* Dim_ZEB_W_INT_ORG_D_POS_Client_Attr_Direct */,
    63                                 W_ZEBRA_REGION_D   T664055 /* Dim_ZEB_W_ZEBRA_REGION_D_POS_Client_Direct */,
    64                                 W_DAY_D            T577698 /* Dim_ZEB_W_DAY_D_Order_Invoice_Date */,
    65                                 WC_PRODUCT_HIER_DH T526821 /* Dim_WC_PRODUCT_HIER_DH */,
    66                                 W_PRODUCT_D        T32069 /* Dim_W_PRODUCT_D */,
    67                                 W_ORG_D            T31796,
    68                                 W_ORG_D            T536086 /* Dim_ZEB_W_ORG_D_Reseller */,
    69                                 W_ORDERITEM_TMP_F      T610543 /* Fact_ZEB_W_ORDERITEM_F_Direct */
    70                           where (T610543.PR_OWNER_BU_WID = T613144.ROW_WID and
    71                                 T577698.ROW_WID =
    72                                 T610543.X_ZEB_AIA_TRXN_DT_WID and
    73                                 T32069.ROW_WID = T526821.PROD_WID and
    74                                 T32069.ROW_WID = T610543.ROOT_LN_PROD_WID and
    75                                 T536086.ROW_WID = T610543.ACCNT_WID and
    76                                 T31796.DATASOURCE_NUM_ID =
    77                                 T610543.DATASOURCE_NUM_ID and
    78                                 T31796.INTEGRATION_ID = T610543.VIS_PR_BU_ID and
    79                                 T536086.DELETE_FLG = 'N' and
    80                                 T610543.X_ZEB_DELETE_FLG = 'N' and
    81                                 T613144.X_ZEB_REGION_WID = T664055.ROW_WID and
    82                                 T577698.FSCL_DAY_OF_YEAR < 97 and
    83                                 '2006' < T577698.PER_NAME_FSCL_YEAR and
    84                                 T536086.X_OU_NUM <> '11073' and
    85                                 T536086.X_ZEBRA_TERRITORY !=
    86                                 'XX23' and
    87                                 T536086.X_OU_NUM != '56791647728774' and
    88                                 T536086.X_OU_NUM != '245395890' and
    89                                 T536086.X_ZEBRA_TERRITORY !=
    90                                 'STRATEGIC ACCTS 2' and
    91                                 T526821.LEVEL2_NAME != 'Charges' and
    92                                 T526821.LEVEL9_NAME != 'Unspecified' and
    93                                 T536086.X_ZEBRA_TERRITORY !=
    94                                 'XX1' and T536086.X_ZEBRA_TERRITORY !=
    95                                 'XX2' and T536086.X_ZEBRA_TERRITORY !=
    96                                 'XX3' and T536086.X_ZEBRA_TERRITORY !=
    97                                 'XX4' and
    98                                 (T536086.X_ZEBRA_TERRITORY in
    99                                 ( ... In List of 22 values )) and
    125                                 T32069.X_ZEB_EBS_PRODUCT_TYPE is null)
    126                           group by T31796.X_ZEBRA_TERRITORY,
    127                                    T31796.X_OU_NUM,
    128                                    T526821.LEVEL1_NAME,
    129                                    T526821.LEVEL4_NAME,
    130                                    T526821.LEVEL9_NAME,
    131                                    T536086.X_OU_NUM,
    132                                    T536086.X_ZEBRA_TERRITORY,
    133                                    T577698.FSCL_QTR,
    134                                    T577698.PER_NAME_FSCL_YEAR,
    135                                    T664055.TERRITORY) D1) D1) D1
    136   where (D1.c17 = 1)
    137  /
    Elapsed: 00:00:35.19
    Execution Plan
    Plan hash value: 3285002974
    | Id  | Operation                                         | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT                                  |                    |  2145M|  2123G|       |   612K  (1)| 03:03:47 |       |       |        |      |            |
    |   1 |  PX COORDINATOR                                   |                    |       |       |       |            |          |       |       |        |      |            |
    |   2 |   PX SEND QC (RANDOM)                             | :TQ10012           |  2145M|  2123G|       |   612K  (1)| 03:03:47 |       |       |  Q1,12 | P->S | QC (RAND)  |
    |*  3 |    VIEW                                           |                    |  2145M|  2123G|       |   612K  (1)| 03:03:47 |       |       |  Q1,12 | PCWP |            |
    |*  4 |     WINDOW NOSORT                                 |                    |  2145M|   421G|       |   612K  (1)| 03:03:47 |       |       |  Q1,12 | PCWP |            |
    |   5 |      SORT GROUP BY                                |                    |  2145M|   421G|   448G|   612K  (1)| 03:03:47 |       |       |  Q1,12 | PCWP |            |
    |   6 |       PX RECEIVE                                  |                    |  2145M|   421G|       |  1740  (11)| 00:00:32 |       |       |  Q1,12 | PCWP |            |
    |   7 |        PX SEND HASH                               | :TQ10011           |  2145M|   421G|       |  1740  (11)| 00:00:32 |       |       |  Q1,11 | P->P | HASH       |
    |*  8 |         HASH JOIN BUFFERED                        |                    |  2145M|   421G|       |  1740  (11)| 00:00:32 |       |       |  Q1,11 | PCWP |            |
    |   9 |          PX RECEIVE                               |                    |   268K|  7864K|       |    93   (2)| 00:00:02 |       |       |  Q1,11 | PCWP |            |
    |  10 |           PX SEND HASH                            | :TQ10009           |   268K|  7864K|       |    93   (2)| 00:00:02 |       |       |  Q1,09 | P->P | HASH       |
    |  11 |            PX BLOCK ITERATOR                      |                    |   268K|  7864K|       |    93   (2)| 00:00:02 |       |       |  Q1,09 | PCWC |            |
    |  12 |             TABLE ACCESS FULL                     | W_ORG_D            |   268K|  7864K|       |    93   (2)| 00:00:02 |       |       |  Q1,09 | PCWP |            |
    |  13 |          PX RECEIVE                               |                    |   345K|    59M|       |  1491   (2)| 00:00:27 |       |       |  Q1,11 | PCWP |            |
    |  14 |           PX SEND HASH                            | :TQ10010           |   345K|    59M|       |  1491   (2)| 00:00:27 |       |       |  Q1,10 | P->P | HASH       |
    |* 15 |            HASH JOIN BUFFERED                     |                    |   345K|    59M|       |  1491   (2)| 00:00:27 |       |       |  Q1,10 | PCWP |            |
    |  16 |             PX RECEIVE                            |                    |  1321 | 30383 |       |     2   (0)| 00:00:01 |       |       |  Q1,10 | PCWP |            |
    |  17 |              PX SEND BROADCAST                    | :TQ10006           |  1321 | 30383 |       |     2   (0)| 00:00:01 |       |       |  Q1,06 | P->P | BROADCAST  |
    |  18 |               PX BLOCK ITERATOR                   |                    |  1321 | 30383 |       |     2   (0)| 00:00:01 |       |       |  Q1,06 | PCWC |            |
    |  19 |                TABLE ACCESS FULL                  | W_ZEBRA_REGION_D   |  1321 | 30383 |       |     2   (0)| 00:00:01 |       |       |  Q1,06 | PCWP |            |
    |* 20 |             HASH JOIN                             |                    |   345K|    52M|       |  1488   (2)| 00:00:27 |       |       |  Q1,10 | PCWP |            |
    |  21 |              JOIN FILTER CREATE                   | :BF0000            |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,10 | PCWP |            |
    |  22 |               PX RECEIVE                          |                    |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,10 | PCWP |            |
    |  23 |                PX SEND HASH                       | :TQ10007           |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,07 | P->P | HASH       |
    |  24 |                 PX BLOCK ITERATOR                 |                    |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,07 | PCWC |            |
    |  25 |                  TABLE ACCESS FULL                | W_INT_ORG_D        |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,07 | PCWP |            |
    |  26 |              PX RECEIVE                           |                    |   344K|    47M|       |  1486   (2)| 00:00:27 |       |       |  Q1,10 | PCWP |            |
    |  27 |               PX SEND HASH                        | :TQ10008           |   344K|    47M|       |  1486   (2)| 00:00:27 |       |       |  Q1,08 | P->P | HASH       |
    |  28 |                JOIN FILTER USE                    | :BF0000            |   344K|    47M|       |  1486   (2)| 00:00:27 |       |       |  Q1,08 | PCWP |            |
    |* 29 |                 HASH JOIN BUFFERED                |                    |   344K|    47M|       |  1486   (2)| 00:00:27 |       |       |  Q1,08 | PCWP |            |
    |  30 |                  JOIN FILTER CREATE               | :BF0001            | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,08 | PCWP |            |
    |  31 |                   PX RECEIVE                      |                    | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,08 | PCWP |            |
    |  32 |                    PX SEND HASH                   | :TQ10004           | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,04 | P->P | HASH       |
    |  33 |                     PX BLOCK ITERATOR             |                    | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,04 | PCWC |            |
    |* 34 |                      TABLE ACCESS FULL            | W_ORG_D            | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,04 | PCWP |            |
    |  35 |                  PX RECEIVE                       |                    |   344K|    38M|       |  1392   (2)| 00:00:26 |       |       |  Q1,08 | PCWP |            |
    |  36 |                   PX SEND HASH                    | :TQ10005           |   344K|    38M|       |  1392   (2)| 00:00:26 |       |       |  Q1,05 | P->P | HASH       |
    |  37 |                    JOIN FILTER USE                | :BF0001            |   344K|    38M|       |  1392   (2)| 00:00:26 |       |       |  Q1,05 | PCWP |            |
    |* 38 |                     HASH JOIN BUFFERED            |                    |   344K|    38M|       |  1392   (2)| 00:00:26 |       |       |  Q1,05 | PCWP |            |
    |  39 |                      PX RECEIVE                   |                    | 93791 |  4671K|       |     7   (0)| 00:00:01 |       |       |  Q1,05 | PCWP |            |
    |  40 |                       PX SEND HASH                | :TQ10001           | 93791 |  4671K|       |     7   (0)| 00:00:01 |       |       |  Q1,01 | P->P | HASH       |
    |  41 |                        PX BLOCK ITERATOR          |                    | 93791 |  4671K|       |     7   (0)| 00:00:01 |       |       |  Q1,01 | PCWC |            |
    |* 42 |                         TABLE ACCESS FULL         | WC_PRODUCT_HIER_DH | 93791 |  4671K|       |     7   (0)| 00:00:01 |       |       |  Q1,01 | PCWP |            |
    |* 43 |                      HASH JOIN                    |                    |   894K|    57M|       |  1384   (2)| 00:00:25 |       |       |  Q1,05 | PCWP |            |
    |  44 |                       JOIN FILTER CREATE          | :BF0002            |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,05 | PCWP |            |
    |  45 |                        PX RECEIVE                 |                    |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,05 | PCWP |            |
    |  46 |                         PX SEND HASH              | :TQ10002           |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,02 | P->P | HASH       |
    |  47 |                          PX BLOCK ITERATOR        |                    |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,02 | PCWC |            |
    |* 48 |                           TABLE ACCESS FULL       | W_PRODUCT_D        |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,02 | PCWP |            |
    |  49 |                       PX RECEIVE                  |                    |   894K|    50M|       |  1336   (2)| 00:00:25 |       |       |  Q1,05 | PCWP |            |
    |  50 |                        PX SEND HASH               | :TQ10003           |   894K|    50M|       |  1336   (2)| 00:00:25 |       |       |  Q1,03 | P->P | HASH       |
    |  51 |                         JOIN FILTER USE           | :BF0002            |   894K|    50M|       |  1336   (2)| 00:00:25 |       |       |  Q1,03 | PCWP |            |
    |* 52 |                          HASH JOIN                |                    |   894K|    50M|       |  1336   (2)| 00:00:25 |       |       |  Q1,03 | PCWP |            |
    |  53 |                           PX RECEIVE              |                    |   292 |  3504 |       |   136   (0)| 00:00:03 |       |       |  Q1,03 | PCWP |            |
    |  54 |                            PX SEND BROADCAST LOCAL| :TQ10000           |   292 |  3504 |       |   136   (0)| 00:00:03 |       |       |  Q1,00 | P->P | BCST LOCAL |
    |  55 |                             PX BLOCK ITERATOR     |                    |   292 |  3504 |       |   136   (0)| 00:00:03 |       |       |  Q1,00 | PCWC |            |
    |* 56 |                              TABLE ACCESS FULL    | W_DAY_D            |   292 |  3504 |       |   136   (0)| 00:00:03 |       |       |  Q1,00 | PCWP |            |
    |  57 |                           PX BLOCK ITERATOR       |                    |  4801K|   215M|       |  1199   (2)| 00:00:22 |     1 |    11 |  Q1,03 | PCWC |            |
    |* 58 |                            TABLE ACCESS FULL      | W_ORDERITEM_TMP_F  |  4801K|   215M|       |  1199   (2)| 00:00:22 |     1 |    44 |  Q1,03 | PCWP |            |
    Note
       - dynamic sampling used for this statement (level=5)
    Statistics
            498  recursive calls
           2046  db block gets
        1193630  consistent gets
          74398  physical reads
              0  redo size
         655170  bytes sent via SQL*Net to client
          11761  bytes received via SQL*Net from client
            541  SQL*Net roundtrips to/from client
             64  sorts (memory)
              0  sorts (disk)
           8090  rows processed
    SQL>So my question is if, cardinality estimates are way off, is that an indicator that the explain plans being generated are sub-optimal?
    Can you provide me with some tips or links to blog post or books on how I approach tuning such queries where cardinalities are not good?
    Edited by: qqq on Apr 7, 2013 2:27 PM

    As already asked in your other thread:
    Please see the FAQ for how to post a tuning request and the information that you need to provide.
    Part of that information is:
    1. DDL for the table and indexes
    2. The query being used
    3. row counts for the table and for the predicates used in the query
    4. info about stats. You did update the table and index stats didn't you?
    5. The 'actual' execution plans.
    An explain plan just shows what Oracle 'thinks' it is going to do. The actual plans show what Oracle actually 'did' do. Just because Oracle expected to save doesn't mean the savings were actually achieved.
    When you post the plans use on the line before and on the line after to preserve formatting.
    Your partial code is virtually unusable because of the missing conditions in the predicates. You need to use '!=' for 'not equals' if that's what those missing conditions are.
    Please edit your post to use code tags, add the missing conditions and provide the other information needed for a tuning request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for