NutzCN Logo
问答 nutzboot maven父子工程,不能启动
发布于 2087天前 作者 qq_12f03815 1511 次浏览 复制 上一个帖子 下一个帖子
标签:

使用最简单的demo,run后就输出

log4j:WARN No appenders could be found for logger (org.nutz.boot.banner.SimpleBannerPrinter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.nutz.lang.reflect.ReflectTool$1 (file:/E:/maven/repository/org/nutz/nutz/1.r.67-SNAPSHOT/nutz-1.r.67-SNAPSHOT.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.nutz.lang.reflect.ReflectTool$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

父工程的pom文件

<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.blue</groupId>
	<artifactId>gll</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>

	<name>gll</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<junit.version>4.11</junit.version>
		<nutzboot.version>2.3-SNAPSHOT</nutzboot.version>
	</properties>


	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.nutz</groupId>
				<artifactId>nutzboot-parent</artifactId>
				<version>${nutzboot.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-swagger</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-nutz-mvc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-nutz-dao</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-redis</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-quartz</artifactId>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutzboot-starter-tomcat</artifactId>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
		</dependency>
		<!-- 日志框架 -->
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
		<dependency>
		    <groupId>org.apache.poi</groupId>
		    <artifactId>poi</artifactId>
		    <version>3.17</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
		<dependency>
		    <groupId>org.apache.poi</groupId>
		    <artifactId>poi-ooxml</artifactId>
		    <version>3.17</version>
		</dependency>
		<!-- FASTJSON 框架 -->
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.44</version>
		</dependency>
	</dependencies>


	<repositories>
		<repository>
			<id>nutz</id>
			<url>http://jfrog.nutz.cn/artifactory/libs-release</url>
		</repository>
		<repository>
			<id>nutz-snapshots</id>
			<url>http://jfrog.nutz.cn/artifactory/snapshots</url>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>nutz-snapshots</id>
			<url>http://jfrog.nutz.cn/artifactory/snapshots</url>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</pluginRepository>
	</pluginRepositories>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<source>1.11</source>
					<target>1.11</target>
					<compilerVersion>1.11</compilerVersion>
				</configuration>
			</plugin>
			<!-- jar插件 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
						</manifest>
					</archive>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<modules>
		<module>common</module>
		<module>service</module>
		<module>admin</module>
	</modules>
</project>

子工程的pom

<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.blue</groupId>
		<artifactId>gll</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>
	<artifactId>admin</artifactId>
	<packaging>war</packaging>
	<name>admin Maven Webapp</name>
	<url>http://maven.apache.org</url>
	<dependencies>
		
	</dependencies>
	<build>
		<finalName>admin</finalName>
	</build>
</project>

MainLauncher.java

@IocBean
public class MainLauncher {

    @Ok("raw")
    @At("/time/now")
    public long now() {
        return System.currentTimeMillis();
    }

    public static void main(String[] args) throws Exception {
        new NbApp().run();
    }
}

摸不着头脑了..

7 回复
<packaging>war</packaging>

nutzboot的package只能是jar

我修改了,重新update后,启动还是

log4j:WARN No appenders could be found for logger (org.nutz.boot.banner.SimpleBannerPrinter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.nutz.lang.reflect.ReflectTool$1 (file:/E:/maven/repository/org/nutz/nutz/1.r.67-SNAPSHOT/nutz-1.r.67-SNAPSHOT.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.nutz.lang.reflect.ReflectTool$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

这个下面就没有了

缺log4j.properties

这个日志是怎么看的,传授下经验呗!

Failed to initialize component [StandardServer[-1]]

2019-02-28 02:15:44,722 org.nutz.boot.NbApp.execute(NbApp.java:220) ERROR -%T - something happen!!
org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
	at org.apache.catalina.startup.Tomcat.start(Tomcat.java:366)
	at org.nutz.boot.starter.tomcat.TomcatStarter.start(TomcatStarter.java:153)
	at org.nutz.boot.AppContext.startServers(AppContext.java:306)
	at org.nutz.boot.NbApp.execute(NbApp.java:206)
	at org.nutz.boot.NbApp.run(NbApp.java:178)
	at com.blue.admin.MainLauncher.main(MainLauncher.java:18)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardService[Tomcat]]
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
	at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
	... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-8080]]
	at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
	... 9 more
2019-02-28 02:15:44,723 org.quartz.core.QuartzScheduler.shutdown(QuartzScheduler.java:666) INFO  -%T - Scheduler NutzbootScheduler_$_NON_CLUSTERED shutting down.
2019-02-28 02:15:44,723 org.quartz.core.QuartzScheduler.standby(QuartzScheduler.java:585) INFO  -%T - Scheduler NutzbootScheduler_$_NON_CLUSTERED paused.
2019-02-28 02:15:44,723 org.quartz.simpl.SimpleThreadPool.shutdown(SimpleThreadPool.java:328) DEBUG -%T - Shutting down threadpool...

找到问题了...不知道什么时候出来一个把端口占了!~

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