tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksander Grzebyta" <ol...@talex.com.pl>
Subject getResource issue
Date Fri, 12 May 2000 08:23:07 GMT
Hello

I tried to run Cocoon 1.7.3 with Tomcat. The following lines cause an error
during Cocoon servlet initialization.
I mark the line 135 where the exact Exception is thrown (the last one
below).
What is the problem ? It looks like "confs" object would not be properly
initialized. The apropriate servlet parameter - the
path to "cocoon.properties" file is set.

##########################
java.lang.NullPointerException
 at org.apache.cocoon.Cocoon.init(Cocoon.java:135)
 at org.apache.tomcat.core.ServletWrapper.initServlet(ServletWrapper.java,
Compiled Code)
[...]
##########################

try {
            // Create the configuration object
            // if we are using a servlet container that is 2.1 or higher
then we
            // can use container based resources instead of files
            if ((containerMajorVersion >= 2) && (containerMinorVersion > 0))
{
               try {
                   URL resource =
config.getServletContext().getResource(confsName);
                   InputStream confsStream =
resource.openConnection().getInputStream();
                   confs = new Configurations(confsStream);
                   confsStream.close();
               } catch (Exception ex) {
                   exception = ex;
                   message = "Unable to open resource: " + confsName;
               }
            } else {
               confs = new Configurations(confsName);
            }

            // Save servlet configurations
            showStatus = ((String) confs.get(SHOW_STATUS,
"false")).toLowerCase().equals("true");

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

#################################


Mime
View raw message