Skip to content

Conversation

@Ariho-Seth
Copy link
Contributor

@Ariho-Seth Ariho-Seth commented Jul 31, 2025

This PR ;

  • Removes policy files, ie, client.policy, security.policy

  • Removes all imports for java.security.Policy, for example Policy.getPolicy(), Policy.setPolicy(), Policy.refresh()

  • Removes all the code that instantiates java.lang.SecurityManager, for example, new SecurityManager(), System.getSecurityManager(), and System.setSecurityManager()

  • Removes all related JVM options: java.security.policy.

  • Removes all methods like refreshPolicy() & removePolicy()

Fixes #25519

@Ariho-Seth
Copy link
Contributor Author

Hello @dmatej, @OndroMih, please check out this PR and let me know incase of any additions

@OndroMih
Copy link
Contributor

OndroMih commented Aug 1, 2025

@dmatej do we want to remove the security manager also in 7.1? Is it needed to run on Java 24 and 25?

Edit: I checked and apps still run on Java 24 and 25 even if they use Security Manager API. It just cannot be enabled. So it’s better to target this PR for 8.0 branch, where we plan to remove Security Manager support completely

@Ariho-Seth , can you rebase on branch 8.0 or cherry pick your commits to it?

@OndroMih OndroMih changed the base branch from master to 8.0 August 1, 2025 05:59
@OndroMih OndroMih changed the base branch from 8.0 to master August 1, 2025 05:59
@Ariho-Seth
Copy link
Contributor Author

Ohhh yeah, I hadn't realised the milestone tag on the issue, I've seen that too, let me rebase it on the 8.0 branch

@Ariho-Seth
Copy link
Contributor Author

Ariho-Seth commented Aug 1, 2025

Hello @OndroMih, I tried rebasing it onto the 8.0 branch but I was unsuccessful and when I tried running
mvn clean install on the 8.0 branch, and it yielded a BUILD FAILURE saying that

Could not resolve dependencies for project org.glassfish.main.security:security-ee:glassfish-jar:8.0.0-SNAPSHOT
[ERROR] dependency: org.glassfish.exousia:exousia:jar:3.0.0-M3 (compile)
[ERROR]         org.glassfish.exousia:exousia:jar:3.0.0-M3 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced
[ERROR] dependency: org.glassfish.epicyro:epicyro:jar:3.1.0 (compile)
[ERROR]         org.glassfish.epicyro:epicyro:jar:3.1.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

Any help? I tried uncommenting the commands in the maven.config file, but it didn't help either, saying that the:
Could not resolve some dependencies i.e,
Could not find artifact org.glassfish.exousia:exousia:jar:3.0.0-M3 in central (https://repo.maven.apache.org/maven2)
Unresolved dependency: 'org.glassfish.concurro:concurro:jar:3.1.0-M6'

@pzygielo
Copy link
Contributor

pzygielo commented Aug 1, 2025

Could not resolve dependencies for project org.glassfish.main.security:security-ee:glassfish-jar:8.0.0-SNAPSHOT
[ERROR] dependency: org.glassfish.exousia:exousia:jar:3.0.0-M3 (compile)
[ERROR]         org.glassfish.exousia:exousia:jar:3.0.0-M3 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed > ```

Any help? 

Read readme:

* `staging` - In some development stages may happen that some dependencies are available just in OSSRH staging repository.

@Ariho-Seth
Copy link
Contributor Author

Could not resolve dependencies for project org.glassfish.main.security:security-ee:glassfish-jar:8.0.0-SNAPSHOT
[ERROR] dependency: org.glassfish.exousia:exousia:jar:3.0.0-M3 (compile)
[ERROR]         org.glassfish.exousia:exousia:jar:3.0.0-M3 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed > ```

Any help? 

Read readme:

* `staging` - In some development stages may happen that some dependencies are available just in OSSRH staging repository.

Sure, thanks, though still some dependencies are not being resolved even after running using the profile
i.e, mvn clean install -Pstaging

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (generate-hk2-config) on project jnosql-jakarta-persistence-integration: Compilation failure
[ERROR] /Users/2/ariho/Programming/Opensource-Projects/glassfish/appserver/persistence/jnosql-integration/src/main/java/org/glassfish/main/jnosql/jakartapersistence/mapping/glassfishcontext/EntityValidator.java:[34,19] cannot find symbol
[ERROR]   symbol:   class SaveEntity
[ERROR]   location: interface org.eclipse.jnosql.jakartapersistence.mapping.spi.MethodInterceptor
[ERROR] 

@arjantijms
Copy link
Contributor

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (generate-hk2-config) on project jnosql-jakarta-persistence-integration: Compilation failure
[ERROR] /Users/2/ariho/Programming/Opensource-Projects/glassfish/appserver/persistence/jnosql-integration/src/main/java/org/glassfish/main/jnosql/jakartapersistence/mapping/glassfishcontext/EntityValidator.java:[34,19] cannot find symbol
[ERROR] symbol: class SaveEntity
[ERROR] location: interface org.eclipse.jnosql.jakartapersistence.mapping.spi.MethodInterceptor

Hmmm, that would mean the published SNAPSHOT dependency on the Jakarta Data / NoSQL work resolves to an older version. @OndroMih can you take a look?

@OndroMih
Copy link
Contributor

OndroMih commented Aug 1, 2025

Yes, currently it's not possible to build 8.0 version until #25645 is merged, sorry.

@OndroMih
Copy link
Contributor

OndroMih commented Aug 1, 2025

@Ariho-Seth , meanwhile, you can merge my branch https://github.com/OndroMih/glassfish/tree/ondromih-jakarta-data-persistence-wip-glassfish into 8.0 locally and then you should be able to build.

@OndroMih
Copy link
Contributor

OndroMih commented Aug 1, 2025

#25645 is merged, so the build of the 8.0 branch should work now.

@dmatej
Copy link
Contributor

dmatej commented Aug 1, 2025

Don't do this yet, or we get into conflict with huge #25640 - it removed several files already, redundant even for GF7, and changed some things around. I am working on the PR, in few days/weeks it should be done as I need to pass the TCK too with it.

@Ariho-Seth
Copy link
Contributor Author

Ariho-Seth commented Aug 2, 2025

#25645 is merged, so the build of the 8.0 branch should work now.

Hello @OndroMih, I updated my local branch too, though this time round the build is failing due to a test in SQLTraceListenerTest class, i.e, public void testSQLQueryWithListener() throws IOException, which expected an asadmin succeeded but an exception was thrown, ie

<remote failure: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 5.0.0-B09.v202507111153-40df9e5d15636cd7801cd5f26058b0963b6496e5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Failed to obtain/create connection from connection pool [DerbyPool]. Reason: Connection creation failed for 1 times.
Error Code: 0. Please see server.log for more details. remote failure: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 5.0.0-B09.v202507111153-40df9e5d15636cd7801cd5f26058b0963b6496e5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Failed to obtain/create connection from connection pool [DerbyPool]. Reason: Connection creation failed for 1 times.
Error Code: 0. Please see server.log for more details.

@Ariho-Seth
Copy link
Contributor Author

#25645 is merged, so the build of the 8.0 branch should work now.

Hello @OndroMih, I updated my local branch too, though this time round the build is failing due to a test in SQLTraceListenerTest class, i.e, public void testSQLQueryWithListener() throws IOException, which expected an asadmin succeeded but an exception was thrown, ie

<remote failure: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 5.0.0-B09.v202507111153-40df9e5d15636cd7801cd5f26058b0963b6496e5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Failed to obtain/create connection from connection pool [DerbyPool]. Reason: Connection creation failed for 1 times.
Error Code: 0. Please see server.log for more details. remote failure: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 5.0.0-B09.v202507111153-40df9e5d15636cd7801cd5f26058b0963b6496e5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Failed to obtain/create connection from connection pool [DerbyPool]. Reason: Connection creation failed for 1 times.
Error Code: 0. Please see server.log for more details.

And this looks to be the same with the master branch, too!

@OndroMih OndroMih marked this pull request as draft August 3, 2025 08:25
@OndroMih
Copy link
Contributor

OndroMih commented Aug 3, 2025

Moving this to draft. @Ariho-Seth , please postpone work on this until we're finished with merging this PR: #25640 as @dmatej wrote.

@Ariho-Seth
Copy link
Contributor Author

Moving this to draft. @Ariho-Seth , please postpone work on this until we're finished with merging this PR: #25640 as @dmatej wrote.

D'accord, yeah, I will be working on other issues then until we are ready.

@OndroMih OndroMih added the 8.0 Issues that happen only on GlassFish 8 and not in version 7 label Aug 4, 2025
@OndroMih OndroMih added this to the 8.0.0 milestone Aug 4, 2025
@OndroMih
Copy link
Contributor

OndroMih commented Aug 4, 2025

Hi, @Ariho-Seth, I moved your question about the failing test into a separate dicussion: #25657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.0 Issues that happen only on GlassFish 8 and not in version 7

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove policy files and their usages

5 participants