Hi, On Thu, Jan 9, 2020 at 7:50 PM Mark Eggers <its_toas...@yahoo.com.invalid> wrote:
> Alex, > > On 1/9/2020 8:51 AM, Alex K wrote: > > Hi all, > > > > I have two .war files that when deployed at a plain Debian 9 VM are > working > > fine. > > I have prepared a docker file so as to deploy the same apps within a > docker > > container and for some reason one of the apps is not loading due to some > > error. > > > > Dockerfile: > > FROM debian:latest > > USER root > > > > ENV CATALINA_HOME /opt/tomcat > > ENV PATH $CATALINA_HOME/bin:$PATH > > RUN mkdir -p "$CATALINA_HOME" > > WORKDIR $CATALINA_HOME > > > > # Install packages > > RUN apt update && apt install default-jdk -y && groupadd tomcat && > useradd > > -s /bin/false -g tomcat -d $CATALINA_HOME tomcat > > COPY apache-tomcat-8.5.50.tar.gz /tmp/ > > > > RUN tar xzvf /tmp/apache-tomcat-8.5.50.tar.gz -C /opt/tomcat > > --strip-components=1 > > > > ADD app.war $CATALINA_HOME/webapps/ > > ADD orbeon.war $CATALINA_HOME/webapps/ > > ADD server.xml $CATALINA_HOME/conf/ > > ADD web.xml $CATALINA_HOME/conf/ > > ADD mariadb-java-client-2.4.1.jar $CATALINA_HOME/lib > > ADD setenv.sh $CATALINA_HOME/bin/ > > > > RUN chgrp -R tomcat $CATALINA_HOME && \ > > chown -R tomcat webapps/ work/ temp/ logs/ && \ > > chmod -R g+r conf && \ > > chmod g+x conf && \ > > chmod 750 $CATALINA_HOME/bin/setenv.sh && \ > > rm -f /tmp/apache-tomcat-8.5.50.tar.gz; > > > > EXPOSE 8443 > > CMD ["catalina.sh", "run"] > > > > I have tried also several other ways, by using directly other docker > tomcat > > images everytime resulting with some error. > > > > The error I am getting now is: > > > > 10:21:32.201 WARN c.h.c.c.s.CubaXmlWebApplicationContext - Exception > > encountered during context initialization - cancelling refresh attempt: > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean with name 'org.springframework.security.filterChains': Cannot > resolve > > reference to bean > > 'org.springframework.security.web.DefaultSecurityFilterChain#0' while > > setting bean property 'sourceList' with key [0]; nested exception is > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean with name > > 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot > > create inner bean '(inner bean)#27690bd5' of type > > > [org.springframework.security.web.authentication.www.BasicAuthenticationFilter] > > while setting constructor argument with key [4]; nested exception is > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean with name '(inner bean)#27690bd5': Cannot resolve reference to bean > > 'clientAuthenticationEntryPoint' while setting constructor argument; > nested > > exception is org.springframework.beans.factory.BeanCreationException: > Error > > creating bean with name 'clientAuthenticationEntryPoint' defined in class > > path resource [com/haulmont/addon/restapi/rest-dispatcher-spring.xml]: > > Instantiation of bean failed; nested exception is > > org.springframework.beans.BeanInstantiationException: Failed to > instantiate > > > [org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint]: > > Constructor threw exception; nested exception is > > java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException > > 10:21:32.243 ERROR c.h.a.r.a.r.RestAPIDispatcherServlet - Context > > initialization failed > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean with name 'org.springframework.security.filterChains': Cannot > resolve > > reference to bean > > 'org.springframework.security.web.DefaultSecurityFilterChain#0' while > > setting bean property 'sourceList' with key [0]; nested exception is > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean with name > > 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot > > create inner bean '(inner bean)#27690bd5' of type > > > [org.springframework.security.web.authentication.www.BasicAuthenticationFilter] > > while setting constructor argument with key [4]; nested exception is > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean with name '(inner bean)#27690bd5': Cannot resolve reference to bean > > 'clientAuthenticationEntryPoint' while setting constructor argument; > nested > > exception is org.springframework.beans.factory.BeanCreationException: > Error > > creating bean with name 'clientAuthenticationEntryPoint' defined in class > > path resource [com/haulmont/addon/restapi/rest-dispatcher-spring.xml]: > > Instantiation of bean failed; nested exception is > > org.springframework.beans.BeanInstantiationException: Failed to > instantiate > > > [org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint]: > > Constructor threw exception; nested exception is > > java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException > > > > > > Since I am not very familiar with tomcat, I would appreciate any pointers > > how to troubleshoot this. > > > > Thanx, > > Alex > > > > What's the Java version for Debian 9 versus the debian:latest docker image? > Thanx for your pointer. It seems it as a version issue I had as using debian:stretch image I was able to deploy successfully as a container. The version I have at Debian 9 is: root@debian9:~# java -version openjdk version "1.8.0_232" OpenJDK Runtime Environment (build 1.8.0_232-8u232-b09-1~deb9u1-b09) OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode) The docker file that successfully deployed the app is: FROM debian:stretch USER root ENV CATALINA_HOME /opt/tomcat ENV PATH $CATALINA_HOME/bin:$PATH RUN mkdir -p "$CATALINA_HOME" WORKDIR $CATALINA_HOME # Install packages RUN apt update && apt install default-jdk -y && groupadd tomcat && useradd -s /bin/false -g tomcat -d $CATALINA_HOME tomcat COPY iforms_files/apache-tomcat-8.5.50.tar.gz /tmp/ RUN tar xzvf /tmp/apache-tomcat-8.5.50.tar.gz -C /opt/tomcat --strip-components=1 ADD iforms_files/app.war $CATALINA_HOME/webapps/ ADD iforms_files/orbeon.war $CATALINA_HOME/webapps/ ADD iforms_files/server.xml $CATALINA_HOME/conf/ ADD iforms_files/mariadb-java-client-2.4.1.jar $CATALINA_HOME/lib ADD iforms_files/setenv.sh $CATALINA_HOME/bin/ RUN chgrp -R tomcat $CATALINA_HOME && \ chown -R tomcat webapps/ work/ temp/ logs/ && \ chmod -R g+r conf && \ chmod g+x conf && \ chmod 750 $CATALINA_HOME/bin/setenv.sh && \ rm -f /tmp/apache-tomcat-8.5.50.tar.gz; EXPOSE 8443 CMD ["catalina.sh", "run"] > . . . just my two cents > /mde/ > > Thank you all for your assistance! Alex