boboson has asked for the wisdom of the Perl Monks concerning the following question:

I am using CGI::App, HTML::Template, XML::Simple etc.
I am working on my webpage and doing alot of changes before testing. When I am done coding I receive the following error message:
Software error: Error executing class callback in init stage: Can't locate object meth +od "new" via package "XML::SAX::PurePerl" at /home/domains/zave/perl/ +lib/site_perl/5.8.7/XML/SAX/ParserFactory.pm line 43.
I narrowed it down so that my webpage will display, by removing a call I make in my baseclass when I load my config file (XML::Simple)
# get config file $self->param('config' => XMLin($self->param('config_url')));
I don't believe thats the real error. I never had any problems with that line of code before I did my changes, unfortunatly, I can't undo my changes. I am using:
use CGI::Carp qw/fatalsToBrowser/;
to catch most coding syntax errors, but I don't understand this new error. Does anyone now what could be wrong or does anyone now of some module which could give me even more specific error codes?

Replies are listed 'Best First'.
Re: XML::Simple error
by runrig (Abbot) on Mar 16, 2006 at 00:11 UTC
    There's a few things that determine which XML parser is used in XML::Simple, see the Environment section of the XML::Simple docs. You probably don't want to be using XML::SAX::PurePerl if you can help it, if possible use either some other XML::SAX parser (e.g. XML::LibXML::SAX::Parser or XML::SAX::Expat) or the expat based XML::Parser. I wonder how you got XML::SAX::ParserFactory installed without XML::SAX::PurePerl since they are in the same bundle XML-SAX.
      XML::SAX::ParserFactory and XML::SAX::PurePerl are installed
      I tried to set the parser to XML::Parser, but I still get a similar error:
      Error executing class callback in init stage: not well-formed (invalid token) at line 11, column 40, byte 458 at /ho +me/domains/zave/perl/lib/site_perl/5.8.7/i686-linux/XML/Parser.pm lin +e 187
      It must be something I did, but I don't know what and how to solve it.
        did you change the xml file? this error msg sounds like malformed xml.