Quantcast

Validation of xml files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Validation of xml files

Jimisola Laursen
Administrator
Hi!

It would be a huge improvement if xml files where validated against the XSD during startup.
I commented out the <hideMessage> section in syslogd-configuration.xml since I didn't use it.

Appearently, the <hideMessage> is not nillable (see http://www.opennms.org/documentation/java-xsddocs-stable/syslogd-configuration.html).
But instead of a nice message informing me about that during startup I had to realize that no syslogd events came in to OpenNMS due to the following NPE as seen in output.log:

Exception in thread "Thread-894" java.lang.NullPointerException
        at org.opennms.netmgt.syslogd.ConvertToEvent.make(ConvertToEvent.java:410)
        at org.opennms.netmgt.syslogd.SyslogConnection.run(SyslogConnection.java:93)
        at java.lang.Thread.run(Thread.java:595)

Is there an enhancement request for validation? If not, I'm filing one.

Regards,
Jimisola
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Validation of xml files

Tarus Balog

On Jul 24, 2008, at 8:04 AM, Jimisola Laursen wrote:

> It would be a huge improvement if xml files where validated against  
> the XSD
> during startup.

Uh, they are. What version of OpenNMS are you running? This feature  
has been in 1.5.x to my knowledge, using xmllint.

-T

_______________________________________________________________________
Tarus Balog, OpenNMS Maintainer             Main:   +1 919 533 0160
The OpenNMS Group, Inc.                     Fax:    +1 503 961 7746
Email: [hidden email]                    URL: http://www.opennms.org
PGP Key Fingerprint: 8945 8521 9771 FEC9 5481  512B FECA 11D2 FD82 B45C


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Validation of xml files

Benjamin Reed
Tarus Balog wrote:
> On Jul 24, 2008, at 8:04 AM, Jimisola Laursen wrote:
>
>> It would be a huge improvement if xml files where validated against  
>> the XSD
>> during startup.
>
> Uh, they are. What version of OpenNMS are you running? This feature  
> has been in 1.5.x to my knowledge, using xmllint.

I think it's only checking that it's well-formed though.  I'm not sure
we're actually checking against the XSD (although I don't see why it's
not possible...)


--
Benjamin Reed
The OpenNMS Group
http://www.opennms.org/



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

signature.asc (257 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Validation of xml files

Jimisola Laursen
Administrator
I know that it check that is well-formed using xmlint because I've had it complaining about it not being it during startup (using 1.5.91), but it does not validate.

Regards,
Jimisola

Benjamin Reed wrote
Tarus Balog wrote:
> On Jul 24, 2008, at 8:04 AM, Jimisola Laursen wrote:
>
>> It would be a huge improvement if xml files where validated against  
>> the XSD
>> during startup.
>
> Uh, they are. What version of OpenNMS are you running? This feature  
> has been in 1.5.x to my knowledge, using xmllint.

I think it's only checking that it's well-formed though.  I'm not sure
we're actually checking against the XSD (although I don't see why it's
not possible...)


--
Benjamin Reed
The OpenNMS Group
http://www.opennms.org/



 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Validation of xml files

Mike Huot

On Jul 24, 2008, at 11:36 AM, Jimisola Laursen wrote:

>
> I know that it check that is well-formed using xmlint because I've  
> had it
> complaining about it not being it during startup (using 1.5.91), but  
> it does
> not validate.
>

Feel free to open an enhancement request and as always patches are  
welcome!

Mike


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Validation of xml files

DJ Gregor
And if you want to hack on the code (or at least mention it in the bug  
report), the WillItUnmarshalTest test case does this already.  It just  
needs to be reworked into single method call that we can add to  
startup in service-configuration.xml (or have it be called like the  
database checker is called from the startup script).

On Jul 24, 2008, at 3:38 PM, Mike Huot <[hidden email]> wrote:

>
> On Jul 24, 2008, at 11:36 AM, Jimisola Laursen wrote:
>
>>
>> I know that it check that is well-formed using xmlint because I've
>> had it
>> complaining about it not being it during startup (using 1.5.91), but
>> it does
>> not validate.
>>
>
> Feel free to open an enhancement request and as always patches are
> welcome!
>
> Mike
>
>
> ---
> ----------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's  
> challenge
> Build the coolest Linux based applications with Moblin SDK & win  
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in  
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Please read the OpenNMS Mailing List FAQ:
> http://www.opennms.org/index.php/Mailing_List_FAQ
>
> opennms-devel mailing list
>
> To *unsubscribe* or change your subscription options, see the bottom  
> of this page:
> https://lists.sourceforge.net/lists/listinfo/opennms-devel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Validation of xml files

Jeff Gehlbach
If we're going to validate the config files at startup, we should also  
add the option to validate them at any time.  That way you can check  
your configs *before* you restart and fix them while OpenNMS is still  
running, rather than in "oh crap" mode after it's stopped and failed  
to start again :)

-jeff

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Validation of xml files

Benjamin Reed
Jeff Gehlbach wrote:
> If we're going to validate the config files at startup, we should also  
> add the option to validate them at any time.  That way you can check  
> your configs *before* you restart and fix them while OpenNMS is still  
> running, rather than in "oh crap" mode after it's stopped and failed  
> to start again :)

What?  That's just crazy talk.  TRIAL BY FIRE!

=)


--
Benjamin Reed
The OpenNMS Group
http://www.opennms.org/



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

signature.asc (257 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Validation of xml files

DJ Gregor
In reply to this post by Jeff Gehlbach
/etc/init.d/opennms check

:-)

Good call, Jeff!

On Jul 24, 2008, at 9:21 PM, Jeff Gehlbach <[hidden email]> wrote:

> If we're going to validate the config files at startup, we should also
> add the option to validate them at any time.  That way you can check
> your configs *before* you restart and fix them while OpenNMS is still
> running, rather than in "oh crap" mode after it's stopped and failed
> to start again :)
>
> -jeff
>
> ---
> ----------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's  
> challenge
> Build the coolest Linux based applications with Moblin SDK & win  
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in  
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Please read the OpenNMS Mailing List FAQ:
> http://www.opennms.org/index.php/Mailing_List_FAQ
>
> opennms-devel mailing list
>
> To *unsubscribe* or change your subscription options, see the bottom  
> of this page:
> https://lists.sourceforge.net/lists/listinfo/opennms-devel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Loading...