NutzCN Logo
问答 MainModule 找不到
发布于 23天前 作者 读书人 15368 次浏览 复制 上一个帖子 下一个帖子
标签:

项目启动报错,

六月 29, 2018 3:14:45 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2018-06-29 15:14:45,479 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO  org.nutz.mvc.NutFilter - NutFilter[nutz] starting ...
2018-06-29 15:14:45,479 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO  org.nutz.mvc.NutFilter - NutFilter[nutz] starting ...
2018-06-29 15:14:45,509 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG org.nutz.resource.Scans - Locations count=5 time use 14ms
2018-06-29 15:14:45,509 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG org.nutz.resource.Scans - Locations count=5 time use 14ms
2018-06-29 15:14:45,530 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG org.nutz.resource.Scans - Locations count=22 time use 20ms
2018-06-29 15:14:45,530 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG org.nutz.resource.Scans - Locations count=22 time use 20ms
六月 29, 2018 3:14:45 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter [nutz]
org.nutz.mvc.NutConfigException: java.lang.ClassNotFoundException: org.wx.MainModule
	at org.nutz.mvc.config.AbstractNutConfig.getMainModule(AbstractNutConfig.java:137)
	at org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:53)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:18)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4590)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5233)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1423)
	at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1387)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1623)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1164)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1388)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1360)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: org.wx.MainModule
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:190)
	at org.nutz.lang.Lang.loadClass(Lang.java:2074)
	at org.nutz.mvc.config.AbstractNutConfig.getMainModule(AbstractNutConfig.java:130)
	... 20 more
六月 29, 2018 3:14:45 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
六月 29, 2018 3:14:45 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/WxCat] startup failed due to previous errors

下面是web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>WxCat</display-name>
  
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
 
	<filter>
		<filter-name>nutz</filter-name>
		<filter-class>org.nutz.mvc.NutFilter</filter-class>
		<init-param>
			<param-name>modules</param-name>
			<param-value>org.wx.MainModule</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>nutz</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
  <servlet>
    <servlet-name>coreServlet</servlet-name>
    <servlet-class>org.wx.servlet.CoreServlet</servlet-class>
    <init-param>  
        <param-name>appid</param-name>  
        <param-value>wxafc5d45c735240e4</param-value>  
    </init-param>  
    <init-param>  
        <param-name>appsecret</param-name>  
        <param-value>1571322a340712a1342bd32eaf2eeb5c</param-value>  
    </init-param>  
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>initServlet</servlet-name>
    <servlet-class>org.wx.servlet.InitServlet</servlet-class>
  </servlet>



  <servlet-mapping>
    <servlet-name>coreServlet</servlet-name>
    <url-pattern>/coreServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>initServlet</servlet-name>
    <url-pattern>/initServlet</url-pattern>
  </servlet-mapping>

</web-app>

MainModule 的位置是正确的 为什么找不到呢

8 回复

写错类名或编译问题

"src/org/wx/MainModule.java" 类名没写错,编译问题怎么解决?

普通javaee项目还是maven项目?

编译完之后没有classes文件

要不, "新手入门" 走一波?

灵光一闪 解决了,不用入门了。。。

@qq_418d2302 如果你把灵光闪现的具体内容写下来,或许其他有类似情况的人会因此得到帮助

来自炫酷的 NutzCN

添加回复
请先登陆
回到顶部