Results 1 to 7 of 7

Thread: org.springframework.aop.framework.Advised not visible??

  1. #1
    Join Date
    Nov 2004
    Posts
    16

    Default org.springframework.aop.framework.Advised not visible??

    i only want to use Transaction in my app, and my applicationContext.xml is :

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
        "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
    
    <beans>
        <!-- Hibernate SessionFactory -->
        <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
           <!-- <property name="dataSource"><ref local="dataSource"/></property>-->
          	<property name="configLocation">
    			<value>classpath&#58;/hibernate.cfg.xml</value>
    		</property>	
        </bean>
        
         <bean id="transfersNetDAO" class="com.jctx.trms.hibernate.DAO.TransfersNetDAOImpl">
            <property name="sessionFactory">
                <ref local="sessionFactory"/>
            </property>
        </bean>
        
        <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
            <property name="sessionFactory">
                <ref local="sessionFactory"/>
            </property>
        </bean>
        
           <bean id="txProxyTemplate" lazy-init="true"
            class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
            <property name="transactionManager">
                <ref bean="transactionManager"/>
            </property>
            <property name="transactionAttributes">
                <props>
                    <prop key="del*">PROPAGATION_REQUIRED</prop>
                    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
                </props>
            </property>
    
        </bean>
          <bean id="transfersNetManager" parent="txProxyTemplate">
            <property name="target">
                <bean class="com.jctx.trms.hibernate.bussiness.TransfersNetManagerImpl">
                    <property name="transfersNetDAO"><ref bean="transfersNetDAO"/></property>
                </bean>
            </property>
        </bean>
        <!-- Add Managers here -->
    </beans>
    but when i use
    TransfersNetManager tx=(TransfersNetManager) ctx.getBean("transfersNetManager");
    tx.findxxx() method ;
    there are some errors ,the messages are:
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transfersNetManager' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: interface org.springframework.aop.framework.Advised is not visible from class loader

    Code:
    java.lang.ExceptionInInitializerError
    	at com.jctx.trms.propertyui.NetworkUI$1.widgetSelected&#40;NetworkUI.java&#58;175&#41;
    	at org.eclipse.swt.widgets.TypedListener.handleEvent&#40;TypedListener.java&#58;89&#41;
    	at org.eclipse.swt.widgets.EventTable.sendEvent&#40;EventTable.java&#58;82&#41;
    	at org.eclipse.swt.widgets.Widget.sendEvent&#40;Widget.java&#58;796&#41;
    	at org.eclipse.swt.widgets.Display.runDeferredEvents&#40;Display.java&#58;2772&#41;
    	at org.eclipse.swt.widgets.Display.readAndDispatch&#40;Display.java&#58;2431&#41;
    	at org.eclipse.ui.internal.Workbench.runEventLoop&#40;Workbench.java&#58;1377&#41;
    	at org.eclipse.ui.internal.Workbench.runUI&#40;Workbench.java&#58;1348&#41;
    	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench&#40;Workbench.java&#58;254&#41;
    	at org.eclipse.ui.PlatformUI.createAndRunWorkbench&#40;PlatformUI.java&#58;141&#41;
    	at org.eclipse.ui.internal.ide.IDEApplication.run&#40;IDEApplication.java&#58;96&#41;
    	at org.eclipse.core.internal.runtime.PlatformActivator$1.run&#40;PlatformActivator.java&#58;335&#41;
    	at org.eclipse.core.runtime.adaptor.EclipseStarter.run&#40;EclipseStarter.java&#58;273&#41;
    	at org.eclipse.core.runtime.adaptor.EclipseStarter.run&#40;EclipseStarter.java&#58;129&#41;
    	at sun.reflect.NativeMethodAccessorImpl.invoke0&#40;Native Method&#41;
    	at sun.reflect.NativeMethodAccessorImpl.invoke&#40;NativeMethodAccessorImpl.java&#58;39&#41;
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;DelegatingMethodAccessorImpl.java&#58;25&#41;
    	at java.lang.reflect.Method.invoke&#40;Method.java&#58;324&#41;
    	at org.eclipse.core.launcher.Main.basicRun&#40;Main.java&#58;185&#41;
    	at org.eclipse.core.launcher.Main.run&#40;Main.java&#58;704&#41;
    	at org.eclipse.core.launcher.Main.main&#40;Main.java&#58;688&#41;
    Caused by&#58; org.springframework.beans.factory.BeanCreationException&#58; Error creating bean with name 'transfersNetManager' defined in class path resource &#91;applicationContext.xml&#93;&#58; Initialization of bean failed; nested exception is java.lang.IllegalArgumentException&#58; interface org.springframework.aop.framework.Advised is not visible from class loader
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;300&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;205&#41;
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;204&#41;
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;136&#41;
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons&#40;DefaultListableBeanFactory.java&#58;230&#41;
    	at org.springframework.context.support.AbstractApplicationContext.refresh&#40;AbstractApplicationContext.java&#58;284&#41;
    	at org.springframework.context.support.AlternateClassPathXmlApplicationContext.<init>&#40;AlternateClassPathXmlApplicationContext.java&#58;66&#41;
    	at org.springframework.context.support.AlternateClassPathXmlApplicationContext.<init>&#40;AlternateClassPathXmlApplicationContext.java&#58;49&#41;
    	at com.jctx.trms.utils.GlobalApplicationContext.<clinit>&#40;GlobalApplicationContext.java&#58;14&#41;
    	... 21 more
    &#91;b&#93;Caused by&#58; java.lang.IllegalArgumentException&#58; interface org.springframework.aop.framework.Advised is not visible from class loader&#91;/b&#93;	at java.lang.reflect.Proxy.getProxyClass&#40;Proxy.java&#58;331&#41;
    	at java.lang.reflect.Proxy.newProxyInstance&#40;Proxy.java&#58;552&#41;
    	at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy&#40;JdkDynamicAopProxy.java&#58;194&#41;
    	at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy&#40;JdkDynamicAopProxy.java&#58;182&#41;
    	at org.springframework.aop.framework.ProxyFactory.getProxy&#40;ProxyFactory.java&#58;66&#41;
    	at org.springframework.transaction.interceptor.TransactionProxyFactoryBean.afterPropertiesSet&#40;TransactionProxyFactoryBean.java&#58;236&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods&#40;AbstractAutowireCapableBeanFactory.java&#58;1057&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;287&#41;
    	... 29 more
    what's the wrong with these? :?:

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    You seem to have a class loader problem. So your XML config isn't really relevant--more how your class loading works. Is there anything unusual about your Eclipse setup?

    What is org.springframework.context.support.AlternateClass PathXmlApplicationContext?
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3
    Join Date
    Nov 2004
    Posts
    16

    Default

    Quote Originally Posted by Rod Johnson
    You seem to have a class loader problem. So your XML config isn't really relevant--more how your class loading works. Is there anything unusual about your Eclipse setup?

    What is org.springframework.context.support.AlternateClass PathXmlApplicationContext?
    this is a class from http://folk.uio.no/olepaa/spring/, i use it to solve the classloader problem that occur in my hibernate+spring+Eclipse RCP integrated application.
    because i use spring in a eclipse rcp application ,not a webapp,so i have to
    use
    Code:
     String&#91;&#93; contextFiles = &#123; "applicationContext.xml" &#125;;
            if &#40;ctx == null&#41; &#123;
                ctx = new AlternateClassPathXmlApplicationContext&#40;contextFiles, LogicMessages.class&#41;;
            &#125;
    to load my applicationContext.xml.

  4. #4
    Join Date
    Dec 2004
    Location
    Portugal
    Posts
    2

    Default

    I had the same problem, what i did is set the Thread context class loader to the clazz class loader from AlternateClassPathXmlApplicationContext, i modified the constructor

    Code:
    	public AlternateClassPathXmlApplicationContext&#40;String&#91;&#93; configLocations, 
    			Class clazz, boolean refresh&#41; throws BeansException &#123;
    		super&#40;configLocations, false&#41;;
    		this.clazz = clazz;
    		
    		
    //To fix problems when triying to load files using the thread class loader. 
    		Thread.currentThread&#40;&#41;.setContextClassLoader&#40;clazz.getClassLoader&#40;&#41;&#41;;
    		
    		
    		
    		if &#40;refresh&#41;&#123;
    			refresh&#40;&#41;;
    		&#125;
    	&#125;
    I haven't has any more problems so long, and i hope it doesn't break anything.

  5. #5
    Join Date
    Jan 2005
    Posts
    4

    Default I get this with Orion in a Debian Linux environment..

    When two apps are loaded up using Spring in the same instance of Orion.

    Here's where the error starts from:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'UserDAO': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: interface org.springframework.aop.framework.Advised is not visible from class loader
    java.lang.IllegalArgumentException: interface org.springframework.aop.framework.Advised is not visible from class loader

    Anyone else having this problem? I've installed a fresh version of orion, fresh JDK, latest Spring jars etc.

  6. #6
    Join Date
    Jan 2005
    Posts
    4

    Default

    full stack trace:

    java.lang.IllegalArgumentException: interface org.springframework.aop.framework.Advised is not visible from class loader
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'UserDAO': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: interface org.springframework.aop.framework.Advised is not visible from class loader
    java.lang.IllegalArgumentException: interface org.springframework.aop.framework.Advised is not visible from class loader
    at java.lang.reflect.Proxy.getProxyClass(Proxy.java:3 45)
    at java.lang.reflect.Proxy.newProxyInstance(Proxy.jav a:564)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.getProxy(JdkDynamicAopProxy.java:102)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.getProxy(JdkDynamicAopProxy.java:92)
    at org.springframework.aop.framework.ProxyFactoryBean .newPrototypeInstance(ProxyFactoryBean.java:267)

  7. #7
    Join Date
    Aug 2005
    Posts
    1

    Default why do I need to pass class to the AlternateClassPathXmlAppl

    Hi there,
    Why do I need to pass a class to the AlternateClassPathXmlApplicationContext?
    Please help, Spring + Eclipse RCP is killing me...

    thanks
    rp

Similar Threads

  1. Replies: 4
    Last Post: Oct 6th, 2009, 12:08 PM
  2. Can't use Junit in eclipse3!?
    By liren in forum SpringSource Tool Suite
    Replies: 2
    Last Post: Mar 18th, 2005, 08:11 PM
  3. spring:bind visible
    By dmitri zakharov in forum Web
    Replies: 0
    Last Post: Mar 4th, 2005, 07:22 AM
  4. Test Controllers
    By kantorn in forum Web
    Replies: 11
    Last Post: Jan 2nd, 2005, 08:20 AM
  5. Replies: 4
    Last Post: Oct 11th, 2004, 12:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •