Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Pointcuts in blueprint xml configuration causes classloading issue
Pointcuts in blueprint xml configuration causes classloading issue [message #975045] Wed, 07 November 2012 09:54 Go to next message
Sebastian Lorenz is currently offline Sebastian Lorenz
Messages: 36
Registered: November 2010
Member
I'm constantly getting the following exception:
Caused by: java.lang.IllegalArgumentException: warning no match for this type name: com.qualitype.genetics.ref.io.ReferenceDataManager [Xlint:invalidAbsoluteTypeName]
	at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:301)
	at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:207)
	at org.springframework.aop.aspectj.AspectJExpressionPointcut.getFallbackPointcutExpression(AspectJExpressionPointcut.java:358)
	at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:255)
	at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:209)
	at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:263)
	at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:295)
	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
	at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
	at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	... 39 more


for this configuration:

<bean id="referenceDataManager" class="com.qualitype.genetics.ref.service.impl.ReferenceDataManagerBean">
    <property name="repository" ref="referenceDataRepository" />
</bean>

<osgi:service ref="referenceDataManager"
     interface="com.qualitype.genetics.ref.io.ReferenceDataManager" />

<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="entityManagerFactory" />
	</bean>

	<tx:advice id="txAdvice" transaction-manager="transactionManager">
		<tx:attributes>
			<tx:method name="get*" read-only="true" />
			<tx:method name="find*" read-only="true" />
			<tx:method name="save*" />
			<tx:method name="delete*" />
		</tx:attributes>
	</tx:advice>

	<aop:config>
		<aop:pointcut id="referenceDataManagerOperation"
			expression="execution(* com.qualitype.genetics.ref.io.ReferenceDataManager.*(..))" />
		<aop:advisor advice-ref="txAdvice" pointcut-ref="referenceDataManagerOperation" />
	</aop:config>


Before using pointcuts in the blueprint configuration I tried the @Transactional annotation and it was working fine. Now using pointcuts I have this classloading trouble. I'm wondering if it is possible to use pointcuts in the blueprint configuration file?
Re: Pointcuts in blueprint xml configuration causes classloading issue [message #975093 is a reply to message #975045] Wed, 07 November 2012 10:42 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Presumably the bundle that contains org.aspectj.weaver.tools.PointcutParser does not import the package com.qualitype.genetics.ref.io. This is one of the issues of attempting load time weaving in an OSGi environment. I guess you could try adding the appropriate import (see this Virgo FAQ if you want to avoid hacking 3rd party bundle manifests). There is also some historic information on this subject here, but my feeling is that you are trail-blazing... Wink
Re: Pointcuts in blueprint xml configuration causes classloading issue [message #976231 is a reply to message #975093] Thu, 08 November 2012 07:18 Go to previous messageGo to next message
Sebastian Lorenz is currently offline Sebastian Lorenz
Messages: 36
Registered: November 2010
Member
Adding the package to the aspectj.weaver bundle did not help. Instead I had to add my com.qualitype.genetics.ref.io package to org.springframework.orm, org.springframework.transaction and org.eclipse.gemini.blueprint.core. All these bundles try to load the class during startup. Sad Well, my intention was to avoid any hard-coded spring dependencies, but for now I switched back to using the @Transactional annotation.

Btw. The OSGi Early Draft 2012.10 describes how to use transactions in osgi. Is using @Transactional "supported" or should I use bean-managed transactions?

[Updated on: Thu, 08 November 2012 10:08]

Report message to a moderator

Re: Pointcuts in blueprint xml configuration causes classloading issue [message #977779 is a reply to message #976231] Fri, 09 November 2012 10:16 Go to previous message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
There is no support in Gemini Blueprint for @Transactional.
Previous Topic:blueprint configuration eclipse juno
Next Topic:[SOLVED] Gemini JPA bundles refresh even with -DREFRESH_BUNDLES=false
Goto Forum:
  


Current Time: Thu Aug 21 04:22:34 EDT 2014

Powered by FUDForum. Page generated in 0.02621 seconds