Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: [7.2024.1.Alpha3] NPE on initial deployment #7141

Open
ctabin opened this issue Dec 19, 2024 · 2 comments
Open

Bug Report: [7.2024.1.Alpha3] NPE on initial deployment #7141

ctabin opened this issue Dec 19, 2024 · 2 comments
Assignees
Labels
Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Status: Pending Waiting on the issue requester to give more details or share a reproducer Type: Bug Label issue as a bug defect

Comments

@ctabin
Copy link
Contributor

ctabin commented Dec 19, 2024

Brief Summary

Hello,
We are anticipating Payara 7 and therefore we try to deploy our application with the latest version payara-embedded-all 7.2024.1.Alpha3.

Without changing anything else that the Payara version, we hit a NPE during deployment.

Dec 19, 2024 3:17:59 PM org.glassfish.api.ActionReport failure
SEVERE: Exception while preparing the app
Dec 19, 2024 3:17:59 PM com.sun.enterprise.v3.server.ApplicationLifecycle prepare
SEVERE: Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: Error in generating security policy for app -- Error in generating security policy for app-ws-war -- Cannot invoke "jakarta.security.jacc.PolicyFactory.getPolicy()" because the return value of "jakarta.security.jacc.PolicyFactory.getPolicyFactory()" is null
        at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:188)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:1255)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:514)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:567)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:558)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:554)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:453)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:553)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:584)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:576)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:453)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:575)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1499)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1881)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1757)
        at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:131)
        at ch.saierp.sainet.embedded.server.SAINetServer.start(SAINetServer.java:2073)
        at ch.saierp.sainet.embedded.server.cli.SAINetServerMain.lambda$startServer$27(SAINetServerMain.java:1354)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.RuntimeException: Error in generating security policy for app -- Error in generating security policy for app-ws-war -- Cannot invoke "jakarta.security.jacc.PolicyFactory.getPolicy()" because the return value of "jakarta.security.jacc.PolicyFactory.getPolicyFactory()" is null
        at org.glassfish.deployment.common.SimpleDeployer.prepare(SimpleDeployer.java:93)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:1255)
        at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:301)
        at org.glassfish.javaee.full.deployment.EarDeployer.lambda$prepare$0(EarDeployer.java:164)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:221)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:233)
        at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:259)
        at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:162)
        ... 23 more
Caused by: org.glassfish.deployment.common.DeploymentException: Error in generating security policy for app -- Error in generating security policy for app-ws-war -- Cannot invoke "jakarta.security.jacc.PolicyFactory.getPolicy()" because the return value of "jakarta.security.jacc.PolicyFactory.getPolicyFactory()" is null
        at com.sun.enterprise.security.ee.authorization.WebAuthorizationManagerService.<init>(WebAuthorizationManagerService.java:137)
        at com.sun.enterprise.security.ee.web.integration.WebSecurityManagerFactory.createManager(WebSecurityManagerFactory.java:101)
        at com.sun.enterprise.security.ee.SecurityDeployer.loadWebPolicy(SecurityDeployer.java:266)
        at com.sun.enterprise.security.ee.SecurityDeployer.generateArtifacts(SecurityDeployer.java:207)
        at org.glassfish.deployment.common.SimpleDeployer.prepare(SimpleDeployer.java:88)
        ... 30 more

We tried to reinstate the jacc="simple" in the <security-service> node as stated in #1596 but the outcome is still the same.
Our JACC provider is configured like this (also I'm not sure it is related to the problem):

<jacc-provider policy-configuration-factory-provider="fish.payara.security.jacc.provider.PolicyConfigurationFactoryImpl" policy-provider="fish.payara.security.jacc.provider.PolicyProviderImpl" name="default"></jacc-provider>

Expected Outcome

The deployment succeeds.

Current Outcome

A NullPointerException is thrown wile deploying the app.

Reproducer

None.

Operating System

Linux Debian

JDK Version

OpenJDK 21

Payara Distribution

Payara Embedded All

@ctabin ctabin added Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Type: Bug Label issue as a bug defect labels Dec 19, 2024
@artur-mal
Copy link

@ctabin, provide a simple, self-contained reproducer that we can test.

@artur-mal artur-mal added the Status: Pending Waiting on the issue requester to give more details or share a reproducer label Dec 20, 2024
@ctabin
Copy link
Contributor Author

ctabin commented Dec 20, 2024

Hi @artur-mal,

Here is the reproducer in the payara-7-alpha branch:

git clone https://github.com/ctabin/gf-test.git payara-7141
cd payara-7141
git checkout payara-7-alpha
mvn clean package

You'll get the error printed and the deployment fails. If you try with mvn clean package -Dappserver.version=6.2024.12, the deployment works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Open Issue has been triaged by the front-line engineers and is being worked on verification Status: Pending Waiting on the issue requester to give more details or share a reproducer Type: Bug Label issue as a bug defect
Projects
None yet
Development

No branches or pull requests

2 participants