Развертывание Tomee работает с использованием интерфейса Tomee, но не при первоначальном запуске с Marvin
В докере я использую Marvin для генерации файла war: mvn clean compile install скопируйте файл war в веб-приложения, затем запустите tomee CMD ["/usr/local/tomee/bin/catalina.sh", "run"] tomee запустится, мой файл войны извлечен и развернут и может быть замечен в менеджере. Но, когда я пытаюсь это сделать (щелкните в менеджере), я получаю 404
Если я сейчас разверну и разверну версию на моем компьютере, также сгенерированную с помощью той же команды, то mvn clean compile install Появляется в диспетчере и работает отлично.
Просматривая файлы журналов, я вижу, что при развертывании докера все записи журнала происходят из "[main]". При развертывании из интерфейса Tomee есть записи журнала из "[http-nio-8080]".
Основной вопрос заключается в том, почему при копировании файла war в веб-приложения и запуске tomee не запускается "HTTP-nio-8080", а из интерфейса менеджера tomee...
Я использую eclipse для управления проектом, но команда marvin (и запуск docker) выполняется в командной строке
Одно замечание: все журналы до того, как я удаляю приложение, взяты из [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"]
Разница в файлах журнала заключается в следующем:
С развертыванием докера:
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]
Развертывание из интерфейса менеджера томов
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:
class org.eclipse.persistence.jpa.rs.exceptions.JPARSExceptionMapper 02-May-2019 19:04:30.353 INFO [http-nio-8080-exec-6] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Инициирующее приложение на Джерси, версия 'Джерси: 1.19 02/11/2015 03:25 AM' 02-May-2019 19:04:32.007 ИНФОРМАЦИЯ [http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication Использование читателей: 02-May-2019 19:04:32.007 INFO [http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication.pp.cxf.jaxrs.provider.PrimitiveTextProvider@ 3878c8d1 02-мая-2019 19:04:32.007 ИНФОРМАЦИЯ [http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.degloyApplicationApplicationApplication.cxf.jaxrs.provider.FormEncodingProvider@ 616f34a4 02-мая-2019 19:04:32.007 ИНФОРМАЦИЯ [http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication или приложение.cxf.jaxrs.provider.MultipartProvider@ 21d2f186 02-мая-2019 19:04:32.007 ИНФОРМАЦИЯ [http-nio-8080-exec-6] или g.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.SourceProvider@2df54c57 02-мая-2019 19:04:32.007 ИНФОРМАЦИЯ [http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.JAXBElementTypedProvider@74c43489 02-мая-2019 19:04:32.007 INFO [http-exo-80] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.cxf.jaxrs.provider.JAXBElementProvider@6c16e4a1 02-мая-2019 19:04:32.008 INFO [http-nio-80] 80 org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonbProvider@3d396015 02-мая-2019 19:04:32.008 INFO [http: n080] exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonpProvider@5e110384 02-мая-2019 19:04:32.009 nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication org.apac he.cxf.jaxrs.provider.StringTextProvider@4d401cd7 02-мая-2019 19:04:32.009 ИНФОРМАЦИЯ [http-nio-8080-exec-6] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.degloyAlication 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'