Start a new topic

GroupNode Filter

[This topic is migrated from our old forums. The original author name has been removed]

I setup a filter for a GroupNode for DBMS Jobs.  The filter index is job which is in the view all_jobs.  The job column is a number.  When I enter a number like 91 in the filter for example, DbVis produces the following error:

An internal error occurred:

Exception: java.lang.ClassCastException
java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.String

The error may have affected the application state.
Please notify vendor.

Stack Trace:

java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.String
    at com.onseven.dbvis.F.B.B.ā(Z:126)
    at com.onseven.dbvis.F.B.B.execute(Z:2378)
    at com.onseven.dbvis.F.B.F.run(Z:2915)
    at com.onseven.dbvis._.A.E.ā(Z:951)
    at com.onseven.dbvis._.A.E.Ă(Z:2781)
    at com.onseven.dbvis._.A.E.execute(Z:1731)
    at com.onseven.dbvis.F.B.H.construct(Z:1013)
    at se.pureit.swing.util.SwingWorker$2.run(Z:1192)
    at java.lang.Thread.run(Thread.java:619)

Is there any way around this?

Thanks,
Nathan

[This reply is migrated from our old forums.]

Re: GroupNode Filter
Nathan, Does index 91 represent column number 91 or is the label for the column? Are you using DbVis 6.0.6? If not then make sure you do. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: GroupNode Filter
91 is the value(or the job number).  The column name/index is job from the all_jobs view.  I am trying to filter based on the job number.  I am using dbvis 6.0.5.

Nathan
[This reply is migrated from our old forums. The original author name has been removed]

Re: GroupNode Filter
It doesn't work in 6.0.6 either.  Here is what I have:

      <Command id="oracle.getJobs">
         <SQL>
            <![CDATA[
SELECT
    JOB,
    LOG_USER,
    PRIV_USER,
    SCHEMA_USER,
    LAST_DATE,
    LAST_SEC,
    THIS_DATE,
    THIS_SEC,
    NEXT_DATE,
    NEXT_SEC,
    TOTAL_TIME,
    BROKEN,
    INTERVAL,
    FAILURES,
    WHAT,
    NLS_ENV,
    INSTANCE
FROM
    ${#cp.SystemTablePrefix}_jobs
WHERE
    LOG_USER = '${owner}'
ORDER BY
    JOB;
            ]]>
         </SQL>
      </Command>


            <GroupNode type="Jobs" label="Jobs" isLeaf="false">
               <DataNode type="Job" label="${oracle.getJobs.JOB}   (${oracle.getJobs.WHAT})" isLeaf="true">
                  <SetVar name="job" value="${oracle.getJobs.JOB}"/>
                  <Command idref="oracle.getJobs">
                     <Input name="owner" value="${schema}"/>
                     <Filter type="Jobs" name="Jobs">
                <Column index="job" name="Job"/>
                        <Column index="what" name="What"/>
                     </Filter>
                  </Command>
               </DataNode>
            </GroupNode>


Thanks,
Nathan
[This reply is migrated from our old forums.]

Re: GroupNode Filter
Nathan, Can you provide the XML for the complete ? (Does the error occur when you enter 91 in the Filter pane in DbVis?) Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]
[Attachment has been removed.]

Re: GroupNode Filter
If I enter 91 or the number of any other Job I get the error.

I have uploaded my whole oracle profile.

Nathan
[This reply is migrated from our old forums. The original author name has been removed]
[Attachment has been removed.]

Re: GroupNode Filter
Nathan,

I have merged your changes into my oracle.xml profile. Your enhancements are really useful! Thanks.

After playing around a little bit I have found a solution to the ClassCastException. Maybe it's not that nice, but it works. See the attached oracle.xml.

I have added "to_char(job) as job_char" to the select and used "job_char" in the filter.

Cheers,
Chris
[This reply is migrated from our old forums. The original author name has been removed]

Re: GroupNode Filter
Yeah, to_char is definitely a work around.  You might want to be careful with the dbms jobs changes I added.  I haven't done a lot of testing with them.  I guess we will see what Roger says about not using to_char.  Also I hope he can add a scroll bar to the action window.  If you haven't noticed, the action window for creating a dbms job is a little large.

Nathan
[This reply is migrated from our old forums.]

Re: GroupNode Filter
Nathan, Sorry for the delay. It's a bug. We'll put a fix in the next version. A workaround (as you and Chris already found) is to make sure the filtered data is of char data. BTW: You've put some nice extensions in the profile. Do you want us to merge these with the profile provided with DbVis? Another related note, make sure you have a for all definitions. I see it is missing for the "Job" . Good work! Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: GroupNode Filter
Roger, I think I found another bug along these lines. I added the ability to right click in the grid for "Locks 1" and "Locks 2" and it script an "alter system kill session". There seems to be an issue with me passing sid and serial as integers also. For example: Here is the error that is produced: An internal error occurred: Exception: java.lang.ClassCastException java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.String The error may have affected the application state. Please notify vendor. Stack Trace: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.String at com.onseven.dbvis._.B.A.G.ā(Z:1074) at com.onseven.dbvis._.B.A.G.ā(Z:2872) at com.onseven.dbvis._.B.A.G$3.execute(Z:873) at se.pureit.swing.util.ActionCommand.actionPerformed(Z:3267) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1170) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1211) at java.awt.Component.processMouseEvent(Component.java:6038) at javax.swing.JComponent.processMouseEvent(JComponent.java:3260) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at com.onseven.dbvis.I.A.f.dispatchEvent(Z:2787) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) Thanks, Nathan
[This reply is migrated from our old forums.]

Re: GroupNode Filter
Nathan, This is related to the other problem when using non text data in a . A workaround is to convert serial# with to_char(). This will also be fixed in the next version. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: GroupNode Filter
Roger,

Did you receive my email?  Just curious.

Nathan
[This reply is migrated from our old forums.]

Re: GroupNode Filter
Hi Nathan, Yes I have received it and will follow-up soon. Best Regards Roger
[This reply is migrated from our old forums.]

Re: GroupNode Filter
Nathan, The fix is now fixed in 6.0.7. http://www.minq.se/products/dbvis/download.html Best Regards Roger