SSH整合时出的问题

整合SSH,运行时报:org.springframework.beans.factory.BeanDefinitionStoreException找了很久现是:

contextConfigLocation写成了ContextConfigLoad (以前我以为是可以随便命名,原来不可以)

<context-param>
  <param-name>contextConfigLoad </param-name>
  <param-value>classpath:applicationContext.xml</param-value>
 </context-param>
 <listener>

 

完整的错误如下:

2009-3-20 23:06:50 org.apache.catalina.startup.HostConfig checkResources
信息: Reloading context [/MySSH]
2009-3-20 23:06:54 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2009-3-20 23:07:16 org.apache.catalina.core.StandardContext addApplicationListener
信息: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
log4j:WARN Please initialize the log4j system properly.
2009-3-20 23:07:19 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2009-3-20 23:07:20 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
    at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1114)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1212)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
    at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
    ... 23 more
2009-3-20 23:07:20 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2009-3-20 23:07:20 org.apache.catalina.core.StandardContext start
严重: Context [/MySSH] startup failed due to previous errors
2009-3-20 23:07:20 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2009-3-20 23:22:51 org.apache.catalina.startup.HostConfig checkResources
信息: Reloading context [/MySSH]
2009-3-20 23:22:51 org.apache.catalina.core.StandardContext stop
信息: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/MySSH] has not been started
2009-3-20 23:22:52 org.apache.catalina.core.StandardContext addApplicationListener
信息: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.
log4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
log4j:WARN Please initialize the log4j system properly.
2009-3-20 23:22:53 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2009-3-20 23:23:04 org.apache.catalina.loader.WebappClassLoader loadClass
信息: Illegal access: this web application instance has been stopped already.  Could not load com.mysql.jdbc.SQLError.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1246)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
    at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1656)
    at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4261)
    at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1248)
    at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2655)
    at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
    at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
    at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)

### STM32CubeMX FreeRTOS CAN Queue Read Example #### 配置项目环境 为了实现基于FreeRTOS的CAN消息队列读取,在STM32CubeMX环境中需完成以下设置: - 使用STM32CubeMX创建新工程并选择目标MCU型号。 - 启用CAN外设支持,并通过RTE(Run-Time Environment)配置其参数,如波特率等。 - 添加对FreeRTOS的支持,这会自动引入必要的库文件和初始化代码。 #### 初始化FreeRTOS与CAN模块 确保已正确设置了`FreeRTOSConfig.h`中的各项参数以适应应用需求[^1]。对于CAN通信部分,则要依据具体硬件平台调整相应的初始化函数调用,通常位于`main.c`或其他由开发者指定的位置。 ```c // main.c or other designated file #include "cmsis_os.h" #include "can.h" osThreadId canReceiveTaskHandle; osMessageQueueId canMsgQueue; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_CAN1_Init(void); int main(void){ HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_CAN1_Init(); osKernelInitialize(); // Initialize CMSIS-OS V2 RTX Kernel // Create the message queue capable of holding up to 10 messages. canMsgQueue = osMessageQueueNew(10, sizeof(CAN_RxHeaderTypeDef), NULL); // Start thread as specified. canReceiveTaskHandle = osThreadNew(can_receive_task, NULL, NULL); osKernelStart(); } ``` #### 创建接收任务处理程序 定义一个专门的任务用于监听来自CAN总线的数据包并通过预先建立的消息队列传递给其他组件进一步解析或响应。 ```c #define MSG_QUEUE_TIMEOUT (10) void can_receive_task(void *argument) { uint8_t rxData[8]; CAN_RxHeaderTypeDef RxHeader; while (true) { if(HAL_CAN_GetRxMessage(&hcan1,&RxHeader,rxData)==HAL_OK){ // Put received data into a queue for processing by another task. osMessageQueuePut(canMsgQueue, &RxHeader, 0, MSG_QUEUE_TIMEOUT); /* Process Data Here */ } osDelay(1); // Short delay between checks } } ``` 上述代码片段展示了如何利用FreeRTOS提供的APIs构建一个多线程应用程序框架下的CAN报文接收机制。每当接收到新的数据帧时即刻将其存入共享资源——消息队列之中等待后续操作;与此同时保持较低优先级循环执行以便让渡CPU时间片给更高紧迫性的作业单元[^2]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值