Announcement Announcement Module
Collapse
No announcement yet.
AOP problems with spring + eclipse Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP problems with spring + eclipse

    I'm working on an rich client built on the top of eclipse RCP. I have a very simple beans.xml with only one bean:

    Code:
    <bean id="siteStructureService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
      <property name="serviceUrl" value="http&#58;//localhost&#58;8090/um-pages-middleware-1.0/ws/SiteStructureService" />
      <property name="serviceInterface" value="com.jcake.um.middleware.api.ISiteStructureService" />
    </bean>
    If I run the factory as:
    Code:
    	public static void main&#40;String&#91;&#93; args&#41; &#123;
    		XmlBeanFactory factory = new XmlBeanFactory&#40;new ClassPathResource&#40;"/com/jcake/um/beans.xml"&#41;&#41;; //$NON-NLS-1$
    		ISiteStructureService svc = &#40;ISiteStructureService&#41; factory.getBean&#40;"siteStructureService"&#41;; //$NON-NLS-1$
    		SiteStructureElement siteStructure = svc.getSiteStructure&#40;&#41;;
    		System.out.println&#40;siteStructure&#41;;
    	&#125;
    then everything is just fine. If I try the same from my eclipse app, spring jumps in infinite loop or something like that. The processor's load is about 70%, and the application hangs.

    I run the app in debug mode. Below there is where it stops:
    Code:
    &#91;...&#93;
    &#91;org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean&#93; defined in class path resource &#91;com/jcake/um/beans.xml&#93;&#93;
    2005-07-14 20&#58;02&#58;04,633 DEBUG AbstractAutowireCapableBeanFactory - Invoking BeanPostProcessors before instantiation of bean 'siteStructureService'
    2005-07-14 20&#58;02&#58;04,714 DEBUG CachedIntrospectionResults - Getting BeanInfo for class &#91;org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean&#93;
    2005-07-14 20&#58;02&#58;04,735 DEBUG CachedIntrospectionResults - Caching PropertyDescriptors for class &#91;org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean&#93;
    &#91;...&#93;
    2005-07-14 20&#58;02&#58;04,771 DEBUG CachedIntrospectionResults - Class &#91;org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean&#93; is cache-safe
    2005-07-14 20&#58;02&#58;04,793 DEBUG BeanWrapperImpl - About to invoke write method &#91;public void org.springframework.remoting.support.UrlBasedRemoteAccessor.setServiceUrl&#40;java.lang.String&#41;&#93; on object of class &#91;org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean&#93;
    2005-07-14 20&#58;02&#58;04,798 DEBUG BeanWrapperImpl - Invoked write method &#91;public void org.springframework.remoting.support.UrlBasedRemoteAccessor.setServiceUrl&#40;java.lang.String&#41;&#93; with value of type &#91;java.lang.String&#93;
    2005-07-14 20&#58;02&#58;04,806 DEBUG BeanWrapperImpl - Converting String to &#91;class java.lang.Class&#93; using property editor &#91;org.springframework.beans.propertyeditors.ClassEditor@1283052&#93;
    2005-07-14 20&#58;02&#58;04,809 DEBUG BeanWrapperImpl - About to invoke write method &#91;public void org.springframework.remoting.support.RemoteAccessor.setServiceInterface&#40;java.lang.Class&#41;&#93; on object of class &#91;org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean&#93;
    2005-07-14 20&#58;02&#58;04,810 DEBUG BeanWrapperImpl - Invoked write method &#91;public void org.springframework.remoting.support.RemoteAccessor.setServiceInterface&#40;java.lang.Class&#41;&#93; with value of type &#91;java.lang.Class&#93;
    2005-07-14 20&#58;02&#58;04,812 DEBUG AbstractAutowireCapableBeanFactory - Invoking BeanPostProcessors before initialization of bean 'siteStructureService'
    2005-07-14 20&#58;02&#58;04,819 DEBUG AbstractAutowireCapableBeanFactory - Invoking afterPropertiesSet&#40;&#41; on bean with name 'siteStructureService'
    2005-07-14 20&#58;02&#58;04,980 INFO  DefaultAopProxyFactory - CGLIB2 available&#58; proxyTargetClass feature enabled
    2005-07-14 20&#58;02&#58;04,985 INFO  CollectionFactory - JDK 1.4+ collections available
    2005-07-14 20&#58;02&#58;05,006 INFO  CollectionFactory - Commons Collections 3.x available
    2005-07-14 20&#58;02&#58;05,007 DEBUG CollectionFactory - Creating java.util.IdentityHashMap
    2005-07-14 20&#58;02&#58;05,010 DEBUG AdvisedSupport - Added new aspect interface&#58; com.jcake.um.middleware.api.ISiteStructureService
    2005-07-14 20&#58;02&#58;05,019 DEBUG JdkDynamicAopProxy - Creating JDK dynamic proxy
    And there is nothing more. The processor load increases to about 70%, my application hangs.

    Any ideas what it may be and how to fix it? I really do not know how is it possible that the same code works if I run in as main() and it does such strange thing when I run it from eclipse-rcp plugin...

  • #2
    I am getting something similar with my RCP client (Eclipse reporting an Unhandled event loop exception) whenever I declare the following bean and invoke a db operation even though the invocation does not utilise the transaction manager bean:

    <bean id="mytransactionManager"
    class="org.springframefork.jdbc.datasource.DataSou rceTransactionManager">
    <property name="dataSource">
    <ref bean="dataSource"></ref>
    </property>
    </bean>

    I am still investigating the cause but I think it may have to do with the fact that this code is running inside an eclipse plugin.

    Comment


    • #3
      Originally posted by jsp4141
      I am getting something similar with my RCP client (Eclipse reporting an Unhandled event loop exception) whenever I declare the following bean and invoke a db operation even though the invocation does not utilise the transaction manager bean:
      I've reported the bug, the patch is already in eclipse's bugzilla.
      https://bugs.eclipse.org/bugs/show_bug.cgi?id=103918

      It helped me, so it should also help you.

      Comment


      • #4
        The patch did not help. I think the issue I am having relates to the eclipse classloaders and the Spring Application Context.

        Thank you so much for your feedback.

        Comment

        Working...
        X