The bean obtained through annotations is null

problem description

applicationContext.xmlbean@AutowirednullApplicationContext ctx = new ClassPathXmlApplicationContext("conf/spring/applicationContext.xml");ctx.getBean()

related codes

<bean id="dalClient" class="com.zhl.framework.dal.client.support.DefaultDalClient">
    <property name="resources" value="classpath:sqlmapper/sqlMap_*.xml" />
    <property name="defaultDataSource" ref="dataSource" />
</bean>

this is an encapsulated method to access sql files

<servlet>
    <servlet-name>springmvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:conf/spring/spring-servlet.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

this is the web configuration

what result do you expect? What is the error message actually seen?

Mar.29,2021

1. Whether the scan is configured or not, the injection mechanism of spring can go to
2, whether it is hosted by spring, whether it is new or can be injected.
I have written a thread business class before, into which bean cannot be injected. You need to new out
thread to get bean

.
ApplicationContext ac = new FileSystemXmlApplicationContext("classpath:spring.xml");  
ac.getBean("companyService"); 
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e450f6-43830.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e450f6-43830.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?