You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ji...@apache.org on 2004/06/05 00:41:53 UTC

[jira] Created: (JAMES-295) Missing sqlDefs wont be detected

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAMES-295

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAMES-295
    Summary: Missing sqlDefs wont be detected
       Type: Bug

     Status: Unassigned
   Priority: Minor

    Project: James
   Versions:
             2.2.0RC5

   Assignee: 
   Reporter: Mark Daring

    Created: Fri, 4 Jun 2004 3:40 PM
    Updated: Fri, 4 Jun 2004 3:40 PM

Description:
Starting at line 113 in SQLResources.java
Elements with tagname "sqlDefs" are scanned for the name of the class we want the sql-strings for.
At line 125 if this element isnt found, by assuming "sectionElement==null", an exception is thrown.
So the question is, how can sectionElement be ever null if the "sqlDef" we are looking for isnt in the xml-file?

For your convenience:
" ...
        // Now get the section defining sql for the repository required.
113     NodeList sections = sqlDoc.getElementsByTagName("sqlDefs");
114     int sectionsCount = sections.getLength();
        Element sectionElement = null;
        for (int i = 0; i < sectionsCount; i++ ) {
            sectionElement = (Element)(sections.item(i));
            String sectionName = sectionElement.getAttribute("name");
            if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
                break;
            }

        }
125      if ( sectionElement == null ) {
            StringBuffer exceptionBuffer =
                new StringBuffer(64)
                        .append("Error loading sql definition file. ")
                        .append("The element named \'")
                        .append(sqlDefsSection)
                        .append("\' does not exist.");
            throw new RuntimeException(exceptionBuffer.toString());
        }
... "


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Resolved: (JAMES-295) Missing sqlDefs wont be detected

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-295?page=all ]
     
Stefano Bagnara resolved JAMES-295:
-----------------------------------

    Resolution: Fixed

Thanx Mark, fixed!

> Missing sqlDefs wont be detected
> --------------------------------
>
>          Key: JAMES-295
>          URL: http://issues.apache.org/jira/browse/JAMES-295
>      Project: James
>         Type: Bug
>     Versions: 2.2.0
>     Reporter: Mark Daring
>     Assignee: Stefano Bagnara
>     Priority: Minor
>      Fix For: 2.2.1

>
> Starting at line 113 in SQLResources.java
> Elements with tagname "sqlDefs" are scanned for the name of the class we want the sql-strings for.
> At line 125 if this element isnt found, by assuming "sectionElement==null", an exception is thrown.
> So the question is, how can sectionElement be ever null if the "sqlDef" we are looking for isnt in the xml-file?
> For your convenience:
> " ...
>         // Now get the section defining sql for the repository required.
> 113     NodeList sections = sqlDoc.getElementsByTagName("sqlDefs");
> 114     int sectionsCount = sections.getLength();
>         Element sectionElement = null;
>         for (int i = 0; i < sectionsCount; i++ ) {
>             sectionElement = (Element)(sections.item(i));
>             String sectionName = sectionElement.getAttribute("name");
>             if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
>                 break;
>             }
>         }
> 125      if ( sectionElement == null ) {
>             StringBuffer exceptionBuffer =
>                 new StringBuffer(64)
>                         .append("Error loading sql definition file. ")
>                         .append("The element named \'")
>                         .append(sqlDefsSection)
>                         .append("\' does not exist.");
>             throw new RuntimeException(exceptionBuffer.toString());
>         }
> ... "

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-295) Missing sqlDefs wont be detected

Posted by "Mark Daring (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-295?page=comments#action_12317942 ] 

Mark Daring commented on JAMES-295:
-----------------------------------

This logic doesnt detect missing sqldef, it only throws an exception if theres no sqldef at all.
This will fix it:

        Element sectionElement = null;
        boolean found = false;
        for (int i = 0; i < sectionsCount; i++ ) {
            sectionElement = (Element)(sections.item(i));
            String sectionName = sectionElement.getAttribute("name");
            if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
                found = true;
                break;
            }

        }
        if ( !found ) {
            StringBuffer exceptionBuffer =
                new StringBuffer(64)
                        .append("Error loading sql definition file. ")
                        .append("The element named \'")
                        .append(sqlDefsSection)
                        .append("\' does not exist.");
            throw new RuntimeException(exceptionBuffer.toString());
        }

> Missing sqlDefs wont be detected
> --------------------------------
>
>          Key: JAMES-295
>          URL: http://issues.apache.org/jira/browse/JAMES-295
>      Project: James
>         Type: Bug
>     Versions: 2.2.0
>     Reporter: Mark Daring
>     Priority: Minor

>
> Starting at line 113 in SQLResources.java
> Elements with tagname "sqlDefs" are scanned for the name of the class we want the sql-strings for.
> At line 125 if this element isnt found, by assuming "sectionElement==null", an exception is thrown.
> So the question is, how can sectionElement be ever null if the "sqlDef" we are looking for isnt in the xml-file?
> For your convenience:
> " ...
>         // Now get the section defining sql for the repository required.
> 113     NodeList sections = sqlDoc.getElementsByTagName("sqlDefs");
> 114     int sectionsCount = sections.getLength();
>         Element sectionElement = null;
>         for (int i = 0; i < sectionsCount; i++ ) {
>             sectionElement = (Element)(sections.item(i));
>             String sectionName = sectionElement.getAttribute("name");
>             if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
>                 break;
>             }
>         }
> 125      if ( sectionElement == null ) {
>             StringBuffer exceptionBuffer =
>                 new StringBuffer(64)
>                         .append("Error loading sql definition file. ")
>                         .append("The element named \'")
>                         .append(sqlDefsSection)
>                         .append("\' does not exist.");
>             throw new RuntimeException(exceptionBuffer.toString());
>         }
> ... "

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (JAMES-295) Missing sqlDefs wont be detected

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-295?page=all ]

Stefano Bagnara updated JAMES-295:
----------------------------------

    Fix Version: 2.2.1
    Description: 
Starting at line 113 in SQLResources.java
Elements with tagname "sqlDefs" are scanned for the name of the class we want the sql-strings for.
At line 125 if this element isnt found, by assuming "sectionElement==null", an exception is thrown.
So the question is, how can sectionElement be ever null if the "sqlDef" we are looking for isnt in the xml-file?

For your convenience:
" ...
        // Now get the section defining sql for the repository required.
113     NodeList sections = sqlDoc.getElementsByTagName("sqlDefs");
114     int sectionsCount = sections.getLength();
        Element sectionElement = null;
        for (int i = 0; i < sectionsCount; i++ ) {
            sectionElement = (Element)(sections.item(i));
            String sectionName = sectionElement.getAttribute("name");
            if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
                break;
            }

        }
125      if ( sectionElement == null ) {
            StringBuffer exceptionBuffer =
                new StringBuffer(64)
                        .append("Error loading sql definition file. ")
                        .append("The element named \'")
                        .append(sqlDefsSection)
                        .append("\' does not exist.");
            throw new RuntimeException(exceptionBuffer.toString());
        }
... "

  was:
Starting at line 113 in SQLResources.java
Elements with tagname "sqlDefs" are scanned for the name of the class we want the sql-strings for.
At line 125 if this element isnt found, by assuming "sectionElement==null", an exception is thrown.
So the question is, how can sectionElement be ever null if the "sqlDef" we are looking for isnt in the xml-file?

For your convenience:
" ...
        // Now get the section defining sql for the repository required.
113     NodeList sections = sqlDoc.getElementsByTagName("sqlDefs");
114     int sectionsCount = sections.getLength();
        Element sectionElement = null;
        for (int i = 0; i < sectionsCount; i++ ) {
            sectionElement = (Element)(sections.item(i));
            String sectionName = sectionElement.getAttribute("name");
            if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
                break;
            }

        }
125      if ( sectionElement == null ) {
            StringBuffer exceptionBuffer =
                new StringBuffer(64)
                        .append("Error loading sql definition file. ")
                        .append("The element named \'")
                        .append(sqlDefsSection)
                        .append("\' does not exist.");
            throw new RuntimeException(exceptionBuffer.toString());
        }
... "

    Environment: 

> Missing sqlDefs wont be detected
> --------------------------------
>
>          Key: JAMES-295
>          URL: http://issues.apache.org/jira/browse/JAMES-295
>      Project: James
>         Type: Bug
>     Versions: 2.2.0
>     Reporter: Mark Daring
>     Assignee: Stefano Bagnara
>     Priority: Minor
>      Fix For: 2.2.1

>
> Starting at line 113 in SQLResources.java
> Elements with tagname "sqlDefs" are scanned for the name of the class we want the sql-strings for.
> At line 125 if this element isnt found, by assuming "sectionElement==null", an exception is thrown.
> So the question is, how can sectionElement be ever null if the "sqlDef" we are looking for isnt in the xml-file?
> For your convenience:
> " ...
>         // Now get the section defining sql for the repository required.
> 113     NodeList sections = sqlDoc.getElementsByTagName("sqlDefs");
> 114     int sectionsCount = sections.getLength();
>         Element sectionElement = null;
>         for (int i = 0; i < sectionsCount; i++ ) {
>             sectionElement = (Element)(sections.item(i));
>             String sectionName = sectionElement.getAttribute("name");
>             if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
>                 break;
>             }
>         }
> 125      if ( sectionElement == null ) {
>             StringBuffer exceptionBuffer =
>                 new StringBuffer(64)
>                         .append("Error loading sql definition file. ")
>                         .append("The element named \'")
>                         .append(sqlDefsSection)
>                         .append("\' does not exist.");
>             throw new RuntimeException(exceptionBuffer.toString());
>         }
> ... "

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-295) Missing sqlDefs wont be detected

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-295?page=comments#action_12317930 ] 

Stefano Bagnara commented on JAMES-295:
---------------------------------------

I don't understand the problem.

Isn't the exception thrown when you remove all the sqldef from your sqlResources.xml?


> Missing sqlDefs wont be detected
> --------------------------------
>
>          Key: JAMES-295
>          URL: http://issues.apache.org/jira/browse/JAMES-295
>      Project: James
>         Type: Bug
>     Versions: 2.2.0
>     Reporter: Mark Daring
>     Priority: Minor

>
> Starting at line 113 in SQLResources.java
> Elements with tagname "sqlDefs" are scanned for the name of the class we want the sql-strings for.
> At line 125 if this element isnt found, by assuming "sectionElement==null", an exception is thrown.
> So the question is, how can sectionElement be ever null if the "sqlDef" we are looking for isnt in the xml-file?
> For your convenience:
> " ...
>         // Now get the section defining sql for the repository required.
> 113     NodeList sections = sqlDoc.getElementsByTagName("sqlDefs");
> 114     int sectionsCount = sections.getLength();
>         Element sectionElement = null;
>         for (int i = 0; i < sectionsCount; i++ ) {
>             sectionElement = (Element)(sections.item(i));
>             String sectionName = sectionElement.getAttribute("name");
>             if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
>                 break;
>             }
>         }
> 125      if ( sectionElement == null ) {
>             StringBuffer exceptionBuffer =
>                 new StringBuffer(64)
>                         .append("Error loading sql definition file. ")
>                         .append("The element named \'")
>                         .append(sqlDefsSection)
>                         .append("\' does not exist.");
>             throw new RuntimeException(exceptionBuffer.toString());
>         }
> ... "

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Assigned: (JAMES-295) Missing sqlDefs wont be detected

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-295?page=all ]

Stefano Bagnara reassigned JAMES-295:
-------------------------------------

    Assign To: Stefano Bagnara

> Missing sqlDefs wont be detected
> --------------------------------
>
>          Key: JAMES-295
>          URL: http://issues.apache.org/jira/browse/JAMES-295
>      Project: James
>         Type: Bug
>     Versions: 2.2.0
>     Reporter: Mark Daring
>     Assignee: Stefano Bagnara
>     Priority: Minor

>
> Starting at line 113 in SQLResources.java
> Elements with tagname "sqlDefs" are scanned for the name of the class we want the sql-strings for.
> At line 125 if this element isnt found, by assuming "sectionElement==null", an exception is thrown.
> So the question is, how can sectionElement be ever null if the "sqlDef" we are looking for isnt in the xml-file?
> For your convenience:
> " ...
>         // Now get the section defining sql for the repository required.
> 113     NodeList sections = sqlDoc.getElementsByTagName("sqlDefs");
> 114     int sectionsCount = sections.getLength();
>         Element sectionElement = null;
>         for (int i = 0; i < sectionsCount; i++ ) {
>             sectionElement = (Element)(sections.item(i));
>             String sectionName = sectionElement.getAttribute("name");
>             if ( sectionName != null && sectionName.equals(sqlDefsSection) ) {
>                 break;
>             }
>         }
> 125      if ( sectionElement == null ) {
>             StringBuffer exceptionBuffer =
>                 new StringBuffer(64)
>                         .append("Error loading sql definition file. ")
>                         .append("The element named \'")
>                         .append(sqlDefsSection)
>                         .append("\' does not exist.");
>             throw new RuntimeException(exceptionBuffer.toString());
>         }
> ... "

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org