geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r160229 - in geronimo/trunk/modules: axis-builder/src/java/org/apache/geronimo/axis/builder/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ jetty-builder/src/java/org/apache/geronimo/jetty/deployment/
Date Tue, 05 Apr 2005 22:09:16 GMT
Author: djencks
Date: Tue Apr  5 15:09:14 2005
New Revision: 160229

URL: http://svn.apache.org/viewcvs?view=rev&rev=160229
Log:
Much better ws exception mapping

Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java
    geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&r1=160228&r2=160229
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Tue Apr  5 15:09:14 2005
@@ -106,9 +106,9 @@
 
 
     //WebServiceBuilder
-    public void configurePOJO(GBeanData targetGBean, Object portInfoObject, String seiClassName,
ClassLoader classLoader) throws DeploymentException {
+    public void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject,
String seiClassName, ClassLoader classLoader) throws DeploymentException {
         PortInfo portInfo = (PortInfo) portInfoObject;
-        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
+        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(moduleFile, portInfo,
classLoader);
         JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
 
         Class pojoClass = null;
@@ -325,6 +325,7 @@
         ServiceEndpointMethodMappingType[] methodMappings = endpointMapping.getServiceEndpointMethodMappingArray();
         int i = 0;
         Set wrapperElementQNames = new HashSet();
+        JavaXmlTypeMappingType[] javaXmlTypeMappings = mapping.getJavaXmlTypeMappingArray();
         for (Iterator ops = operations.iterator(); ops.hasNext();) {
             Operation operation = (Operation) ops.next();
             String operationName = operation.getName();
@@ -343,12 +344,11 @@
                 throw new DeploymentException("No BindingOperation for operation: " + operationName
+ ", input: " + operation.getInput().getName() + ", output: " + (operation.getOutput() ==
null ? "<none>" : operation.getOutput().getName()));
             }
             ServiceEndpointMethodMappingType methodMapping = WSDescriptorParser.getMethodMappingForOperation(operationName,
methodMappings);
-            HeavyweightOperationDescBuilder operationDescBuilder = new HeavyweightOperationDescBuilder(bindingOperation,
mapping, methodMapping, portStyle, exceptionMap, complexTypeMap, elementMap, classLoader,
enhancedServiceEndpointClass);
+            HeavyweightOperationDescBuilder operationDescBuilder = new HeavyweightOperationDescBuilder(bindingOperation,
mapping, methodMapping, portStyle, exceptionMap, complexTypeMap, elementMap, javaXmlTypeMappings,
classLoader, enhancedServiceEndpointClass);
             OperationInfo operationInfo = operationDescBuilder.buildOperationInfo(soapVersion);
             operationInfos[i++] = operationInfo;
             wrapperElementQNames.addAll(operationDescBuilder.getWrapperElementQNames());
         }
-        JavaXmlTypeMappingType[] javaXmlTypeMappings = mapping.getJavaXmlTypeMappingArray();
         List typeMappings = new ArrayList();
         Map typeDescriptors = new HashMap();
         buildTypeInfoHeavyweight(wrapperElementQNames, javaXmlTypeMappings, schemaTypeKeyToSchemaTypeMap,
classLoader, typeMappings, typeDescriptors);
@@ -471,16 +471,12 @@
                 deserializerFactoryClass = ArrayDeserializerFactory.class;
             }
 
-            TypeDesc typeDesc = getTypeDescriptor(clazz, typeName, javaXmlTypeMapping, schemaType);
+            TypeDesc typeDesc = TypeDescBuilder.getTypeDescriptor(clazz, typeName, javaXmlTypeMapping,
schemaType);
 
             TypeMappingInfo typeMappingInfo = new TypeMappingInfo(clazz, typeName, serializerFactoryClass,
deserializerFactoryClass);
             typeMappings.add(typeMappingInfo);
             typeDescriptors.put(clazz, typeDesc);
         }
-    }
-
-    private static TypeDesc getTypeDescriptor(Class javaClass, QName typeQName, JavaXmlTypeMappingType
javaXmlTypeMapping, SchemaType schemaType) throws DeploymentException {
-        return TypeDescBuilder.getTypeDescriptor(javaClass, typeQName, javaXmlTypeMapping,
schemaType);
     }
 
     private Class getServiceEndpointInterfaceLightweight(PortType portType, JavaWsdlMappingType
mappings, ClassLoader classLoader) throws DeploymentException {

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java?view=diff&r1=160228&r2=160229
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
Tue Apr  5 15:09:14 2005
@@ -70,7 +70,7 @@
 
         // Grab the portInfo for this ejb
         PortInfo portInfo = (PortInfo) portComponentsMap.get(ejbName);
-        JavaServiceDesc serviceDesc = createServiceDesc(portInfo, classLoader);
+        JavaServiceDesc serviceDesc = createServiceDesc(jarFile, portInfo, classLoader);
         List handlerInfos = createHandlerInfos(portInfo, classLoader);
         return new ServiceInfo(serviceDesc, handlerInfos);
     }
@@ -86,7 +86,7 @@
 
         // Grab the portInfo for this ejb
         PortInfo portInfo = (PortInfo) portComponentsMap.get(ejbName);
-        return createServiceDesc(portInfo, classLoader);
+        return createServiceDesc(jarFile, portInfo, classLoader);
     }
 
     private static List createHandlerInfos(PortInfo portInfo, ClassLoader classLoader) throws
DeploymentException {
@@ -129,13 +129,13 @@
         return list;
     }
 
-    public static ServiceInfo createServiceInfo(PortInfo portInfo, ClassLoader classLoader)
throws DeploymentException {
-        JavaServiceDesc serviceDesc = createServiceDesc(portInfo, classLoader);
+    public static ServiceInfo createServiceInfo(JarFile moduleFile, PortInfo portInfo, ClassLoader
classLoader) throws DeploymentException {
+        JavaServiceDesc serviceDesc = createServiceDesc(moduleFile, portInfo, classLoader);
         List handlerInfos = createHandlerInfos(portInfo, classLoader);
         return new ServiceInfo(serviceDesc, handlerInfos);
     }
 
-    public static JavaServiceDesc createServiceDesc(PortInfo portInfo, ClassLoader classLoader)
throws DeploymentException {
+    public static JavaServiceDesc createServiceDesc(JarFile moduleFile, PortInfo portInfo,
ClassLoader classLoader) throws DeploymentException {
 
         Port port = portInfo.getPort();
 //        System.out.println("port = " + port);
@@ -148,7 +148,7 @@
         }
 
         Map exceptionMap = WSDescriptorParser.getExceptionMap(portInfo.getJavaWsdlMapping());
-        SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(null, portInfo.getDefinition());
+        SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(moduleFile, portInfo.getDefinition());
         Map schemaTypeKeyToSchemaTypeMap = schemaInfoBuilder.getSchemaTypeKeyToSchemaTypeMap();
         Map complexTypeMap = schemaInfoBuilder.getComplexTypesInWsdl();
         Map elementMap = schemaInfoBuilder.getElementToTypeMap();
@@ -324,7 +324,8 @@
                 String operationName = bindingOperation.getOperation().getName();
                 ServiceEndpointMethodMappingType[] methodMappings = portInfo.getServiceEndpointInterfaceMapping().getServiceEndpointMethodMappingArray();
                 ServiceEndpointMethodMappingType methodMapping = WSDescriptorParser.getMethodMappingForOperation(operationName,
methodMappings);
-                operationDescBuilder = new HeavyweightOperationDescBuilder(bindingOperation,
portInfo.getJavaWsdlMapping(), methodMapping, Style.RPC, exceptionMap, complexTypeMap, elementMap,
classLoader, serviceEndpointInterface);
+                JavaXmlTypeMappingType[] javaXmlTypeMappingTypes = portInfo.getJavaWsdlMapping().getJavaXmlTypeMappingArray();
+                operationDescBuilder = new HeavyweightOperationDescBuilder(bindingOperation,
portInfo.getJavaWsdlMapping(), methodMapping, Style.RPC, exceptionMap, complexTypeMap, elementMap,
javaXmlTypeMappingTypes, classLoader, serviceEndpointInterface);
                 Set wrappedElementQNamesForOper = ((HeavyweightOperationDescBuilder) operationDescBuilder).getWrapperElementQNames();
                 wrappedElementQNames.addAll(wrappedElementQNamesForOper);
             }

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java?view=diff&r1=160228&r2=160229
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
Tue Apr  5 15:09:14 2005
@@ -58,6 +58,7 @@
 import org.apache.xmlbeans.SchemaProperty;
 import org.apache.xmlbeans.SchemaType;
 import org.objectweb.asm.Type;
+import org.apache.geronimo.xbeans.j2ee.JavaXmlTypeMappingType;
 
 public class HeavyweightOperationDescBuilder extends OperationDescBuilder {
 
@@ -72,7 +73,9 @@
     private final Map elementMap;
     private final ClassLoader classLoader;
     private final boolean wrappedStype;
-    
+    private final Map publicTypes = new HashMap();
+    private final Map anonymousTypes = new HashMap();
+
     /* Keep track of in and out parameter names so we can verify that
      * everything has been mapped and mapped correctly
      */
@@ -84,8 +87,8 @@
      * Track the wrapper elements
      */
     private final Set wrapperElementQNames = new HashSet();
-    
-    public HeavyweightOperationDescBuilder(BindingOperation bindingOperation, JavaWsdlMappingType
mapping, ServiceEndpointMethodMappingType methodMapping, Style defaultStyle, Map exceptionMap,
Map complexTypeMap, Map elementMap, ClassLoader classLoader, Class serviceEndpointInterface)
throws DeploymentException {
+
+    public HeavyweightOperationDescBuilder(BindingOperation bindingOperation, JavaWsdlMappingType
mapping, ServiceEndpointMethodMappingType methodMapping, Style defaultStyle, Map exceptionMap,
Map complexTypeMap, Map elementMap, JavaXmlTypeMappingType[] javaXmlTypeMappingTypes, ClassLoader
classLoader, Class serviceEndpointInterface) throws DeploymentException {
         super(bindingOperation);
         this.mapping = mapping;
         this.methodMapping = methodMapping;
@@ -93,6 +96,17 @@
         this.exceptionMap = exceptionMap;
         this.complexTypeMap = complexTypeMap;
         this.elementMap = elementMap;
+        for (int i = 0; i < javaXmlTypeMappingTypes.length; i++) {
+            JavaXmlTypeMappingType javaXmlTypeMappingType = javaXmlTypeMappingTypes[i];
+            String javaClassName = javaXmlTypeMappingType.getJavaType().getStringValue().trim();
+            if (javaXmlTypeMappingType.isSetAnonymousTypeQname()) {
+                String anonymousTypeQName = javaXmlTypeMappingType.getAnonymousTypeQname().getStringValue().trim();
+                anonymousTypes.put(anonymousTypeQName, javaClassName);
+            } else if (javaXmlTypeMappingType.isSetRootTypeQname()) {
+                QName qname = javaXmlTypeMappingType.getRootTypeQname().getQNameValue();
+                publicTypes.put(qname, javaClassName);
+            }
+        }
         this.classLoader = classLoader;
         this.serviceEndpointInterface = serviceEndpointInterface;
         BindingInput bindingInput = bindingOperation.getBindingInput();
@@ -102,7 +116,7 @@
 
     public Set getWrapperElementQNames() throws DeploymentException {
         buildOperationDesc();
-        
+
         return Collections.unmodifiableSet(wrapperElementQNames);
     }
 
@@ -340,38 +354,35 @@
                 SchemaProperty property = properties[i];
                 QName elementName = property.getName();
                 SchemaType elementType = property.getType();
-                QName elementTypeQName = elementType.getName();
-                elementMap.put(elementName.getLocalPart(), elementTypeQName);
+                elementMap.put(elementName.getLocalPart(), elementType);
             }
-//                LocalElement[] elements = explicitGroup.getElementArray();
-//                for (int i = 0; i < elements.length; i++) {
-//                    LocalElement element = elements[i];
-//                    String elementName = element.getName();
-//                    QName elementType = element.getType();
-//                    elementMap.put(elementName, elementType);
-//                }
             ArrayList parameterTypes = new ArrayList();
             ConstructorParameterOrderType constructorParameterOrder = exceptionMapping.getConstructorParameterOrder();
             for (int i = 0; i < constructorParameterOrder.getElementNameArray().length;
i++) {
                 String elementName = constructorParameterOrder.getElementNameArray(i).getStringValue().trim();
-                QName elementType = (QName) elementMap.get(elementName);
+                SchemaType elementType = (SchemaType) elementMap.get(elementName);
                 Class javaElementType;
-                if (complexTypeMap.containsKey(elementType)) {
-                    String packageName = WSDescriptorParser.getPackageFromNamespace(elementType.getNamespaceURI(),
mapping);
-                    String javaElementTypeName = packageName + "." + elementType.getLocalPart();
-                    try {
-                        javaElementType = ClassLoading.loadClass(javaElementTypeName, classLoader);
-                    } catch (ClassNotFoundException e) {
-                        throw new DeploymentException("Could not load exception constructor
parameter", e);
+
+                QName elementTypeQName = elementType.getName();
+                if (elementTypeQName != null) {
+                    if (complexTypeMap.containsKey(elementType)) {
+                        String javaClassName = (String) publicTypes.get(elementTypeQName);
+                        javaElementType = getJavaClass(javaClassName);
+                    } else if (qnameToClassMap.containsKey(elementType)) {
+                        javaElementType = (Class) qnameToClassMap.get(elementType);
+                    } else {
+                        throw new DeploymentException("Unknown type: " + elementType + "
of name: " + elementName);
                     }
-                } else if (qnameToClassMap.containsKey(elementType)) {
-                    javaElementType = (Class) qnameToClassMap.get(elementType);
                 } else {
-                    throw new DeploymentException("Unknown type: " + elementType);
+                    //anonymous type
+                    //anonymous type qname is constructed using rules 1.b and 2.b
+                    String anonymousQName = complexType.getName().getNamespaceURI() + ":>"
+ complexType.getName().getLocalPart() + ">" + elementName;
+                    String javaClassName = (String) anonymousTypes.get(anonymousQName);
+                    javaElementType = getJavaClass(javaClassName);
                 }
                 //todo faultTypeQName is speculative
                 //todo outheader might be true!
-                ParameterDesc parameterDesc = new ParameterDesc(faultTypeQName, ParameterDesc.OUT,
elementType, javaElementType, false, false);
+                ParameterDesc parameterDesc = new ParameterDesc(faultTypeQName, ParameterDesc.OUT,
elementTypeQName, javaElementType, false, false);
                 parameterTypes.add(parameterDesc);
             }
             faultDesc.setParameters(parameterTypes);
@@ -379,6 +390,15 @@
         return faultDesc;
     }
 
+    private Class getJavaClass(String javaClassName) throws DeploymentException {
+        try {
+            Class javaClass = ClassLoading.loadClass(javaClassName, classLoader);
+            return javaClass;
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException("Could not load class", e);
+        }
+    }
+
     private void mapReturnType() throws DeploymentException {
         QName returnType = null;
         QName returnQName = null;
@@ -406,7 +426,7 @@
             if (outParamNames.contains(wsdlMessagePartName)) {
                 throw new DeploymentException("output message part " + wsdlMessagePartName
+ " has both an INOUT or OUT mapping and a return value mapping for operation " + operationName);
             }
-            
+
             if (wrappedStype) {
                 Part outPart = getWrappedPart(output);
                 SchemaParticle returnParticle = getWrapperChild(outPart, wsdlMessagePartName);
@@ -452,7 +472,7 @@
 
         QName paramQName;
         QName paramTypeQName;
-        
+
         Part part = null;
         SchemaParticle inParameter = null;
         if (isInParam) {
@@ -465,7 +485,7 @@
                 // the local name of the global element refered by the part is equal to the
operation name
                 QName name = inPart.getElementName();
                 if (false == name.getLocalPart().equals(operationName)) {
-                    throw new DeploymentException("message " + input.getQName() + " refers
to a global element named " +  
+                    throw new DeploymentException("message " + input.getQName() + " refers
to a global element named " +
                             name.getLocalPart() + ", which is not equal to the operation
name " + operationName);
                 }
                 inParameter = getWrapperChild(inPart, wsdlMessagePartName);
@@ -489,7 +509,7 @@
                     Part outPart = getWrappedPart(input);
                     SchemaParticle outParameter = getWrapperChild(outPart, wsdlMessagePartName);
                     if (inParameter.getType() != outParameter.getType()) {
-                        throw new DeploymentException("The wrapper children " + wsdlMessagePartName
+ 
+                        throw new DeploymentException("The wrapper children " + wsdlMessagePartName
+
                                 " do not have the same type for operation " + operationName);
                     }
                 } else {
@@ -552,18 +572,18 @@
         // in case of wrapped element, the message has only one part.
         Collection parts = message.getParts().values();
         if (1 != parts.size()) {
-            throw new DeploymentException("message " + message.getQName() + " has " + parts.size()
+ 
-                    " parts and should only have one as wrapper style mapping is specified
for operation " + 
+            throw new DeploymentException("message " + message.getQName() + " has " + parts.size()
+
+                    " parts and should only have one as wrapper style mapping is specified
for operation " +
                     operationName);
         }
         return (Part) parts.iterator().next();
     }
-    
+
     private SchemaParticle getWrapperChild(Part part, String wsdlMessagePartName) throws
DeploymentException {
         QName name = part.getElementName();
-        
+
         wrapperElementQNames.add(name);
-        
+
         SchemaType operationType = (SchemaType) complexTypeMap.get(name);
         if (null == operationType) {
             throw new DeploymentException("No global element named " + name + " for operation
" + operationName);
@@ -588,7 +608,7 @@
                 }
             }
             throw new DeploymentException("Global element named " + name +
-                    " does not define a child element named " + wsdlMessagePartName + 
+                    " does not define a child element named " + wsdlMessagePartName +
                     " required by the operation " + operationName);
         } else {
             throw new DeploymentException("Global element named " + name +

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java?view=diff&r1=160228&r2=160229
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
Tue Apr  5 15:09:14 2005
@@ -396,7 +396,7 @@
             InputStream wsdlInputStream = null;
             try {
                 ZipEntry entry = moduleFile.getEntry(location.toString());
-                System.out.println("entry: " + entry.getName());
+//                System.out.println("entry: " + entry.getName());
                 wsdlInputStream = moduleFile.getInputStream(entry);
 //                byte[] buf = new byte[1024];
 //                int i;

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java?view=diff&r1=160228&r2=160229
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/POJOWebServiceBuilder.java
Tue Apr  5 15:09:14 2005
@@ -18,6 +18,7 @@
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanData;
+import java.util.jar.JarFile;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -30,11 +31,12 @@
      * The GBeanData will be for a ServletHolder like gbean that is adapted to holding a
ws stack that talks to a
      * POJO web service.  The web deployer is responsible for filling in the standard servlet
info such as init params.
      * @param targetGBean
+     * @param moduleFile
      * @param portInfo
      * @param seiClassName
      * @throws DeploymentException
      */
-    void configurePOJO(GBeanData targetGBean, Object portInfo, String seiClassName, ClassLoader
classLoader) throws DeploymentException;
+    void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfo, String
seiClassName, ClassLoader classLoader) throws DeploymentException;
 
     /**
      * configure the supplied EJBContainer gbeandata to implement the ejb web service described
in the deployment descriptor

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&r1=160228&r2=160229
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Tue Apr  5 15:09:14 2005
@@ -702,11 +702,11 @@
 
             //set up servlet gbeans.
             ServletType[] servletTypes = webApp.getServletArray();
-            Map portMap = ((WebModule)module).getPortMap();
+            Map portMap = webModule.getPortMap();
 
             for (int i = 0; i < servletTypes.length; i++) {
                 ServletType servletType = servletTypes[i];
-                addServlet(webModuleName, servletType, servletMappings, securityRoles, portMap,
webClassLoader, moduleJ2eeContext, earContext);
+                addServlet(webModuleName, webModule.getModuleFile(), servletType, servletMappings,
securityRoles, portMap, webClassLoader, moduleJ2eeContext, earContext);
             }
         } catch (DeploymentException de) {
             throw de;
@@ -735,10 +735,12 @@
     }
 
     private void addServlet(ObjectName webModuleName,
+                            JarFile moduleFile,
                             ServletType servletType,
                             Map servletMappings,
                             Set securityRoles,
-                            Map portMap, ClassLoader webClassLoader,
+                            Map portMap,
+                            ClassLoader webClassLoader,
                             J2eeContext moduleJ2eeContext,
                             EARContext earContext) throws MalformedObjectNameException, DeploymentException
{
         String servletName = servletType.getServletName().getStringValue().trim();
@@ -773,7 +775,7 @@
                 if (portInfo == null) {
                     throw new DeploymentException("No web service deployment info for servlet
name " + servletName);
                 }
-                pojoWebServiceBuilder.configurePOJO(servletData, portInfo, servletClassName,
webClassLoader);
+                pojoWebServiceBuilder.configurePOJO(servletData, moduleFile, portInfo, servletClassName,
webClassLoader);
             }
         } else if (servletType.isSetJspFile()) {
             servletData = new GBeanData(servletObjectName, JettyServletHolder.GBEAN_INFO);



Mime
View raw message