JBossWS SVN: r17090 - in container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices: deployers and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-17 04:03:34 -0500 (Mon, 17 Dec 2012)
New Revision: 17090
Modified:
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
Log:
Impl failsafe methods
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-12-17 08:54:06 UTC (rev 17089)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-12-17 09:03:34 UTC (rev 17090)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -40,6 +40,7 @@
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
@MessageLogger(projectCode = "JBAS")
public interface WSLogger extends BasicLogger {
@@ -257,5 +258,8 @@
@LogMessage(level = WARN)
@Message(id = 15596, value = "Multiple EJB3 endpoints in the same deployment with different declared security roles; be aware this might be a security risk if you're not controlling allowed roles (@RolesAllowed) on each ws endpoint method.")
void multipleEndpointsWithDifferentDeclaredSecurityRoles();
-
+
+ @LogMessage(level = TRACE)
+ @Message(id = 15597, value = "Child '%s' not found for VirtualFile: %s")
+ void missingChild(String child, VirtualFile file);
}
\ No newline at end of file
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2012-12-17 08:54:06 UTC (rev 17089)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2012-12-17 09:03:34 UTC (rev 17090)
@@ -28,7 +28,6 @@
import static org.jboss.as.webservices.util.DotNames.WEB_SERVICE_ANNOTATION;
import static org.jboss.as.webservices.util.WSAttachmentKeys.JMS_ENDPOINT_METADATA_KEY;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.LinkedList;
@@ -99,11 +98,12 @@
if (!map.isEmpty()) {
for (String wsdlLocation : map.keySet()) {
- try {
- final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
- if (resourceRoot == null) continue;
- final UnifiedVirtualFile uvf = new VirtualFileAdaptor(resourceRoot.getRoot());
- URL url = uvf.findChild(wsdlLocation).toURL();
+ final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
+ if (resourceRoot == null) continue;
+ final UnifiedVirtualFile uvf = new VirtualFileAdaptor(resourceRoot.getRoot());
+ UnifiedVirtualFile childUvf = uvf.findChildFailSafe(wsdlLocation);
+ if (childUvf != null) {
+ URL url = childUvf.toURL();
SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url);
for (AnnotationInstance ai : map.get(wsdlLocation)) {
String port = ai.value(PORT_NAME).asString();
@@ -127,7 +127,7 @@
endpointsMetaData.addEndpointMetaData(endpointMetaData);
}
}
- } catch (Exception ignore) {
+ } else {
ROOT_LOGGER.cannotReadWsdl(wsdlLocation);
}
}
@@ -141,7 +141,7 @@
// NOOP
}
- private static ResourceRoot getWsdlResourceRoot(final DeploymentUnit unit, final String wsdlPath) throws MalformedURLException {
+ private static ResourceRoot getWsdlResourceRoot(final DeploymentUnit unit, final String wsdlPath) {
final AttachmentList<ResourceRoot> resourceRoots = new AttachmentList<ResourceRoot>(ResourceRoot.class);
final ResourceRoot root = unit.getAttachment(DEPLOYMENT_ROOT);
resourceRoots.add(root);
Modified: container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-12-17 08:54:06 UTC (rev 17089)
+++ container/jboss71/branches/jbossws-jboss711/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-12-17 09:03:34 UTC (rev 17090)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source
- * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * Copyright 2012, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -22,6 +22,7 @@
package org.jboss.as.webservices.util;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
import java.io.IOException;
import java.net.URL;
@@ -52,14 +53,32 @@
return file;
}
- public UnifiedVirtualFile findChild(String child) throws IOException {
+ private UnifiedVirtualFile findChild(String child, boolean throwExceptionIfNotFound) throws IOException {
final VirtualFile virtualFile = getFile();
final VirtualFile childFile = file.getChild(child);
- if (!childFile.exists())
- throw MESSAGES.missingChild(child, virtualFile);
+ if (!childFile.exists()) {
+ if (throwExceptionIfNotFound) {
+ throw MESSAGES.missingChild(child, virtualFile);
+ } else {
+ if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.missingChild(child, virtualFile);
+ return null;
+ }
+ }
return new VirtualFileAdaptor(childFile);
}
+ public UnifiedVirtualFile findChild(String child) throws IOException {
+ return findChild(child, true);
+ }
+
+ public UnifiedVirtualFile findChildFailSafe(String child) {
+ try {
+ return findChild(child, false);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
public URL toURL() {
try {
return getFile().toURL();
11 years, 5 months
JBossWS SVN: r17089 - container/jboss71/branches.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-17 03:54:06 -0500 (Mon, 17 Dec 2012)
New Revision: 17089
Added:
container/jboss71/branches/jbossws-jboss711-JBWS3551/
Log:
11 years, 5 months
JBossWS SVN: r17088 - in container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices: deployers and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-17 03:48:04 -0500 (Mon, 17 Dec 2012)
New Revision: 17088
Modified:
container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
Log:
Impl failsafe methods
Modified: container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
===================================================================
--- container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-12-17 08:38:29 UTC (rev 17087)
+++ container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-12-17 08:48:04 UTC (rev 17088)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 20112 Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -40,6 +40,7 @@
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
@MessageLogger(projectCode = "JBAS")
public interface WSLogger extends BasicLogger {
@@ -261,5 +262,9 @@
@LogMessage(level = WARN)
@Message(id = 15596, value = "Multiple EJB3 endpoints in the same deployment with different declared security roles; be aware this might be a security risk if you're not controlling allowed roles (@RolesAllowed) on each ws endpoint method.")
void multipleEndpointsWithDifferentDeclaredSecurityRoles();
+
+ @LogMessage(level = TRACE)
+ @Message(id = 15597, value = "Child '%s' not found for VirtualFile: %s")
+ void missingChild(String child, VirtualFile file);
}
\ No newline at end of file
Modified: container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
===================================================================
--- container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2012-12-17 08:38:29 UTC (rev 17087)
+++ container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2012-12-17 08:48:04 UTC (rev 17088)
@@ -99,11 +99,12 @@
if (!map.isEmpty()) {
for (String wsdlLocation : map.keySet()) {
- try {
- final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
- if (resourceRoot == null) continue;
- final UnifiedVirtualFile uvf = new VirtualFileAdaptor(resourceRoot.getRoot());
- URL url = uvf.findChild(wsdlLocation).toURL();
+ final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
+ if (resourceRoot == null) continue;
+ final UnifiedVirtualFile uvf = new VirtualFileAdaptor(resourceRoot.getRoot());
+ UnifiedVirtualFile childUvf = uvf.findChildFailSafe(wsdlLocation);
+ if (childUvf != null) {
+ URL url = childUvf.toURL();
SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url);
for (AnnotationInstance ai : map.get(wsdlLocation)) {
String port = ai.value(PORT_NAME).asString();
@@ -127,7 +128,7 @@
endpointsMetaData.addEndpointMetaData(endpointMetaData);
}
}
- } catch (Exception ignore) {
+ } else {
ROOT_LOGGER.cannotReadWsdl(wsdlLocation);
}
}
@@ -141,7 +142,7 @@
// NOOP
}
- private static ResourceRoot getWsdlResourceRoot(final DeploymentUnit unit, final String wsdlPath) throws MalformedURLException {
+ private static ResourceRoot getWsdlResourceRoot(final DeploymentUnit unit, final String wsdlPath) {
final AttachmentList<ResourceRoot> resourceRoots = new AttachmentList<ResourceRoot>(ResourceRoot.class);
final ResourceRoot root = unit.getAttachment(DEPLOYMENT_ROOT);
resourceRoots.add(root);
Modified: container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
===================================================================
--- container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-12-17 08:38:29 UTC (rev 17087)
+++ container/jboss71/branches/jbossws-jboss713-JBWS3551/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-12-17 08:48:04 UTC (rev 17088)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source
- * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * Copyright 2012, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -22,6 +22,7 @@
package org.jboss.as.webservices.util;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
import java.io.IOException;
import java.net.URL;
@@ -52,14 +53,32 @@
return file;
}
- public UnifiedVirtualFile findChild(String child) throws IOException {
+ private UnifiedVirtualFile findChild(String child, boolean throwExceptionIfNotFound) throws IOException {
final VirtualFile virtualFile = getFile();
final VirtualFile childFile = file.getChild(child);
- if (!childFile.exists())
- throw MESSAGES.missingChild(child, virtualFile);
+ if (!childFile.exists()) {
+ if (throwExceptionIfNotFound) {
+ throw MESSAGES.missingChild(child, virtualFile);
+ } else {
+ if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.missingChild(child, virtualFile);
+ return null;
+ }
+ }
return new VirtualFileAdaptor(childFile);
}
+ public UnifiedVirtualFile findChild(String child) throws IOException {
+ return findChild(child, true);
+ }
+
+ public UnifiedVirtualFile findChildFailSafe(String child) {
+ try {
+ return findChild(child, false);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
public URL toURL() {
try {
return getFile().toURL();
11 years, 5 months
JBossWS SVN: r17087 - container/jboss71/branches.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-17 03:38:29 -0500 (Mon, 17 Dec 2012)
New Revision: 17087
Added:
container/jboss71/branches/jbossws-jboss713-JBWS3551/
Log:
11 years, 5 months
JBossWS SVN: r17086 - shared-testsuite/branches.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-17 03:30:32 -0500 (Mon, 17 Dec 2012)
New Revision: 17086
Added:
shared-testsuite/branches/JBWS3551/
Log:
Branching
11 years, 5 months
JBossWS SVN: r17085 - stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-17 03:15:02 -0500 (Mon, 17 Dec 2012)
New Revision: 17085
Modified:
stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
Log:
Modified: stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
===================================================================
--- stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2012-12-15 00:26:18 UTC (rev 17084)
+++ stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2012-12-17 08:15:02 UTC (rev 17085)
@@ -169,7 +169,7 @@
@Message(id = 24055, value = "Unsupported token type: %s")
SecurityException unsupportedTokenType(Object tokenType);
- @Message(id = 24056, value = "Could not get subject info from computed SecurityContext")
+ @Message(id = 24056, value = "Could not get subject info neither from Security Token in the current message nor directly from computed SecurityContext")
SecurityException couldNotGetSubjectInfo();
@Message(id = 24057, value = "Failed Authentication : Subject has not been created")
11 years, 5 months
JBossWS SVN: r17084 - in stack/cxf/branches/JBWS3551/modules: client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-14 19:26:18 -0500 (Fri, 14 Dec 2012)
New Revision: 17084
Modified:
stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java
stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java
stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java
Log:
Impl and use failsafe methods
Modified: stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
===================================================================
--- stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2012-12-15 00:24:43 UTC (rev 17083)
+++ stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2012-12-15 00:26:18 UTC (rev 17084)
@@ -169,7 +169,7 @@
@Message(id = 24055, value = "Unsupported token type: %s")
SecurityException unsupportedTokenType(Object tokenType);
- @Message(id = 24056, value = "Could not get subject info neither from Security Token in the current message nor directly from computed SecurityContext")
+ @Message(id = 24056, value = "Could not get subject info from computed SecurityContext")
SecurityException couldNotGetSubjectInfo();
@Message(id = 24057, value = "Failed Authentication : Subject has not been created")
Modified: stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java
===================================================================
--- stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java 2012-12-15 00:24:43 UTC (rev 17083)
+++ stack/cxf/branches/JBWS3551/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceObjectFactoryJAXWS.java 2012-12-15 00:26:18 UTC (rev 17084)
@@ -93,24 +93,14 @@
private URL getCXFConfiguration(final UnifiedVirtualFile vfsRoot)
{
- URL url = null;
- try
- {
- url = vfsRoot.findChild("WEB-INF/" + Constants.JBOSSWS_CXF_SPRING_DD).toURL();
- }
- catch (Exception e)
- {
- }
+ UnifiedVirtualFile uvf = vfsRoot.findChildFailSafe("WEB-INF/" + Constants.JBOSSWS_CXF_SPRING_DD);
+ URL url = (uvf != null) ? uvf.toURL() : null;
if (url == null)
{
- try
- {
- url = vfsRoot.findChild("META-INF/" + Constants.JBOSSWS_CXF_SPRING_DD).toURL();
- }
- catch (Exception e)
- {
- }
+ uvf = vfsRoot.findChildFailSafe("META-INF/" + Constants.JBOSSWS_CXF_SPRING_DD);
+ if (uvf != null)
+ url = uvf.toURL();
}
return url;
}
Modified: stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2012-12-15 00:24:43 UTC (rev 17083)
+++ stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2012-12-15 00:26:18 UTC (rev 17084)
@@ -99,8 +99,8 @@
if (jbosswsCxfXml != null)
{
// Spring available and jbossws-cxf.xml provided
- final URL cxfServletUrl = getResourceUrl(deploymentResolver, "WEB-INF/cxf-servlet.xml", false); // TODO: decide not to support this?
- final URL jbosswsCxfUrl = getResourceUrl(deploymentResolver, jbosswsCxfXml, true);
+ final URL cxfServletUrl = deploymentResolver.resolveFailSafe("WEB-INF/cxf-servlet.xml"); // TODO: decide not to support this?
+ final URL jbosswsCxfUrl = getResourceUrl(deploymentResolver, jbosswsCxfXml);
holder = new SpringBusHolder(cxfServletUrl, jbosswsCxfUrl);
}
else
@@ -135,16 +135,16 @@
}
}
- private static URL getResourceUrl(final ResourceResolver resolver, final String resourcePath, final boolean fail) {
- try {
- return resolver.resolve(resourcePath);
- } catch (final IOException e) {
- if (fail) {
- throw new RuntimeException(e);
- } else {
- return null;
- }
- }
+ private static URL getResourceUrl(final ResourceResolver resolver, final String resourcePath)
+ {
+ try
+ {
+ return resolver.resolve(resourcePath);
+ }
+ catch (final IOException e)
+ {
+ throw new RuntimeException(e);
+ }
}
}
Modified: stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java
===================================================================
--- stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java 2012-12-15 00:24:43 UTC (rev 17083)
+++ stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java 2012-12-15 00:26:18 UTC (rev 17084)
@@ -41,11 +41,12 @@
@Override
public void start(final Deployment dep)
{
+ boolean springAvailable = SpringUtils.isSpringAvailable();
for (final Endpoint ep : dep.getService().getEndpoints())
{
final ServerFactoryBean factory = ep.getAttachment(ServerFactoryBean.class);
//TODO: remove this after JBWS-3396 resolved
- if (factory == null && SpringUtils.isSpringAvailable())
+ if (factory == null && springAvailable)
{
throw Messages.MESSAGES.endpointNotDefineInJbwsCxf(ep.getTargetBeanName());
}
Modified: stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2012-12-15 00:24:43 UTC (rev 17083)
+++ stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2012-12-15 00:26:18 UTC (rev 17084)
@@ -27,7 +27,6 @@
import static org.jboss.ws.common.integration.WSHelper.isWarArchive;
import static org.jboss.wsf.stack.cxf.Loggers.DEPLOYMENT_LOGGER;
-import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@@ -121,17 +120,11 @@
}
URL cxfURL = null;
- try
- {
- // get resource URL
- ArchiveDeployment archDep = (ArchiveDeployment)dep;
- cxfURL = archDep.getResourceResolver().resolve(metadir + "/" + Constants.JBOSSWS_CXF_SPRING_DD);
+ //get resource URL
+ ArchiveDeployment archDep = (ArchiveDeployment)dep;
+ cxfURL = archDep.getResourceResolver().resolveFailSafe(metadir + "/" + Constants.JBOSSWS_CXF_SPRING_DD);
+ if (cxfURL != null)
DEPLOYMENT_LOGGER.jbwscxfConfFound(cxfURL);
- }
- catch (IOException ignore)
- {
- // resource not found
- }
return cxfURL;
}
Modified: stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
===================================================================
--- stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2012-12-15 00:24:43 UTC (rev 17083)
+++ stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2012-12-15 00:26:18 UTC (rev 17084)
@@ -292,24 +292,23 @@
wsdlLocation = ddep.getAnnotationWsdlLocation();
}
if (wsdlLocation != null) {
- try {
- URL wsdlUrl = dep.getResourceResolver().resolve(wsdlLocation);
-
- SOAPAddressWSDLParser parser = getCurrentSOAPAddressWSDLParser(wsdlUrl, soapAddressWsdlParsers);
- //do not try rewriting addresses for not-http binding
- String wsdlAddress = parser.filterSoapAddress(ddep.getServiceName(), ddep.getPortName(), SOAPAddressWSDLParser.SOAP_HTTP_NS);
-
- final ServerConfig sc = AbstractServerConfig.getServerIntegrationServerConfig();
- String rewrittenWsdlAddress = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(wsdlAddress, ddep.getAddress(), sc);
- //If "auto rewrite", leave "publishedEndpointUrl" unset so that CXF do not force host/port values for
- //wsdl imports and auto-rewrite them too; otherwise set the new address into "publishedEndpointUrl",
- //which causes CXF to override any address in the published wsdl.
- if (!SoapAddressRewriteHelper.isAutoRewriteOn(sc)) {
- ddep.setPublishedEndpointUrl(rewrittenWsdlAddress);
+ URL wsdlUrl = dep.getResourceResolver().resolveFailSafe(wsdlLocation);
+ if (wsdlUrl != null) {
+ SOAPAddressWSDLParser parser = getCurrentSOAPAddressWSDLParser(wsdlUrl, soapAddressWsdlParsers);
+ //do not try rewriting addresses for not-http binding
+ String wsdlAddress = parser.filterSoapAddress(ddep.getServiceName(), ddep.getPortName(), SOAPAddressWSDLParser.SOAP_HTTP_NS);
+
+ final ServerConfig sc = AbstractServerConfig.getServerIntegrationServerConfig();
+ String rewrittenWsdlAddress = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(wsdlAddress, ddep.getAddress(), sc);
+ //If "auto rewrite", leave "publishedEndpointUrl" unset so that CXF do not force host/port values for
+ //wsdl imports and auto-rewrite them too; otherwise set the new address into "publishedEndpointUrl",
+ //which causes CXF to override any address in the published wsdl.
+ if (!SoapAddressRewriteHelper.isAutoRewriteOn(sc)) {
+ ddep.setPublishedEndpointUrl(rewrittenWsdlAddress);
+ }
+ } else {
+ METADATA_LOGGER.abortSoapAddressRewrite(wsdlLocation, null);
}
- } catch (IOException e) {
- METADATA_LOGGER.abortSoapAddressRewrite(wsdlLocation, e);
- }
}
}
Modified: stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java
===================================================================
--- stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java 2012-12-15 00:24:43 UTC (rev 17083)
+++ stack/cxf/branches/JBWS3551/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java 2012-12-15 00:26:18 UTC (rev 17084)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, 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.
*
@@ -65,16 +65,10 @@
public <T> T resolve(String resourcePath, Class<T> resourceType)
{
- URL url = null;
- try
- {
- url = resolver.resolve(resourcePath);
+ URL url = resolver.resolveFailSafe(resourcePath);
+ if (url == null && Loggers.ROOT_LOGGER.isDebugEnabled()) {
+ Loggers.ROOT_LOGGER.cannotResolveResource(JBossWSResourceResolver.class.getSimpleName(), resourcePath);
}
- catch (IOException ioe)
- {
- if (Loggers.ROOT_LOGGER.isDebugEnabled())
- Loggers.ROOT_LOGGER.cannotResolveResource(JBossWSResourceResolver.class.getSimpleName(), resourcePath);
- }
if (url != null && resourceType.isInstance(url))
{
return resourceType.cast(url);
11 years, 5 months
JBossWS SVN: r17083 - stack/cxf/branches.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-14 19:24:43 -0500 (Fri, 14 Dec 2012)
New Revision: 17083
Added:
stack/cxf/branches/JBWS3551/
Log:
11 years, 5 months
JBossWS SVN: r17082 - in container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices: deployers and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-14 19:22:40 -0500 (Fri, 14 Dec 2012)
New Revision: 17082
Modified:
container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
Log:
Impl failsafe method in virtual file adaptor
Modified: container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java
===================================================================
--- container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-12-15 00:22:00 UTC (rev 17081)
+++ container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/WSLogger.java 2012-12-15 00:22:40 UTC (rev 17082)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., and individual contributors
+ * Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -40,6 +40,7 @@
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
*/
@MessageLogger(projectCode = "JBAS")
public interface WSLogger extends BasicLogger {
@@ -262,4 +263,8 @@
@Message(id = 15596, value = "Multiple EJB3 endpoints in the same deployment with different declared security roles; be aware this might be a security risk if you're not controlling allowed roles (@RolesAllowed) on each ws endpoint method.")
void multipleEndpointsWithDifferentDeclaredSecurityRoles();
+ @LogMessage(level = TRACE)
+ @Message(id = 15597, value = "Child '%s' not found for VirtualFile: %s")
+ void missingChild(String child, VirtualFile file);
+
}
\ No newline at end of file
Modified: container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java
===================================================================
--- container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2012-12-15 00:22:00 UTC (rev 17081)
+++ container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSIntegrationProcessorJAXWS_JMS.java 2012-12-15 00:22:40 UTC (rev 17082)
@@ -99,11 +99,12 @@
if (!map.isEmpty()) {
for (String wsdlLocation : map.keySet()) {
- try {
- final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
- if (resourceRoot == null) continue;
- final UnifiedVirtualFile uvf = new VirtualFileAdaptor(resourceRoot.getRoot());
- URL url = uvf.findChild(wsdlLocation).toURL();
+ final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
+ if (resourceRoot == null) continue;
+ final UnifiedVirtualFile uvf = new VirtualFileAdaptor(resourceRoot.getRoot());
+ UnifiedVirtualFile childUvf = uvf.findChildFailSafe(wsdlLocation);
+ if (childUvf != null) {
+ URL url = childUvf.toURL();
SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url);
for (AnnotationInstance ai : map.get(wsdlLocation)) {
String port = ai.value(PORT_NAME).asString();
@@ -127,7 +128,7 @@
endpointsMetaData.addEndpointMetaData(endpointMetaData);
}
}
- } catch (Exception ignore) {
+ } else {
ROOT_LOGGER.cannotReadWsdl(wsdlLocation);
}
}
@@ -141,7 +142,7 @@
// NOOP
}
- private static ResourceRoot getWsdlResourceRoot(final DeploymentUnit unit, final String wsdlPath) throws MalformedURLException {
+ private static ResourceRoot getWsdlResourceRoot(final DeploymentUnit unit, final String wsdlPath) {
final AttachmentList<ResourceRoot> resourceRoots = new AttachmentList<ResourceRoot>(ResourceRoot.class);
final ResourceRoot root = unit.getAttachment(DEPLOYMENT_ROOT);
resourceRoots.add(root);
Modified: container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java
===================================================================
--- container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-12-15 00:22:00 UTC (rev 17081)
+++ container/jboss71/branches/JBWS3551-jboss712/server-integration/src/main/java/org/jboss/as/webservices/util/VirtualFileAdaptor.java 2012-12-15 00:22:40 UTC (rev 17082)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source
- * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * Copyright 2012, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -22,6 +22,7 @@
package org.jboss.as.webservices.util;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
+import static org.jboss.as.webservices.WSLogger.ROOT_LOGGER;
import java.io.IOException;
import java.net.URL;
@@ -52,14 +53,32 @@
return file;
}
- public UnifiedVirtualFile findChild(String child) throws IOException {
+ private UnifiedVirtualFile findChild(String child, boolean throwExceptionIfNotFound) throws IOException {
final VirtualFile virtualFile = getFile();
final VirtualFile childFile = file.getChild(child);
- if (!childFile.exists())
- throw MESSAGES.missingChild(child, virtualFile);
+ if (!childFile.exists()) {
+ if (throwExceptionIfNotFound) {
+ throw MESSAGES.missingChild(child, virtualFile);
+ } else {
+ if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.missingChild(child, virtualFile);
+ return null;
+ }
+ }
return new VirtualFileAdaptor(childFile);
}
+
+ public UnifiedVirtualFile findChild(String child) throws IOException {
+ return findChild(child, true);
+ }
+ public UnifiedVirtualFile findChildFailSafe(String child) {
+ try {
+ return findChild(child, false);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
public URL toURL() {
try {
return getFile().toURL();
11 years, 5 months
JBossWS SVN: r17081 - container/jboss71/branches.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-14 19:22:00 -0500 (Fri, 14 Dec 2012)
New Revision: 17081
Added:
container/jboss71/branches/JBWS3551-jboss712/
Log:
11 years, 5 months