bloritsch 01/02/13 20:53:26
Modified: src/org/apache/cocoon Tag: xml-cocoon2
DefaultComponentManager.java
src/org/apache/cocoon/servlet Tag: xml-cocoon2
CocoonServlet.java
Log:
Fixed a NullPointerException
Revision Changes Path
No revision
No revision
1.1.2.15 +5 -3
xml-cocoon/src/org/apache/cocoon/Attic/DefaultComponentManager.java
Index: DefaultComponentManager.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/DefaultComponentManager.java,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -r1.1.2.14 -r1.1.2.15
--- DefaultComponentManager.java 2001/02/12 13:30:42 1.1.2.14
+++ DefaultComponentManager.java 2001/02/14 04:53:25 1.1.2.15
@@ -40,7 +40,7 @@
/** Default component manager for Cocoon's non sitemap components.
* @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a>
- * @version CVS $Revision: 1.1.2.14 $ $Date: 2001/02/12 13:30:42 $
+ * @version CVS $Revision: 1.1.2.15 $ $Date: 2001/02/14 04:53:25 $
*/
public class DefaultComponentManager implements ComponentManager,
Configurable, Loggable {
@@ -182,6 +182,7 @@
public void configure(Configuration conf) throws ConfigurationException {
// Set components
+
Iterator e = conf.getChildren("component");
while (e.hasNext()) {
Configuration co = (Configuration) e.next();
@@ -189,11 +190,11 @@
String role = co.getAttribute("role", "");
String className = co.getAttribute("class", "");
- if (! type.equals("")) {
+ if (! "".equals(type)) {
role = RoleUtils.lookup(type);
}
- if (className.equals("")) {
+ if ("".equals(className)) {
className = RoleUtils.defaultClass(role);
}
@@ -333,6 +334,7 @@
protected void addComponent(String role, Class component, Configuration
config)
throws ConfigurationException,
ComponentManagerException {
+
this.components.put(role,component);
if ( config != null ) {
this.configurations.put(role, config);
No revision
No revision
1.1.4.54 +2 -2
xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java
Index: CocoonServlet.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java,v
retrieving revision 1.1.4.53
retrieving revision 1.1.4.54
diff -u -r1.1.4.53 -r1.1.4.54
--- CocoonServlet.java 2001/02/14 03:58:37 1.1.4.53
+++ CocoonServlet.java 2001/02/14 04:53:26 1.1.4.54
@@ -59,7 +59,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Nicola Ken Barozzi</a> Aisa
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.4.53 $ $Date: 2001/02/14 03:58:37 $
+ * @version CVS $Revision: 1.1.4.54 $ $Date: 2001/02/14 04:53:26 $
*/
public class CocoonServlet extends HttpServlet {
@@ -402,8 +402,8 @@
URL configFile = (URL)
this.appContext.get(Constants.CONTEXT_CONFIG_URL);
log.info("Reloading from: " + configFile.toExternalForm());
Cocoon c = (Cocoon)
ClassUtils.newInstance("org.apache.cocoon.Cocoon");
- c.contextualize(this.appContext);
c.setLogger(this.log);
+ c.contextualize(this.appContext);
c.init();
this.creationTime = new Date().getTime();
this.cocoon = c;