Thursday, 27 April 2017

Errata - Java EE Module 1, Chapter 6

We've recently been made aware of a small issue which affects chapter 6 (the CDI chapter) of Java EE with Wildfly, Module 1. You might experience this issue if you're using some versions of Java 8 to create your project - we're aware it is a problem in Java 8.60 and above.

In the video we talk about the different ways to tell JavaEE which implementation of a particular interface should be injected at runtime, when multiple implementations exist in your project. We first demonstrate the @Default and @Alternative annotations, then we look at specifying the required implementation in beans.xml, and finally we discuss qualifiers, which allow us to specify a different implementation in one specific area of our code.

In the video, we end up with all 3 methods in our project in use at the same time, and this worked fine at the time of recording. However we have found that when you then add in your own custom annotations (such as @ProductionDao - the example we use in the video) the deployment might fail. It appears that there is a bug in Java 8 which means that you can't use custom annotations together with beans.xml.

So you are fine to use @Default and custom annotations together, but not beans.xml and custom annotations. As most users will agree that using @Default and @Alternative are much easier than editing the xml file, this probably won't cause much difficulty in practice, but if you are getting a message that the build has failed, this will be why. If you're following along with the chapter, simply remove beans.xml from your project, and you will be able to continue with no further issues.


  1. Hay I am trying to start the wildfly-10.1.0 in windows 10 but I can't. I face this problem "Calling "C:\Program Files\wildfly-10.1.0.Final\bin\standalone.conf.bat"
    JAVA_HOME "C:\Program Files\Java\jdk1.7.0_71;C:\Users\wonde12\android-sdks\tools\;C:\Program Files\Java\jdk1.7.0_71;C:\Users\wonde12\android-sdks\tools;C:\Users\wonde12\AppData\Local\Android\sdk\tools;c:\Program Files\Java\jdk1.7.0_21\;C:\Program Files\wildfly-10.1.0.Final\bin" path doesn't exist" , am trying all options, i mean setup environment variable of JBOSS_HOME, change the JAVA_HOME inside standalone.conf.bat file but still the error is coming so I can not follow the video please help me.

    1. Great Article android based projects

      Java Training in Chennai

      Project Center in Chennai

      Java Training in Chennai

      projects for cse

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. Hi Wondyfraw - please can you raise this question via the contact-us page on the Virtual Pair Programmers' website, and then one of our technical team can help you. When you've sent the message, you'll get an automated response by email - you can reply to that response adding any attachments - it might help if you can send a screenshot as it's difficult to work through that error message when it's typed in... it looks like it might be either JAVA_HOME or PATH that are not right?

  3. It could be mentioned that @Alternative annotation must be removed from EmployeeDataAccessTesting together with bean.xml

  4. Hi Matt,

    Sorry for contacting you via your Blog - I tried to find contact details on your web page, but couldn't get through, so I hope this is okay. My name's Riddhi Phatnani, and I work as the Licensing Editor for Packt Publishing ( We're currently looking to expand our video content and are exploring licensing video courses from experienced instructors such as yourself. I've seen your courses on Udemy that I think would do really well on our platform and our partner platforms and channels.
    At Packt we have a substantial reach to a huge number of developers through our book publishing, and we are currently expanding that through video. We think we can also expand your own reach to your audience, leveraging Packt's brand and excellent direct marketing knowledge, increasing your profile and your income. Not only can Packt offer more ways to reach customers for you, but also something like 80% of developers are estimated to be people in a B2B and corporate learning situation, and we have a global reach to people in these environments, as well as our core retail. We'd be looking at a non-exclusive license, so all of your content could still thrive on your existing platforms including Udemy, etc., and we’d be looking at a flat revenue share with you taking 50%.
    Let me know if that's something that you'd like to discuss further. My email address is

    Riddhi Phatnani

  5. Hi Matt,

    Hope you've had got a chance to think about our partnership. Let me know what do you think. Are there any clarifications I can help with?

    Riddhi P.
    Licensing Editor

  6. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. keep it up.
    data analytics course in Bangalore

  7. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    Data Science Course

  8. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression

  9. Other content online cannot measure up to the work you have put out here. Your insight on this subject has convinced me of many of the points you have expressed. This is great unique writing.
    SAP training in Mumbai
    Data Science training in Mumbai
    Best data science training in Mumbai
    SAP training in Mumbai

  10. Attend The Course in Data Analytics From ExcelR. Practical Course in Data Analytics Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Course in Data Analytics.
    Course in Data Analytics

  11. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Simple Linear Regression
    Correlation vs covariance
    data science interview questions
    KNN Algorithm
    Logistic Regression explained

  12. Great! This article is packed full of constructive information. The valuable points made here are apparent, brief, clear and poignant. I am sincerely fond of your writing style.
    SAP training in Mumbai
    SAP course in Mumbai

  13. By reading this article, many things have piled up in my mind which made me to think about it. You have put some high quality and valuable information here that any reader would love to read. I sincerely share many of your views in this article.
    SAP training in Kolkata
    SAP course in kolkata

  14. Honestly speaking this blog is absolutely amazing in learning the subject that is building up the knowledge of every individual and enlarging to develop the skills which can be applied in to practical one. Finally, thanking the blogger to launch more further too.
    Data Analytics online course

  15. Thanks for posting the best information and the blog is very science interview questions and answers

  16. I was basically inspecting through the web filtering for certain data and ran over your blog. I am flabbergasted by the data that you have on this blog. It shows how well you welcome this subject. Bookmarked this page, will return for extra. data science course in jaipur

  17. Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such an amazing content for all the curious readers who are very keen of being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in future too.

    Data Science Course in Bhilai

  18. Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

    Data Science Training in Bhilai

  19. Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing. python course in delhi