Permalink
Browse files

AS7-6199 Resteasy 2.3.5.Final

  • Loading branch information...
1 parent 55b23cf commit f49c6287e29b73f5779aa3d42deca9a828264c25 @stuartwdouglas stuartwdouglas committed with kabir Jan 9, 2013
@@ -22,6 +22,8 @@
package org.jboss.as.jaxrs;
+import java.util.List;
+
import javax.ws.rs.core.Application;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
@@ -82,12 +84,13 @@
/**
* JAX-RS resource @Path annotation is on a class or interface that is not a view
*
+ *
* @param type The class with the annotation
* @param ejbName The ejb
* @return
*/
@Message(id = 11234, value = "JAX-RS resource %s does not correspond to a view on the EJB %s. @Path annotations can only be placed on classes or interfaces that represent a local, remote or no-interface view of an EJB.")
- DeploymentUnitProcessingException typeNameNotAnEjbView(String type, String ejbName);
+ DeploymentUnitProcessingException typeNameNotAnEjbView(List<Class> type, String ejbName);
@Message(id = 11235, value = "Invalid value for parameter %s: %s")
DeploymentUnitProcessingException invalidParamValue(String param, String value);
@@ -22,6 +22,8 @@
package org.jboss.as.jaxrs.deployment;
+import java.util.Arrays;
+
import org.jboss.as.ee.component.Attachments;
import org.jboss.as.ee.component.ComponentDescription;
import org.jboss.as.ee.component.EEModuleDescription;
@@ -79,24 +81,30 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
if (!GetRestful.isRootResource(componentClass)) continue;
if (component instanceof SessionBeanComponentDescription) {
- Class jaxrsType = GetRestful.getSubResourceClass(componentClass);
+ Class[] jaxrsType = GetRestful.getSubResourceClass(componentClass);
final String jndiName;
if (component.getViews().size() == 1) {
//only 1 view, just use the simple JNDI name
jndiName = "java:app/" + moduleDescription.getModuleName() + "/" + componentClass.getSimpleName();
} else {
- final String jaxRsTypeName = jaxrsType.getName();
boolean found = false;
+ String foundType = null;
for (final ViewDescription view : component.getViews()) {
- if (view.getViewClassName().equals(jaxRsTypeName)) {
- found = true;
+ for(Class subResource : jaxrsType) {
+ if (view.getViewClassName().equals(subResource.getName())) {
+ foundType = subResource.getName();
+ found = true;
+ break;
+ }
+ }
+ if(found) {
break;
}
}
if (!found) {
- throw JaxrsMessages.MESSAGES.typeNameNotAnEjbView(jaxRsTypeName, component.getComponentName());
+ throw JaxrsMessages.MESSAGES.typeNameNotAnEjbView(Arrays.asList(jaxrsType), component.getComponentName());
}
- jndiName = "java:app/" + moduleDescription.getModuleName() + "/" + componentClass.getSimpleName() + "!" + jaxRsTypeName;
+ jndiName = "java:app/" + moduleDescription.getModuleName() + "/" + componentClass.getSimpleName() + "!" + foundType;
}
JAXRS_LOGGER.debugf("Found JAX-RS Managed Bean: %s local jndi jaxRsTypeName: %s", component.getComponentClassName(), jndiName);
View
@@ -189,7 +189,7 @@
<version.org.jboss.remote-naming>1.0.5.Final</version.org.jboss.remote-naming>
<version.org.jboss.remoting3>3.2.14.GA</version.org.jboss.remoting3>
<version.org.jboss.remotingjmx.remoting-jmx>1.1.0.Beta1</version.org.jboss.remotingjmx.remoting-jmx>
- <version.org.jboss.resteasy>2.3.4.Final</version.org.jboss.resteasy>
+ <version.org.jboss.resteasy>2.3.5.Final</version.org.jboss.resteasy>
<version.org.jboss.sasl>1.0.3.Final</version.org.jboss.sasl>
<version.org.jboss.seam.int>6.0.0.GA</version.org.jboss.seam.int>
<version.org.jboss.security.jboss-negotiation>2.2.2.Final</version.org.jboss.security.jboss-negotiation>
@@ -944,7 +944,7 @@
<artifactId>jboss-as-core-model-test-controller-7.1.2</artifactId>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ee</artifactId>

0 comments on commit f49c628

Please sign in to comment.