JBossWS SVN: r11137 - in stack/metro/trunk/modules: testsuite/metro-tests and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2009-11-20 02:38:42 -0500 (Fri, 20 Nov 2009)
New Revision: 11137
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2820/
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2820/InvokerEJB3Test.java
Modified:
stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/InvokerEJB3.java
stack/metro/trunk/modules/testsuite/metro-tests/pom.xml
Log:
[JBWS-2820]:Applied Andreas Wuest's patch. Thanks Andreas
Modified: stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/InvokerEJB3.java
===================================================================
--- stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/InvokerEJB3.java 2009-11-19 15:50:30 UTC (rev 11136)
+++ stack/metro/trunk/modules/server/src/main/java/org/jboss/wsf/stack/metro/InvokerEJB3.java 2009-11-20 07:38:42 UTC (rev 11137)
@@ -24,6 +24,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import javax.ejb.EJBAccessException;
import javax.ejb.EJBException;
import javax.xml.ws.Provider;
import javax.xml.ws.WebFault;
@@ -109,9 +110,11 @@
return retObj;
}
- private void handleException(Exception ex)
+ protected void handleException(Exception ex)
throws InvocationTargetException, IllegalAccessException
{
+ final Exception originalException = ex;
+
//Unwrap EJBException
if (ex instanceof EJBException)
ex = ((EJBException)ex).getCausedByException();
@@ -122,6 +125,10 @@
if (ex instanceof IllegalAccessException)
throw (IllegalAccessException)ex;
+ if (ex == null && originalException instanceof EJBAccessException)
+ throw new IllegalAccessException(originalException.getMessage());
+
+
//check if this is a declared fault; Metro expects an InvocationTargetException
//for declared faults also when calling an EJB3 endpoint
if (ex.getClass().isAnnotationPresent(WebFault.class))
Modified: stack/metro/trunk/modules/testsuite/metro-tests/pom.xml
===================================================================
--- stack/metro/trunk/modules/testsuite/metro-tests/pom.xml 2009-11-19 15:50:30 UTC (rev 11136)
+++ stack/metro/trunk/modules/testsuite/metro-tests/pom.xml 2009-11-20 07:38:42 UTC (rev 11137)
@@ -20,6 +20,11 @@
<artifactId>jbossws-metro-client</artifactId>
<version>${version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws.metro</groupId>
+ <artifactId>jbossws-metro-server</artifactId>
+ <version>${version}</version>
+ </dependency>
</dependencies>
<!-- Profiles -->
Added: stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2820/InvokerEJB3Test.java
===================================================================
--- stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2820/InvokerEJB3Test.java (rev 0)
+++ stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2820/InvokerEJB3Test.java 2009-11-20 07:38:42 UTC (rev 11137)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2820;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.ejb.EJBAccessException;
+
+import org.jboss.wsf.stack.metro.InvokerEJB3;
+
+import junit.framework.TestCase;
+
+import com.sun.xml.ws.api.server.InstanceResolver;
+
+/**
+ * @author Andreas Wuest
+ *
+ */
+public class InvokerEJB3Test extends TestCase
+{
+
+ public void testHandleException()
+ {
+ CustomInvokerEJB3 invoker = new CustomInvokerEJB3(null);
+ try
+ {
+ invoker.runHandleException(new EJBAccessException("authentication failure."));
+ fail("expect InvokerEjB3 throws exception");
+ }
+ catch (InvocationTargetException e)
+ {
+ fail("InvocationTargetException is not expected");
+ }
+ catch (IllegalAccessException e)
+ {
+ assertTrue("authentication failure.".equals(e.getMessage()));
+ }
+ }
+
+ private final class CustomInvokerEJB3 extends InvokerEJB3
+ {
+ public CustomInvokerEJB3(InstanceResolver resolver)
+ {
+ super(resolver);
+ }
+
+ public void runHandleException(Exception ex) throws InvocationTargetException, IllegalAccessException
+ {
+ super.handleException(ex);
+ }
+ }
+
+}
14 years, 5 months
JBossWS SVN: r11136 - stack/native/tags/jbossws-native-2.0.1.SP2_CP07.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-11-19 10:50:30 -0500 (Thu, 19 Nov 2009)
New Revision: 11136
Modified:
stack/native/tags/jbossws-native-2.0.1.SP2_CP07/version.properties
Log:
[JBPAPP-3128] Fixing version.properties
Modified: stack/native/tags/jbossws-native-2.0.1.SP2_CP07/version.properties
===================================================================
--- stack/native/tags/jbossws-native-2.0.1.SP2_CP07/version.properties 2009-11-19 13:46:58 UTC (rev 11135)
+++ stack/native/tags/jbossws-native-2.0.1.SP2_CP07/version.properties 2009-11-19 15:50:30 UTC (rev 11136)
@@ -6,8 +6,8 @@
specification.vendor=JBoss (http://www.jboss.org)
specification.version=jbossws-2.0
-version.id=2.0.1.SP2_CP-SNAPSHOT
-repository.id=2.0.1.SP2_CP-SNAPSHOT
+version.id=2.0.1.SP2_CP07
+repository.id=2.0.1.SP2_CP07
implementation.title=JBoss Web Services - Native
implementation.url=http://www.jboss.org/products/jbossws
14 years, 5 months
JBossWS SVN: r11135 - stack/metro/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-11-19 08:46:58 -0500 (Thu, 19 Nov 2009)
New Revision: 11135
Modified:
stack/metro/trunk/pom.xml
Log:
Moving to spi snapshot
Modified: stack/metro/trunk/pom.xml
===================================================================
--- stack/metro/trunk/pom.xml 2009-11-19 13:45:35 UTC (rev 11134)
+++ stack/metro/trunk/pom.xml 2009-11-19 13:46:58 UTC (rev 11135)
@@ -46,7 +46,7 @@
<properties>
<jbossws.common.version>1.2.2-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>3.2.2-SNAPSHOT</jbossws.framework.version>
- <jbossws.spi.version>1.2.1.GA</jbossws.spi.version>
+ <jbossws.spi.version>1.2.2-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss500.version>3.2.1.GA</jbossws.jboss500.version>
<jbossws.jboss501.version>3.2.1.GA</jbossws.jboss501.version>
<jbossws.jboss510.version>3.2.1.GA</jbossws.jboss510.version>
14 years, 5 months
JBossWS SVN: r11134 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-11-19 08:45:35 -0500 (Thu, 19 Nov 2009)
New Revision: 11134
Modified:
stack/native/trunk/pom.xml
Log:
Moving to spi snapshot
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2009-11-19 12:22:03 UTC (rev 11133)
+++ stack/native/trunk/pom.xml 2009-11-19 13:45:35 UTC (rev 11134)
@@ -49,7 +49,7 @@
<properties>
<jbossws.common.version>1.2.2-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>3.2.2-SNAPSHOT</jbossws.framework.version>
- <jbossws.spi.version>1.2.1.GA</jbossws.spi.version>
+ <jbossws.spi.version>1.2.2-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss500.version>3.2.1.GA</jbossws.jboss500.version>
<jbossws.jboss501.version>3.2.1.GA</jbossws.jboss501.version>
<jbossws.jboss510.version>3.2.1.GA</jbossws.jboss510.version>
14 years, 5 months
JBossWS SVN: r11133 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-11-19 07:22:03 -0500 (Thu, 19 Nov 2009)
New Revision: 11133
Modified:
stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss520.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
Log:
[JBWS-2809] Enabling tests
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-11-19 12:14:21 UTC (rev 11132)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-11-19 12:22:03 UTC (rev 11133)
@@ -41,6 +41,3 @@
# [JBWS-2397] Fix jbws1797 testcase
org/jboss/test/ws/jaxws/jbws1797/**
-
-# [JBWS-2809] Investigate why MemoryBufferRecorderTestCase is failing
-org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-11-19 12:14:21 UTC (rev 11132)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-11-19 12:22:03 UTC (rev 11133)
@@ -41,6 +41,3 @@
# [JBWS-2397] Fix jbws1797 testcase
org/jboss/test/ws/jaxws/jbws1797/**
-
-# [JBWS-2809] Investigate why MemoryBufferRecorderTestCase is failing
-org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-11-19 12:14:21 UTC (rev 11132)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-11-19 12:22:03 UTC (rev 11133)
@@ -41,6 +41,3 @@
# [JBWS-2397] Fix jbws1797 testcase
org/jboss/test/ws/jaxws/jbws1797/**
-
-# [JBWS-2809] Investigate why MemoryBufferRecorderTestCase is failing
-org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss520.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss520.txt 2009-11-19 12:14:21 UTC (rev 11132)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss520.txt 2009-11-19 12:22:03 UTC (rev 11133)
@@ -47,6 +47,3 @@
# [JBWS-2397] Fix jbws1797 testcase
org/jboss/test/ws/jaxws/jbws1797/**
-
-# [JBWS-2809] Investigate why MemoryBufferRecorderTestCase is failing
-org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-11-19 12:14:21 UTC (rev 11132)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-11-19 12:22:03 UTC (rev 11133)
@@ -41,6 +41,3 @@
# [JBWS-2397] Fix jbws1797 testcase
org/jboss/test/ws/jaxws/jbws1797/**
-
-# [JBWS-2809] Investigate why MemoryBufferRecorderTestCase is failing
-org/jboss/test/ws/management/recording/MemoryBufferRecorderTestCase.*
14 years, 5 months
JBossWS SVN: r11132 - in stack/cxf/trunk: modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-11-19 07:14:21 -0500 (Thu, 19 Nov 2009)
New Revision: 11132
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config.xml
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf.sar/META-INF/spring.schemas
stack/cxf/trunk/pom.xml
Log:
[JBWS-2828] Moving to Apache CXF 2.2.5: installing custom ResourceResolver, patching JBossWSCXFConfigurer to deal with new reusable CXF factories
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2009-11-19 12:06:59 UTC (rev 11131)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2009-11-19 12:14:21 UTC (rev 11132)
@@ -26,6 +26,7 @@
import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.jaxb.JAXBDataBinding;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
@@ -95,9 +96,21 @@
if (customization != null)
{
//customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
- setBindingCustomization(factory.getServiceFactory().getDataBinding(), customization);
+ ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
+ serviceFactory.reset();
+ DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
+ setBindingCustomization(serviceFactoryDataBinding, customization);
+ serviceFactory.setDataBinding(serviceFactoryDataBinding);
//customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
- setBindingCustomization(factory.getDataBinding(), customization);
+ if (factory.getDataBinding() == null)
+ {
+ //set the service factory's databinding to prevent CXF resetting everything because user did not provide anything
+ factory.setDataBinding(serviceFactoryDataBinding);
+ }
+ else
+ {
+ setBindingCustomization(factory.getDataBinding(), customization);
+ }
}
//add other configurations here below
}
@@ -113,9 +126,21 @@
if (customization != null)
{
//customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
- setBindingCustomization(factory.getServiceFactory().getDataBinding(), customization);
+ ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
+ serviceFactory.reset();
+ DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
+ setBindingCustomization(serviceFactoryDataBinding, customization);
+ serviceFactory.setDataBinding(serviceFactoryDataBinding);
//customize user provided databinding (CXF later overrides the ServiceFactory databinding using the user provided one)
- setBindingCustomization(factory.getDataBinding(), customization);
+ if (factory.getDataBinding() == null)
+ {
+ //set the service factory's databinding to prevent CXF resetting everything because user did not provide anything
+ factory.setDataBinding(serviceFactoryDataBinding);
+ }
+ else
+ {
+ setBindingCustomization(factory.getDataBinding(), customization);
+ }
}
//add other configurations here below
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2009-11-19 12:06:59 UTC (rev 11131)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2009-11-19 12:14:21 UTC (rev 11132)
@@ -40,12 +40,13 @@
import org.apache.cxf.binding.soap.SoapTransportFactory;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerImpl;
import org.apache.cxf.endpoint.ServerRegistry;
import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.management.InstrumentationManager;
import org.apache.cxf.management.counters.CounterRepository;
+import org.apache.cxf.resource.ResourceManager;
+import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.transport.DestinationFactoryManager;
import org.apache.cxf.transport.jms.AddressType;
import org.apache.cxf.transport.jms.JMSDestination;
@@ -139,6 +140,14 @@
ServletContext context = servletConfig.getServletContext();
String contextPath = context.getContextPath();
endpoint = initServiceEndpoint(contextPath);
+
+ //Install the JBossWS resource resolver
+ ResourceResolver resourceResolver = endpoint.getAttachment(ResourceResolver.class);
+ if (resourceResolver != null)
+ {
+ bus.getExtension(ResourceManager.class).addResourceResolver(resourceResolver);
+ }
+
//Add customization check to use default CXF configurer
BindingCustomization customization = endpoint.getAttachment(BindingCustomization.class);
if (customization != null) {
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2009-11-19 12:06:59 UTC (rev 11131)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2009-11-19 12:14:21 UTC (rev 11132)
@@ -26,6 +26,10 @@
import java.util.HashMap;
import java.util.Map;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.soap.SOAPBinding;
+
import org.jboss.logging.Logger;
import org.jboss.wsf.common.integration.WSConstants;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -36,10 +40,6 @@
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
import org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.soap.MTOM;
-
/**
* A deployer that locates or generates cxf.xml
*
@@ -140,7 +140,7 @@
{
// get resource URL
ArchiveDeployment archDep = (ArchiveDeployment)dep;
- cxfURL = archDep.getMetaDataFileURL(metadir + "/jbossws-cxf.xml");
+ cxfURL = archDep.getResourceResolver().resolve(metadir + "/jbossws-cxf.xml");
log.info("JBossWS-CXF configuration found: " + cxfURL);
}
catch (IOException ignore)
@@ -202,6 +202,7 @@
* @param cxfURL CXF DD URL
* @see org.jboss.wsf.common.integration.WSConstants.STACK_CONTEXT_PARAMS
*/
+ @SuppressWarnings("unchecked")
private void putCXFConfigToDeployment(Deployment dep, URL cxfURL)
{
// get property map
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java 2009-11-19 12:14:21 UTC (rev 11132)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.cxf.resource.ResourceResolver;
+import org.jboss.logging.Logger;
+
+/**
+ * A CXF resource resolver that uses the JBossWS spi resource resolver,
+ * which in turn uses unified virtual files to access resources attached
+ * to the deployment (via JBoss VFS).
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 17-Nov-2009
+ *
+ */
+public class JBossWSResourceResolver implements ResourceResolver
+{
+ private static Logger log = Logger.getLogger(JBossWSResourceResolver.class);
+ private org.jboss.wsf.spi.deployment.ResourceResolver resolver;
+
+ public JBossWSResourceResolver(org.jboss.wsf.spi.deployment.ResourceResolver resolver)
+ {
+ this.resolver = resolver;
+ }
+
+ public InputStream getAsStream(String resourcePath)
+ {
+ URL url = resolve(resourcePath, URL.class);
+ if (url != null)
+ {
+ try
+ {
+ return url.openStream();
+ }
+ catch (IOException ioe)
+ {
+ log.warn("Cannot open stream for resource: " + resourcePath);
+ }
+ }
+ return null;
+ }
+
+ public <T> T resolve(String resourcePath, Class<T> resourceType)
+ {
+ URL url = null;
+ try
+ {
+ url = resolver.resolve(resourcePath);
+ }
+ catch (IOException ioe)
+ {
+ log.warn("Cannot resolve resource: " + resourcePath);
+ }
+ if (url != null && resourceType.isInstance(url))
+ {
+ return resourceType.cast(url);
+ }
+ return null;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java 2009-11-19 12:14:21 UTC (rev 11132)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf;
+
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.ResourceResolver;
+
+/**
+ * A deployment aspect for attaching a custom JBoss resources resolver to the endpoint;
+ * CXF requires a ResourceResolver for getting wsdl, xsd, etc. correctly when they're
+ * not reachable using the context classloader (for instance if they're out of
+ * WEB-INF/classes in a war deployed on AS 5 or greater - see. JBAS-5151)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Nov-2009
+ */
+public class ResourceResolverDeploymentAspect extends DeploymentAspect
+{
+ @Override
+ public void start(Deployment dep)
+ {
+ if (dep instanceof ArchiveDeployment)
+ {
+ ResourceResolver resolver = ((ArchiveDeployment)dep).getResourceResolver();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ep.addAttachment(org.apache.cxf.resource.ResourceResolver.class, new JBossWSResourceResolver(resolver));
+ }
+ }
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ if (dep instanceof ArchiveDeployment)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ep.removeAttachment(org.apache.cxf.resource.ResourceResolver.class);
+ }
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config.xml
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config.xml 2009-11-19 12:06:59 UTC (rev 11131)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config.xml 2009-11-19 12:14:21 UTC (rev 11132)
@@ -51,6 +51,11 @@
<property name="relativeOrder">22</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
+ <bean name="ResourceResolverDeploymentAspect" class="org.jboss.wsf.stack.cxf.ResourceResolverDeploymentAspect">
+ <property name="requires">StackDescriptor</property>
+ <property name="relativeOrder">23</property> <!-- [JBDEPLOY-201] workaround -->
+ </bean>
+
<bean name="WSCXFEndpointHandlerDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect">
<property name="requires">ContainerMetaData</property>
<property name="provides">StackEndpointHandler</property>
Modified: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf.sar/META-INF/spring.schemas
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf.sar/META-INF/spring.schemas 2009-11-19 12:06:59 UTC (rev 11131)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf.sar/META-INF/spring.schemas 2009-11-19 12:14:21 UTC (rev 11132)
@@ -45,6 +45,7 @@
http\://schemas.xmlsoap.org/ws/2004/08/addressing=schemas/wsdl/addressing.xsd
http\://cxf.apache.org/schemas/configuration/security.xsd=schemas/configuration/security.xsd
+http\://cxf.apache.org/schemas/configuration/parameterized-types.xsd=schemas/configuration/parameterized-types.xsd
#
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2009-11-19 12:06:59 UTC (rev 11131)
+++ stack/cxf/trunk/pom.xml 2009-11-19 12:14:21 UTC (rev 11132)
@@ -45,7 +45,7 @@
<properties>
<jbossws.common.version>1.2.2-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>3.2.2-SNAPSHOT</jbossws.framework.version>
- <jbossws.spi.version>1.2.1.GA</jbossws.spi.version>
+ <jbossws.spi.version>1.2.2-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss500.version>3.2.1.GA</jbossws.jboss500.version>
<jbossws.jboss501.version>3.2.1.GA</jbossws.jboss501.version>
<jbossws.jboss510.version>3.2.1.GA</jbossws.jboss510.version>
@@ -56,8 +56,7 @@
<jbossws.jboss600.version>3.2.1.GA</jbossws.jboss600.version>
-->
<!-- END -->
- <cxf.version>2.2.4</cxf.version>
- <cxf.anttasks.version>2.1.5</cxf.anttasks.version>
+ <cxf.version>2.2.5</cxf.version>
<cxf.stax.version>1.0.1</cxf.stax.version>
<cxf.asm.version>2.2.3</cxf.asm.version>
<fastinfoset.api.version>1.2.7</fastinfoset.api.version>
@@ -76,7 +75,7 @@
<saaj.api.version>1.3</saaj.api.version>
<velocity.version>1.5</velocity.version>
<xmlsec.version>1.4.3</xmlsec.version>
- <wstx.version>3.2.8</wstx.version>
+ <wstx.version>3.2.9</wstx.version>
<spring.version>2.5.5</spring.version>
</properties>
14 years, 5 months
JBossWS SVN: r11131 - in framework/trunk: src/main/java/org/jboss/wsf/framework/deployment and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-11-19 07:06:59 -0500 (Thu, 19 Nov 2009)
New Revision: 11131
Added:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java
Modified:
framework/trunk/pom.xml
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java
Log:
[JBWS-2828] Providing implementation for ResourceResolver and moving to jbossws-spi snapshot
Modified: framework/trunk/pom.xml
===================================================================
--- framework/trunk/pom.xml 2009-11-19 12:06:04 UTC (rev 11130)
+++ framework/trunk/pom.xml 2009-11-19 12:06:59 UTC (rev 11131)
@@ -28,7 +28,7 @@
<jaxws.api.version>2.1</jaxws.api.version>
<jboss.web.version>2.1.3.GA</jboss.web.version>
<jbossws.common.version>1.2.1.GA</jbossws.common.version>
- <jbossws.spi.version>1.2.1.GA</jbossws.spi.version>
+ <jbossws.spi.version>1.2.2-SNAPSHOT</jbossws.spi.version>
<jbossxb.version>2.0.1.GA</jbossxb.version>
</properties>
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java 2009-11-19 12:06:04 UTC (rev 11130)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java 2009-11-19 12:06:59 UTC (rev 11131)
@@ -22,13 +22,12 @@
package org.jboss.wsf.framework.deployment;
import java.io.IOException;
-import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Iterator;
import java.util.List;
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.ResourceResolver;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -81,81 +80,10 @@
return name;
}
+ @Deprecated
public URL getMetaDataFileURL(String resourcePath) throws IOException
{
- URL resourceURL = null;
- if (resourcePath != null && resourcePath.length() > 0)
- {
- if (resourcePath.startsWith("/"))
- resourcePath = resourcePath.substring(1);
-
- try
- {
- // assign an absolute URL
- resourceURL = new URL(resourcePath);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- if (resourceURL == null && getRootFile() != null)
- {
- try
- {
- UnifiedVirtualFile vfResource = getRootFile().findChild(resourcePath);
- resourceURL = vfResource.toURL();
- }
- catch (IOException e)
- {
- if (metadataFiles == null || metadataFiles.isEmpty())
- {
- throw e;
- }
- else
- {
- if (log.isDebugEnabled())
- log.debug("Cannot get " + resourcePath + " from root file, trying with additional metadata files", e);
- }
-
- }
- }
- //scan additional metadata files (for instance originally attached to a VFSDeploymentUnit)
- if (resourceURL == null && metadataFiles != null && !metadataFiles.isEmpty())
- {
- UnifiedVirtualFile vfResource = null;
- for (Iterator<UnifiedVirtualFile> it = getMetadataFiles().iterator(); it.hasNext() && vfResource == null;)
- {
- UnifiedVirtualFile uvf = it.next();
- URL wsdlUrl = uvf.toURL();
- String wsdlPath = wsdlUrl.getPath();
- if (wsdlPath.startsWith("/"))
- wsdlPath = wsdlPath.substring(1);
- if (resourcePath.equals(wsdlPath))
- {
- vfResource = uvf;
- }
- else
- {
- try
- {
- vfResource = uvf.findChild(resourcePath);
- }
- catch (IOException e)
- {
- if (log.isDebugEnabled())
- log.debug("Cannot get " + resourcePath + " from " + uvf, e);
- }
- }
- }
- if (vfResource == null)
- throw new IOException("Could not find " + resourcePath + " in the additional metadatafiles!");
-
- resourceURL = vfResource.toURL();
- }
- }
-
- return resourceURL;
+ return getResourceResolver().resolve(resourcePath);
}
public List<UnifiedVirtualFile> getMetadataFiles()
@@ -167,4 +95,9 @@
{
this.metadataFiles = metadataFiles;
}
+
+ public ResourceResolver getResourceResolver()
+ {
+ return new ResourceResolverImpl(rootFile, metadataFiles);
+ }
}
Added: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java (rev 0)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java 2009-11-19 12:06:59 UTC (rev 11131)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.deployment;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.ResourceResolver;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+
+/**
+ * A resource resolver implementation using unified virtual files
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Nov-2009
+ *
+ */
+public class ResourceResolverImpl implements ResourceResolver
+{
+ private static Logger log = Logger.getLogger(ResourceResolverImpl.class);
+
+ private UnifiedVirtualFile rootFile;
+ private Collection<UnifiedVirtualFile> metadataFiles;
+
+ public ResourceResolverImpl(UnifiedVirtualFile rootFile, Collection<UnifiedVirtualFile> metadataFiles)
+ {
+ this.rootFile = rootFile;
+ this.metadataFiles = metadataFiles;
+ }
+
+ public URL resolve(String resourcePath) throws IOException
+ {
+ URL resourceURL = null;
+ if (resourcePath != null && resourcePath.length() > 0)
+ {
+ if (resourcePath.startsWith("/"))
+ resourcePath = resourcePath.substring(1);
+
+ try
+ {
+ // assign an absolute URL
+ resourceURL = new URL(resourcePath);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ if (resourceURL == null && rootFile != null)
+ {
+ try
+ {
+ UnifiedVirtualFile vfResource = rootFile.findChild(resourcePath);
+ resourceURL = vfResource.toURL();
+ }
+ catch (IOException e)
+ {
+ if (metadataFiles == null || metadataFiles.isEmpty())
+ {
+ throw e;
+ }
+ else
+ {
+ if (log.isDebugEnabled())
+ log.debug("Cannot get " + resourcePath + " from root file, trying with additional metadata files", e);
+ }
+ }
+ }
+ //scan additional metadata files (for instance originally attached to a VFSDeploymentUnit)
+ if (resourceURL == null && metadataFiles != null && !metadataFiles.isEmpty())
+ {
+ UnifiedVirtualFile vfResource = null;
+ for (Iterator<UnifiedVirtualFile> it = metadataFiles.iterator(); it.hasNext() && vfResource == null;)
+ {
+ UnifiedVirtualFile uvf = it.next();
+ URL wsdlUrl = uvf.toURL();
+ String wsdlPath = wsdlUrl.getPath();
+ if (wsdlPath.startsWith("/"))
+ wsdlPath = wsdlPath.substring(1);
+ if (resourcePath.equals(wsdlPath))
+ {
+ vfResource = uvf;
+ }
+ else
+ {
+ try
+ {
+ vfResource = uvf.findChild(resourcePath);
+ }
+ catch (IOException e)
+ {
+ if (log.isDebugEnabled())
+ log.debug("Cannot get " + resourcePath + " from " + uvf, e);
+ }
+ }
+ }
+ if (vfResource == null)
+ throw new IOException("Could not find " + resourcePath + " in the additional metadatafiles!");
+
+ resourceURL = vfResource.toURL();
+ }
+ }
+ return resourceURL;
+ }
+
+}
Property changes on: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
14 years, 5 months
JBossWS SVN: r11130 - spi/trunk/src/main/java/org/jboss/wsf/spi/deployment.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-11-19 07:06:04 -0500 (Thu, 19 Nov 2009)
New Revision: 11130
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ResourceResolver.java
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
Log:
[JBWS-2828] Adding ResourceResolver interface
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java 2009-11-18 18:12:17 UTC (rev 11129)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ArchiveDeployment.java 2009-11-19 12:06:04 UTC (rev 11130)
@@ -50,7 +50,10 @@
/** The concatenated names including all parents. */
String getCanonicalName();
- /** Get the URL for a given resource path */
+ /** Get the URL for a given resource path
+ * Deprecated, use getResourceResolver().resolve(String resourcePath).
+ */
+ @Deprecated
URL getMetaDataFileURL(String resourcePath) throws IOException;
/** Get additional metadata files attached to the deployment **/
@@ -58,4 +61,8 @@
/** Set additional metadata files for this deployment **/
void setMetadataFiles(List<UnifiedVirtualFile> metadataFiles);
+
+ /** Get the resource resolver to be used to access resources from this archive */
+ ResourceResolver getResourceResolver();
+
}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java 2009-11-18 18:12:17 UTC (rev 11129)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java 2009-11-19 12:06:04 UTC (rev 11130)
@@ -70,9 +70,9 @@
/** Set the current deployment state */
void setState(DeploymentState type);
- /** Get the service assiated with this deployment */
+ /** Get the service associated with this deployment */
Service getService();
- /** Set the service assiated with this deployment */
+ /** Set the service associated with this deployment */
void setService(Service service);
}
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ResourceResolver.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ResourceResolver.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ResourceResolver.java 2009-11-19 12:06:04 UTC (rev 11130)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.deployment;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * A resource resolver
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Nov-2009
+ *
+ */
+public interface ResourceResolver
+{
+ /** Get the URL for a given resource path
+ *
+ * @param resourcePath
+ * @return
+ * @throws IOException
+ */
+ public URL resolve(String resourcePath) throws IOException;
+
+}
Property changes on: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ResourceResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
14 years, 5 months