tomj 2003/01/06 12:09:24
Modified: java/src/org/apache/axis/i18n resource.properties
java/src/org/apache/axis/wsdl/toJava Emitter.java
Log:
Change to fix for Bug 15675:
- Only print information messages when verbose is turned on.
- Throw an error if there is a NStoPkg.properties file explicitly specified
and not found.
- Do NOT print any messages if no file is specified or found on CLASSPATH.
Revision Changes Path
1.41 +1 -2 xml-axis/java/src/org/apache/axis/i18n/resource.properties
Index: resource.properties
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- resource.properties 3 Jan 2003 14:23:10 -0000 1.40
+++ resource.properties 6 Jan 2003 20:09:24 -0000 1.41
@@ -1083,10 +1083,9 @@
wsdlFileMissing=Unable to find WSDL file or resource {0}
nullEngine=Null engine passed to SOAPService.setEngine()!
servletEngineWebInfError03=Unable to find config file. Creating new servlet engine
config file: {0}
-nsToPkgFileNotFound00=WARNING: Unable to open namespace-to-package mapping file
"{0}". Using default mappings.
+nsToPkgFileNotFound00=ERROR: Unable to open namespace-to-package mapping file "{0}".
nsToPkgFileLoaded00=INFO: Loaded namespace-to-package mapping file "{0}".
nsToPkgDefaultFileLoaded00=INFO: Loaded default namespace-to-package mapping file
"{0}" as java resource.
-nsToPkgDefaultFileNotFound00=WARNING: Unable to open default namespace-to-package
mapping file "{0}". Using default mappings.
missingPortNameException=No name defined for <port> element. Hint: add an attribute
"name" to the port definition, i.e. <port name="...">
missingBindingException=No binding defined for <port> element. Hint: add an
attribute "binding" to he port definition, i.e. <port binding="...">
twoPortsWithSameName=Two <port> elements with the same name "{0}" found. Hint:
choose unique names among all port elements in a WSDL document.
1.56 +26 -22 xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java
Index: Emitter.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- Emitter.java 30 Dec 2002 18:05:42 -0000 1.55
+++ Emitter.java 6 Jan 2003 20:09:24 -0000 1.56
@@ -326,7 +326,7 @@
* Get the Package name for the specified namespace
*/
public String getPackage(String namespace) {
- return (String) namespaces.getCreate(namespace);
+ return namespaces.getCreate(namespace);
}
/**
@@ -398,7 +398,7 @@
super.run(context, doc);
} // run
- private void setup() {
+ private void setup() throws IOException {
if (baseTypeMapping == null) {
setTypeMappingVersion(typeMappingVersion);
}
@@ -440,20 +440,22 @@
* @see
org.apache.axis.utils.ClassUtils#getResourceAsStream(java.lang.Class,String)
*
*/
- private void getNStoPkgFromPropsFile(HashMap namespaces)
+ private void getNStoPkgFromPropsFile(HashMap namespaces) throws IOException
{
Properties mappings = new Properties();
if (NStoPkgFilename != null) {
try {
mappings.load(new FileInputStream(NStoPkgFilename));
- System.out.println(
- Messages.getMessage("nsToPkgFileLoaded00", NStoPkgFilename)
- );
+ if (verbose) {
+ System.out.println(
+ Messages.getMessage("nsToPkgFileLoaded00", NStoPkgFilename)
+ );
+ }
} catch (Throwable t) {
// loading the custom mapping file failed. We do not
try
- // to load the mapping from a default mapping file.
- System.err.println(
+ // to load the mapping from a default mapping file.
+ throw new IOException(
Messages.getMessage("nsToPkgFileNotFound00",
NStoPkgFilename)
);
}
@@ -461,24 +463,26 @@
else {
try {
mappings.load(new FileInputStream(DEFAULT_NSTOPKG_FILE));
- System.out.println(
- Messages.getMessage("nsToPkgFileLoaded00", DEFAULT_NSTOPKG_FILE)
- );
+ if (verbose) {
+ System.out.println(
+ Messages.getMessage("nsToPkgFileLoaded00",
DEFAULT_NSTOPKG_FILE)
+ );
+ }
} catch (Throwable t) {
try {
mappings.load(ClassUtils.getResourceAsStream(
Emitter.class, DEFAULT_NSTOPKG_FILE));
- System.out.println(
- Messages.getMessage("nsToPkgDefaultFileLoaded00",
DEFAULT_NSTOPKG_FILE)
- );
-
- } catch(Throwable t1) {
- // loading the default mapping file failed.
The built-in default
- // mapping is used
- System.err.println(
- Messages.getMessage("nsToPkgDefaultFileNotFound00",
DEFAULT_NSTOPKG_FILE)
- );
- }
+ if (verbose) {
+ System.out.println(
+ Messages.getMessage("nsToPkgDefaultFileLoaded00",
DEFAULT_NSTOPKG_FILE)
+ );
+ }
+
+ } catch(Throwable t1) {
+ // loading the default mapping file failed.
+ // The built-in default mapping is used
+ // No message is given, since this is generally what happens
+ }
}
}