Author: vgritsenko
Date: Wed Oct 27 18:17:17 2004
New Revision: 55759
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/transformation/XMLDBTransformer.java
cocoon/branches/BRANCH_2_1_X/status.xml
Log:
Bug 30849: NPE in XMLDBTransformer
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/transformation/XMLDBTransformer.java
==============================================================================
---
cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/transformation/XMLDBTransformer.java
(original)
+++
cocoon/branches/BRANCH_2_1_X/src/blocks/xmldb/java/org/apache/cocoon/transformation/XMLDBTransformer.java
Wed Oct 27 18:17:17 2004
@@ -416,7 +416,10 @@
// Obtain collection for the current operation
collection = (xbase != null)?
DatabaseManager.getCollection(local_base + "/" + xbase) : this.collection;
- if ("create".equals(operation)) {
+ if (collection == null) {
+ message = "Failed to " + operation + " resource " +
this.key + ": Collection " + local_base + "/" + xbase + " not found.";
+ getLogger().debug(message);
+ } else if ("create".equals(operation)) {
if (key != null && key.endsWith("/")) {
try {
// Cut trailing '/'
@@ -490,7 +493,7 @@
message = "Failed to get context collection for the query
(base: " + local_base + ", context: " + xbase + "): " + e.errorCode;
getLogger().debug(message, e);
} finally {
- if (xbase != null) {
+ if (xbase != null && collection != null) {
try {
collection.close();
} catch (XMLDBException ignored) {
Modified: cocoon/branches/BRANCH_2_1_X/status.xml
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Wed Oct 27 18:17:17 2004
@@ -205,6 +205,10 @@
<changes>
<release version="@version@" date="@date@">
+ <action dev="VG" type="fix" fixes-bug="30849">
+ XMLDB Block: Fix NullPointerException in XMLDBTransformer if specified
+ collection does not exist.
+ </action>
<action dev="AG" type="fix" fixes-bug="31564" due-to="Gunnar Brand"
due-to-email="[EMAIL PROTECTED]">
XSP - JXPath logicsheet: Allow use relative contexts in
<jxpath:for-each>.
Add a new tag <jpath:set-lenient lenient="true|false">