<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: custom repository beans injection in alfresco process services 1.9.0 in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6087#M2946</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try to use a custom bean annotated as Configuration and ComponentScan with package&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;com.activiti.extension.conf that would point to your custom package bean. Check here for example:&amp;nbsp;&lt;A href="https://dzone.com/articles/spring-component-scan" rel="nofollow noopener noreferrer"&gt;https://dzone.com/articles/spring-component-scan&lt;/A&gt;&amp;nbsp;(see&amp;nbsp;Component Scanning Filters).&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;An example could be the following:&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;package&lt;/SPAN&gt; com.activiti.extension.conf;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.annotation.Bean;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.annotation.ComponentScan;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.annotation.Configuration;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.annotation.PropertySource;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.support.PropertySourcesPlaceholderConfigurer;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;/**&lt;/P&gt;&lt;P class=""&gt;*&lt;/P&gt;&lt;P class=""&gt;* A configuration class which will help get the custom packages scanned&lt;/P&gt;&lt;P class=""&gt;*&lt;/P&gt;&lt;P class=""&gt;* &lt;SPAN class=""&gt;@author&lt;/SPAN&gt; &lt;SPAN class=""&gt;Rui&lt;/SPAN&gt; &lt;SPAN class=""&gt;Fernandes&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;*&lt;/P&gt;&lt;P class=""&gt;*/&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;@Configuration&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;@ComponentScan&lt;/SPAN&gt;&lt;SPAN class=""&gt;(basePackages = {&lt;/SPAN&gt;"se.alfresco.activiti.listener"&lt;SPAN class=""&gt;})&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;@PropertySource&lt;/SPAN&gt;&lt;SPAN class=""&gt;(value=&lt;/SPAN&gt;"classpath:external-script.properties"&lt;SPAN class=""&gt;,ignoreResourceNotFound=&lt;/SPAN&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;public&lt;/SPAN&gt; &lt;SPAN class=""&gt;class&lt;/SPAN&gt; ActivitiExternalScriptExtensionConfiguration&lt;/P&gt;&lt;P class=""&gt;{&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;@Bean&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;public&lt;/SPAN&gt; &lt;SPAN class=""&gt;static&lt;/SPAN&gt; PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PropertySourcesPlaceholderConfigurer();&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P class=""&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Jul 2019 09:01:53 GMT</pubDate>
    <dc:creator>rui_fernandes</dc:creator>
    <dc:date>2019-07-02T09:01:53Z</dc:date>
    <item>
      <title>custom repository beans injection in alfresco process services 1.9.0</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6086#M2945</link>
      <description>Hi AllI developed a spring application and it had some rest controllers in package com.activiti.extension.api and some repositories in package com.activiti.extension.beans. I deployed it in alfresco process services 1.9.0/tomcat/webapps/activiti-app/WEB-INF/lib/ as extension jar then i got problem w</description>
      <pubDate>Mon, 01 Jul 2019 13:47:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6086#M2945</guid>
      <dc:creator>ajay_k</dc:creator>
      <dc:date>2019-07-01T13:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: custom repository beans injection in alfresco process services 1.9.0</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6087#M2946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try to use a custom bean annotated as Configuration and ComponentScan with package&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;com.activiti.extension.conf that would point to your custom package bean. Check here for example:&amp;nbsp;&lt;A href="https://dzone.com/articles/spring-component-scan" rel="nofollow noopener noreferrer"&gt;https://dzone.com/articles/spring-component-scan&lt;/A&gt;&amp;nbsp;(see&amp;nbsp;Component Scanning Filters).&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;An example could be the following:&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;package&lt;/SPAN&gt; com.activiti.extension.conf;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.annotation.Bean;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.annotation.ComponentScan;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.annotation.Configuration;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.annotation.PropertySource;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt; org.springframework.context.support.PropertySourcesPlaceholderConfigurer;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;/**&lt;/P&gt;&lt;P class=""&gt;*&lt;/P&gt;&lt;P class=""&gt;* A configuration class which will help get the custom packages scanned&lt;/P&gt;&lt;P class=""&gt;*&lt;/P&gt;&lt;P class=""&gt;* &lt;SPAN class=""&gt;@author&lt;/SPAN&gt; &lt;SPAN class=""&gt;Rui&lt;/SPAN&gt; &lt;SPAN class=""&gt;Fernandes&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;*&lt;/P&gt;&lt;P class=""&gt;*/&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;@Configuration&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;@ComponentScan&lt;/SPAN&gt;&lt;SPAN class=""&gt;(basePackages = {&lt;/SPAN&gt;"se.alfresco.activiti.listener"&lt;SPAN class=""&gt;})&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;@PropertySource&lt;/SPAN&gt;&lt;SPAN class=""&gt;(value=&lt;/SPAN&gt;"classpath:external-script.properties"&lt;SPAN class=""&gt;,ignoreResourceNotFound=&lt;/SPAN&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;public&lt;/SPAN&gt; &lt;SPAN class=""&gt;class&lt;/SPAN&gt; ActivitiExternalScriptExtensionConfiguration&lt;/P&gt;&lt;P class=""&gt;{&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;@Bean&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;public&lt;/SPAN&gt; &lt;SPAN class=""&gt;static&lt;/SPAN&gt; PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; PropertySourcesPlaceholderConfigurer();&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P class=""&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2019 09:01:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6087#M2946</guid>
      <dc:creator>rui_fernandes</dc:creator>
      <dc:date>2019-07-02T09:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: custom repository beans injection in alfresco process services 1.9.0</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6088#M2947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rui Fernandes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I implemented the same but I'm still facing the issue. Please look into below details&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Stack trace:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.activiti.extension.bean.AssetsAvailabilityRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}&lt;BR /&gt; at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1493)&lt;BR /&gt; at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104)&lt;BR /&gt; at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)&lt;BR /&gt; at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ERROR com.activiti.service.ActivitiEndpointLicenseService - Non-enterprise Activiti endpoint: Activiti app&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i gives my code sample.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Configuration:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;package com.activiti.extension.conf;&lt;/P&gt;&lt;P&gt;import org.springframework.context.annotation.Bean;&lt;BR /&gt;import org.springframework.context.annotation.ComponentScan;&lt;BR /&gt;import org.springframework.context.annotation.Configuration;&lt;BR /&gt;import org.springframework.context.annotation.PropertySource;&lt;BR /&gt;import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;&lt;/P&gt;&lt;P&gt;@Configuration&lt;BR /&gt;@ComponentScan(basePackages = {"com.mypackage"})&lt;BR /&gt;@PropertySource(value="classpath:application.properties",ignoreResourceNotFound=true)&lt;BR /&gt;public class MyConfiguration {&lt;/P&gt;&lt;P&gt;@Bean&lt;BR /&gt; public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {&lt;/P&gt;&lt;P&gt;return new PropertySourcesPlaceholderConfigurer();&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Repository:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;package com.activiti.extension.bean;&lt;/P&gt;&lt;P&gt;import java.sql.Date;&lt;BR /&gt;import java.util.List;&lt;/P&gt;&lt;P&gt;import org.springframework.data.jpa.repository.Query;&lt;BR /&gt;import org.springframework.data.repository.PagingAndSortingRepository;&lt;BR /&gt;import org.springframework.data.repository.query.Param;&lt;BR /&gt;import org.springframework.stereotype.Repository;&lt;/P&gt;&lt;P&gt;import com.mypackage.entity.AssetsAvailability;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;@Repository&lt;BR /&gt;public interface AssetsAvailabilityRepository extends PagingAndSortingRepository&amp;lt;AssetsAvailability, Long&amp;gt; {&lt;/P&gt;&lt;P&gt;@Query(value="select * from assets_availability aa inner join assets a on aa.aid = a.aid and a.asset_type=:type and date between :fromDate and :toDate", nativeQuery = true)&lt;BR /&gt; public List&amp;lt;AssetsAvailability&amp;gt; findByAssetTypeAndDateBetween(@Param("type") String type, @Param("fromDate")Date fromDate, @Param("toDate")Date toDate);&lt;BR /&gt; &lt;BR /&gt; public AssetsAvailability findByDateAndAid(Date date,long aid);&lt;BR /&gt; &lt;BR /&gt; public AssetsAvailability findByDateAndApsUserId(Date date,long apsUserId);&lt;BR /&gt; &lt;BR /&gt; public List&amp;lt;AssetsAvailability&amp;gt; findByApsUserIdInAndDateBetween(List&amp;lt;Long&amp;gt; apsUserIds, Date fromDate, Date toDate);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Spring Dependency:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;&lt;BR /&gt; &amp;lt;artifactId&amp;gt;spring-boot-starter-parent&amp;lt;/artifactId&amp;gt;&lt;BR /&gt; &amp;lt;version&amp;gt;1.5.10.RELEASE&amp;lt;/version&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are other repositories also and all are interfaces. And my entities are in package com.mypackage.entity.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Repository annotation in package&amp;nbsp;&lt;SPAN&gt;com.activiti.extension.bean. Is it Correct?&amp;nbsp;Please give me the solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ajay&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2019 11:19:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6088#M2947</guid>
      <dc:creator>ajay_k</dc:creator>
      <dc:date>2019-07-03T11:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: custom repository beans injection in alfresco process services 1.9.0</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6089#M2948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ajay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your errors are related with the Spring&amp;nbsp;JPA not with Alfresco Process Services. Maybe you would like to make sure you have your code running first as an independent Spring JPA application and then adapt it as an extension of APS. Anyway&amp;nbsp;my guess is that you may be missing the annotation for&amp;nbsp;@EnableJpaRepositories("com.activiti.extension.bean") on the configuration class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as said I would first suggest to get everything working first as an independent JPA application and then merge as an extension of APS. My second suggestion would be to rethink how much you want to include as extension to APS and how much makes more sense to live as a separate app (that can be accessed from APS by REST API for example in a more service oriented way. In general doesnt make sense to implement a subsystem as an APS extension to handle as embedded code other entities as you seem to want to do. Typically you want your bpm (APS or any other one) to call your different services and not running them all internally as embedded code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rui&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2019 21:55:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-repository-beans-injection-in-alfresco-process-services-1/m-p/6089#M2948</guid>
      <dc:creator>rui_fernandes</dc:creator>
      <dc:date>2019-07-03T21:55:40Z</dc:date>
    </item>
  </channel>
</rss>

