You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sc...@apache.org on 2008/03/14 03:53:25 UTC
svn commit: r636969 - in /webservices/axis2/trunk/java/modules:
jaxws-integration/ jaxws-integration/test/org/apache/axis2/jaxws/sample/
jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/
jaxws-integration/test/org/apache/axis2/jaxws/samp...
Author: scheu
Date: Thu Mar 13 19:53:23 2008
New Revision: 636969
URL: http://svn.apache.org/viewvc?rev=636969&view=rev
Log:
AXIS2-2494
Contributor:Rich Scheuerle
Fixed StringListService tests.
Corrected packages/classes in jaxws/test and jaxws-integration modules. (Moved some classes...eliminated some classes)
Fixed several calls that needed doPriv
Added:
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/META-INF/
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/META-INF/StringList.wsdl
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/StringListPortTypeImpl.java
- copied, changed from r635684, webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/StringListPortTypeImpl.java
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListPortType.java
- copied, changed from r635684, webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/sei/StringListPortType.java
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListService.java
- copied, changed from r635684, webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/sei/StringListService.java
Removed:
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/utility/
Modified:
webservices/axis2/trunk/java/modules/jaxws-integration/pom.xml
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/catalog/impl/OASISCatalogManager.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/pom.xml?rev=636969&r1=636968&r2=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/pom.xml Thu Mar 13 19:53:23 2008
@@ -1109,9 +1109,9 @@
<copy toDir="target/test-classes/servicejars/StringListService/">
<fileset dir="target/test-classes">
- <include name="org/apache/axis2/jaxws/stringlist/**"/>
+ <include name="org/apache/axis2/jaxws/sample/stringlist/**"/>
</fileset>
- <fileset dir="test/org/apache/axis2/jaxws/stringlist/">
+ <fileset dir="test/org/apache/axis2/jaxws/sample/stringlist/">
<include name="META-INF/**"/>
</fileset>
</copy>
@@ -1248,17 +1248,17 @@
<include>**/DocLitBareMinTests.java</include>
<include>**/MtomSampleByteArrayTests.java</include>
<include>**/HandlerTests.java</include>
+ <include>**/StringListTests.java</include>
<!-- These tests are currently failing -->
<!-- <include>**/FaultyWebServiceTests.java</include> -->
<!-- <include>**/ParallelAsyncTests.java</include> -->
- <!-- <include>**/StringListTests.java</include> -->
<!-- <include>**/NonWrapTests.java</include> -->
</includes>
<systemProperties>
<property>
<name>OASISCatalogManager.catalog.debug.level</name>
- <value>9999</value>
+ <value>0</value>
</property>
<property>
<name>build.repository</name>
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java?rev=636969&r1=636968&r2=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/StringListTests.java Thu Mar 13 19:53:23 2008
@@ -22,20 +22,20 @@
import junit.framework.TestSuite;
import org.apache.axis2.jaxws.TestLogger;
import org.apache.axis2.jaxws.framework.AbstractTestCase;
-import org.apache.axis2.jaxws.stringlist.sei.StringListPortType;
-import org.apache.axis2.jaxws.stringlist.sei.StringListService;
+import org.apache.axis2.jaxws.sample.stringlist.sei.StringListPortType;
+import org.apache.axis2.jaxws.sample.stringlist.sei.StringListService;
import javax.xml.ws.BindingProvider;
public class StringListTests extends AbstractTestCase {
- String axisEndpoint = "http://localhost:6060/axis2/services/StringListPortTypeImpl.StringListPortType";
-
+ String axisEndpoint = "http://localhost:6060/axis2/services/StringListService.StringListPortTypeImplPort";
+
public static Test suite() {
return getTestSetup(new TestSuite(StringListTests.class));
}
-
- public void testStringListScenario() throws Exception {
+
+ public void testStringListScenario() throws Exception {
TestLogger.logger.debug("----------------------------------");
TestLogger.logger.debug("test: " + getName());
StringListService sls = new StringListService();
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/META-INF/StringList.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/META-INF/StringList.wsdl?rev=636969&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/META-INF/StringList.wsdl (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/META-INF/StringList.wsdl Thu Mar 13 19:53:23 2008
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+<definitions name="StringList" targetNamespace="http://org/test/StringList"
+ xmlns:tns="http://org/test/StringList" xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" targetNamespace="http://org/test/StringList">
+ <xsd:element name="StringList" type="tns:StringListType" />
+ <xsd:element name="StringListResponse" type="tns:StringListType" />
+
+ <xsd:simpleType name="StringListType">
+ <xsd:list itemType="xsd:string"/>
+ </xsd:simpleType>
+
+ </xsd:schema>
+ </types>
+
+ <message name="StringList">
+ <part name="parameters" element="tns:StringList" />
+ </message>
+ <message name="StringListResponse">
+ <part name="result" element="tns:StringListResponse" />
+ </message>
+
+ <portType name="StringListPortType">
+ <operation name="StringList">
+ <input message="tns:StringList" name="add" />
+ <output message="tns:StringListResponse" name="addResponse" />
+
+ </operation>
+ </portType>
+ <binding name="StringListBinding" type="tns:StringListPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+ <operation name="StringList">
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+
+ </operation>
+
+ </binding>
+ <service name="StringListService">
+ <port name="StringListPort" binding="tns:StringListBinding">
+ <soap:address
+ location="http://localhost:6060/axis2/services/StringListService" />
+ </port>
+ </service>
+</definitions>
Copied: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/StringListPortTypeImpl.java (from r635684, webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/StringListPortTypeImpl.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/StringListPortTypeImpl.java?p2=webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/StringListPortTypeImpl.java&p1=webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/StringListPortTypeImpl.java&r1=635684&r2=636969&rev=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/StringListPortTypeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/StringListPortTypeImpl.java Thu Mar 13 19:53:23 2008
@@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis2.jaxws.stringlist;
+package org.apache.axis2.jaxws.sample.stringlist;
-import org.apache.axis2.jaxws.stringlist.sei.StringListPortType;
+import org.apache.axis2.jaxws.sample.stringlist.sei.StringListPortType;
import javax.jws.WebService;
-@WebService(endpointInterface="org.apache.axis2.jaxws.stringlist.sei.StringListPortType")
+@WebService(serviceName="StringListService", endpointInterface="org.apache.axis2.jaxws.sample.stringlist.sei.StringListPortType")
public class StringListPortTypeImpl implements StringListPortType {
/* (non-Javadoc)
Copied: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListPortType.java (from r635684, webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/sei/StringListPortType.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListPortType.java?p2=webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListPortType.java&p1=webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/sei/StringListPortType.java&r1=635684&r2=636969&rev=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/sei/StringListPortType.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListPortType.java Thu Mar 13 19:53:23 2008
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis2.jaxws.stringlist.sei;
+package org.apache.axis2.jaxws.sample.stringlist.sei;
import javax.jws.WebMethod;
import javax.jws.WebParam;
Copied: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListService.java (from r635684, webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/sei/StringListService.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListService.java?p2=webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListService.java&p1=webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/sei/StringListService.java&r1=635684&r2=636969&rev=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/stringlist/sei/StringListService.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/stringlist/sei/StringListService.java Thu Mar 13 19:53:23 2008
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis2.jaxws.stringlist.sei;
+package org.apache.axis2.jaxws.sample.stringlist.sei;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -26,6 +26,7 @@
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.List;
/**
@@ -40,7 +41,7 @@
{
private final static URL STRINGLISTSERVICE_WSDL_LOCATION;
- private static String wsdlLocation="/test/org/apache/axis2/jaxws/stringlist/META-INF/StringList.wsdl";
+ private static String wsdlLocation="/test/org/apache/axis2/jaxws/sample/stringlist/META-INF/StringList.wsdl";
static {
URL url = null;
try {
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java?rev=636969&r1=636968&r2=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java Thu Mar 13 19:53:23 2008
@@ -409,12 +409,20 @@
// list on client array on server, Can happen only in start from java
// case.
else if ((ctype == JAXBUtils.CONSTRUCTION_TYPE.BY_CLASS_ARRAY)) {
+ jaxb = unmarshalAsListOrArray(reader, u, type);
+ /*
+ * Commenting out code...
+ *
// The type could be any Object or primitive
// I will first unmarshall the xmldata to a String[]
// Then use the unmarshalled jaxbElement to create
// proper type Object Array.
+
jaxb = u.unmarshal(reader, String[].class);
+
+
Object typeObj = getTypeEnabledObject(jaxb);
+
// Now convert String Array in to the required Type Array.
if (getTypeEnabledObject(typeObj) instanceof String[]) {
String[] strArray = (String[]) typeObj;
@@ -422,14 +430,18 @@
for (String str : strArray) {
strTokens = strTokens + " " + str;
}
+
QName qName =
XMLRootElementUtil.
getXmlRootElementQNameFromObject(jaxb);
Object obj = XSDListUtils.fromXSDListString(strTokens, type);
jaxb = new JAXBElement(qName, type, obj);
}
+ */
} else {
+
jaxb = u.unmarshal(reader, type);
+
}
} else if (type.isEnum()) {
@@ -476,7 +488,9 @@
// list or array (see NOTE above)
// First unmarshal as a String
//Second convert the String into a list or array
+
jaxb = unmarshalAsListOrArray(reader, u, type);
+
}
return jaxb;
} catch (OMException e) {
@@ -579,21 +593,34 @@
// String instead. Then we get the correct wire format:
// <foo>1 2 3</foo>
Object jbo = b;
-
if (isList || (type != null && type.isArray())) {
if (DEBUG_ENABLED) {
log.debug("marshalling type which is a List or Array");
}
- // We conver to xsdListString only if the type is not known
- // to the context. In case a jaxbcontext is created from package
- // the array types or list are not know to the context.
+
+ // This code assumes that the JAXBContext does not understand
+ // the array or list. In such cases, the contents are converted
+ // to a String and passed directly.
+
if (ctype == JAXBUtils.CONSTRUCTION_TYPE.BY_CONTEXT_PATH) {
QName qName = XMLRootElementUtil.getXmlRootElementQNameFromObject(b);
String text = XSDListUtils.toXSDListString(getTypeEnabledObject(b));
+ if (DEBUG_ENABLED) {
+ log.debug("marshalling [context path approach] " +
+ "with xmllist text = " + text);
+ }
jbo = new JAXBElement(qName, String.class, text);
} else if (ctype == JAXBUtils.CONSTRUCTION_TYPE.BY_CLASS_ARRAY) {
- // do nothing common array types should be know to the jaxbcontext.
- // so do not use xsdListString conversion.
+ // Some versions of JAXB have array/list processing built in.
+ // This code is a safeguard because apparently some versions
+ // of JAXB don't.
+ QName qName = XMLRootElementUtil.getXmlRootElementQNameFromObject(b);
+ String text = XSDListUtils.toXSDListString(getTypeEnabledObject(b));
+ if (DEBUG_ENABLED) {
+ log.debug("marshalling [class array approach] " +
+ "with xmllist text = " + text);
+ }
+ jbo = new JAXBElement(qName, String.class, text);
}
}
@@ -630,6 +657,10 @@
"Marshaling to an XMLStreamWriter. Object is "
+ getDebugName(b));
}
+
+ /// TODO
+ // For the cases like enum and list, should we
+ // intercept exceptions and try a different approach ?
m.marshal(jbo, writer);
} catch (OMException e) {
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java?rev=636969&r1=636968&r2=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java Thu Mar 13 19:53:23 2008
@@ -24,12 +24,15 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.deployment.DeploymentException;
import org.apache.axis2.description.AxisService;
+import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.util.Constants;
import org.apache.axis2.metadata.registry.MetadataFactoryRegistry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import java.security.PrivilegedAction;
+
/** This class serves as a factory for ConfigurationContexts suitable in the client environment. */
public class ClientConfigurationFactory {
@@ -73,8 +76,8 @@
}
// Get the system properties for axis2.xml and the repository.
- String repoPath = System.getProperty(Constants.AXIS2_REPO_PATH);
- String axisConfigPath = System.getProperty(Constants.AXIS2_CONFIG_PATH);
+ String repoPath = getProperty_doPriv(Constants.AXIS2_REPO_PATH);
+ String axisConfigPath = getProperty_doPriv(Constants.AXIS2_CONFIG_PATH);
if (log.isDebugEnabled()) {
log.debug("Axis2 repository path : " + repoPath);
log.debug("Axis2 Config path : " + axisConfigPath);
@@ -98,6 +101,21 @@
}
}
+ private static String getProperty_doPriv(final String property) {
+ return (String)
+ AccessController.doPrivileged(
+ new PrivilegedAction() {
+
+ public Object run() {
+ try {
+ return System.getProperty(property);
+ } catch (Throwable t) {
+ return null;
+ }
+ }
+ });
+ }
+
/**
* Perform any final client-specific configuration on a newly created AxisService.
*
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/catalog/impl/OASISCatalogManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/catalog/impl/OASISCatalogManager.java?rev=636969&r1=636968&r2=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/catalog/impl/OASISCatalogManager.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/catalog/impl/OASISCatalogManager.java Thu Mar 13 19:53:23 2008
@@ -20,8 +20,10 @@
import java.lang.reflect.Method;
import java.net.URL;
+import java.security.PrivilegedAction;
import java.util.logging.Logger;
+import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.catalog.JAXWSCatalogManager;
import org.apache.xml.resolver.Catalog;
@@ -41,8 +43,22 @@
private static final Logger LOG =
Logger.getLogger(OASISCatalogManager.class.getName());
- private static final String DEBUG_LEVEL = System.getProperty(CATALOG_DEBUG_KEY);
+ private static String DEBUG_LEVEL = null;
+ static {
+ DEBUG_LEVEL = (String)
+ AccessController.doPrivileged(
+ new PrivilegedAction() {
+
+ public Object run() {
+ try {
+ return System.getProperty(CATALOG_DEBUG_KEY);
+ } catch (Throwable t) {
+ return null;
+ }
+ }
+ });
+ }
/** The static catalog used by this manager. */
private Catalog staticCatalog = null;
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java?rev=636969&r1=636968&r2=636969&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java Thu Mar 13 19:53:23 2008
@@ -9,6 +9,7 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.catalog.impl.OASISCatalogManager;
import org.apache.axis2.jaxws.catalog.JAXWSCatalogManager;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -39,6 +40,7 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLDecoder;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -96,7 +98,7 @@
File tempFile = (File) axisConfiguration.getParameterValue(
Constants.Configuration.ARTIFACTS_TEMP_DIR);
if (tempFile == null) {
- tempFile = new File(System.getProperty("java.io.tmpdir"), "_axis2");
+ tempFile = new File(getProperty_doPriv("java.io.tmpdir"), "_axis2");
}
Parameter servletConfigParam = axisConfiguration
@@ -506,7 +508,7 @@
* @param property
*/
private static void getClassPathFromDirectoryProperty(HashSet classpath, String property) {
- String dirs = System.getProperty(property);
+ String dirs = getProperty_doPriv(property);
String path = null;
try {
path = expandDirs(dirs);
@@ -518,6 +520,20 @@
}
}
+ private static String getProperty_doPriv(final String property) {
+ return (String)
+ AccessController.doPrivileged(
+ new PrivilegedAction() {
+
+ public Object run() {
+ try {
+ return System.getProperty(property);
+ } catch (Throwable t) {
+ return null;
+ }
+ }
+ });
+ }
/**
* Add a classpath stored in a property.
*
@@ -525,7 +541,7 @@
* @param property
*/
private static void getClassPathFromProperty(HashSet classpath, String property) {
- String path = System.getProperty(property);
+ String path = getProperty_doPriv(property);
if (path != null) {
addPath(classpath, path);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org