Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    Java Spring Framework

    General Discussion
    java spring
    1
    1
    318
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SachithAnu
      SachithAnu Web Development last edited by SachithAnu

      මේ Error එක එනව main claas eke එකෙ "ApplicationContext context = new ClassPathXmlApplicationContext("applicationContextFile.xml");" line එකෙන්

      Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator#0' defined in class path resource [applicationContextFile.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]

      applicationContextFile.xml

      <beans xmlns="http://www.springframework.org/schema/beans"  
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
      xmlns:aop="http://www.springframework.org/schema/aop"   
         xsi:schemaLocation="http://www.springframework.org/schema/beans   
         http://www.springframework.org/schema/beans/spring-beans.xsd   
         http://www.springframework.org/schema/aop   
         http://www.springframework.org/schema/aop/spring-aop.xsd">  
        
        <bean id="opBean" class="aspectdeclaresasaspect.Operation"></bean>
        <bean id="trackMyBean" class="aspectdeclaresasaspect.TrackOperation"></bean>
        <bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"></bean> 
        
      </beans>  
      

      main class "Test.java"

      public class Test {

      public static void main(String[] args) {
      	// TODO Auto-generated method stub
      	ApplicationContext context = new ClassPathXmlApplicationContext("applicationContextFile.xml");
      	Operation o = (Operation) context.getBean("opBean");
      
      	System.out.println("Calling msg.....");
      	o.msg();
      
      	System.out.println("Calling m.....");
      	o.m();
      
      	System.out.println("Calling k.....");
      	o.k();
      }
      

      }

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post

      0
      Online

      3.6k
      Users

      1.3k
      Topics

      5.3k
      Posts

      • Privacy
      • Terms & Conditions
      • Donate

      © Copyrights and All right reserved Lanka Developers Community

      Powered by Axis Technologies (PVT) Ltd

      Made with in Sri Lanka

      | |