Issue with Java Servlet not finding classes

Hi all, i am trying to utilize my existing context config location as well as my app config. The isssue is i am trying to do dependency injection with spring, but want to do it via Java not xml. Can someone help? I am using Java Servlets, With Tomcat and Apache my xml
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/security.xml, com.utility.config.AppConfig
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/security.xml, com.utility.config.AppConfig
</param-value>
</context-param>
app config
package com.utility.config;

import com.utility.datamaintenance.products.services.ProductRetrieveService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {
public AppConfig() {
}

@Bean
public ProductRetrieveService productRetrieveService() {
return new ProductRetrieveService();
}
}
package com.utility.config;

import com.utility.datamaintenance.products.services.ProductRetrieveService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {
public AppConfig() {
}

@Bean
public ProductRetrieveService productRetrieveService() {
return new ProductRetrieveService();
}
}
1 Reply
JavaBot
JavaBot5w ago
This post has been reserved for your question.
Hey @shaan160! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server