problem with Wildfly/Resteasy bootstrap

34 views
Skip to first unread message

RPE Colorado

unread,
Apr 5, 2018, 4:42:19 PM4/5/18
to MVC 1.0 Users Mailing List
Hi List,

I'm working on evaluating MVC/Ozark as a replacement for an old JSF project, and so far things are going pretty well.

One question I had is, is there any public maven repository with milestone 4 snapshot builds?

And I think I may have found an issue with Ozark on Wildfly/Resteasy, relating back to the recent bootstrapping changes that were done with issues 129 and 140. The base problem is the entry for OzarkCoreFeature in META-INF/services/javax.ws.rs.ext.Providers. It seems that Resteasy is ignoring the @ConstrainedTo(RuntimeType.SERVER) annotation on OzarkCoreFeature when the class is loaded this way, which ultimately causes problems if you try to use a JAX-RS client instance, as OzarkCoreFeature injects the servlet context, which won't be available for a client operation. You can see this behavior with the simple timer EJB code below on Wildfly 11 or 12 deployed along with your MVC app (you'll see the error every time the timer fires), but everything works fine with Glassfish 5.

At any rate, I think the intention with the fixes for 129 and 140 was to get auto-detection working, and as far as I can tell it is working, so this file entry in META-INF/services really isn't needed anymore. 

Here's the code for the simple timer EJB that uses a JAX-RS client and exposes the bad behavior.

Thanks!
Chris

@javax.ejb.Singleton
public class TimerEjb {

private final static Logger log = Logger.getLogger(TimerEjb.class.getName());

@javax.ejb.Schedule(minute = "*", hour = "*")
public void timerUpdate() {
log.info("Timer firing");
final Client restClient = ClientBuilder.newClient(); // <-- this will cause an error
log.info("Rest client created");
restClient.close();
}
}

Christian Kaltepoth

unread,
Apr 6, 2018, 1:19:42 AM4/6/18
to MVC 1.0 Users
Hi,

thanks a lot for your feedback. I'm happy to hear that you are evaluating MVC 1.0 for your project.

Snapshots of the spec and the RI are automatically deployed to the Sonatype OSS repository. You will find all the required details here:


Regarding your issue with RESTEasy. I was able to reproduce this issue you described. This really seems to be some kind of RESTEasy bug. I already reported it upstream here:


Feel free to comment on the issue if there is anything I missed.

However, I also added a workaround for this issue to Ozark. Please see the corresponding commit here:


I guess this will fix the issue for you. I just pushed the fix. So the new snapshots should be available in the next minutes.

Christian

--
You received this message because you are subscribed to the Google Groups "MVC 1.0 Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsr371-users...@googlegroups.com.
To post to this group, send email to jsr371...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsr371-users/77f903d4-e738-4c8a-8379-e1537ce2cece%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

RPE Colorado

unread,
Apr 9, 2018, 9:36:57 AM4/9/18
to jsr371...@googlegroups.com
Thanks, Christian! I can confirm that the latest snapshots with your workaround do fix the issue on wildfly.

And I agree that the behavior of RESTeasy does seem like a bug. I'm following the jira issue you created and will comment on it if any questions come up.

Thanks again.
Chris

To unsubscribe from this group and stop receiving emails from it, send an email to jsr371-users+unsubscribe@googlegroups.com.

To post to this group, send email to jsr371...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsr371-users/77f903d4-e738-4c8a-8379-e1537ce2cece%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "MVC 1.0 Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsr371-users+unsubscribe@googlegroups.com.

To post to this group, send email to jsr371...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages