Hello,
Using Java 11 (openjdk) and following the advice in SAK-33595 regarding CATALINA_OPTS, I’m encountering severe errors during tomcat startup. I’m assuming that there might be some instructions or pointers I’m missing, but let me know if I should be posting a jira for the issue described below.
Thanks,
Sean
======
Using the maven and java settings below, I’ve successfully built the latest source in the master branch as of this writing (up to commit 6d2931a on Sep. 29, 2021).
[shorner@myhost ootb-sakai]$ mvn -version
Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
Maven home: /opt/maven/apache-maven-3.8.2
Java version: 11.0.12, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.el7_9.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.41.1.el7.x86_64", arch: "amd64", family: "unix"
Prior to building, I’ve also ensured that the local maven repository was empty and that the instance of tomcat (9.0.53) had no prior Sakai classes or jars therein. The entirety of my setenv.sh follows.
export JAVA_HOME=/usr/lib/jvm/jre-11-openjdk
CATALINA_OPTS="-server -Xms1g -Xmx2g -Djava.awt.headless=true -XX:+UseCompressedOops -XX:+UseG1GC -Xlog:gc"
CATALINA_OPTS="$CATALINA_OPTS -Dhttp.agent=Sakai"
CATALINA_OPTS="$CATALINA_OPTS -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"
CATALINA_OPTS="$CATALINA_OPTS -Dsakai.security=$CATALINA_BASE/sakai/"
CATALINA_OPTS="$CATALINA_OPTS -Duser.timezone=US/Pacific"
CATALINA_OPTS="$CATALINA_OPTS -Dsakai.cookieName=SAKAI2SESSIONID"
CATALINA_OPTS="$CATALINA_OPTS --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --illegal-access=permit"
export CATALINA_OPTS
I’m also using the latest version of MySQL/JConnector in $CATALINA_HOME/lib: mysql-connector-java-8.0.25.jar.
The first inkling of an issue in catalina.out is expressed in the following snippet:
29-Sep-2021 10:42:14.890 ^[[31mERROR^[[m [main] o.s.i.IgniteEntityManagerFactoryBean.buildNativeEntityManagerFactory Failed to initialize JPA EntityManagerFactory: Could not parse mapping document: jar:file:/opt/tomcat/tomcat9.0.53_ootb-master/lib/coursemanagement-hibernate-model-22-SNAPSHOT.jar!/org/sakaiproject/coursemanagement/impl/AcademicSessionCmImpl.hbm.xml (INPUT_STREAM)
29-Sep-2021 10:42:14.890 ^[[33mWARN^[[m [main] o.s.u.SakaiApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/opt/tomcat/tomcat9.0.53_ootb-master/components/sakai-kernel-impl/WEB-INF/db-components.xml]: Invocation of init method failed; nested exception is org.hibernate.boot.InvalidMappingException: Could not parse mapping document: jar:file:/opt/tomcat/tomcat9.0.53_ootb-master/lib/coursemanagement-hibernate-model-22-SNAPSHOT.jar!/org/sakaiproject/coursemanagement/impl/AcademicSessionCmImpl.hbm.xml (INPUT_STREAM)
Further on things go downhill rapidly, leading to a large number of exception stack traces. The following edited stack trace is the first of those:
29-Sep-2021 10:42:15.303 [31mERROR[m [main] o.s.c.i.SpringCompMgr.init Error creating bean with name 'entityManagerFactory' defined in file [/opt/tomcat/tomcat9.0.53_ootb-master/components/sakai-kernel-impl/WEB-INF/db-components.xml]: Invocation of init method failed; nested exception is org.hibernate.boot.InvalidMappingException: Could not parse mapping document: jar:file:/opt/tomcat/tomcat9.0.53_ootb-master/lib/coursemanagement-hibernate-model-22-SNAPSHOT.jar!/org/sakaiproject/coursemanagement/impl/AcademicSessionCmImpl.hbm.xml (INPUT_STREAM)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/opt/tomcat/tomcat9.0.53_ootb-master/components/sakai-kernel-impl/WEB-INF/db-components.xml]: Invocation of init method failed; nested exception is org.hibernate.boot.InvalidMappingException: Could not parse mapping document: jar:file:/opt/tomcat/tomcat9.0.53_ootb-master/lib/coursemanagement-hibernate-model-22-SNAPSHOT.jar!/org/sakaiproject/coursemanagement/impl/AcademicSessionCmImpl.hbm.xml (INPUT_STREAM)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.9.jar:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.9.jar:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.9.jar:5.3.9]
at org.sakaiproject.component.impl.SpringCompMgr.init(SpringCompMgr.java:164)
-- SNIP --
Caused by: org.hibernate.boot.InvalidMappingException: Could not parse mapping document: jar:file:/opt/tomcat/tomcat9.0.53_ootb-master/lib/coursemanagement-hibernate-model-22-SNAPSHOT.jar!/org/sakaiproject/coursemanagement/impl/AcademicSessionCmImpl.hbm.xml (INPUT_STREAM)
at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:46) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:38) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.spi.XmlMappingBinderAccess.bind(XmlMappingBinderAccess.java:79) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
-- SNIP --
Caused by: org.hibernate.internal.util.config.ConfigurationException: Unable to build hbm.xml JAXBContext
at org.hibernate.boot.jaxb.internal.MappingBinder.hbmJaxbContext(MappingBinder.java:85) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.jaxb.internal.MappingBinder.doBind(MappingBinder.java:62) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
-- SNIP --
Caused by: javax.xml.bind.JAXBException: Error while searching for service [javax.xml.bind.JAXBContextFactory]
at javax.xml.bind.ContextFinder$1.createException(ContextFinder.java:72) ~[jakarta.xml.bind-api-2.3.3.jar:2.3.3]
at javax.xml.bind.ContextFinder$1.createException(ContextFinder.java:69) ~[jakarta.xml.bind-api-2.3.3.jar:2.3.3]
-- SNIP --
Caused by: java.util.ServiceConfigurationError: javax.xml.bind.JAXBContextFactory: com.sun.xml.bind.v2.JAXBContextFactory not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:589) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1237) ~[?:?]
at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1265) ~[?:?]
at java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300) ~[?:?]
at java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385) ~[?:?]
at javax.xml.bind.ServiceLoaderUtil.firstByServiceLoader(ServiceLoaderUtil.java:39) ~[jakarta.xml.bind-api-2.3.3.jar:2.3.3]
at javax.xml.bind.ContextFinder.find(ContextFinder.java:354) ~[jakarta.xml.bind-api-2.3.3.jar:2.3.3]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:691) ~[jakarta.xml.bind-api-2.3.3.jar:2.3.3]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:632) ~[jakarta.xml.bind-api-2.3.3.jar:2.3.3]
at org.hibernate.boot.jaxb.internal.MappingBinder.hbmJaxbContext(MappingBinder.java:82) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.jaxb.internal.MappingBinder.doBind(MappingBinder.java:62) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.jaxb.internal.AbstractBinder.doBind(AbstractBinder.java:102) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.jaxb.internal.AbstractBinder.bind(AbstractBinder.java:57) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:43) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:38) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.spi.XmlMappingBinderAccess.bind(XmlMappingBinderAccess.java:79) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.model.process.internal.ScanningCoordinator.applyScanResultsToManagedResources(ScanningCoordinator.java:220) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.model.process.internal.ScanningCoordinator.coordinateScan(ScanningCoordinator.java:82) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.prepare(MetadataBuildingProcess.java:99) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:240) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:168) ~[hibernate-core-5.3.20.Final.jar:5.3.20.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:52) ~[spring-orm-5.3.9.jar:5.3.9]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.9.jar:5.3.9]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.9.jar:5.3.9]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.9.jar:5.3.9]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[spring-beans-5.3.9.jar:5.3.9]
... 59 more
--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAJkC2Sdy4dysCwqvLeEpaxd%3DH7PZ2j%2BrYJnuHfrU20j3HOQgPQ%40mail.gmail.com.
There is another revert that just went in. It builds and starts./Chuck
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAJkC2SdwS2b9r2GDspiQRtW8Bi5y45iax6TaAn5dp18jv_3Jrw%40mail.gmail.com.
Sean,
I spent yesterday (with master broken two times) testing things over and over and over to the point where I am pretty sure I can predictably make Sakai master work with Java 11 four different ways. I send a dev list note and made a blog post. You can use my stuff or Matt’s stuff or just look at my stuff and borrow all my bits.
https://www.dr-chuck.com/csev-blog/2021/09/sakai-development-moving-to-java-11/
I would suggest that you start with a fresh Tomcat and a fresh master. There are little messed up bits like “endorsed” that were not fixed in the big merge but were fixed in the past few days.
I hope this helps.
I want to make this all easier and Matt’s docker and my scripts keep evolving and becoming more useful and reliable.
/Chuck
P.S. Thanks Matt for all the help.
--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAJkC2SfSh%2BuKnK-RoT2pXXPVkTuDBhUCAEUS5zA-svgOs74WrQ%40mail.gmail.com.
Hello Miguel, I managed to get Sakai 22.1 up and running with Java 11.0.17 on AlmaLinux 9... The problem was indeed due to the combination of Centos 8 and Java 11. Now its running without problems..
Regards.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAJkC2SciawSB7Aip%3DkhbJAEtQ-r0589%2B15O_OPBf_40axhnT_g%40mail.gmail.com.
Exactly Sean, it's working now after applying SAK-47417 and SAK-47436 to our 22.x branch, this is also part of 22.x now.
Miguel
-- ----------------------------------------------- Miguel Pellicer CTO at EDF Website: https://www.edf.global LinkedIn: https://es.linkedin.com/company/entornosdeformacion LinkedIn: https://www.linkedin.com/in/mpellicer-edf Office Phone: +34 - 96 381 35 75 Request a meeting here: https://calendly.com/mpellicer ----------------------------------------------- Su dirección de correo electrónico junto a sus datos personales consta en un fichero cuya finalidad es la de mantener el contacto profesional con Ud. Por ENTORNOS DE FORMACIÓN S.L., como responsable del Fichero y del Tratamiento. De conformidad con el Reglamento (UE) núm. 2016/679, General de Protección de Datos y la LO 3/2018, de 5 de diciembre, de Protección de Datos Personales y garantía de los derechos digitales, puede ejercer de forma totalmente gratuita los derechos de acceso, información, rectificación, supresión y olvido, limitación del tratamiento, oposición, portabilidad y a no ser objeto de decisiones individuales automatizadas enviando un correo electrónica a la siguiente dirección: in...@edf.global Si no desea recibir información por correo electrónico notifiquenoslo en esta misma dirección. Aviso sobre confidencialidad: Este documento se dirige exclusivamente a su destinatario. Por contener información confidencial, sometida a secreto profesional cuya divulgación está prohibida en virtud de la legislación vigente. Se informa a quien lo recibiera, sin ser el destinatario, que la información contenida en el mismo es reservada y su utilización con cualquier fin está prohibida. Si ha recibido este documento por error, le rogamos nos lo comunique y proceda a su destrucción. Your e-mail address and your data are stored in a file to maintain professional contact between you and ENTORNOS DE FORMACIÓN S.L., as the party responsible for the file and the processing. In accordance with Regulation (EU) No. 2016/679, General Data Protection and the OL 3/2018 of 5th December, to guarantee digital rights, you can exercise free of charge the rights of access, information, rectification, deletion and oblivion, limitation of processing, opposition, portability and the right of you are not subject to automated individual decisions, by sending an e-mail to the following address: in...@edf.global. If you do not wish to receive information by e-mail, please notify us at the same address. Confidentiality notice: This document is addressed exclusively to the addressee. If you have received this document in error, please inform us and destroy it.
Thanks for confirming Ernesto, after the latest changes it's now
working on CentOS 8, so you can choose to stay with CentOS 8 or
use AlmaLinux.
Miguel
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/ee5c4b42-10ed-3592-24df-4cfa6648a1a0%40gmail.com.