![](https://seccdn.libravatar.org/avatar/e6d0c9f42625f8f9f45b6bd11ffbb77b.jpg?s=120&d=mm&r=g)
Hi please check your /etc/rhn/rhn.conf . You should have the following 3 lines: hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect hibernate.connection.driver_class=org.postgresql.Driver hibernate.connection.driver_proto=jdbc:postgresql I think this is set in spacewalk-setup . You can configure debug logging in /srv/tomcat/webapps/rhn/WEB-INF/classes/log4j.properties (maybe tomcat is installed at a different place in CentOS) log4j.logger.com.redhat.rhn.common.hibernate.HibernateFactory=DEBUG But errors should always be logged. See also https://github.com/uyuni-project/uyuni/wiki/Java-Logging Am Montag, 28. Dezember 2020, 09:30:49 CET schrieb Stefan Bluhm:
One step forward: I managed to hook up Eclipse with Tomcat and was able to inspect some variables.
In the end spacewalk-java is trying to connect to "hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver". So it seems I really have to sort our the configuration file issue first.
The line: "LOG.error("FATAL ERROR creating HibernateFactory", e);" does get fired but I do not see anything in the logs.
Can you explain me (for dummies) how to enable logging properly? It seems that I am doing something wrong.
Thank you and best wishes,
Stefan
----- Ursprüngliche Mail ----- Von: "Stefan Bluhm"
An: "uyuni-devel" Gesendet: Donnerstag, 24. Dezember 2020 11:15:53 Betreff: Re: Uyuni Master Java issues on CentOS 8 Hello Uyuni Team,
can you please share some ideas for me on how to debug the below issue (previously mentioned here)? Unfortunately, I was not able to progress at all on this one.
17-Dec-2020 12:01:21.779 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.redhat.rhn.webapp.RhnServletListener] java.lang.NullPointerException at com.redhat.rhn.common.hibernate.ConnectionManager.getSession(ConnectionMana ger.java:276) at com.redhat.rhn.common.hibernate.HibernateFactory.getSession(HibernateFactor y.java:352) at com.redhat.rhn.common.hibernate.HibernateFactory.listObjectsByNamedQuery(Hi bernateFactory.java:275) at com.redhat.rhn.common.hibernate.HibernateFactory.listObjectsByNamedQuery(Hi bernateFactory.java:220) at com.redhat.rhn.domain.reactor.SaltEventFactory.countSaltEvents(SaltEventFac tory.java:54) at com.suse.manager.reactor.PGEventStream.<init>(PGEventStream.java:102) at com.suse.manager.webui.services.impl.SaltService.createEventStream(SaltServ ice.java:536) at com.suse.manager.webui.services.impl.SaltService.createOrGetEventStream(Sal tService.java:488) at com.suse.manager.webui.services.impl.SaltService.getEventStream(SaltService .java:546) at com.suse.manager.reactor.SaltReactor.connectToEventStream(SaltReactor.java: 184) at com.suse.manager.reactor.SaltReactor.start(SaltReactor.java:155) at com.redhat.rhn.webapp.RhnServletListener.contextInitialized(RhnServletListe ner.java:131) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java :4678) ...
Steps taken on CentOS 8: service tomcat start
Full logs: catalina.2020-12-24.log: https://pastebin.com/FTaVb9t4 localhost.2020-12-24.log: https://pastebin.com/mPkfxRr4
- Should I be looking at other logs (couldn't find any relevant ones). - Could this be a spacewalk-java build/packaging issue? The package was originally built without jaxb available. Then I would revisit the build process.
Thank you and best wishes,
Stefan
----- Ursprüngliche Mail ----- Von: "Stefan Bluhm"
An: "uyuni-devel" Gesendet: Donnerstag, 17. Dezember 2020 12:25:19 Betreff: Re: Uyuni Master Java issues on CentOS 8 Hello Ricardo,
when I filled out the DB fields in /usr/share/rhn/config-defaults/rhn.conf, I was able to progress two steps. Item on my todo list is now to check out why the /etc/rhn/ file is not being picked up.
After adding istacks-commons-runtime.jar to the Tomcat classpath, Tomcat progresses to the error message below. I tried following your advice.
From what i can tell, the process is now actually stuck at org.hibernate.SessionFactory itself. Can you confirm this? com.redhat.rhn.common.hibernate.ConnectionManager.getSession(ConnectionMana ger.java:276) 276: info = new SessionInfo(sessionFactory.openSession());
Part of the stack trace (full stack trace in links below) 17-Dec-2020 12:01:21.779 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.redhat.rhn.webapp.RhnServletListener] java.lang.NullPointerException at com.redhat.rhn.common.hibernate.ConnectionManager.getSession(ConnectionMana ger.java:276) at com.redhat.rhn.common.hibernate.HibernateFactory.getSession(HibernateFactor y.java:352) at com.redhat.rhn.common.hibernate.HibernateFactory.listObjectsByNamedQuery(Hi bernateFactory.java:275) at com.redhat.rhn.common.hibernate.HibernateFactory.listObjectsByNamedQuery(Hi bernateFactory.java:220) at com.redhat.rhn.domain.reactor.SaltEventFactory.countSaltEvents(SaltEventFac tory.java:54) at com.suse.manager.reactor.PGEventStream.<init>(PGEventStream.java:102) at com.suse.manager.webui.services.impl.SaltService.createEventStream(SaltServ ice.java:536) at com.suse.manager.webui.services.impl.SaltService.createOrGetEventStream(Sal tService.java:488) at com.suse.manager.webui.services.impl.SaltService.getEventStream(SaltService .java:546) at com.suse.manager.reactor.SaltReactor.connectToEventStream(SaltReactor.java: 184) at com.suse.manager.reactor.SaltReactor.start(SaltReactor.java:155) at com.redhat.rhn.webapp.RhnServletListener.contextInitialized(RhnServletListe ner.java:131) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java :4678) ...
Full stack trace: https://pastebin.com/S7R6864y
Best wishes,
Stefan
----- Ursprüngliche Mail ----- Von: "Ricardo Mateus"
An: "Stefan Bluhm" , "uyuni-devel" Gesendet: Mittwoch, 16. Dezember 2020 11:41:27 Betreff: Re: Uyuni Master Java issues on CentOS 8 Hey Stefan,
Regarding NPE yo can analyze stack trace, and check the code base in reverse order, starting from one class that is part of package *.rhn.* Java codebase is placed on https://github.com/uyuni-project/uyuni/tree/master/java/code/src
For example:
at
com.redhat.rhn.webapp.RhnServletListener.contextInitialized(RhnServletListen er.java:125)
https://github.com/uyuni-project/uyuni/blob/master/java/code/src/com/redhat/ rhn/webapp/RhnServletListener.java#L125
at
com.redhat.rhn.webapp.RhnServletListener.startHibernate(RhnServletListener.j ava:103)
https://github.com/uyuni-project/uyuni/blob/master/java/code/src/com/redhat/ rhn/webapp/RhnServletListener.java#L103
at
com.redhat.rhn.common.hibernate.HibernateFactory.createSessionFactory(Hibern ateFactory.java:108)
https://github.com/uyuni-project/uyuni/blob/master/java/code/src/com/redhat/ rhn/common/hibernate/HibernateFactory.java#L108
at
com.redhat.rhn.common.hibernate.ConnectionManager.initialize(ConnectionManag er.java:136)
https://github.com/uyuni-project/uyuni/blob/master/java/code/src/com/redhat/ rhn/common/hibernate/ConnectionManager.java#L136
at
com.redhat.rhn.common.hibernate.ConnectionManager.createSessionFactory(Conne ctionManager.java:168)
https://github.com/uyuni-project/uyuni/blob/master/java/code/src/com/redhat/ rhn/common/hibernate/ConnectionManager.java#L168
First argument in the map is a static string, so the problem is that secound argument is returning null, and that is the configuration value for the database user name.
I will try to investigate a bit more about the problem latter.
Cheers, Ricardo
On 12/16/20 9:52 AM, Stefan Bluhm wrote:
Thank you Ricardo,
I indeed forgot to re-run mgr-setup. But the file is actually there and filled out. I also made sure it is readable by everyone.
Here the
configuration: https://pastebin.com/vfdrrCkC (I also tried setting db_ssl_enabled = 0).
Just now, I also noticed this line in the main catalina log seconds before (and not after) the stack trace. Is this directly impacting the error? 16-Dec-2020 10:25:50.873 WARNING [main] org.apache.catalina.startup.HostConfig.deployDescriptor The path attribute with value [/rhn] in deployment descriptor [/etc/tomcat/Catalina/localhost/rhn.xml] has been ignored Full trace of catalina.2020-12-16.log: https://pastebin.com/jSpX0pNc Full trace of localhost.2020-12-16.log: https://pastebin.com/Qd7mgWqT (unchanged as far as I can tell) How did you pinpoint the property "db_user"? If you guide me, I might be able to understand more of those stack traces. At the moment, I only understand the plain text and NPE :).
https://github.com/uyuni-project/uyuni/blob/master/java/buildconf/test/rhn .conf.postgresql-example
Thanks and best wishes,
Stefan
----- Ursprüngliche Mail ----- Von: "Ricardo Mateus"
An: "Stefan Bluhm" , "uyuni-devel" Gesendet: Dienstag, 15. Dezember 2020 23:27:12 Betreff: Re: Uyuni Master Java issues on CentOS 8 Hello Stefan,
This error is happening because the configuration property for `db_user` is not set on the rhn.config. I was able to reproduce the same error by commenting this property in my local server.
Default location for this file is `/etc/rhn/rhn.conf`. Do you have this file on your instalation? Does this file have all the needed properties?
You can check some examples in: - https://github.com/uyuni-project/uyuni/blob/master/backend/rhn-conf/rhn.co nf
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
15-Dec-2020 21:08:25.182 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStop Exception sending context destroyed event to listener instance of class [com.redhat.rhn.webapp.RhnServletListener]
java.lang.NullPointerException
at
com.redhat.rhn.common.hibernate.ConnectionManager.close(ConnectionMana
ger.java:114)
at
com.redhat.rhn.common.hibernate.HibernateFactory.closeSessionFactory(H
ibernateFactory.java:92) at
com.redhat.rhn.webapp.RhnServletListener.stopHibernate(RhnServletListe
ner.java:108) at
com.redhat.rhn.webapp.RhnServletListener.contextDestroyed(RhnServletLi
stener.java:165) at
org.apache.catalina.core.StandardContext.listenerStop(StandardContext.
java:4724) at
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.
java:5395) at
org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:187)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.
java:717) at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690
) at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.jav
a:631) at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig
.java:1830) at java.base/
java.util.concurrent.Executors$RunnableAdapter.call(Executor
s.java:515) at java.base/
java.util.concurrent.FutureTask.run(FutureTask.java:264) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExe
cutorService.java:75) at java.base/
java.util.concurrent.AbstractExecutorService.submit(Abstract
ExecutorService.java:118) at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.ja
va:526) at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:425)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:
309) at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBas
e.java:123) at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.
java:423) at
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366
) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.jav
a:936) at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:
843) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.j
ava:1384) at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.j
ava:1374) at java.base/
java.util.concurrent.FutureTask.run(FutureTask.java:264) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExe
cutorService.java:75) at java.base/
java.util.concurrent.AbstractExecutorService.submit(Abstract
ExecutorService.java:140) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.jav
a:909) at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.j
ava:262) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardService.startInternal(StandardService
.java:421) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.j
ava:930) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.startup.Catalina.start(Catalina.java:772)
at java.base/
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeM
ethodAccessorImpl.java:62) at java.base/
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Del
egatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:
Cheers, Ricardo
On 12/15/20 8:42 PM, Stefan Bluhm wrote:
Hello Java Experts,
I am back at trying to get "rhn" to start on Tomcat/CentOS 8. Brief history:
OpenSUSE Leap 15.2 comes with a non-standard Java 11 OpenJDK version that integrates com.sun.xml.bind and allows usage by starting Java with the flag "--add-modules java.annotation,com.sun.xml.bind".
As CentOS does
not have these modules, the following packages need to be added: glassfish-jaxb-api, glassfish-jaxb-core, jaf, istack-commons-runtime. Using the same jars on Leap allows the removal of the module flag and the system starts up without any issues (that I noticed).>>
CentOS also does not show any "class not found" exceptions anymore so it sounds from that perspective, I am good.
Unfortunately, now the stack trace below is thrown. I guess this might have something to do with bundle/class version requirements.
Can you
please give me some suggestions how to best approach the issue resolutions? I am currently testing on a Uyuni installation itself, trying to get it to start.>>
Also any ad-hoc ideas where to focus the issue identification on the stack trace?
Thank you and best wishes,
Stefan
15-Dec-2020 21:08:25.119 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.redhat.rhn.webapp.RhnServletListener]
java.lang.NullPointerException
at java.base/ java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHash Map.java:1011) at java.base/ java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap .java:1006) at java.base/ java.util.Properties.put(Properties.java:1337) at
com.redhat.rhn.common.hibernate.ConnectionManager.createSessionFactory
(ConnectionManager.java:168)
at
com.redhat.rhn.common.hibernate.ConnectionManager.initialize(Connectio
nManager.java:136) at
com.redhat.rhn.common.hibernate.HibernateFactory.createSessionFactory(
HibernateFactory.java:108) at
com.redhat.rhn.webapp.RhnServletListener.startHibernate(RhnServletList
ener.java:103) at
com.redhat.rhn.webapp.RhnServletListener.contextInitialized(RhnServlet
Listener.java:125) at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext
.java:4678) at
org.apache.catalina.core.StandardContext.startInternal(StandardContext
.java:5139) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.
java:717) at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690
) at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.jav
a:631) at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig
.java:1830) at java.base/
java.util.concurrent.Executors$RunnableAdapter.call(Executor
s.java:515) at java.base/
java.util.concurrent.FutureTask.run(FutureTask.java:264) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExe
cutorService.java:75) at java.base/
java.util.concurrent.AbstractExecutorService.submit(Abstract
ExecutorService.java:118) at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.ja
va:526) at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:425)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:
309) at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBas
e.java:123) at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.
java:423) at
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366
) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.jav
a:936) at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:
843) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.j
ava:1384) at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.j
ava:1374) at java.base/
java.util.concurrent.FutureTask.run(FutureTask.java:264) at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExe
cutorService.java:75) at java.base/
java.util.concurrent.AbstractExecutorService.submit(Abstract
ExecutorService.java:140) at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.jav
a:909) at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.j
ava:262) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardService.startInternal(StandardService
.java:421) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.j
ava:930) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.startup.Catalina.start(Catalina.java:772)
at java.base/
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeM
ethodAccessorImpl.java:62) at java.base/
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Del
egatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
_______________________________________________ Uyuni Development mailing list -- devel@lists.uyuni-project.org To unsubscribe, email devel-leave@lists.uyuni-project.org List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/devel@lists.uyuni-project.org
-- Ricard Mateus SUSE Manager Development Team _______________________________________________ Uyuni Development mailing list -- devel@lists.uyuni-project.org To unsubscribe, email devel-leave@lists.uyuni-project.org List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/devel@lists.uyuni-project.org