validation error when using AOP after registering a patient

I’m using AOP to step in after a new patient is registered. When the new patient is saved I need to add the patient to my list of patients - I’ll create a PatientListItem I’m using the reference app standalone 2.8.1, running on an iMac. Help is much appreciated… Following is the application context file and the AOP method segment

I"m getting the following error: Validation errors found:

*** Service not found: interface org.openmrs.module.patientlist.api.PatientListItemService**

The only issue is with the AOP

I have the following bean listed in my moduleapplicationcontext.xml file

<bean parent="serviceContext">
	<property name="moduleService">
		<list>
			<value>${project.parent.groupId}.${project.parent.artifactId}.api.PatientListItemService</value>
			<bean
				class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
				<property name="transactionManager">
					<ref bean="transactionManager" />
				</property>
				<property name="target">
					<bean class="${project.parent.groupId}.${project.parent.artifactId}.api.impl.PatientListItemServiceImpl">
						<property name="dao">
							<bean class="${project.parent.groupId}.${project.parent.artifactId}.api.db.hibernate.HibernatePatientListItemDAO">
								<property name="sessionFactory">
									<ref bean="dbSessionFactory" />
								</property>
							</bean>
						</property>
					</bean>
				</property>
				<property name="preInterceptors">
					<ref bean="serviceInterceptors" />
				</property>
				<property name="transactionAttributeSource">
					<ref bean="transactionAttributeSource" />
				</property>
			</bean>
		</list>
	</property>
</bean>

Here is a slice of the AOP method:

public class PatientAfterSaveAdvice implements AfterReturningAdvice {

public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
	if (!method.getName().equals("savePatient")) {
		return;
	}
	User user = Context.getAuthenticatedUser();
	Patient patient = (Patient) args[0];
	PatientListItem patientListItem = new PatientListItem();

… PatientListItem item = Context.getService(PatientListItemService.class).savePatientListItem(patientListItem);

Do you think you can share the full error log at pastebin.com?

It seems when I restarted the standalone it’s working fine. Thanks for your offer to help:slightly_smiling_face: