Spring Tutorial 04 - Writing Code Using the Bean Factory

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ส.ค. 2024

ความคิดเห็น • 171

  • @pratik2861
    @pratik2861 4 ปีที่แล้ว +61

    For all new viewers, as xmlBeanFactory is deprecated use Application Context instead, explained in next video.

  • @AT-vm2jh
    @AT-vm2jh 3 ปีที่แล้ว +17

    This tutorial is great and definitely needs an update to an recent versions of Spring. I hope you will find time to make some soon. Thanks for your amazing work!

  • @kaiwalyapowle7804
    @kaiwalyapowle7804 2 ปีที่แล้ว +2

    This video is still relevant because even if we don't use the old framework much, we need to understand the configuration and basic concepts in order to know the latest framework and how the latest framework bypasses all the tedious configuation.

  • @MDehran
    @MDehran 10 ปีที่แล้ว

    This is simplest and clear example i saw to create bean using bean factory and its implementation classes. thanks

  • @JitendraDas62075
    @JitendraDas62075 5 ปีที่แล้ว +3

    If someone is getting problem with DTD xml format then they can try the XSD XMl format as shown below:

    • @Rhyzal_
      @Rhyzal_ 4 ปีที่แล้ว

      Thank you so much! This solved my problem!

  • @MukulTripathi
    @MukulTripathi 13 ปีที่แล้ว +1

    Seen all four as soon as they came out... waiting for more... Excellent tutorials!

  • @funkybuddha1598
    @funkybuddha1598 4 ปีที่แล้ว

    Please donot delete these tutorials!!

  • @rav8149
    @rav8149 10 ปีที่แล้ว +1

    If you're getting classnot found then
    this is the right way in spring.xml
    This will work

  • @Java.Brains
    @Java.Brains  13 ปีที่แล้ว +1

    @roshansalvi81 Hope you've seen the other tutorials on my channel. I cover Spring annotations in considerable detail.

  • @vitezkoja6949
    @vitezkoja6949 8 ปีที่แล้ว +40

    If someone use maven for this project: 1. spring.xml need to be in folder res/main/resources and 2. in DrawingApp main metod should be like this:
    // BeanFactory factory = new ClassPathXmlApplicationContext("spring.xml");
    //Triangle triangle = (Triangle) factory.getBean("triangle");
    //triangle.drawn();

    • @logeshs9370
      @logeshs9370 7 ปีที่แล้ว +1

      instead of xml file we can use configuration class

    • @piyushchandra3585
      @piyushchandra3585 6 ปีที่แล้ว +2

      Putting spring.xml in src folder will also work.

    • @NavigatingCareer
      @NavigatingCareer 3 ปีที่แล้ว

      Thanks!

  • @linchenSeth
    @linchenSeth 5 ปีที่แล้ว +2

    For the latest version of Spring, the Spring.xml should be under the src directory to get rid of the No bean available exception :)

  • @ureachsenthil2
    @ureachsenthil2 10 ปีที่แล้ว

    Thank you very much for taking time and effort to put this wonderful and useful tutorial. It is very simple and easy to follow. Love your teaching skills!

  • @kiphill5447
    @kiphill5447 11 ปีที่แล้ว

    Great Educator. Your instructions are concise and very helpful.

  • @nikhidas23
    @nikhidas23 12 ปีที่แล้ว

    Awewsome Koushik ! Thank you so much for sharing your knowledge

  • @santubudhe2
    @santubudhe2 13 ปีที่แล้ว

    i got spring setup in eclipse, now i can give a high level description about dependence injection, need for bean factory and how spring is helping avoid dependence between classes. thank you very much.

  • @saurabhgangamwar8290
    @saurabhgangamwar8290 4 ปีที่แล้ว

    thank you so much.i have learned lot of things from your videos.

  • @vivekcg519
    @vivekcg519 8 ปีที่แล้ว +6

    Guys, XMLBeanFactory is depricated.So, Use:
    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    BeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
    reader.loadBeanDefinitions(new FileSystemResource("Spring.xml"));

    • @Lostforface
      @Lostforface 7 ปีที่แล้ว

      worked for me! thnks

  • @muzzammilayyubi6944
    @muzzammilayyubi6944 10 ปีที่แล้ว

    Very clean and clear tutorial. Awesome

  • @hensshad4832
    @hensshad4832 8 ปีที่แล้ว +22

    The XmlBeanFactory is deprecated. The better alternative is using ClassPathXmlApplicationContext as follow:
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");

    • @michaelpoznecki3033
      @michaelpoznecki3033 6 ปีที่แล้ว +4

      I am trying this, but I keep getting "File does not exist" error for spring.xml

    • @ramkethireddy9445
      @ramkethireddy9445 6 ปีที่แล้ว +8

      need to put the xml file under src folder

    • @VenkateshMogili
      @VenkateshMogili 5 ปีที่แล้ว

      Thank you Ram, it got solved...

    • @dev-skills
      @dev-skills 5 ปีที่แล้ว +1

      _ApplicationContext_ uses *eager loading* whereas _BeanFactory_ used *lazy loading* . It includes all functionality of _BeanFactory_ and more. For most of the enterprise applications, _ApplicationContext_ is preferred. Use as below:
      ApplicationContext context=new ClassPathXmlApplicationContext("springs.xml");

    • @krishnasomayajulu4963
      @krishnasomayajulu4963 5 ปีที่แล้ว

      @@ramkethireddy9445 Correct, it worked well.Thanks

  • @Raind3ad
    @Raind3ad 10 ปีที่แล้ว +9

    XmlBeanFactory is deprecated in the latest version but you could try it this way (Like in the next Tutorial 05 ):
    //Gets the resource
    ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
    Triangle triangle = (Triangle) context.getBean("triangle");
    triangle.draw();
    //Closes the context
    ( (ClassPathXmlApplicationContext) context ).close();

  • @stokescomp
    @stokescomp 12 ปีที่แล้ว +1

    I followed your tutorial and it worked the first time!! It does mention that XmlBeanFactory is deprecated. I have fixed it using this line: ApplicationContext factory= new ClassPathXmlApplicationContext("spring.xml"); instead of: BeanFactory factory = new XmlBeanFactory(new FileSystemResource("spring.xml"));
    Thanks for the great tutorial.

    • @stokescomp
      @stokescomp 2 ปีที่แล้ว

      Glad I was able to help 9 years in the past! Good luck!

  • @pallavimanan4124
    @pallavimanan4124 5 ปีที่แล้ว +3

    If you're getting the below exceptions, do the following:
    1. Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring.xml] cannot be opened because it does not exist
    Solution: Write the fully qualified name of the spring.xml file, e.g. ApplicationContext factory= new ClassPathXmlApplicationContext("\\org\\pallavi\\spring\\spring.xml");
    2. org.xml.sax.SAXParseException; Content is not allowed in trailing section.
    Solution: When you're copying the contents of ApplicationContext.xml from some other website, it copies some other invisible characters too. You should create it fresh without copy-pasting so that extra characters are not added to the XML.
    e.g.
    Since I am using spring 5.1.1, I replaced 2.0 with 5.1.1 and it worked for me!
    Hope it helps! :)
    Thank you

    • @AkashSingh-el1ew
      @AkashSingh-el1ew 5 ปีที่แล้ว +1

      for BeanDefinitionStoreException, we would see in error description, something like, parsing XML document from file[location], for me i had to include 'src\\', we .......what I am trying to say is, we can always use the location to find the location of xml file in local disk, which can be used accordingly :)

    • @Lycheeee11
      @Lycheeee11 5 ปีที่แล้ว

      This really helped me! Thanks!

  • @stokescomp
    @stokescomp 12 ปีที่แล้ว +3

    When I used the ApplicationContext I also had to move the spring.xml file into the src folder in the project instead of the project folder.

  • @Java.Brains
    @Java.Brains  12 ปีที่แล้ว

    My guess is that Spring is not able to find the class Triangle that you've mapped for bean name "triangle". Have you double-checked the package name, class name for typos?

  • @fagonas
    @fagonas 12 ปีที่แล้ว

    Thank you so much! you lighten my life.

  • @fatiheneskose4477
    @fatiheneskose4477 5 ปีที่แล้ว +1

    Use ClassPathXmlApplicationContext instead of XmlBeanFactory for new versions

  • @garytimeless7251
    @garytimeless7251 3 ปีที่แล้ว

    I am going to write an exam about software architecture tomorrow - thx for your nice explanation.

  • @CHeRNoRMX
    @CHeRNoRMX 8 ปีที่แล้ว

    I like your english, especially the gaps between the words... "we're doing a (pause) bean", "you get a (pause) Triangle)"... once again, thanks for the great tutorial.

  • @muhammadzaman9804
    @muhammadzaman9804 2 ปีที่แล้ว +1

    Nothing works. I am doing projects on all your work but unfortunately nothing works. Errors and Errors and Errors.

  • @danishrubhan3884
    @danishrubhan3884 ปีที่แล้ว

    Error occurred during initialization of boot layer
    java.lang.module.FindException: Module spring.beans not found, required by SpringDemo

  • @donoi2k22
    @donoi2k22 9 ปีที่แล้ว

    Make sure there's no blank space after , otherwise big fat exception.

  • @chandrakanthdudela5515
    @chandrakanthdudela5515 9 ปีที่แล้ว +2

    Hi, I created the spring.xml under the root as you have explained but it showed me a IOExceptoin saying it couldn't find the XML file. I copied it under the 'src' folder and it worked. Is there any reason behind it?

    • @victort.5040
      @victort.5040 8 ปีที่แล้ว +1

      +chandra kanth I think because we use ClassPathXmlApplicationContent() instead, it doesn't allow pass FileSystemResource variable. The path of FileSystemResouce is /, but that of ClassPathXmlApplicationContent is /src/ +Java Brains is it correct?

    • @lemonginger001
      @lemonginger001 7 ปีที่แล้ว

      Can u elobarate more

    • @aparnaganguri8066
      @aparnaganguri8066 6 ปีที่แล้ว

      Even I encountered with same exception java.io.FileNotFoundException. I copied xml file under 'src' folder,but still i am getting same Exception. i appreciate your help ...Thank You

  • @zebashabnam4962
    @zebashabnam4962 5 ปีที่แล้ว +2

    In my case its depriccating the XmlBeanFactory

  • @SushantKumar-ev5uh
    @SushantKumar-ev5uh 2 ปีที่แล้ว +1

    XmlBeanFactory is deprecated . You videos are great but please update them.

  • @pranneetthbheemisetty8685
    @pranneetthbheemisetty8685 8 ปีที่แล้ว

    I have did exactly the same what is done in the tutorial except that i have ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
    new String[] {"spring.xml"});
    in place of XmlBeanFactory. But when i run the program its not printing anything on console..its completely blank. Please help me!

  • @richardlarancuente7377
    @richardlarancuente7377 3 ปีที่แล้ว

    The dependencies can be found from here
    repo.spring.io/release/org/springframework/spring/ [Spring jar] => Select the approriate version
    commons.apache.org/proper/commons-logging/download_logging.cgi [Apache jars] => Inside zip/tar file

  • @adarshverma3372
    @adarshverma3372 3 ปีที่แล้ว

    if someone is using the maven then add the spring.xml in the src/main/resources

  • @helipilot727
    @helipilot727 8 ปีที่แล้ว

    I'm not following what was accomplished. You moved the new Triangle() out of code and into a config to avoid a code dependency on Triangle(), but then used Triangle in the method anyway, to store the reference from getBean(). So the code is still dependent on on Triangle(). So you added a spring config file, third party library (spring framework), effectively moved a possible compile time error to a run time error, all to eliminate the "new" keyword?

    • @Java.Brains
      @Java.Brains  8 ปีที่แล้ว +1

      +flgliderpilot Not just new. The idea is to have the class depend on an interface and not an implementation. Having moved the new out of the class and into config, we now have the flexibility to supply a new instance of any class that implements that interface.

    • @shinigami0018
      @shinigami0018 8 ปีที่แล้ว

      +flgliderpilot I agree with you. As for Triangle object, to be fully independent of any concrete type, I guess you would better use Shape Class, and then call shape.draw(), that way your class wouldn't be dependent on any concrete class.

  • @AkeshwarJha
    @AkeshwarJha 9 ปีที่แล้ว +4

    Hi, when I try to import org.springframework.beans.factory.xml.XmlBeanFactory, it says that XmlBeanFactory is deprecated. Using spring 4.2.0
    Kindly resolve!

    • @thijs-de-haan
      @thijs-de-haan 9 ปีที่แล้ว

      +Akeshwar Jha stackoverflow.com/questions/5231371/springs-xmlbeanfactory-is-deprecated#answer-9210939

  • @aayushagrawal24
    @aayushagrawal24 6 ปีที่แล้ว

    i have added all the reqiured jar files, but still beanfactory interface and xmlbeanfactory classes are not getting resolved. sumone pls help

  • @sumanshrestha834
    @sumanshrestha834 8 ปีที่แล้ว +5

    XmlBeanFactory is depreciated what does it means when we are import it it shows that msg

  • @xh3992
    @xh3992 8 ปีที่แล้ว +5

    Great tutorial, it would be better if the project is first created as Maven project though

  • @kenilpatel7841
    @kenilpatel7841 2 ปีที่แล้ว

    Loved this

  • @RickyRicheRebelle
    @RickyRicheRebelle 6 ปีที่แล้ว +1

    as many others i'm getting the annoying arror msg: class path resource [spring.xml] cannot be opened because it does not exist while I did everything shown in the video. as the methods are deprecated in newest releases, I changed BeanFactory etc into :
    BeanDefinitionRegistry factory = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
    reader.loadBeanDefinitions(new ClassPathResource("spring.xml"));
    Triangle tri1 = (Triangle) ((DefaultListableBeanFactory) factory).getBean("tri1");
    in the XML file, it seems that the standard has changed as well (since when i put DOCTYPE in it, eclipse immediately shows me multiple errors, while without DOCTYPE I'm not getting any error msg). instead of DOCTYPE I looked up official notes and implemented the following lines:
    but still not working. why my spring.xml does not exist ? can't understand. If anyone knows what's wrong I'll appreciate that tnx

    • @ihor3729
      @ihor3729 6 ปีที่แล้ว

      try to write full path to the spring.xml For example: /org/koushik/javabrains/Spring.xml in DrawingAppClass

    • @RickyRicheRebelle
      @RickyRicheRebelle 6 ปีที่แล้ว

      possible solution. but actually after searching I found that if the xml is defined directly in the current package of the src folder then everything works fine. otherwise we need to put the xml into a special folder (as in the case of boot projects). I still can't figure out how could his project in the video works with that xml defined at project level...

    • @pallavimanan4124
      @pallavimanan4124 5 ปีที่แล้ว +1

      Use this:
      Since I am using spring 5.1.1, I replaced 2.0 with 5.1.1 and it worked for me!
      Thanks!

    • @tianyangren
      @tianyangren 5 ปีที่แล้ว

    • @abhijeetzade3336
      @abhijeetzade3336 5 ปีที่แล้ว +1

      @@pallavimanan4124 thanks mam now it works

  • @praslisa
    @praslisa 8 ปีที่แล้ว

    awesome tutorial!! thank you!!

  • @andrewshenka
    @andrewshenka 10 ปีที่แล้ว

    Yes, in last version Spring 4 XmlBeanFactory is cross out.

  • @amanvikram04
    @amanvikram04 7 ปีที่แล้ว +1

    why i am getting suppress warning annotations?

  • @chrismartin16cm
    @chrismartin16cm 4 ปีที่แล้ว +2

    I'm getting a "XmlBeanDefinitionStoreException"

  • @josselynmunoz8743
    @josselynmunoz8743 5 ปีที่แล้ว +1

    "...why are we performing this circus act..." haha

  • @jain7497
    @jain7497 6 ปีที่แล้ว

    Really excellent

  • @omocal4u
    @omocal4u 11 ปีที่แล้ว

    Great tutorial, clear and precise. A quich question is can I use hibernate in a stand alone application?

  • @ccosborn2000
    @ccosborn2000 10 ปีที่แล้ว

    Is this just for ECLIPSE? I do not see a BeanFactory in NetBeans.

  • @sethuramanpalaniappan2710
    @sethuramanpalaniappan2710 8 ปีที่แล้ว

    I am using Spring4.2 Jars,XmlBeanFactory is depricated for me...pls help me through an alternative way of doing it.

  • @jahanavilagadapati2706
    @jahanavilagadapati2706 9 ปีที่แล้ว

    i'm getting class not found exception for the program when i tried how to build it?

  • @nezz0r
    @nezz0r 6 ปีที่แล้ว

    The tutorial series is good but no matter how I think about it I still do not see any advantage in using Spring for creating objects.
    Can someone explain to me the advantage?

  • @ambarbs
    @ambarbs 10 ปีที่แล้ว

    Thanks a lot for making this tutorial!

  • @ujjawalgupta8799
    @ujjawalgupta8799 5 ปีที่แล้ว

    I can't import those spring factory library in my class.... I have added the spring factory jars as specified in the video... But diffrnt version

  • @sweetztcs
    @sweetztcs 12 ปีที่แล้ว

    Hi, I tried implementing the above program but it shows the error as "XmlBeanFactory is deprecated". Can you please tell me why it shows this?

  • @niharikapatnaik1199
    @niharikapatnaik1199 4 ปีที่แล้ว +1

    can u pls tell how we can get those info level messages on the console? pls i'm struggling to get that since 6 months.

    • @niharikapatnaik1199
      @niharikapatnaik1199 4 ปีที่แล้ว +1

      Finally got the answer, after almost a year. I needed to use the earlier version of springs; used 4.2.2 instead of 5.2.2. Now I can see the info logs in the console

  • @ambikabc
    @ambikabc 12 ปีที่แล้ว

    @Koushks : I have a doubt. If the spring.xml file has say like 100 entries meaning 100 classes.
    Does that mean we need to remember the names of all those classes in case we have to create an object of a particular class in DrawingApp? (like for example we create triangle object).

  • @malbrantj
    @malbrantj 9 ปีที่แล้ว

    Really good tutorial!

  • @AminHasan85
    @AminHasan85 9 ปีที่แล้ว

    Great example. thx

  • @ViswanathanRanganathan
    @ViswanathanRanganathan 11 ปีที่แล้ว

    Are there any other means of configuring the bean factory other than using XMLBeanFactory?...Just curious!

  • @abarag8
    @abarag8 6 ปีที่แล้ว

    In Spring v 5.0, BeanFactory is deprecated. Use below alternative for BeanFactory:
    BeanDefinitionRegistry factory = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
    reader.loadBeanDefinitions(new ClassPathResource("spring.xml"));
    Triangle triangle = (Triangle) ((DefaultListableBeanFactory) factory).getBean("triangle");
    triangle.draw();

  • @leddel746
    @leddel746 11 ปีที่แล้ว

    it was awesome learning this.

  • @ravenblizzard
    @ravenblizzard 11 ปีที่แล้ว

    A little tip: Ctr+Shift+O will do all your imports at once.

  • @roshansalvi81
    @roshansalvi81 13 ปีที่แล้ว

    Very good explanation. But I was looking out for spring 3.0 examples with annotation.

  • @PawanSRAO-fk7vd
    @PawanSRAO-fk7vd 8 ปีที่แล้ว

    Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file . Can anyone help me resolve this error?

  • @ayanmukherjee333
    @ayanmukherjee333 6 ปีที่แล้ว

    If you are getting XmlBeanFactory is deprecated warning use this alternative code
    ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
    BeanFactory factory = context;

    • @dev-skills
      @dev-skills 5 ปีที่แล้ว

      Or you can use a
      Triangle triangle = (Triangle) context.getBean("triangle"); // instead of factory.getBean("triangle")

  • @musicLover29102011
    @musicLover29102011 11 ปีที่แล้ว

    I am learning Spring framework and videos are very helpful for me. In this video, you have used Factory pattern for creating objects and so you have a brand new object whenever you call getBean(id) api. Is there a way to return an already created object if the same id is passed again?

  • @sudipupadhyay6935
    @sudipupadhyay6935 6 ปีที่แล้ว

    if we do factory.getBean("triangle",Triangle.class) i dont think we need to type cast it.

  • @parthsalat3915
    @parthsalat3915 2 ปีที่แล้ว +1

    Please give us the Doctype code!

  • @chrismartin16cm
    @chrismartin16cm 4 ปีที่แล้ว +1

    I'm also using Netbeans IDE

  • @JimitRupani
    @JimitRupani 7 ปีที่แล้ว

    Why i am getting Calss not found exception error on the same code?

  • @shashgo
    @shashgo 7 ปีที่แล้ว

    koushik @javabrains You put the spring jars and the common logging utilities in a spring folder in the project by right clicking on the project, going to properties ..... and creating a user library. How about if instead of creating a new user library, we right just add the external jar libraries under the libraries tag, would everything still work.
    Also, yes I know that XmlBeanFactory is deprecated in favour of ApplicationContext, but shouldn't a deprecated tag still work?

    • @Deocampo3
      @Deocampo3 6 ปีที่แล้ว

      In regards to the deprecated tag question, Yes it will work, I tried it for Spring v-3.2.0.

  • @meytal-3478
    @meytal-3478 4 ปีที่แล้ว

    Awesome

  • @TheSridharraj
    @TheSridharraj 10 ปีที่แล้ว +1

    Will you please update all the videos with the latest spring version?

  • @ZACK-mp7ek
    @ZACK-mp7ek 3 ปีที่แล้ว

    Error: Unable to initialize main class com.edureka.springbootdemo.DrawingApp
    Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
    help me anyone

  • @mohnishpwr10
    @mohnishpwr10 2 ปีที่แล้ว

    From where to get the code ?

  • @programm.r
    @programm.r 9 ปีที่แล้ว

    I've downloaded the newest version of spring -version 4.1.6. I tried the code that was suggested within the comments below as a solution to the deprecated XmlBeanFactory, and unfortunately, that code failed to execute. Would someone be able to explain how to do all the steps in this tutorial using the latest version?

    • @sudysona
      @sudysona 9 ปีที่แล้ว

      Robyn Silber So I just did the same steps as told in the tutorial with 4.1.6 and it worked fine. I assume you are using Java 1.6 and above. What happens when you try to run the code? Is there a compile time problem?

    • @ittejes
      @ittejes 9 ปีที่แล้ว

      Sudarshan Datta i have the same problem.
      It shows NoClassDefFoundError: org/apache/commons/logging/LogFactory

    • @sudysona
      @sudysona 9 ปีที่แล้ว

      tejeswi vallamkonda Did u include logging classes as shown by Java brains during library setup? If so, ensure that the libarary is part of your current classpath.

    • @aleksejskadulins6064
      @aleksejskadulins6064 9 ปีที่แล้ว

      Sudarshan Datta Thanks you, I had the same problem, you helped me a lot. This logging class is commons-logging-x.x.jar

  • @nikeshshetty7814
    @nikeshshetty7814 9 ปีที่แล้ว

    That was really great Java Brains Can you please add some comments with respect to changes in latest spring It would be helpful.
    I know the effort of uploading the new video, so comments would be really helpful.
    Thanks

  • @PratikShende91
    @PratikShende91 9 ปีที่แล้ว

    java.io.FileNotFoundException: class path resource [spring.xml] cannot be opened because it does not exist ,sir am getting this error..help me in that

    • @Java.Brains
      @Java.Brains  9 ปีที่แล้ว +1

      Pratik Shende Should be obvious if you read the error! :) It doesn't find the spring.xml file. Check the path, and make sure it matches what I do in the video.

    • @PratikShende91
      @PratikShende91 9 ปีที่แล้ว

      Ohh.thanks for the rply sir.I resolved that problem.actually problem.was in XML doc tag..as m using spring 4.1.6 .so the XML pattern is different for that.now its working sir.your teaching is good sir.Thanks for uploading videos.

    • @programm.r
      @programm.r 9 ปีที่แล้ว

      Pratik Shende Hi, would you mind providing a quick explanation and the code of the changes made using the latest version?

    • @PratikShende91
      @PratikShende91 9 ปีที่แล้ว

      Robyn Silber yeah.why not?just search for the XML pattern releated to the version you are using then just copy the XML pattern into your .XML file.it will work.if you still won't get how to do that,send me your mail id..ill gonna send you the XML pattern.

    • @SimpleGita
      @SimpleGita 9 ปีที่แล้ว

      Pratik Shende Could you post it here ?

  • @kartiktamtaincupdates
    @kartiktamtaincupdates 7 ปีที่แล้ว

    where to put spring.xml in netbeans in my case it is not reconizing it

    • @azuhiru
      @azuhiru 7 ปีที่แล้ว

      maybe it's late but... you have to put the spring.xml file in the /src folder

    • @archi7373
      @archi7373 7 ปีที่แล้ว

      In that, it is asking to select from:- 1.Well formed Document,2.DTD Constrained Document,3.XML schema constrained document.Which one of them am i supposed to select?

    • @archi7373
      @archi7373 7 ปีที่แล้ว

      In that, it is asking to select from:- 1.Well formed Document,2.DTD Constrained Document,3.XML schema constrained document.Which one of them am i supposed to select?

  • @TheGuroguro12
    @TheGuroguro12 7 ปีที่แล้ว

    Thank you very much.

  • @kalyanipatel1255
    @kalyanipatel1255 10 ปีที่แล้ว

    Hi Kaushik,
    Thanks a lot for these wonderful tutorials, these are really helpful.
    I had one question, I see tutorial bundles which got most hits in utube are of urs.
    So it must be good :) and thats not only for one framework , starting from servlet to spring, hibernet and more
    I just wonder how many framework have you mastered ...
    Just one thing these tutorials are very very helpful.
    I am done with 2 of the framework , thanks to u
    Is there any tutorials which is in more depth , or with some assignments which u can suggest
    Thanks again mate

  • @gauravsingh-nt2bs
    @gauravsingh-nt2bs 11 ปีที่แล้ว

    xml document from class path resource is invalid.. :(

  • @RonnyKibet
    @RonnyKibet 8 ปีที่แล้ว +2

    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
    Works.

  • @m0kter
    @m0kter 9 ปีที่แล้ว

    thanks for the videos

  • @michaeltansy
    @michaeltansy 9 ปีที่แล้ว

    I dont have that spring folder in my java project, how you guys have that? fyi spring is already installed on my computer

  • @CoLinearProductions
    @CoLinearProductions 9 ปีที่แล้ว

    is this deprecated?

  • @ch1n089
    @ch1n089 12 ปีที่แล้ว

    you work is with MVC?
    thx

  • @HH_Linkmusic
    @HH_Linkmusic 4 ปีที่แล้ว

    try this ClassPathXmlApplicationContext mContext=new ClassPathXmlApplicationContext("spring.xml")

  • @YasirShabbirChoudhary
    @YasirShabbirChoudhary 9 ปีที่แล้ว

    nice tutorial Sir G

  • @rexsam3134
    @rexsam3134 2 ปีที่แล้ว

    How important is this 10 year old video if it is deprecated?

  • @himanshudgp
    @himanshudgp 8 ปีที่แล้ว

    people who are facing problems while using XmlBeanFactory can start using ClassPathXmlApplicationContext to initialize *bean.xml. I hope this will solve the problem also for more discussion go through : stackoverflow.com/questions/5231371/springs-xmlbeanfactory-is-deprecated#answer-9210939

    • @osirisrobledo8425
      @osirisrobledo8425 8 ปีที่แล้ว

      I'm getting a "java.io.FileNotFoundException exception" for my file "spring.xml"
      ApplicationContext context= new ClassPathXmlApplicationContext("triangle.xml");
      Triangle triangle = (Triangle) context.getBean("triangle");
      triangle.draw();

  • @simplyabdou8425
    @simplyabdou8425 2 ปีที่แล้ว

    those poor keyboard keys really took a beating :(

  • @luckyshaqqq
    @luckyshaqqq 10 ปีที่แล้ว

    hey, does anyone know the difference between the id and the name of the bean?

  • @jiatong950
    @jiatong950 8 ปีที่แล้ว

    很好

  • @43098108
    @43098108 4 ปีที่แล้ว

    If using a maven project use:
    //place spring.xml in src folder
    BeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource("src/spring.xml"));
    //spring.xml file format:

  • @richadesai4128
    @richadesai4128 7 ปีที่แล้ว

    Can someone please post the latest working code for DrawingApp.java? Thanks!

    • @Pioplu
      @Pioplu 6 ปีที่แล้ว +4

      I'm using Spring Framework 4.3.9 and this code is working:
      package com.example.spring;
      import org.springframework.context.support.ClassPathXmlApplicationContext;
      public class DrawingApp {
      public static void main(String[] args) {
      ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
      Triangle triangle = (Triangle) context.getBean("triangle");
      triangle.draw();
      }
      }

    • @suneethadevi4257
      @suneethadevi4257 6 ปีที่แล้ว

      write the code like this
      Resource res = new ClassPathResource("spring.xml");
      BeanFactory factory = new XmlBeanFactory(res);
      factory.draw();
      try this one................

    • @suneethadevi4257
      @suneethadevi4257 6 ปีที่แล้ว

      Resource res = new ClassPathResource("spring.xml");
      BeanFactory factory = new XmlBeanFactory(res);
      Triangle triangle = (Triangle)factory.getBean("triangle");
      triangle.display();
      try this code............................................................