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

Unable to add library from archive to CP in appclient test #1650

Closed
alwin-joseph opened this issue Nov 14, 2024 · 2 comments · Fixed by #1653
Closed

Unable to add library from archive to CP in appclient test #1650

alwin-joseph opened this issue Nov 14, 2024 · 2 comments · Fixed by #1653
Assignees

Comments

@alwin-joseph
Copy link
Contributor

Describe the bug

As mentioned in #1649, the indirect_classpath_util.jar need to be in CP for assembly/src/main/java/com/sun/ts/tests/assembly/classpath/appclient/Client.java.
This is included as a library to the ear archive along with direct_classpath_util.jar.
The jar direct_classpath_util.jar is added to the CP when the Client.class is added as "Main-Class" in the MANIFEST file, but unable to do same for indirect_classpath_util. This seems like fix required in arquillian appclient tool.

cc @starksm64

@scottmarlow
Copy link
Contributor

This seems like fix required in arquillian appclient tool.

Another option could be to update GlassFish to support appclient deployment via an EAR. As per the below pasted text I think that is required from an earlier Jakarta EE Platform Call entry for Date: 2024-09-24 :

appclient configuration question:

"
If the .jar file contains a META-INF/MANIFEST.MF file with a Main-Class attribute, or contains a META-INF/application-client.xml file, consider the .jar file to be an application client module.
Marlow: https://jakarta.ee/specifications/platform/11/jakarta-platform-spec-11.0-m4#a3179 is the current EE 11 text that mentions what Jared found. Thank you!
https://jakarta.ee/specifications/platform/10/jakarta-platform-spec-10.0#a2948 covers the Bundled Library requirement:

A .ear file may contain a directory that contains libraries packaged in JAR files. The library-directory element of the .ear file’s deployment descriptor contains the name of this directory. If a library-directory element isn’t specified, or if the .ear file does not contain a deployment descriptor, the directory named lib is used. An empty library-directory element may be used to specify that there is no library directory.

All files in this directory (but not subdirectories) with a .jar extension must be made available to all components packaged in the EAR file, including application clients. These libraries may reference other libraries, either bundled with the application or installed separately, using any of the techniques described herein.
"

ACTION: steps 6 and 7 uses the word “consider”. Modify the wording to include “must”.

@alwin-joseph
Copy link
Contributor Author

Thanks @starksm64 ! I see the test failure is fixed with the PR.

I also see the client jars are not added to the classpath in assembly module runs, unlike other modules where they are added using -jar ${clientEarDir}/${clientAppArchive} . I suspect this is causing more test failures at least in assembly/src/main/java/com/sun/ts/tests/assembly/classpath/ejb/Client.java with java.lang.NoClassDefFoundError: com/sun/ts/tests/assembly/classpath/ejb/TestBean

Can you please review the appclient-arquillian.xml and assembly/src/main/java/com/sun/ts/tests/assembly/classpath/ejb/Client.java to find why the client archives are not added to CP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants