Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public static Option[] configuration() throws Exception {
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),

// Repository
repository("http://repository.ops4j.org/maven2"),
repository("https://repository.ops4j.org/maven2"),

// Logging
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public static Option[] configuration() {
mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),

// Repository
repository("http://repository.ops4j.org/maven2"),
repository("https://repository.ops4j.org/maven2"),

// Logging
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
Expand Down
6 changes: 3 additions & 3 deletions blueprint/blueprint-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@

<properties>
<blueprint.api.dev.version>1.0.2-SNAPSHOT</blueprint.api.dev.version>
<blueprint.core.dev.version>1.10.2-SNAPSHOT</blueprint.core.dev.version>
<blueprint.cm.dev.version>1.3.2-SNAPSHOT</blueprint.cm.dev.version>
<blueprint.parser.dev.version>1.6.1-SNAPSHOT</blueprint.parser.dev.version>
<blueprint.core.dev.version>1.10.4-SNAPSHOT</blueprint.core.dev.version>
<blueprint.cm.dev.version>1.3.3-SNAPSHOT</blueprint.cm.dev.version>
<blueprint.parser.dev.version>1.6.2-SNAPSHOT</blueprint.parser.dev.version>
<blueprint.authz.dev.version>1.0.1-SNAPSHOT</blueprint.authz.dev.version>
<blueprint.spring.dev.version>1.0.0-SNAPSHOT</blueprint.spring.dev.version>
<blueprint.spring.extender.dev.version>1.0.0-SNAPSHOT</blueprint.spring.extender.dev.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.aries.blueprint.parser;

import org.osgi.service.blueprint.container.ComponentDefinitionException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

/**
* A ComponentDefinitionException with specifying a node in the blueprint XML.
* It will expand the explanation with the node but does not store the node.
*
* @version $Revision$
*/
public class ComponentDefinitionElementException extends ComponentDefinitionException {

private static final long serialVersionUID = 1L;

/**
* Creates a Component Definition Exception with no message or exception
* cause.
*/
public ComponentDefinitionElementException() {
super();
}

/**
* Creates a Component Definition Exception with the specified message.
* The node is regarded as the cause path and will be added to the explanation.
*
* @param node The element path in which the exception originates.
* @param explanation The associated message.
*/
public ComponentDefinitionElementException(Node node, String explanation) {
super(getElementPathForError(node) + ": " + explanation);
}

/**
* Creates a Component Definition Exception with the specified message and
* exception cause.
* The node is regarded as the cause path and will be added to the explanation.
*
* @param node The element path in which the exception originates.
* @param explanation The associated message.
* @param cause The cause of this exception.
*/
public ComponentDefinitionElementException(Node node, String explanation, Throwable cause) {
super(getElementPathForError(node) + ": " + explanation, cause);
}

private static String getElementPathForError(Node node) {
if (node == null) {
return "<none>";
}
StringBuilder result = new StringBuilder();
while (node != null) {
if (node instanceof Element) {
Element element = (Element) node;

String errorElement = "<"
+ element.getLocalName()
// the following are possibly helping attributes to find the malfunction path
+ getErrorPathAttributeString(element, Parser.ID_ATTRIBUTE)
+ getErrorPathAttributeString(element, Parser.NAME_ATTRIBUTE)
+ getErrorPathAttributeString(element, Parser.KEY_ATTRIBUTE)
+ getErrorPathAttributeString(element, Parser.CLASS_ATTRIBUTE)
+ ">";
result.insert(0, errorElement); // prefix the parent
}
node = node.getParentNode();
}
return result.toString();
}

private static String getErrorPathAttributeString(Element element, String attributeName) {
if (element.hasAttribute(attributeName)) {
return " " + attributeName
+ "=\"" + element.getAttribute(attributeName) + "\"";
}
return "";
}

}
Loading