org.StandardContext.star。。。
SSM项⽬,⼀直部署失败,连主页⾯都⽆法打开。
在⽹上了⼏个⽅法尝试都⽆法奏效,例如直接往WEB-INF添加jar包,更改Tomcat的conf⽬录下的 catalina.properties ⽂件。最后发现是配置⽂件出错,在配置 l ⾥
context-param 的 param-value 时多写了⼀个 * 号。
由于是直接复制的千峰李卫民⽼师博客⾥的配置⽂件代码,没想过会在这⾥出错,前前后后了两天。
控制台⽇志如下:
四⽉ 26, 2021 7:13:52 下午 org.StandardContext listenerStart
严重: 异常将上下⽂初始化事件发送到类的侦听器实例.[org.t.ContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in file [D:\001 Learnging\Java\Java单体应⽤\代码\my-shop-back\target\my-shop-1.0.0-SNAPSH
OT\WEB-INF\classes\com\jluzh\my\s    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1163)
at org.springframework.beans.factory.ateBeanInstance(AbstractAutowireCapableBeanFactory.java:1107)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.ateBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.Object(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.Singleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.Bean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at t.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at t.fresh(AbstractApplicationContext.java:543)
at org.figureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.t.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.tInitialized(ContextLoaderListener.java:107)
at org.StandardContext.listenerStart(StandardContext.java:4701)
at org.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.ContainerBase.addChild(ContainerBase.java:719)
at org.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1720)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at flect.Method.invoke(Method.java:498)
at deler.BaseModelMBean.invoke(BaseModelMBean.java:287)spring framework jar包
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.ateStandardContext(MBeanFactory.java:479)
at org.apache.catalina.ateStandardContext(MBeanFactory.java:428)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at flect.Method.invoke(Method.java:498)
at deler.BaseModelMBean.invoke(BaseModelMBean.java:287)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at com.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at i.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at i.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at i.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at java.security.AccessController.doPrivileged(Native Method)
at i.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
at i.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
flect.NativeMethodAccessorImpl.invoke0(Native Method)
flect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
flect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at flect.Method.invoke(Method.java:498)
i.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
i.transport.Transport$1.run(Transport.java:200)
i.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
i.transport.Transport.serviceCall(Transport.java:196)
p.TCPTransport.handleMessages(TCPTransport.java:573)
p.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
p.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
p.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at urrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at urrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [shop.service.impl.UserServiceImpl]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1155)
... 60 more
Caused by: java.lang.NullPointerException
at Bean(SpringContext.java:26)
at shop.service.impl.UserServiceImpl.<init>(UserServiceImpl.java:12)
wInstance0(Native Method)
wInstance(NativeConstructorAccessorImpl.java:62)
wInstance(DelegatingConstructorAccessorImpl.java:45)
at wInstance(Constructor.java:423)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
... 62 more
26-Apr-2021 19:13:52.803 严重 [RMI TCP Connection(5)-127.0.0.1] org.StandardContext.startInternal ⼀个或多个listeners启动失败,更多详细信息查看对应的容器⽇志⽂件
26-Apr-2021 19:13:52.805 严重 [RMI TCP Connection(5)-127.0.0.1] org.StandardContext.startInternal 由于之前的错误,Context[/my_shop_war_exploded]启动失败
四⽉ 26, 2021 7:13:52 下午 org.ApplicationContext log
信息: Closing Spring root WebApplicationContext
[2021-04-26 07:13:52,822] Artifact my-shop:war exploded: Error during artifact deployment. See server log for details.
26-Apr-2021 19:14:00.851 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应⽤程序部署到⽬录 [D:\Program Files\apache-tomcat-8.5.54\webapps\manager]
26-Apr-2021 19:14:00.933 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Program Files\apache-tomcat-8.5.54\webapps\manager] has finished in [81] ms
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="/xml/ns/javaee"
xmlns:xsi="/2001/XMLSchema-instance"
xsi:schemaLocation="/xml/ns/javaee /xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>my-shop</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-context*.xml</param-value>
</context-param>
<listener>
<listener-class>org.t.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>LoginController</servlet-name>
<servlet-class>ller.LoginController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginController</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
</web-app>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。