Refactored out the policy files and their usages
This PR ;
-
Removes policy files, ie,
client.policy,security.policy -
Removes all imports for
java.security.Policy, for examplePolicy.getPolicy(),Policy.setPolicy(),Policy.refresh() -
Removes all the code that instantiates
java.lang.SecurityManager, for example,new SecurityManager(),System.getSecurityManager(), andSystem.setSecurityManager() -
Removes all related JVM options:
java.security.policy. -
Removes all methods like
refreshPolicy()&removePolicy()
Fixes https://github.com/eclipse-ee4j/glassfish/issues/25519
Hello @dmatej, @OndroMih, please check out this PR and let me know incase of any additions
@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?
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
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'
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:
https://github.com/eclipse-ee4j/glassfish/blob/df025709f1482b0acbf7e240dbe876c2c4cc162b/README.md?plain=1#L53
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:
https://github.com/eclipse-ee4j/glassfish/blob/df025709f1482b0acbf7e240dbe876c2c4cc162b/README.md?plain=1#L53
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]
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?
Yes, currently it's not possible to build 8.0 version until https://github.com/eclipse-ee4j/glassfish/pull/25645 is merged, sorry.
@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.
https://github.com/eclipse-ee4j/glassfish/pull/25645 is merged, so the build of the 8.0 branch should work now.
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.
#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.
#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
SQLTraceListenerTestclass, i.e,public void testSQLQueryWithListener() throws IOException, which expected anasadmin succeededbut 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!
Moving this to draft. @Ariho-Seth , please postpone work on this until we're finished with merging this PR: https://github.com/eclipse-ee4j/glassfish/pull/25640 as @dmatej wrote.
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.
Hi, @Ariho-Seth, I moved your question about the failing test into a separate dicussion: https://github.com/eclipse-ee4j/glassfish/discussions/25657