我正在使用Gernomino 3.0.1与Aries/Blueprint试用OSGI。由于以下异常而碰壁:
2013-08-06 10:54:54832错误[BlueprintContainerImpl]无法启动捆绑包com.xxx.xxx的蓝图容器org.osgi.service.blueprint.cotainer.ComponentDefinitionException:无法实例化组件网址:org.apache.aries.bluendat.container.BlueprintContainerImpl.instantiateEagleComponents(BlueprintContainerImpl.java:644)网址:org.apache.aries.bluendat.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:331)网址:org.apache.aries.bluendat.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:227)位于java.util.concurrent.Executors$RunnableAdapter.call(Executitors.java:439)位于java.util.concurrent.FFutureTask$Sync.innerRun(FutureTask.java:303)位于java.util.concurrent.FFutureTask.run(FutureTask.java:138)位于java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)位于java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)位于java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)位于java.lang.Thread.run(Thread.java:662)由:java.lang.VerifyError引起:(类:com/xxx.xxx/services/impl/$UserServiceImpl307032798,方法:signature:(Ljava/lang/reflect/InInvocationHandler;)V)调用错误的初始化方法位于java.lang.Class.getDeclaredConstructors0(本机方法)位于java.lang.Class.privateGetDeclaredConstructors(Class.java:2398)位于java.lang.Class.getConstructor0(Class.java:2708)位于java.lang.Class.getConstructor(Class.java:1659)网址:org.apache.aries.proxy.impl.gen.ProxySubclassGenerator.newProxySubclassInstance(ProxySubclassGenerator.java:159)网址:org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:81)网址:org.apache.aries.proxy.impl.AbstractProxyManager.createProxy(AbstractProxy Manager.java:50)网址:org.apache.aries.bluent.contacter.Beancipe.addInterceptors(Beancipe.java:688)网址:org.apache.aries.bluent.contacter.Beancipe.internalCreate(Beancipe.java:728)网址:org.apache.aries.bluent.di.AbstractRecipe.create(AbstractRecipe.java:64)网址:org.apache.aries.bluent.contacter.BlueprintRepository.createInstances(BlueprintRepository.java:219)网址:org.apache.aries.bluent.contacter.BlueprintRepository.createAll(BlueprintRepository.java:147)网址:org.apache.aries.bluendat.container.BlueprintContainerImpl.instantiateEagleComponents(BlueprintContainerImpl.java:640)…还有10个
我的JDK版本是Ubuntu 13.04上的1.7.0_25-b15。
以下是我的蓝图配置:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0"
xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0">
<!-- DataSource Derby -->
<bean id="dataSourceDerby" class="org.apache.derby.jdbc.EmbeddedDataSource">
<property name="databaseName" value="/home/imme/Data/xxxxdb"/>
<property name="createDatabase" value="create"/>
</bean>
<bean id="dataSourceXADerby" class="org.apache.derby.jdbc.EmbeddedXADataSource">
<property name="databaseName" value="/home/imme/Data/xxxxdb"/>
<property name="createDatabase" value="create"/>
</bean>
<!-- Expose DataSource as JNDI reference -->
<service ref="dataSourceDerby" interface="javax.sql.DataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/xxxxdb"/>
</service-properties>
</service>
<service ref="dataSourceXADerby" interface="javax.sql.XADataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/xaxxxxdb"/>
</service-properties>
</service>
<bean id="userServiceImpl" class="com.xxx.xxx.services.impl.UserServiceImpl">
<tx:transaction method="*" value="Required" />
<jpa:context property="entityManager" unitname="xxx-unit"/>
</bean>
<service id="userService" ref="userServiceImpl" interface="com.xxx.xxxx.services.UserService"/>
</blueprint>
如果我评论这句话:<tx:transaction method="*" value="Required" />
我再也看不到异常了,但是服务不起作用,因为容器无法打开事务。已经尝试过JDK1.6,同样的问题。
感谢您的帮助,谢谢!
此错误已在最新版本的areis.jpa.container中修复,但geronimo仍保留旧捆绑包。
错误描述[http://mail-archives.apache.org/mod_mbox/aries-user/201210.mbox/%3CCAJ0TPGK12vVNFyb5TXH-dxLn29aORu_y1MKR2omD_Dmi-8tMOw@mail.gmail.com%3E][1]
受影响的捆绑包:
aries.jpa.container
org.apache.aries.proxy.impl
org.apache.aries.proxy