Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Marsoni X](https://secure.gravatar.com/avatar/121d6c205d23ceb3a8167d61cd594038?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Marsoni X
Front End Web Development Techdegree Student 417 PointsType mismatch: cannot convert from StandardServiceRegistry to ServiceRegistry
I'm coding the same as the instructor is doing in this video. But I get a warning as given in the title. In eclipse, it is telling me to cast to ServiceRegistry(and it is working on cast). All I wanted to know is, how come the instructor not getting this error/warning. Is it because he is using IntelliJ? Is there a way that I can do it without casting the object, If so How can I do this?
4 Answers
![Marsoni X](https://secure.gravatar.com/avatar/121d6c205d23ceb3a8167d61cd594038?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Marsoni X
Front End Web Development Techdegree Student 417 PointsGot it, There was a wrong Import done. :) I had to import:
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
![Marvin Deutz](https://uploads.teamtreehouse.com/production/profile-photos/10391862/micro_1D69E77C-8D90-43B4-A6FA-AF8E5A1A12E8.jpg)
Marvin Deutz
8,349 PointsJust a quick Headsup for anyone having the same problem. There is also a ServiceRegistry in Java (Javax.io I think). IntelliJ imported this one and the hibernate one for me automatically, but it somehow used the Java one. So I had to delete the Java Service registry import and then type the hibernate one again.
![Anthony Amicarelli](https://secure.gravatar.com/avatar/81815a0a2228fd1b0b8cf69c140faf58?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Anthony Amicarelli
5,375 PointsI had the same issue. I had to remove this import which intellij added:
import javax.imageio.spi.ServiceRegistry;
and add this one:
import org.hibernate.service.ServiceRegistry;
![Nelson Fleig](https://uploads.teamtreehouse.com/production/profile-photos/6998282/micro_trabajador1.jpg)
Nelson Fleig
25,356 PointsI had the same problem. Thanks for pointing that out :)
Caleb Kleveter
Treehouse Moderator 37,862 PointsCaleb Kleveter
Treehouse Moderator 37,862 PointsI am glad you figured it out! I marked your answer as best because it explains how you solved your problem. If you ever solve your own problem in the future, feel free to mark your own answer as best!