ResultSetMetaData.getColumnType() throws NPE

Following is a trace that I got when I executed when a simple java class accessed
result set meta data from within a JSP on WLS 8.1 Sp1 using oracle oci driver.
java.lang.NullPointerException
     at weblogic.jdbc.oci.ResultSetMetaData.getColumnType(ResultSetMetaData.java:172)
     at weblogic.jdbc.wrapper.ResultSetMetaData_weblogic_jdbc_oci_ResultSetMetaData.getColumnType(Unknown
Source)
     at com.abc.impl.vm.data.CommonResultSetProcessor.process(CommonResultSetProcessor.java:44)
     at com.abc.impl.vm.data.DefaultTranslator.translate(DefaultTranslator.java:77)
     at unittest.TestDefaultTranslator.main(TestDefaultTranslator.java:53)
     at jsp_servlet.__testdefaulttranslator._jspService(__testdefaulttranslator.java:126)
     at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
     at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
It looks for some reason the wrapper class does not have a reference to the wrapped
ResultSetMetaData instance and when the getColumnType() is invoked it throws NPE.
Any help would be appreciated.
Thanks,
Parag

Changing the index from 0 to 1 did solve my problem. I realised looking at the
"0" in the exception trace after attaching the jar file you gave.
Although the mistake was on my part and I would like a descriptive message in
the exception.
Sorry for the trouble.
Thanks.
Parag
Joe Weinstein <[email protected]> wrote:
>
>
Parag wrote:
I think I know what the problem is and is my mistake. The ResultSetMetaDatais
indexed from 1 and not 0.
Let me try that and I will let you know whether that solves my problem.
ThanksSure thing. Glad to help. We should fix our driver to
check the column value and throw a descriptive exception
if it's out of range.
Joe
Parag
"Parag" <[email protected]> wrote:
After attaching the jar that you provided in the beginning of the classpath,
I
get following exception
java.sql.SQLException: getColumn() for column number 0 gives null!
     at weblogic.jdbc.oci.ResultSetMetaData.getColumnType(ResultSetMetaData.java:177)
     at weblogic.jdbc.wrapper.ResultSetMetaData_weblogic_jdbc_oci_ResultSetMetaData.getColumnType(Unknown
Source)
     at com.abc.impl.vm.data.CommonResultSetProcessor.process(CommonResultSetProcessor.java:44)
     at com.abc.impl.vm.data.DefaultTranslator.translate(DefaultTranslator.java:77)
     at unittest.TestDefaultTranslator.main(TestDefaultTranslator.java:53)
     at jsp_servlet.__testdefaulttranslator._jspService(__testdefaulttranslator.java:126)
     at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
     at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCont<Dec
24, 2003 9:02:35 AM EST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=2220309,name=test,context-path=/test)]
Root cause ext.java:3622)
     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)of
ServletException.
com.abc.vm.TranslationProcessException: java.sql.SQLException: getColumn()
for
column number 0 gives
     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:17null!
     at com.abc.impl.vm.data.DefaultTranslator.translate(DefaultTranslator.java:83)
     at unittest.TestDefaultTranslator.0)
main(TestDefaultTranslator.java:53)
     at jsp_servlet.__testdefaulttranslator._jspService(__testdefaulttranslator.java:126)
Parag
Joe Weinstein <[email protected]> wrote:
Parag wrote:
Following is a trace that I got when I executed when a simple javaclass accessed
result set meta data from within a JSP on WLS 8.1 Sp1 using oracleoci driver.
java.lang.NullPointerException
     at weblogic.jdbc.oci.ResultSetMetaData.getColumnType(ResultSetMetaData.java:172)
     at weblogic.jdbc.wrapper.ResultSetMetaData_weblogic_jdbc_oci_ResultSetMetaData.getColumnType(Unknown
Source)Hi. This looks like a driver bug in the oci driver.
Would you please put the small attached jar file at the
front of the classpath formed for the server by the startup
script, and then boot the server and repeat the code that
showed the problem? The problem may occur, but will show a more helpfu;
exception for me to debug.
thanks,
Joe
     at com.abc.impl.vm.data.CommonResultSetProcessor.process(CommonResultSetProcessor.java:44)
     at com.abc.impl.vm.data.DefaultTranslator.translate(DefaultTranslator.java:77)
     at unittest.TestDefaultTranslator.main(TestDefaultTranslator.java:53)
     at jsp_servlet.__testdefaulttranslator._jspService(__testdefaulttranslator.java:126)
     at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
     at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
It looks for some reason the wrapper class does not have a referenceto the wrapped
ResultSetMetaData instance and when the getColumnType() is invokedit throws NPE.
Any help would be appreciated.
Thanks,
Parag

Similar Messages

  • AdvanceCache throwing NPE in headless mode

    Using jCharts (cross-posted there too), axisChart.render() is throwing this NullPointerException, but only some of the time. Looks like about half the time, the other half everything works great. I'm at a loss. It's a servlet that generates a JPEG chart, running in Caucho's Resin engine, 1.4 jdk running in headless mode, on a Linux box. Any ideas are appreciated...
    dataSeries.addIAxisChartDataSet( new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, barChartProperties ) );
    AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties, legendProperties, width, height );
    BufferedImage awtImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    axisChart.setGraphics2D(awtImage.createGraphics());
    axisChart.render();
    try {
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(response.getOutputStream());
    encoder.encode(awtImage);
    } catch (Exception e) {
    System.out.println(e);
    java.lang.NullPointerException
    at sun.awt.font.AdvanceCache.get(AdvanceCache.java:125)
    at java.awt.font.TextLayout$OptInfo.handleGetVisualBounds(TextLayout.java:280)
    at sun.awt.font.Decoration.getVisualBounds(Decoration.java:105)
    at java.awt.font.TextLayout$OptInfo.getVisualBounds(TextLayout.java:309)
    at java.awt.font.TextLayout.getBounds(TextLayout.java:1109)
    at org.jCharts.Chart.renderChartTitle(Unknown Source)
    at org.jCharts.axisChart.AxisChart.renderChart(Unknown Source)
    at org.jCharts.Chart.render(Unknown Source)
    at ChartGen.doGet(ChartGen.java:76)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
    at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
    at com.caucho.server.http.Invocation.service(Invocation.java:311)
    at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:342)
    at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:272)
    at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
    at java.lang.Thread.run(Thread.java:536)

    I'm also running into this. It seems after having Tomcat running for a while (days) it suddenly starts happening. It's as if it caches something that is then forgotten (or closed), and when called, it throws NPE. I'd love to know if this turns out to be a JDK bug or if there's a logical explanation.

  • JDeveloper throws NPE

    I have recently installed jdeveloper 11.1.1.3 on my machine running windows xp - 32. I am getting o.jdev.pathconfiguration errors while I am trying to edit method action or add new method action in page definition. It striaght away popups with the jdeveloper error window saying exit, continue. I have done exit and save, problem not resolved. If I continue the operation, it throws NPE exception.
    I have tested the same application on different machines, it runs well with no error messages. Most weired thing is it does work sometimes on my machine.

    Hi,
    I looked up the bug database for similar issues and found one fixed in 11.1.1.2. However, your may be different. Maybe if you compare your install directory structure with the ones on machines that don't have the issue, it will give you a hint
    Frank

  • Help with ResultSetMetaData.getColumntype()

    For some reason when I call the getColumnType() on a ResultSetMetaData object I get a -9 for VARCHAR objects, but it's suppose to be 12 (based on java.sql.TYPES). I am connecting to a SQL Server Database using ODBC drivers.
    Thanks,
    Dan

    SQL Server has a few non-standard types, including -9 for NVARCHAR (VARCHAR is 12 as it should be). The JDBC driver should map these non-standard types to the java.sql.Types defined constants and it seems like the bridge doesn't do it. If this is that important to you try another driver or write a wrapper for the bridge.
    Alin.

  • DefaultDesktopManager.activateFrame throws NPE on Mac OS X (Leopard)

    We have a Swing app deployed via JNLP. The JNLP file specifies JRE 1.5+.
    There is an error that occurs ONLY on Mac OSX desktops. When the user clicks in the open area of a frame, they get a NullPointerException. Stack looks like:
    javax.swing.DefaultDesktopManager.activateFrame(DefaultDesktopManager.java:233)
    apple.laf.CUIAquaInternalFramePane.mousePressed(CUIAquaInternalFramePane.java:203)
    java.awt.Component.processMouseEvent(Component.java:5599)
    javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    java.awt.Component.processEvent(Component.java:5367)
    java.awt.Container.processEvent(Container.java:2010)
    java.awt.Component.dispatchEventImpl(Component.java:4068)
    java.awt.Container.dispatchEventImpl(Container.java:2068)
    java.awt.Component.dispatchEvent(Component.java:3903)
    java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
    java.awt.LightweightDispatcher.processMouseEvent(Container.java:3933)
    java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
    java.awt.Container.dispatchEventImpl(Container.java:2054)
    java.awt.Window.dispatchEventImpl(Window.java:1791)
    java.awt.Component.dispatchEvent(Component.java:3903)
    java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
    java.awt.EventDispatchThread.run(EventDispatchThread.java:110)I've been able to gather very little from the web on this, other than a recognition of the bug, with a partially-described solution that I don't understand.
    If anyone has seen this problem, or has any helpful information, it would be greatly appreciated.
    Pete

    If the exception is otherwise harmless, you could "mask" it by simply using a custom DesktopManager that usually simply delegates to the default one. Untested code:
    // Make your desktop pane use your new DesktopManager
    JDesktopPane dp = new JDesktopPane();
    DesktopManager newManager = new MyDesktopManager(dp.getDesktopManager());
    dp.setDesktopManager(newManager);
    class MyDesktopManager implements DesktopManager {
       private DesktopManager delegate;
       public MyDesktopManager(DesktopManager delegate) {
          this.delegate = delegate;
       public void activateFrame(JInternalFrame f) {
          try {
             delegate.activateFrame(f);
          } catch (NullPointerException npe) {
             // Swallow, log, or whatever you want
       // All other methods, simply delegate
    }

  • JSF calls DAO layer based on  JPA/Hibernate throws NPE

    I'm new in JSF and Hibernate;
    I'm using Hibernate as JPA provider, the dataaccess is tied to DAO layer; when my JSF controller(UserController) calls the getUsers() of my DAO layer
    (Glassfish is the app Server I use)
    NullpointerException is thrown, I assume it's because instance of BasicDAO is initialized, where do I have to instantiate BasicDAO
    here is my code :
    public class BasicDAO {      
    @PersistenceUnit(unitName = "test5PU")
    private EntityManager entityManager;
    public void setEntityManager(EntityManager entityManager)
    {        this.entityManager = entityManager;    }
    public List getUsers() {       
    Query query = entityManager.createNamedQuery("User.findAllUsers");
    return query.getResultList();
    public User findUser(String id) {       
    try{
    Query q = entityManager.createNamedQuery("User.findByIdUser");
    User o = (User)q.getSingleResult();
    return o;
    } finally {
    entityManager.close();
    public class UserController {
    /** Creates a new instance of UserController */
    public UserController() {      
    private DataModel model;
    private BasicDAO basicDAO;
    public DataModel getUsers() {            
    return new ListDataModel(basicDAO.getUsers());
    public void setBasicDAO(BasicDAO basicDAO) {     
    this.basicDAO = basicDAO;
    public BasicDAO getBasicDAO() {           
    return this.basicDAO;
    public User findUser(String id) {
    return basicDAO.findUser(id);
    List.jsp :
    <h:dataTable value='#{user.users}' var='item' border="1" cellpadding="2" cellspacing="0">
    <h:column>
    <f:facet name="header">
    <h:outputText value="IdUser"/>
    </f:facet>
    <h:outputText value="#{item.idUser}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Password"/>
    </f:facet>
    <h:outputText value="#{item.password}"/>
    </h:column>
    </h:dataTable>

    in fact, i did some tests, and the reason why the NPE happens revealed to be caused by the call to
    this.emf = Persistence.createEntityManagerFactory(persistenceUnitName, emfProperties);
    which returns NULL value, and later when emf is accessed to create entitymanager NullPointerException is thrown.
    I think there is a configuration probem some where, except in persistence.xml file. my persistence.xml content is :
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="test9PU" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>JeeCertDB</jta-data-source>
    <class>persistence.user.User</class>
    <properties>
    <property name="hibernate.jdbc.driver"
    value="com.mysql.jdbc.Driver" />
    <property name="hibernate.jdbc.url"
    value="jdbc:mysql://localhost:3306/JeeCertDB" />
    <property name="hibernate.jdbc.user" value="root" />
    <property name="hibernate.jdbc.password" value="belly" />
    <property name="hibernate.logging.level" value="INFO" />
    </properties>
    </persistence-unit>
    </persistence>
    Message was edited by:
    S_screen

  • PDF generation with FOP throws NPE

    Hi,
    Stack trace
    at oracle.xml.jaxp.JXTransformer.reportXSLException(JXTransformer.java:769)
    at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:342)
    I'm using standard Java 1.4 API calls to create a PDF document from a DOM with Apache FOP 0.20.5.
    The servlet is deployed to Oracle 10g Application Server 9.0.4.0.0. With Tomcat 4.1.30 the same code executes without exceptions
    Because I have to port our web application to Oracle for a new customer it is important for me to get this fixed soon.
    Thank you
    Eckard

    Light at the end of the tunnel: It seems to work when FO and PDF generation are separated. Until now the DOM was piped into FOP who internally created the FO from SAX events and then seems to parse it again to create PDF.
    I separated the two steps: There is no problem in FO generation, but due to a namespace problem subsequent parsing fails
    ("org.apache.fop.apps.FOPException: null:2:10 Root element is missing the namespace declaration: http://www.w3.org/1999/XSL/Format")
    Now the correct exception comes up. Whether FOP SAX event listener is buggy or XML parser's error handling has a problem, I don't know
    Thank you anyway
    Eckard

  • JUTableSortModel throws NPE if table has no rows

    Hi people,
    I place this here in case its not known about ....
    Clicking on a column header in an empty table produces this (JDeveloper 9.0.5):
    java.lang.NullPointerException
         at oracle.jbo.uicli.jui.JUTableSortModel.sortByColumn(JUTableSortModel.java:246)
         at oracle.jbo.uicli.jui.JUTableSortModel$1.mouseClicked(JUTableSortModel.java:504)
         at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:207)
         at java.awt.Component.processMouseEvent(Component.java:5137)
         at java.awt.Component.processEvent(Component.java:4931)
         at java.awt.Container.processEvent(Container.java:1566)
         at java.awt.Component.dispatchEventImpl(Component.java:3639)
         at java.awt.Container.dispatchEventImpl(Container.java:1623)
         at java.awt.Component.dispatchEvent(Component.java)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3174)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
         at java.awt.Container.dispatchEventImpl(Container.java:1609)
         at java.awt.Window.dispatchEventImpl(Window.java:1590)
         at java.awt.Component.dispatchEvent(Component.java)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:452)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Regards
    Andy

    Andy,
    here is how I tried to reproduce with the "almost" production release
    1. set where clause of the VO the table is based on to a value that doesn't return record
    2. Run application and clicked on table header
    If this is similar to what your scenario is, then the good news is that this problem seems to be fixed.
    Frank

  • JDev throws NPE using Visual Editor

    Hi,
    I post this here for information.
    Whilst trying to track down an intermittant JDev hang I ran the command line exe (jdev.exe) and saw this stack trace when using the Visual Ed to modify a panel layout.
    java.lang.NullPointerException
    at oracle.jdevimpl.uieditor.assistant.GridBagLayoutAssistant.prepareMouseMoveStatus(GridBagL
    ayoutAssistant.java:2507)
    at oracle.jdevimpl.uieditor.UIEditorController.mouseMoveNode(UIEditorController.java:767)
    at oracle.jdevimpl.uieditor.uicanvas.UICanvas$GlassPane.processMouseMoved(UICanvas.java:2406
    at oracle.jdevimpl.uieditor.uicanvas.UICanvas$GlassPane.processMouseMotionEvent(UICanvas.jav
    a:1624)
    at java.awt.Component.processEvent(Component.java:4901)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3211)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    Regards
    Andy

    The code on that line is doing this:
    <pre>
    2501: public String prepareMouseMoveStatus(CmtModelNode node,
    2502: CmtModelNode toNode,
    2503: Point location)
    2504: {
    2505: Container container = toNode.getSubcomponent().getAsContainer();
    2506: GridBagLayout layout = (GridBagLayout) container.getLayout();
    2507: Point cell = layout.location(location.x, location.y);
    </pre>
    So either layout or location is null. I don't otherwise know enough about this area to say specifically what might be the problem. Can you send me sample code that reproduces the problem?
    Thanks,
    Brian

  • Jdev 11.1.3 throws NPE from editor

    this is the error received.. is ther a fix for this it happens alot ?
    java.lang.NullPointerException
    com.cajhughes.jdev.override.view.OverrideEditorListener.editorOpened()
    o.ii.editor.EditorManagerImpl.fireEditorEvent(EditorManagerImpl.java:1005)
    o.ii.editor.EditorManagerImpl.whenEditorOpened(EditorManagerImpl.java:2923)
    o.ii.editor.EditorState.openEditor(EditorState.java:302)
    o.ii.editor.EditorState.createEditor(EditorState.java:184)
    o.ii.editor.EditorState.getOrCreateEditor(EditorState.java:95)
    o.ii.editor.SplitPaneState.canSetEditorStatePos(SplitPaneState.java:232)
    o.ii.editor.SplitPane.setCurrentEditorStatePos(SplitPane.java:1228)
    o.ii.editor.SplitPane$1.valueChanged(SplitPane.java:133)
    o.i.controls.customtab.CustomTab.fireSelectionChange(CustomTab.java:294)
    o.i.controls.customtab.CustomTab._setSelectedPage(CustomTab.java:625)
    o.i.controls.customtab.CustomTab.setSelectedPage(CustomTab.java:586)
    o.i.controls.customtab.CustomTab.selectPageAt(CustomTab.java:640)
    o.i.controls.customtab.CustomTab.mousePressed(CustomTab.java:990)
    j.a.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:262)
    j.a.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:262)
    j.a.Component.processMouseEvent(Component.java:6260)
    jx.s.JComponent.processMouseEvent(JComponent.java:3267)
    j.a.Component.processEvent(Component.java:6028)
    j.a.Container.processEvent(Container.java:2041)
    j.a.Component.dispatchEventImpl(Component.java:4630)
    j.a.Container.dispatchEventImpl(Container.java:2099)
    j.a.Component.dispatchEvent(Component.java:4460)
    j.a.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    j.a.LightweightDispatcher.processMouseEvent(Container.java:4235)
    j.a.LightweightDispatcher.dispatchEvent(Container.java:4168)
    j.a.Container.dispatchEventImpl(Container.java:2085)
    j.a.Window.dispatchEventImpl(Window.java:2478)
    j.a.Component.dispatchEvent(Component.java:4460)
    j.a.EventQueue.dispatchEvent(EventQueue.java:599)
    j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    j.a.EventDispatchThread.run(EventDispatchThread.java:122)

    Hi Rob,
    From the exception stack reported, it appears that you are hitting an error with the "Add Overrides" extension that I developed - the quickest solution I can offer is for you to temporarily disable this extension until this issue has been resolved.
    I have logged this in the "issue log" for the project on Google Code, http://code.google.com/p/jdev-addoverrides/ , and you can track progress on resolving this problem there.
    Thanks for reporting this error, and apologies for any problems this has caused you.
    Chris Hughes

  • NPE on JInternalFrame. init on GTK LNF with some GTK themes

    Hi!
    I has updated my Ubuntu system (from 9 to 10) and new GTK themes were added to it. Now if some themes are used the application throws NPE on creating JInernalFrame. Currently I noticed it happens with 'Ambiance' theme, but it works with 'Clearity' theme.
    Also once I saw such error message in log:
    Exception in Metacity for theme "Clearlooks": Variable "Bmin`max`height" not defined
    It happens on OpenJDK 1.6.0_18 and HotSpot 1.6.0_20 also.
    I suppose the problem may be like this:
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6425949]
    The only way which I see is not to use GTK LnF at all.
    java.lang.NullPointerException
         at com.sun.java.swing.plaf.gtk.Metacity.getInt(Unknown Source)
         at com.sun.java.swing.plaf.gtk.Metacity.calculateButtonSize(Unknown Source)
         at com.sun.java.swing.plaf.gtk.Metacity$TitlePaneLayout.minimumLayoutSize(Unknown Source)
         at com.sun.java.swing.plaf.gtk.Metacity$TitlePaneLayout.preferredLayoutSize(Unknown Source)
         at java.awt.Container.preferredSize(Unknown Source)
         at java.awt.Container.getPreferredSize(Unknown Source)
         at javax.swing.JComponent.getPreferredSize(Unknown Source)
         at java.awt.BorderLayout.preferredLayoutSize(Unknown Source)
         at javax.swing.plaf.basic.BasicDesktopIconUI.getPreferredSize(Unknown Source)
         at javax.swing.JComponent.getPreferredSize(Unknown Source)
         at javax.swing.JInternalFrame$JDesktopIcon.updateUI(Unknown Source)
         at javax.swing.JInternalFrame$JDesktopIcon.<init>(Unknown Source)
         at javax.swing.JInternalFrame.<init>(Unknown Source)
    <some my code which creates an object of subclass JInternalFrame>
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)Edited by: Electriq2 on Jun 29, 2010 4:22 AM

    That one indeed was the 1 pixel border bug.
    I have now solved this, atleast partially I believe. I am now using ArchSimple theme, which I modified to have 2px borders and better colors for my taste.
    Compositions are still not working, and I do not know why. I have multiple monitors and I am using twinview instead of Xinerama and it should work with it - atleast that is what wiki says if I have not missed anything. The networkmanager menu is still a bit weird looking, but atleast it is not that ugly anymore. Below is a screenshot from current state:
    http://dl.dropbox.com/u/27198869/images … 1%3A54.png
    I will mark this as solved now, even though there are still some minor issues which I think do not belong to this thread, but I will list them below anyway if someone knows something about them. I have not found answers for these:
    - GTK checkbox enabled state is way too light. It is hard to see if it is enabled or not. I can not find any docs about it.
    - GTK combobox, when I click it open, list background is black and text is black. Only the hovered text is visible. No docs about this either.
    - Compositions still not working. But that is not really the most important feature I need. I can live without it.
    - My menus are themed as white on black, but some menus are still black on grey (or white). But I can live with it.

  • I can't throw my exception

    I created my exception
    public class wyjatek extends Exception {
        public wyjatekNieobslugiwany() {
    }i can throw him in my code:
       try{
                                    try{
                             x= request.getParameter("x");
                             y= request.getParameter("y");
                        } catch (NullPointerException npe){
                             throw new wyjatek();
                                    if (x.equals(y)){
                                        out.println('equal')
        } catch (wyjatek w){
        }but i have NullPointerException. Code after throw new wyjatek() is executing.
    Why?
    I change line "throw new wyjatek()" to "throw new Exception()" and everything was fine. Why I can properly throw Exception() but I can't throw wyjatek() witch extends Exception()?

    but i have NullPointerException. Code after throw new wyjatek() is >executing.Wrong, that's the code throwing NPE.
    try{
         //A NPE Exception will never be thrown here
           x= request.getParameter("x");
          y= request.getParameter("y");
    } catch (NullPointerException npe){
          throw new wyjatek();
    if (x.equals(y)){ //this is where NPE will be thrown if x or y is null
         out.println('equal')
    }For your exception to be thrown (cant figure out why you should throw CustomExceptions on NP, though)
          x= request.getParameter("x");
          y= request.getParameter("y");
          try{
                     if (x.equals(y)){
                         out.println('equal')
              }catch(NullPointerException npe){
                   throw new wyjatek(npe.getMessage());
          }cheers,
    ram.

  • Unexpected output sequence and NPE

    Compile given code under Eclipse (tested on Eclipse 3.1.0, WebsphereStudio6) and then run on IBM JVM (tested on 1.4.1, 1.4.2)
    Under WSAD6 after few seconds I got output sequence:
    Leaving try1;0
    In finally1;0
    Leaving try1;0
    In finally1;0
    Leaving try1;0
    In finally1;0
    but it's imposiible if you look on the code... (or I'am ignorant in java)
    If program is runned under Eclipse or standalone IBM JVM (only runned, compiled under Eclipse!!!), porogram throws NPE after few seconds and JVM is terminated.
    Could anybody explain this ??
    Is this bug??
    For me, this is a problem, beacuse I'm working now under application, that is runnign on Websphere Application Server, and of course I'm using WSAD as IDE. And in this program I have found place, where my code hangs'up - it's going in infinite loop without any reason.
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.PrintStream;
    import org.apache.log4j.Logger;
    public class FinallyTest {
         private static IMyLogger log = new MyLogger(FinallyTest.class);
         public static void someMethod(String text){
                   int count = 0;
                   int code = -1;
                   while (count < 2 && (code == -1 || code == 2)) {
                        count++;
                        try {
                                  System.out.println("Entering try:"+count+";"+code);
                                  System.out.println("Do something"+count+";"+code);
                                  if (log.isDebugEnabled()) {
                                       System.out.println("Leaving try"+count+";"+code);
                             code = 0;
                        } finally {
                             if (log.isDebugEnabled()) {
                                  System.out.println("In finally"+count+";"+code);
                   if (log.isDebugEnabled()) {
                        System.out.println("Outering");
                   if (code == 0) {
                        if (log.isDebugEnabled()) {
                             System.out.println("Before return:"+count+";"+code);
                        return;
                   throw new RuntimeException(null+"a");
         public static void main(String[] args) throws Exception {
              File f = new File("out.txt");
              PrintStream ps = new PrintStream(new FileOutputStream(f));
              System.setOut(ps);
              for (;;){
                   someMethod("any text");
    interface IMyLogger {
         public boolean isDebugEnabled();
    class MyLogger  implements IMyLogger{
         private Logger logger;
         MyLogger(Class clazz) {
              this.logger = Logger.getLogger(clazz.getName());
         public boolean isDebugEnabled() {
              return logger.isDebugEnabled();
    }btw: log4j is needed, tested on 1.2.6 and 1.2.8

    for (;;){
        someMethod("any text");
    }is not source of problem!!! Infinite loops is created in method someMethod, You can change for (;;) with for (int x=1; x<10000; x++) if You wish.
    Here is another simplified version (without log4j. Run this code please:
    public class FinallyTest {
         private static IMyLogger log = new MyLogger(FinallyTest.class);
         public static void someMethod(String text){
                   int count = 0;
                   int code = -1;
                   while (count < 2 && (code == -1 || code == 2)) {
                        count++;
                        try {
                                  System.out.println("Entering try:"+count+";"+code);
                                  System.out.println("Do something"+count+";"+code);
                                  if (log.isDebugEnabled()) {
                                       System.out.println("Leaving try"+count+";"+code);
                             code = 0;
                        } finally {
                             if (log.isDebugEnabled()) {
                                  System.out.println("In finally"+count+";"+code);
                   if (log.isDebugEnabled()) {
                        System.out.println("Outering");
                   if (code == 0) {
                        if (log.isDebugEnabled()) {
                             System.out.println("Before return:"+count+";"+code);
                        return;
                   throw new RuntimeException(null+"a");
         public static void main(String[] args) throws Exception {
              for (int x=1; x<10000; x++){
                   someMethod("any text");
    interface IMyLogger {
         public boolean isDebugEnabled();
    class MyLogger  implements IMyLogger{
         MyLogger(Class clazz) {
         public boolean isDebugEnabled() {
              return Priority.DEBUG.isGreaterOrEqual(Priority.DEBUG);
    class Priority {
      int level;
      public final static int DEBUG_INT = 10000;
      final static public Priority DEBUG = new Priority(DEBUG_INT);
      protected  Priority(int level) {
        this.level = level;
      public boolean isGreaterOrEqual(Priority r) {
        return level >= r.level;
    }

  • I guess the version is old

    my assignment requires me to work with ms access. i had thus taken an example from dietel and dietel book to learn how java works with access. i am getting output messages like Failed to connect to JDBS/ODBC driver.
    here is the code i will be greatful if any one can check it out.
    import java.sql.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class Scene3 extends JFrame
         private Connection connection;
         private JTable table;
         public Scene3()
              // the url specifying the book database to which this program connects using JDBC
              // to connect to a Microsoft ODBC database.
              String url = "jdbc:odbc:Transport1";
              String username = "anonymous";
              String password = "guest";
              //Load the driver to allow connection to the database
              try
                   Class.forName("sun.jdbc.odbc.jdbcodbcDriver");
                   connection = DriverManager.getConnection(url,username, password);
              catch (ClassNotFoundException cnfex)
                   System.err.println("Failed to load JDBC/ODBC driver.oooooooooooooooo");
                   cnfex.printStackTrace();
                   System.exit(1);// termainatin program
              catch (SQLException sqlex)
                   System.err.println("Unable to connect");
                   sqlex.printStackTrace();
              getTable();
              setSize(450,150);
              show();
         private void getTable()
              Statement statement;
              ResultSet resultSet;
              try
                   String query= "SELECT * FROM Driver";
                   statement = connection.createStatement();
                   resultSet = statement.executeQuery(query);
                   displayResultSet(resultSet);
                   statement.close();
              catch(SQLException sqlex)
                   sqlex.printStackTrace();
         private void displayResultSet(ResultSet rs)
         throws SQLException
              //position to first record
              boolean moreRecords = rs.next();
              // if there are no records, display a message
              if(! moreRecords)
                   JOptionPane.showMessageDialog ( this, "ResultSet Contained no records");
                   setTitle ( "No records to display");
                   return;
                   setTitle ("Authors table from Books");
                   Vector columnHeads = new Vector();
                   Vector rows = new Vector();
                   try
                        // get column heads
                        ResultSetMetaData rsmd = rs.getMetaData();
                        for (int i = 1; i <= rsmd.getColumnCount();++i)
                        columnHeads.addElement(rsmd.getColumnName(i));
                        // get row data
                        do
                             rows.addElement(getNextRow( rs,rsmd));
                        while (rs.next());
                        // display table with Resultset Contents
                        table = new JTable(rows, columnHeads);
                        JScrollPane scroller = new JScrollPane (table);
                        getContentPane().add(scroller,BorderLayout.CENTER);
                        validate();
                   catch (SQLException sqlex)
                        sqlex.printStackTrace();
         private Vector getNextRow( ResultSet rs, ResultSetMetaData rsmd)
         throws SQLException
              Vector currentRow = new Vector();
              for(int i = 1; i<=rsmd.getColumnCount();++i)
              switch(rsmd.getColumnType(i))
                   case Types.VARCHAR:currentRow.addElement(rs.getString(i));
                   break;
                   case Types.INTEGER:
                   currentRow.addElement(new Long(rs.getLong(i)));
                   break;
                   default:
                   System.out.println("Type was: "+rsmd.getColumnTypeName(i));
                   return currentRow;
         public void shutDown()
              try
                   connection.close();
              catch (SQLException sqlex)
                   System.err.println("Unable to disconnect");
                   sqlex.printStackTrace();
         public static void main(String args[])
              final Scene3 S3 = new Scene3();
              /* S3.addWindowsListener(
                   new WindowsAdapter()
                        public void windowClosing( WindowEvent e)
                        S3.shutDown();
                        System.exit(0);
    }

    the code buttons and code tags, man i have no idea about that. thanks a looooot man, i was very happy see that i had made a typo and now i can do it.
    unfortunately it did not help much
    just take a look at the output:
    Note: D:\FyearProject 2005\ver2-Colorful F.Y.Project 2005\Scene3.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: D:\FyearProject 2005\ver2-Colorful F.Y.Project 2005\Scene3.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

  • Trying to display tables reusing same code.

    I'm probably being really naive but I just can't get this to work!
    I have a display table class that will only display a one table when a button is pressed in a GUI. I want to use the same code again to display another table but pressing another button this time. ie: press "Table 1" button and the SQL query SELECT * FROM Customer should be used. Press "Table 2" Button and SQL query SELECT * FROM Order should be used. I have tried creating a constructor for this but it keeps coming up with errors. Please can you have a look at my code. The bits that don't work are commented out. I want to be able to just change the query that is used each time a different button is pressed.
    Thanks in advance.
    import java.sql.*;
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class TableDisplay extends JFrame{
    private Connection aConnection;
    private JTable cusTable;
    private String Query;
    private String Title;
    public TableDisplay() {
    //public TableDisplay (String Query,String Title){
    try {
    DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
    aConnection = DriverManager.getConnection("jdbc:odbc:RelAlg", "", "");
    catch (SQLException e) { System.exit(11);}
    getTable();
    setSize(450,150);
    show();
    private void getTable(){
    Statement aStatement;
    ResultSet aSet;
    try{
    aStatement = aConnection.createStatement();
    aSet = aStatement.executeQuery("SELECT * FROM RelAlgCustomerTable");
    //aSet = aStatement.executeQuery(Query);
    displayResultSet(aSet);
    aStatement.close();
    catch (SQLException e) { System.exit(12);}
    private void displayResultSet(ResultSet rs)
    throws SQLException{
    //position to first record
    boolean moreRecords = rs.next();
    //if there is no records display a message
    if(!moreRecords){
    JOptionPane.showMessageDialog(this, "ResultSet unable to find table");
    setTitle("No table to display");
    return;
    setTitle("Customer Table");
    // setTitle(Title);
    Vector columnHeads = new Vector();
    Vector rows = new Vector();
    try{
    //get column heads
    ResultSetMetaData rsmd = rs.getMetaData();
    for(int i = 1;i <= rsmd.getColumnCount();i++)
    columnHeads.addElement(rsmd.getCatalogName(i));
    //get row data
    do{
    rows.addElement(getNextRow(rs,rsmd));
    while (rs.next());
    //display tabel with ResultSet contents
    cusTable = new JTable(rows, columnHeads);
    JScrollPane scroller = new JScrollPane(cusTable);
    getContentPane().add(scroller,BorderLayout.CENTER);
    validate();
    catch (SQLException e) { System.exit(13);}
    private Vector getNextRow(ResultSet rs, ResultSetMetaData rsmd)
    throws SQLException {
    Vector currentRow = new Vector();
    for (int i = 1; i<=rsmd.getColumnCount();++i)
    switch(rsmd.getColumnType(i)){
    case Types.VARCHAR:
    currentRow.addElement(rs.getString(i));
    break;
    case Types.INTEGER:
    currentRow.addElement(new Long(rs.getLong(i)));
    break;
    default:
    System.out.println("Type was:" +rsmd.getColumnTypeName(i));
    return currentRow;
    public void shutDown(){
    try{
    aConnection.close();
    catch (SQLException e) { System.exit(14);}
    public static void main(String args []){
    final TableDisplay app = new TableDisplay();
    This is the code from the gui that displays the table on the press of the table button
    void table1_mouseClicked(MouseEvent e) {
    TableDisplay tDisp = new TableDisplay();
    tDisp.show();
    }

    what errors are you getting?
    Where are you passing in the value for "Query" and assigning it to the class variable of the same name?
    do this in the constructor:
    public TableDisplay (String Query,String Title){
    /////new line
    this.Query = Query;
    ////end new line
    try {
    DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
    aConnection = DriverManager.getConnection("jdbc:odbc:RelAlg", "", "");
    }

Maybe you are looking for

  • EWA,SL reporting into BI

    Hi.. Can somebody help in configuring the BI for solution manager. I want to push the data from solution manager like EWA,SL,System monitoring reports in to BI. and later i need to extract from BI as and when required.. Help me with the documentation

  • Internal Server Error (HTTP 500)

    I try to run a JSP but after publishing it to a Tomcat 5.5 localhost server, the error is Internal Error. I find no defect in the code. The code is given below : <%@page errorPage="errorPageJSP.jsp" %> <%@page import="teller.Teller"%> <%@page import=

  • I need to send an automated birthday greetings mail notification

    hi all .. I have a requirement like.. I need to send an automated birthday greetings mail notification on every morning.. so I need a general code...for that so pls any one help me thank you in advance

  • Have snippet bugs been fixed in RH8?

    Hello All, I have noticed a few bugs associated with using snippets in RH7, such as the snippets disappearing from the Snippets Pod once in a while, and bullets not rendering correctly in design view, to name a few. I was wondering if anyone knows if

  • Missing Devices

    Hello 6 iDevices are registered within 3 accounts in iCloud. They are all configured identically how to behave with location services. Using find my iPhone I have strange results. In the table I show, what I can see on the different t iPhones and iPa