Re: [Resteasy-users] resteasy-jaxrs-3.0-beta-5 oauth2 example deploy to domain fail?
I'll check it out. JBoss Modules was a bit quirky. Probably user error though. On 6/5/2013 11:55 AM, Doug Toppin wrote: I'm using resteasy-jaxrs-3.0-beta-5 and want to deploy the oauth2 skeleton code examples into a JBoss EAP 6.0.1 domain and getting this error on the deploy (deploying via the cli and getting a rollback): 11:17:00,567 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC01: Failed to start service jboss.module.service.deployment.auth-server.war.main: org.jboss.msc.service.StartException in service jboss.module.service.deployment.auth-server.war.main: JBAS018759: Failed to load module: deployment.auth-server.war:main at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:92) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17] at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17] Caused by: org.jboss.modules.ModuleNotFoundException: Module org.jboss.resteasy.security.smime.MultipartSignedReader:main is not found in local module loader @7bf5f379 (roots: /Users/dougtoppin/Desktop/JBoss/jboss-eap-6.0/modules) at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126) [jboss-modules.jar:1.1.3.GA-redhat-1] at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275) [jboss-modules.jar:1.1.3.GA-redhat-1] at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222) [jboss-modules.jar:1.1.3.GA-redhat-1] at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94) [jboss-modules.jar:1.1.3.GA-redhat-1] at org.jboss.modules.Module.addPaths(Module.java:851) [jboss-modules.jar:1.1.3.GA-redhat-1] at org.jboss.modules.Module.link(Module.java:1206) [jboss-modules.jar:1.1.3.GA-redhat-1] at org.jboss.modules.Module.relinkIfNecessary(Module.java:1235) [jboss-modules.jar:1.1.3.GA-redhat-1] at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208) [jboss-modules.jar:1.1.3.GA-redhat-1] at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:71) [jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4] ... 5 more 11:17:00,772 INFO [org.jboss.as.server] (host-controller-connection-threads - 4) JBAS015870: Deploy of deployment auth-server.war was rolled back with failure message {JBAS014671: Failed services = {jboss.module.service.\deployment.auth-server.war\.main = org.jboss.msc.service.StartException in service jboss.module.service.\deployment.auth-server.war\.main: JBAS018759: Failed to load module: deployment.auth-server.war:main Caused by: org.jboss.modules.ModuleNotFoundException: Module org.jboss.resteasy.security.smime.MultipartSignedReader:main is not found in local module loader @7bf5f379 (roots: /Users/dougtoppin/Desktop/JBoss/jboss-eap-6.0/modules)},JBAS014771: Services with missing/unavailable dependencies = [jboss.deployment.unit.\auth-server.war\.POST_MODULE Missing[JBAS014861: one or more transitive dependencies]]} In a standalone deployment via maven the same warning occurs but maven does a force and the examples still work. I have not been able to to do a force in domain mode and it rolls the deploy back. For domain mode I copied the mods from the standalone.xml to my domain.xml to try to try to get the example to work in domain mode. Has anyone seen and/or solved this? I would appreciate any tips on what to do about this. tks Doug -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j ___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j ___ Resteasy-users
[Resteasy-users] Want to return common object with reference to list of resources or the resource
Running RestEasy 2.3.5 We are looking at exposing many of our EJB services thru RestEasy. One of our thoughts is to return a common object that contains a reference to the resource or list of resources. The object would look like below, where the resource or list of resources would be saved in the messageObject field. This fails when Resteasy tries to find the correct message writer. package rest; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = RestfulResponse) public class RestfulResponse { private long statusCode; private String statusDescription; private Object messageObject; private String excpDetails; @XmlElement(name=StatusCode) public long getStatusCode() { return statusCode; } public void setStatusCode(long statusCode) { this.statusCode = statusCode; } @XmlElement(name=StatusDescription) public String getStatusDescription() { return statusDescription; } public void setStatusDescription(String statusDescription) { this.statusDescription = statusDescription; } @XmlElement(name=ExceptionDetails) public String getExcpDetails() { return excpDetails; } public void setExcpDetails(String excpDetails) { this.excpDetails = excpDetails; } @XmlElement(name=Response) public Object getMessageObject() { return messageObject; } public void setMessageObject(Object messageObject) { this.messageObject = messageObject; } } I tried adjusting my resource method to use the GenericEntity class but must have gotten that wrong, see exception below. @GET @Produces({application/json, application/xml}) public RestfulResponse findAll(@QueryParam(BaseResource.OFFSET) @DefaultValue(0) String offset, @QueryParam(BaseResource.LIMIT) @DefaultValue(10) String limit) { ListEnvironmentBean list = null; EnvironmentServiceLocal envSvc = Services.get(EnvironmentServiceLocal.class); RestfulResponse response = new RestfulResponse(); try { if (isRetrieveAllAllowed()) { list = envSvc.findAll(); } else { validatePaginationParms(offset, limit); list = envSvc.find(paginationParms.get(BaseResource.OFFSET), paginationParms.get(BaseResource.LIMIT)); } } catch (FinderException e) { response.setStatusCode(404); return response; } response.setStatusCode(200); GenericEntityListEnvironmentBean entity = new GenericEntityListEnvironmentBean(list) {}; response.setMessageObject(entity); //response.setMessageObject(list); return response; } org.jboss.resteasy.plugins.providers.jaxb.JAXBMarshalException: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: rest.EnvironmentResource$1 nor any of its super class is known to this context] at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.writeTo(AbstractJAXBProvider.java:148) at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:117) at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.write(GZIPEncodingInterceptor.java:104) at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:123) . . . This seems to work okay if I use the javax.ws.rs.core.Response class and set the entities in there. We wanted the option to return some additional 'metadata' about the requests if appropriate, like a total count in a metadata field somewhere when getting a list of resources. Is there a better way to do what we are trying to do? Just setting the messageObject to the list reference gives exception: JAXBException: java.util.ArrayList nor any of its super class is known to this context. -- How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j___ Resteasy-users mailing list Resteasy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/resteasy-users