在docker中,我使用Marvin生成war文件: mvn clean编译安装 将战争文件复制到Web应用程序 然后开始 CMD [“ /usr/local/tomee/bin/catalina.sh”,“运行”] tomee开始,我的war文件被提取并部署,可以在管理器中看到。 但是,当我尝试(在管理器中单击)时,我得到404
如果我现在取消部署并在同样使用相同命令生成的计算机上部署版本 mvn clean编译安装 它出现在管理器中,并且运行正常。
查看日志文件,我发现在docker部署中,所有日志条目均来自“ [main]” 从tomee界面进行部署后,会有来自[[http-nio-8080]'
的日志条目基本问题是为什么将war文件复制到Web应用程序并启动tomee不会启动“ HTTP-nio-8080”,而是从tomee管理器界面启动...
我正在使用eclipse来管理项目,但是marvin命令(和docker run)是在命令行上完成的
一个注意:取消部署应用程序之前的所有日志都来自[main],然后当我取消部署时,日志显示“ [http-nio-8080]”(包括取消部署) Docker文件本质上是:
FROM maven:3.5-jdk-8 as build
RUN cd webReaction/reactionWebService;mvn compile install
FROM tomee:8-jre-8.0.0-M2-webprofile
COPY ./tomcat-users.xml /usr/local/tomee/conf/tomcat-users.xml
COPY --from=build /Reaction/webReaction/reactionWebService/target/reactionWebService-1.0.war /usr/local/tomee/webapps/reactionWebService-1.0.war
CMD ["/usr/local/tomee/bin/catalina.sh", "run"]
日志文件中的差异如下:
使用docker部署:
02-May-2019 19:02:57.035 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Deploying web application archive [/usr/local/tomee/webapps/reactionWebService-1.0.war]
02-May-2019 19:02:57.058 INFO [main] org.apache.tomee.catalina.TomcatWebAppBuilder.init ------------------------- localhost -> /reactionWebService-1.0
02-May-2019 19:02:57.068 INFO [main] org.apache.openejb.util.JarExtractor.extract Extracting jar: /usr/local/tomee/webapps/reactionWebService-1.0.war
02-May-2019 19:02:57.220 INFO [main] org.apache.openejb.util.JarExtractor.extract Extracted path: /usr/local/tomee/webapps/reactionWebService-1.0
02-May-2019 19:02:58.560 INFO [main] org.apache.openejb.config.ConfigurationFactory.configureApplication Configuring enterprise application: /usr/local/tomee/webapps/reactionWebService-1.0
02-May-2019 19:02:58.667 SEVERE [main] org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy servlet JAX-RS Servlet has no servlet-class defined and is not a subclass of Application
02-May-2019 19:02:58.733 INFO [main] org.apache.openejb.config.ConfigurationFactory.configureService Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
02-May-2019 19:02:58.734 INFO [main] org.apache.openejb.config.AutoConfig.createContainer Auto-creating a container for bean reactionWebService-1.0.Comp1126853225: Container(type=MANAGED, id=Default Managed Container)
02-May-2019 19:02:58.735 INFO [main] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating Container(id=Default Managed Container)
02-May-2019 19:02:58.752 INFO [main] org.apache.openejb.core.managed.SimplePassivater.init Using directory /usr/local/tomee/temp for stateful session passivation
02-May-2019 19:02:58.816 INFO [main] org.apache.openejb.config.AppInfoBuilder.build Enterprise application "/usr/local/tomee/webapps/reactionWebService-1.0" loaded.
02-May-2019 19:02:58.823 INFO [main] org.apache.openejb.assembler.classic.Assembler.createApplication Assembling app: /usr/local/tomee/webapps/reactionWebService-1.0
02-May-2019 19:02:59.320 INFO [main] org.apache.openejb.assembler.classic.Assembler.createApplication Deployed Application(path=/usr/local/tomee/webapps/reactionWebService-1.0)
02-May-2019 19:02:59.625 INFO [main] org.apache.myfaces.ee.MyFacesContainerInitializer.onStartup Using org.apache.myfaces.ee.MyFacesContainerInitializer
02-May-2019 19:02:59.846 INFO [main] 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.
02-May-2019 19:02:59.937 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web application archive [/usr/local/tomee/webapps/reactionWebService-1.0.war] has finished in [2,900] ms
02-May-2019 19:02:59.938 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Deploying web application directory [/usr/local/tomee/webapps/ROOT]
通过tomee管理器界面进行部署
02-May-2019 19:04:05.960 INFO [http-nio-8080-exec-4] org.apache.openejb.assembler.classic.Assembler.destroyApplication Undeploying app: /usr/local/tomee/webapps/reactionWebService-1.0
02-May-2019 19:04:06.658 INFO [http-nio-8080-exec-4] sun.reflect.DelegatingMethodAccessorImpl.invoke Undeploying context [/reactionWebService-1.0]
02-May-2019 19:04:27.586 INFO [http-nio-8080-exec-6] sun.reflect.DelegatingMethodAccessorImpl.invoke Deploying web application archive [/usr/local/tomee/webapps/reactionWebService-1.0.war]
'02-May-2019 19:04:27.588 INFO [http-nio-8080-exec-6] org.apache.tomee.catalina.TomcatWebAppBuilder.init ------------------------- localhost -> /reactionWebService-1.0'
'02-May-2019 19:04:27.590 INFO [http-nio-8080-exec-6] org.apache.openejb.util.JarExtractor.extract Extracting jar: /usr/local/tomee/webapps/reactionWebService-1.0.war'
02-May-2019 19:04:27.797 INFO [http-nio-8080-exec-6] org.apache.openejb.util.JarExtractor.extract Extracted path: /usr/local/tomee/webapps/reactionWebService-1.0
02-May-2019 19:04:28.833 INFO [http-nio-8080-exec-6] org.apache.openejb.config.ConfigurationFactory.configureApplication Configuring enterprise application: /usr/local/tomee/webapps/reactionWebService-1.0
'02-May-2019 19:04:28.860 SEVERE [http-nio-8080-exec-6] org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy servlet JAX-RS Servlet has no servlet-class defined and is not a subclass of Application'
'02-May-2019 19:04:28.894 INFO [http-nio-8080-exec-6] org.apache.openejb.config.AppInfoBuilder.build Enterprise application /usr/local/tomee/webapps/reactionWebService-1.0 loaded.'
02-May-2019 19:04:28.894 INFO [http-nio-8080-exec-6] org.apache.openejb.assembler.classic.Assembler.createApplication Assembling app: /usr/local/tomee/webapps/reactionWebService-1.0
02-May-2019 19:04:28.913 INFO [http-nio-8080-exec-6] org.apache.openejb.assembler.classic.Assembler.createApplication Deployed Application(path=/usr/local/tomee/webapps/reactionWebService-1.0)
02-May-2019 19:04:29.047 INFO [http-nio-8080-exec-6] 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.
02-May-2019 19:04:29.083 INFO [http-nio-8080-exec-6] com.sun.jersey.api.core.servlet.WebAppResourceConfig.init Scanning for root resource and provider classes in the Web app resource paths:
/WEB-INF/lib
/WEB-INF/classes
02-May-2019 19:04:30.228 INFO [http-nio-8080-exec-6] com.sun.jersey.api.core.ScanningResourceConfig.logClasses Root resource classes found:
class org.eclipse.persistence.jpa.rs.resources.MetadataResource
class org.eclipse.persistence.jpa.rs.resources.QueryResource
class
org.eclipse.persistence.jpa.rs.resources.unversioned.EntityResource
class org.eclipse.persistence.jpa.rs.resources.SingleResultQueryResource
class info.esblurock.reactionservice.ReactionServiceRestful
class org.eclipse.persistence.jpa.rs.resources.PersistenceResource
class org.eclipse.persistence.jpa.rs.resources.unversioned.PersistenceResource
class org.eclipse.persistence.jpa.rs.resources.EntityResource
class org.eclipse.persistence.jpa.rs.resources.unversioned.SingleResultQueryResource
class org.eclipse.persistence.jpa.rs.resources.unversioned.PersistenceUnitResource
class org.eclipse.persistence.jpa.rs.resources.PersistenceUnitResource
class org.eclipse.persistence.jpa.rs.resources.unversioned.QueryResource
02-May-2019 19:04:30.229 INFO [http-nio-8080-exec-6] com.sun.jersey.api.core.ScanningResourceConfig.logClasses Provider classes found:
org.eclipse.persistence.jpa.rs.exceptions.JPARSExceptionMapper类 2019年5月2日19:04:30.353信息[http-nio-8080-exec-6] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate正在启动Jersey应用程序,版本为“ Jersey:1.19 02/11 /” 2015 03:25 AM' 2019年5月2日19:04:32.007信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication使用阅读器: 2019年5月2日19:04:32.007信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.PrimitiveTextProvider@3878c8d1 2019年5月2日19:04:32.007信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.FormEncodingProvider@616f34a4 2019年5月2日19:04:32.007信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.MultipartProvider@21d2f186 2019年5月2日19:04:32.007信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.SourceProvider@2df54c57 2019年5月2日19:04:32.007信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.JAXBElementTypedProvider@74c43489 2019年5月2日19:04:32.007信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.JAXBElementProvider@6c16e4a1 2019年5月2日19:04:32.008信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.openejb.server.cxf.rs.johnzon .TomEEJsonbProvider @ 3d396015 2019年5月2日19:04:32.008信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.openejb.server.cxf.rs.johnzon .TomEEJsonpProvider @ 5e110384 2019年5月2日19:04:32.009信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.StringTextProvider@4d401cd7 2019年5月2日19:04:32.009信息[http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.BinaryDataProvider@5e67fdb
etc. etc. etc...
02-May-2019 19:04:32.038 INFO [http-nio-8080-exec-6] sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web application archive [/usr/local/tomee/webapps/reactionWebService-1.0.war] has finished in [4,453] ms'