Closed michaelwechner closed 12 years ago
Imho, the target environment should always be set. I'm not sure every single piece of code depending on the target environment is always checking whether or not it is null before using the value (and it should not have to). If anything, the getTargetEnvironment() function should return an empty string instead of null. That being said, I added a check and will push it shortly.
Thanks for implementing the check.
For backwards compatibility reasons and also because there are no pre-configured target environments, but just suggestions to use by convention, we cannot require the configuration of the target environment.
If one is commenting the target environment inside
local/apache-tomcat-7.0.25/webapps/yanel/WEB-INF/classes/yanel.xml
then one receives the following null pointer when accessing
http://127.0.0.1:8080/yanel/
java.lang.NullPointerException at org.apache.xml.serializer.TreeWalker.dispatachChars(TreeWalker.java:244) at org.apache.xml.serializer.TreeWalker.startNode(TreeWalker.java:414) at org.apache.xml.serializer.TreeWalker.traverse(TreeWalker.java:143) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:389) at org.wyona.yanel.impl.resources.showrealms.ShowRealms.getContentXML(ShowRealms.java:189)