- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在遵循位于:Camel MyBatis Integration Guide 的设置指南。我正在使用服务混合 5.0.1。我使用了 features-install spring-mybatis 来引入 3.2.4.RELEASE。我的 SqlMapConfig 文件仅包含有关 typeHandlers 和 typeAliases 的信息。
当我启动服务组合然后启动我的应用程序时,我收到以下堆栈跟踪:
org.osgi.service.blueprint.container.ComponentDefinitionException: Errorsetting property: PropertyDescriptor <name: configLocation, getter: null, setter: [class org.mybatis.spring.SqlSessionFactoryBean.setConfigLocation(interface org.springframework.core.io.Resource)]
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:941)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[8:org.apache.aries.blueprint.core:1.4.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_45]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:933)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[8:org.apache.aries.blueprint.core:1.4.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_45]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:681)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:378)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[11:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[11:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[11:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[11:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[11:org.apache.aries.util:1.1.0]
at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4244)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.Felix.startBundle(Felix.java:1923)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:37)[39:org.apache.karaf.shell.osgi:2.3.4]
at org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:37)[39:org.apache.karaf.shell.osgi:2.3.4]
at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.karaf.shell.console.jline.Console.run(Console.java:183)[15:org.apache.karaf.shell.console:2.3.4]
at org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)[15:org.apache.karaf.shell.console:2.3.4]
*Caused by: java.lang.Exception: Unable to convert value /META-INF/SqlMapConfig.xml to type interface org.springframework.core.io.Resource. Type interface org.springframework.core.io.Resource is an interface or an abstract class*
at org.apache.aries.blueprint.container.AggregateConverter.createObject(AggregateConverter.java:310)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.AggregateConverter.convertFromString(AggregateConverter.java:304)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:174)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BlueprintRepository.convert(BlueprintRepository.java:402)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.convert(ReflectionUtils.java:394)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:628)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(ReflectionUtils.java:378)[8:org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:939)[8:org.apache.aries.blueprint.core:1.4.0]
...还有 50 个
我的Bean定义如下:
<bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<argument>
<bean class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="oracle.jdbc.OracleDriver"/>
<property name="jdbcUrl" value="jdbc:oracle:thin:@intersting-ip:port:schema"/>
<property name="user" value="user"/>
<property name="password" value="password"/>
</bean>
</argument>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="/META-INF/SqlMapConfig.xml"/>
<property name="mapperLocations" value="classpath*:META-INF/mappers/**/*.xml"/>
</bean>
<bean id="mybatis" class="org.apache.camel.component.mybatis.MyBatisComponent">
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>
更新配置和新错误
更新配置:
<bean id="myBatis" class="org.apache.camel.component.mybatis.MyBatisComponent">
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>
<bean id="mybatisConfig" class="org.springframework.core.io.ClassPathResource">
<argument value="classpath*:META-INF/SqlMapConfig.xml" />
</bean>
<bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<argument>
<bean class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="oracle.jdbc.OracleDriver"/>
<property name="jdbcUrl" value="jdbc:oracle:thin:@intersting-ip:port:schema"/>
<property name="user" value="user"/>
<property name="password" value="password"/>
</bean>
</argument>
</bean>
<!-- Without this, the creation of myBatis will bomb out stating that org.mybatis.spring.SqlSessionFactoryBean is not an instance of org.apache.ibatis.session.SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.apache.ibatis.session.SqlSessionFactory" factory-ref="sqlSessionFactoryBean" factory-method="getObject" />
<bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="cctvDataSource"/>
<property name="configLocation" ref="mybatisConfig"/>
<property name="mapperLocations">
<array value-type="org.springframework.core.io.Resource">
<bean class="org.springframework.core.io.ClassPathResource">
<argument value="classpath*:META-INF/mappers/**/*.xml" />
</bean>
</array>
</property>
</bean>
更新错误
2014-08-06 10:46:20,824 | ERROR | mix\5.0.1/deploy | BlueprintContainerImpl | ?? | 7 - org.apache.aries.blueprint.core - 1.4.0 | Unable to start blueprint container for bundle project org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean sqlSessionFactory of class interface org.apache.ibatis.session.SqlSessionFactory
....
Caused by: java.io.FileNotFoundException: class path resource [classpath*:META-INF/SqlCookConfig.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:157)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:358)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessio
nFactoryBean.java:340)
最佳答案
您使用的指南适用于 Spring ,而不是 Aries blueprint这就是问题的主要根源。 mybatis-spring用于集成,它使用 spring 特定的东西。
问题出在 SqlSessionFactoryBean
的 configLocation
属性上。它应该是 spring org.springframework.core.io.Resource。如果您use prefix,Spring 可以自动将字符串转换为Resource
给予提示。 Aries 对 spring 一无所知,也没有从 String
到 spring Resource
的内置转换器。
有两种方法可以解决这个问题:
Resource
实现 bean 注入(inject)到 SqlSessionFactoryBean
而不是字符串org.osgi.service.blueprint.container.Converter
,它将接受字符串并返回Resource
实现。转换器应该作为常规 bean 添加到上下文中,并且 Aries 将在需要时使用它进行转换。在这种情况下,SqlSessionFactoryBean
的定义不会更改。在这两种情况下,您都可以使用org.springframework.core.io.ClassPathResource
或自己实现Resource
。
关于java - Camel + MyBatis + Apache Aries,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25045264/
a = [ "a", "b", "c", "d", "e" ] 这两种说法有什么区别? a[1,3] #=> [ "b", "c", "d" ] 对比 a[1..3]
我按照此处的教程 (https://github.com/apache/aries-jpa/tree/master/examples) 运行 aries-jpa 示例,但没有成功。 README.md
万字长文解析最常见的数据库恢复算法: ARIES 首发地址: https://mp.weixin.qq.com/s/Kc13g8OHK1h_f7eMlnl4Aw Intro
我想知道是否有人有录制 ARI 桥来分离文件、未混合的经验(或至少分离立体声文件的 L 和 R channel )。似乎这可以通过记录单独的 channel 来实现,但这些 channel 无法桥接。
我正在尝试使用 ARI API 发起调用,我遵循的过程是 POST/ari/channels 创建 channel 1 到本地扩展 POST/ari/bridges 创建网桥 POST/ari/bri
我正在尝试使用 Asterisk ARI 来监视与桥相关的事件。我正在使用 Asterisk 13.6.0。 具体来说,我想知道桥何时创建或销毁,以及用户( channel )何时加入或离开桥。在我的
为什么在聚类方法中使用调整兰德指数 (ARI) 和归一化互信息 (NMI) 比简单的测试分数(例如 MSE)能获得更好的测量结果?我明白哪个点属于哪个簇在聚类算法中很重要,并且标记是任意的。 最佳答案
给定一棵 n 元整数树,任务是找到一个子序列的最大和,其约束条件是序列中的任何 2 个数字都不应共享树中的公共(public)边。例子: 1个 /\ 2 5 /\ 3 4最大非相邻和 = 3 + 4
我无法通过控制台浏览器(lynx、elinks)在 ARI 中进行身份验证 cat/etc/asterisk/ari.conf : [general] enabled = yes pret
如果 Aries 算法已经知道在分析阶段后要撤消哪些事务,为什么要在撤消之前应用重做? 我知道(认为)它与 Lsn 编号和保持一致性有关,因为鉴于磁盘上刷新的数据可能与崩溃时撤消事务不同,撤消事务(由
在ARIES algorithm ,为什么它需要在重做通行证中重复崩溃前的所有历史记录?我可以在分析过程中获取提交的事务编号,然后重做提交的事务日志记录吗?这种方法将减少需要重做和撤消的记录数。 最佳
我目前正在为 asterisk 开发静音功能,我可以使用 asterisk ARI 从我的 Web 前端运行它。 但每次我尝试运行/调用静音函数时,都会出现以下错误: Error: { "mess
我想接受一个返回元组的函数。有没有办法描述函数的返回元组长度? 最佳答案 似乎不是。可能是因为它在形式逻辑中不是必需的,因为使用了 2 个函数而不是一个具有两个输出的函数。 如果 arity 或 ad
我用Java编写了一个K-ary树结构的程序,所以我试图找到树的叶子数.. import java.util.List; import java.util.ArrayList; /** A tree
我正在遵循位于:Camel MyBatis Integration Guide 的设置指南。我正在使用服务混合 5.0.1。我使用了 features-install spring-mybatis 来
计算ARI时与 scikit's implementation ,我注意到一个奇怪的情况。对于某些看起来标签上高度一致的列表,ARI 仍然是 0.0 甚至更糟。 我尝试了几种标签,以下是观察到的最奇怪
我想找出一个函数 f(x) 来计算 k 叉树中的叶子数。例如,假设我们创建了一棵树,它以根 4 开始,有 3 个 child ,每个 child 分别为 -1、-2、-3。我们的叶子只会是 0 值,而
我正在尝试用 C++ 设计一个树类,但我遇到了节点销毁的问题。 如果我销毁一个节点,我不想销毁它的整个子树,因为可能有其他东西指向它。所以显而易见的解决方案是使用引用计数。我会有一个指向父节点的弱指针
我在销毁树时遇到删除节点的问题。每个节点都是在我的 Tree 类中定义的结构: struct node { Skill skill; node** child; node
我正在尝试编写一个程序,将家谱表示为 n 叉树。该程序必须从 CSV 文件中读取名称并构建树。树由以下结构表示: typedef struct NTree_S { char * na
我是一名优秀的程序员,十分优秀!