glassfish icon indicating copy to clipboard operation
glassfish copied to clipboard

Exception while deploying the app [__admingui]]]

Open pzygielo opened this issue 3 years ago • 23 comments

Environment Details

  • GlassFish Version (and build number): Eclipse GlassFish 7.0.0 (build master-b-g3463ea0 2022-02-05T16:50:42+0000) Where 3463ea0 is current master.

  • JDK version: openjdk version "11.0.14" 2022-01-18

  • OS: Linux

  • Database: none


Problem Description

GlassFish Server Administration Console (http://localhost:4848) cannot be loaded.

Seems to be easily reproducible with https://ci.eclipse.org/glassfish/view/GlassFish/job/glassfish_build-and-test-using-jenkinsfile/job/master/611/artifact/bundles/glassfish.zip

server.log contains:

[2022-02-06T13:23:50.861+0100] [glassfish 7.0] [SEVERE] [NCLS-CORE-00026] [jakarta.enterprise.system.core] [tid: _ThreadID=125 _ThreadName=Thread-28] [timeMillis: 1644150230861] [levelValue: 1000] [[
  Exception during lifecycle processing
MultiException stack 1 of 2
com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-common-full-plugin [238]], State = [NEW]
	at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:193)
	at org.jvnet.hk2.osgiadapter.OsgiPopulatorPostProcessor$1.loadClass(OsgiPopulatorPostProcessor.java:54)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2254)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:433)
	at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2067)
	at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
	at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServices(ServiceLocatorImpl.java:852)
	at com.sun.enterprise.v3.server.ClassLoaderHierarchyImpl.createApplicationParentCL(ClassLoaderHierarchyImpl.java:179)
	at org.glassfish.deployment.common.DeploymentContextImpl.createClassLoader(DeploymentContextImpl.java:222)
	at org.glassfish.deployment.common.DeploymentContextImpl.createDeploymentClassLoader(DeploymentContextImpl.java:205)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:345)
	at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:382)
	at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:188)
	at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:77)
Caused by: org.osgi.framework.BundleException: Unable to resolve org.glassfish.main.admingui.console-common-full-plugin [238](R 238.0): missing requirement [org.glassfish.main.admingui.console-common-full-plugin [238](R 238.0)] osgi.wiring.package; (&(osgi.wiring.package=com.sun.jsftemplating.layout.descriptors.handler)(version>=3.0.0)(!(version>=4.0.0))) [caused by: Unable to resolve org.glassfish.jsftemplating [93](R 93.0): missing requirement [org.glassfish.jsftemplating [93](R 93.0)] osgi.wiring.package; (&(osgi.wiring.package=jakarta.el)(version>=4.0.0)(!(version>=5.0.0)))] Unresolved requirements: [[org.glassfish.main.admingui.console-common-full-plugin [238](R 238.0)] osgi.wiring.package; (&(osgi.wiring.package=com.sun.jsftemplating.layout.descriptors.handler)(version>=3.0.0)(!(version>=4.0.0)))]
	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:1006)
	at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.startBundle(OSGiModuleImpl.java:224)
	at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:185)
	... 14 more
MultiException stack 2 of 2
java.lang.IllegalStateException: Could not load descriptor SystemDescriptor(
	implementation=org.glassfish.full.admingui.JMailConsolePlugin
	contracts={org.glassfish.full.admingui.JMailConsolePlugin,org.glassfish.api.admingui.ConsoleProvider}
	scope=jakarta.inject.Singleton
	qualifiers={}
	descriptorType=CLASS
	descriptorVisibility=NORMAL
	metadata=Bundle-SymbolicName={org.glassfish.main.admingui.console-common-full-plugin},Bundle-Version={7.0.0.SNAPSHOT}
	rank=0
	loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-common-full-plugin [238]], State = [NEW],1511516330)
	proxiable=null
	proxyForSameScope=null
	analysisName=null
	id=79
	locatorId=0
	identityHashCode=1777825289
	reified=false)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2263)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:433)
	at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2067)
	at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
	at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServices(ServiceLocatorImpl.java:852)
	at com.sun.enterprise.v3.server.ClassLoaderHierarchyImpl.createApplicationParentCL(ClassLoaderHierarchyImpl.java:179)
	at org.glassfish.deployment.common.DeploymentContextImpl.createClassLoader(DeploymentContextImpl.java:222)
	at org.glassfish.deployment.common.DeploymentContextImpl.createDeploymentClassLoader(DeploymentContextImpl.java:205)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:345)
	at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:382)
	at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:188)
	at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:77)
]]

[2022-02-06T13:23:50.889+0100] [glassfish 7.0] [SEVERE] [NCLS-CORE-00041] [jakarta.enterprise.system.core] [tid: _ThreadID=125 _ThreadName=Thread-28] [timeMillis: 1644150230889] [levelValue: 1000] [[
  Application deployment failed: Exception while deploying the app [__admingui]]]

Steps to reproduce

wget -nc https://ci.eclipse.org/glassfish/view/GlassFish/job/glassfish_build-and-test-using-jenkinsfile/job/master/611/artifact/bundles/glassfish.zip
unzip glassfish.zip
cd glassfish7/glassfish
./bin/asadmin start-domain
curl http://localhost:4848 & tail -f domains/domain1/logs/server.log # interrupt once done
./bin/asadmin stop-domain

Impact of Issue

Admin GUI is not usable.

pzygielo avatar Feb 06 '22 12:02 pzygielo

This is indeed the case. The Admin GUI, being based on JSF Template/Woodstock is not compatible with Faces 4.0.

We likely have to deliver GlassFish 7 without the admin console. I tried to find sponsors, but either people don't understand the issue, or when they do they say to just deliver indeed with the admin console.

arjantijms avatar Feb 06 '22 14:02 arjantijms

The Admin GUI, being based on JSF Template/Woodstock is not compatible with Faces 4.0.

@arjantijms Do you have any clues as to what kind of JSF specification changes are affecting it?

hs536 avatar Mar 02 '22 07:03 hs536

Do you have any clues as to what kind of JSF specification changes are affecting it?

It's mainly the removal of a lot of deprecated features I guess.

arjantijms avatar Mar 02 '22 14:03 arjantijms

The issue is also reproducible with glassfish7 M3 release.

ttelang avatar Mar 24 '22 17:03 ttelang

The issue is also reproducible with glassfish7 M3 release.

That's correct indeed.

arjantijms avatar Mar 25 '22 15:03 arjantijms

Now the access to the admin console is successful, but it keeps loading...
image in the server log, I get the following error:

[2022-03-27T19:34:00.423+0900] [glassfish 7.0] [SEVERE] [NCLS-CORE-00026] [jakarta.enter
prise.system.core] [tid: _ThreadID=116 _ThreadName=Thread-25] [timeMillis: 1648377240423
] [levelValue: 1000] [[
  Exception during lifecycle processing
com.sun.enterprise.module.ResolveError: Not able to locate a unique module by name org.glassfish.jakarta.el
        at com.sun.enterprise.v3.server.ClassLoaderHierarchyImpl.createApplicationParentCL(ClassLoaderHierarchyImpl.java:149)
        at org.glassfish.deployment.common.DeploymentContextImpl.createClassLoader(DeploymentContextImpl.java:222)
        at org.glassfish.deployment.common.DeploymentContextImpl.createDeploymentClassLoader(DeploymentContextImpl.java:205)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:345)
        at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:382)
        at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:188)
        at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:
77)
]]

it seems necessary to update the following manifest to the latest state https://github.com/eclipse-ee4j/glassfish/blob/2e3d8d54c03f3711455fd9691a35a86ed7b79b04/appserver/admingui/war/pom.xml#L133-L136

hs536 avatar Mar 27 '22 10:03 hs536

Can we perform all operations of Admin Console (https://localhost:4848) either using GlassFish REST Interface (http://localhost:4848/management/domain) or commandline (via asadmin command) ?

ttelang avatar Apr 01 '22 06:04 ttelang

Can we perform all operations of Admin Console (https://localhost:4848/) either using GlassFish REST Interface (http://localhost:4848/management/domain) or commandline (via asadmin command) ?

AFAIK, asadmin command basically covers all operations. The GlassFish REST Interface is also enabled, but the interface specification is not public now, so it is currently difficult to use it outside of getting the server's parameter settings...

hs536 avatar Apr 01 '22 07:04 hs536

I am trying to migrate woodstock and jsftemplating to JFS4 but having difficulty with JSP de-support (such as UIComponentELTag, FACES-1546) and migration local EL API to Jakarta EL API (FACES-1548). Now I am looking for migration tips.

hs536 avatar Apr 03 '22 04:04 hs536

@hs536 that's a very brave attempt!

arjantijms avatar Apr 03 '22 13:04 arjantijms

Current Status

  • Build each project with EE10 APIs: Done
  • Deploy __admingui without error: Done
  • Resolve osgi error: Done
  • View login page: Error

Steps to reproduce

  1. Build woodstock
git clone -b glassfish#23782 --single-branch https://github.com/hs536/glassfish-woodstock
cd glassfish-woodstock
mvn clean install
  1. Build jsftemplate
git clone -b glassfish#23782 --single-branch https://github.com/hs536/glassfish-jsftemplating
cd glassfish-jsftemplating
mvn clean install
  1. ~~Build jsonp~~

  2. Build glassfish

git clone -b glassfish#23782 --single-branch https://github.com/hs536/glassfish
cd glassfish
mvn clean install -Pfast
  1. setup glassfish
unzip appserver/distributions/glassfish/target/glassfish.zip
cd glassfish7/glassfish/
asadmin start-domain
asadmin change-admin-password
asadmin enable-secure-admin
asadmin restart-domain

Then, accessing the management console, the following error is output to server.log. It appears that this is still missing changes related to the migration of ManagedBean to CDI beans for admingui.

[2022-04-17T17:45:04.210+0900] [glassfish 7.0] [SEVERE] [] [jakarta.enterprise.resource.webcontainer.faces.config] [tid: _ThreadID=117 _ThreadName=Thread-25] [timeMillis: 1650185104210] [levelValue: 1000] [[
  Critical error during deployment: 
java.lang.IllegalStateException: CDI is not available
        at com.sun.faces.util.Util.getCdiBeanManager(Util.java:1493)
        at com.sun.faces.el.ELUtils.addCDIELResolver(ELUtils.java:192)
        at com.sun.faces.el.ELUtils.buildFacesResolver(ELUtils.java:164)
        at com.sun.faces.application.ApplicationAssociate.initializeELResolverChains(ApplicationAssociate.java:416)
        at com.sun.faces.application.applicationimpl.ExpressionLanguage.performOneTimeELInitialization(ExpressionLanguage.java:144)
        at com.sun.faces.application.applicationimpl.ExpressionLanguage.getELResolver(ExpressionLanguage.java:89)
        at com.sun.faces.application.ApplicationImpl.getELResolver(ApplicationImpl.java:200)
        at com.sun.faces.el.ELContextImpl.<init>(ELContextImpl.java:60)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:202)
        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5051)
        at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:563)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5627)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:511)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:877)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:860)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:644)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2021)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1667)
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:82)
        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:98)
        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:267)
        at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:328)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:480)
        at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:382)
        at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:188)
        at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:77)
]]

hs536 avatar Apr 17 '22 09:04 hs536

Amazing work!

java.lang.IllegalStateException: CDI is not available

Could this perhaps be related to CDI now needing a beans.xml with scanning set to all? A lot of tests in GF were tripping on exactly this issue too.

arjantijms avatar Apr 20 '22 09:04 arjantijms

Hi, I tried to continue and I got a bit further -- now it fails loading the tree :-) It is work in progress, some commits add debugging outputs.

Code

https://github.com/aubi/glassfish-jsftemplating/commits/upgrade-to-faces-4 (pageSession should return the map, not an element from it) https://github.com/aubi/patched-src-glassfish-woodstock/commits/FISH-6085-upgrade-to-faces-4 (removed logging of base as one of its value is recursive -> StackOverflow) https://github.com/aubi/Payara/tree/FISH-6347-fix-admin-gui (solves the CDI, must be loaded manually as admin gui is not a normal app, beans.xml doesn't help)

Results

login.jsf

This code is perfomed properly:

setPageSessionAttribute(key="byPassLogin" value="false");
if ("$pageSession{loginUser}") {
    setPageSessionAttribute(key="byPassLogin" value="true");
}

pageSession.byPassLogin is set to true

But later

if (#{byPassLogin}) {

it is not recognized and ends in if() {

I tried also

if (#{pageSession.byPassLogin}) {

This is obviously executed by Expressly, which knows nothing about pageSession.

I think, that the execution in the second part must go through admin gui evaluation, not Expressly.

Nevertheless, it is possible to enter "admin" without password and get logged in, which then fails during initialization of the left Tree, complaining about pageSession.

aubi avatar Jul 15 '22 22:07 aubi

I think I found a solution to this problem. But I need more time to test it. Its based on @hs536 and @aubi work

avpinchuk avatar Aug 04 '22 13:08 avpinchuk

The current state of the branches is:

  • it passes Login
  • shows majority of admingui (GET requests, parsing parameters from url)

Current problem:

  • restore view doesn't work, POST requests depend on it, the jsftemplating is based on JSP evaluation and behaviour, which no more exists in Mojarra. I'm trying to ping JDBC connection pool, it crashes in beforeCreate event -- it shouldn't be called at all).

Remainder, branches: https://github.com/aubi/glassfish-jsftemplating/commits/upgrade-to-faces-4 https://github.com/aubi/patched-src-glassfish-woodstock/commits/FISH-6085-upgrade-to-faces-4 https://github.com/aubi/Payara/tree/FISH-6347-fix-admin-gui

aubi avatar Aug 15 '22 10:08 aubi

@aubi In your branches, did you include the changes @hs536 ?

Maybe it's an idea to make WIP branches in the Woodstock and JsfTemplate projects and merge all we have to that. That way we have a common base to work from.

arjantijms avatar Aug 26 '22 11:08 arjantijms

Yeah, then we could work together as a team, even with some temporal snapshot dependencies ;)

dmatej avatar Aug 26 '22 12:08 dmatej

@arjantijms Yes, I started from the most stable of his branches, glassfish#23782 :-) image

By Woodstock project you mean https://github.com/eclipse-ee4j/glassfish-woodstock, right? Payara uses patched project. Yes, I can move my changes there.

aubi avatar Aug 29 '22 14:08 aubi

The Administration console of M8 build still does not work. (JDK 11, Mac OS)

[2022-09-28T19:29:43.155900+02:00] [GlassFish 7.0] [SEVERE] [NCLS-CORE-00026] [jakarta.enterprise.system.core] [tid: _ThreadID=135 _ThreadName=Thread-23] [levelValue: 1000] [[
  Exception during lifecycle processing
com.sun.enterprise.module.ResolveError: Not able to locate a unique module by name org.glassfish.jakarta.el
	at com.sun.enterprise.v3.server.ClassLoaderHierarchyImpl.createApplicationParentCL(ClassLoaderHierarchyImpl.java:149)
	at org.glassfish.deployment.common.DeploymentContextImpl.createClassLoader(DeploymentContextImpl.java:229)
	at org.glassfish.deployment.common.DeploymentContextImpl.createDeploymentClassLoader(DeploymentContextImpl.java:213)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:401)
	at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:382)
	at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:188)
	at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:77)
]]

[2022-09-28T19:29:43.158515+02:00] [GlassFish 7.0] [SEVERE] [NCLS-CORE-00041] [jakarta.enterprise.system.core] [tid: _ThreadID=135 _ThreadName=Thread-23] [levelValue: 1000] [[
  Application deployment failed: Exception while deploying the app [__admingui]]]

rdebusscher avatar Sep 28 '22 17:09 rdebusscher

The Administration console of M8 build still does not work. (JDK 11, Mac OS)

That's why is this issue still open ;)

dmatej avatar Sep 29 '22 06:09 dmatej

@arjantijms @dmatej @aubi

Maybe it's an idea to make WIP branches in the Woodstock and JsfTemplate projects and merge all we have to that. That way we have a common base to work from.

+1

Woodstock and JsfTemplate projects have not had any changes since the next version was prepared, so we can merge them into master branch, I think. GlassFish admingui module also needs to be fixed, but it will need a WIP branch.

hs536 avatar Oct 03 '22 07:10 hs536

@aubi I creates to "faces4" branches in the jsftemplate and Woodstock projects. Can you push your changes to there?

See

  • https://github.com/eclipse-ee4j/glassfish-jsftemplating/tree/faces4
  • https://github.com/eclipse-ee4j/glassfish-woodstock/tree/faces4

arjantijms avatar Oct 10 '22 10:10 arjantijms

@arjantijms I need one or two weeks for complete my experiments and do some code cleanup, then I can submit my draft

avpinchuk avatar Oct 14 '22 05:10 avpinchuk

So, first part, jsftemplating, is done.

https://github.com/avpinchuk/glassfish-jsftemplating/commits/ccx-faces4

avpinchuk avatar Oct 25 '22 19:10 avpinchuk

Part 2 of 3, woodstock

https://github.com/avpinchuk/glassfish-woodstock/commits/ccx-faces4

avpinchuk avatar Oct 27 '22 21:10 avpinchuk

Last part, GlassFish

https://github.com/avpinchuk/glassfish/commits/ccx-fix-admingui

avpinchuk avatar Oct 30 '22 21:10 avpinchuk

Yesterday I have created a WIP branch admingui7.

dmatej avatar Nov 05 '22 09:11 dmatej

I tried out the admingui7 branch and it seems that the Admin Console works, at least with the basic scenarios I tried (deploy an app, modify HTTP and Logger config, add password to admin, log in with a password). I fixed a few issues that I discovered with separate PRs into the admingui7 branch.

A lot of thanks to you, @avpinchuk, you deserve a mention and thanks in the release notes once GF 7 is released!

OndroMih avatar Nov 12 '22 12:11 OndroMih

Thanks a lot to everyone involved, amazing work! I'l close this as fixed now.

arjantijms avatar Nov 14 '22 21:11 arjantijms