[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3449) Upgrade to latest RestEasy beta

John Sublette (JIRA) jira-events at lists.jboss.org
Fri Jan 30 10:34:44 EST 2009


    [ https://jira.jboss.org/jira/browse/JBSEAM-3449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12450412#action_12450412 ] 

John Sublette commented on JBSEAM-3449:
---------------------------------------

After doing that patch, I noticed several additional bugs.  For the Resteasy client interface, you can share an interface and implement it in a class without the tags and it should find it.  The code as it existed with my patch would break if it found tags on interfaces, and wouldn't register tagless classes that implement tagged interfaces.  The resteasy bootstrapper uses Scannotation to search and find them, and that worked for me, though I cludged it in a bit poorly.

Also, I had difficulty trying to get two web-applications to use Seam+Resteasy, only the last web-application worked.  I had to make a ResteasyProviderFactory in the mold of ThreadLocalResteasyProviderFactory that used Component to retrieve the right Application scoped ResteasyDispatcher, where I stored the providerFactory that should be used in that application.  Then I had to change the ResteasyDispatcher.onStartup() to register my factory with the Resteasy library, and to provide access to the stored instance of ResteasyProviderFactory.

In order to do this, though I had to replicate all seam and resteasy libraries in each application's WEB-INF/lib directory.  I couldn't seem to get things to go into Tomcat's common library directory and still work - it would get the last loaded's context.  I probably have to understand Seam's library structure better.

e.g.:
**ResteasyDispatcher**
....
    @Create
    public void onStartup()
    {
        log.debug("assigning registered RESTEasy resources and providers");

        providerFactory = new ResteasyProviderFactory();
        ResteasyProviderFactory providerFactory = new SeamApplicationLocalResteasyProviderFactory(); 
        ResteasyProviderFactory.setInstance(providerFactory); // This is really necessary
....
    public ResteasyProviderFactory getProviderFactory() {
        return providerFactory;
    }

**SeamApplicationLocalResteasyProviderFactory**
public class SeamApplicationLocalResteasyProviderFactory extends ResteasyProviderFactory
   public ResteasyProviderFactory getDelegate()
   {
	  ResteasyDispatcher dispatcher = (ResteasyDispatcher)Component.getInstance(ResteasyDispatcher.class, ScopeType.APPLICATION);
      if (dispatcher == null) 
    	  return defaultFactory;
      return dispatcher.getProviderFactory();
   }
...
...(Everything else is pretty much identical to ThreadLocalResteasyProviderFactory)

> Upgrade to latest RestEasy beta
> -------------------------------
>
>                 Key: JBSEAM-3449
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3449
>             Project: Seam
>          Issue Type: Feature Request
>          Components: WS
>    Affects Versions: 2.1.0.BETA1
>            Reporter: Scott Olcott
>            Assignee: Jozef Hartinger
>             Fix For: 2.1.2.GA
>
>         Attachments: jboss-seam-resteasy-2.1.1.CR2.JBSEAM-3449-patched.jar, resteasyBeta-8.txt
>
>
> The latest beta is beta-8

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list