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

[JBWS-4385]:This fix starts with Brad Maxwell's proposed change and a… #308

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

jimma
Copy link
Member

@jimma jimma commented Oct 24, 2023

…dded a JAXPDelegateClassLoader to Protect the jbossws runtime from loading the jaxp impl from user's deployment

…dded a JAXPDelegateClassLoader to Protect the jbossws runtime from loading the jaxp impl from user's deployment
@jimma jimma requested a review from a team as a code owner October 24, 2023 08:03
@jimma
Copy link
Member Author

jimma commented Oct 24, 2023

@bmaxwell Could you please review this change ?

@jimma jimma merged commit 1c27976 into jbossws:main Nov 1, 2023
@bmaxwell
Copy link

bmaxwell commented Nov 1, 2023

@jimma it works with the test app I had , Thanks!

@NiasSt90
Copy link

However, this leads to a problem with SOAP interceptors from the deployment that want to use CDI.
These no longer work with this adjustment, because CDI (CDI.current()) no longer sees the deployment class loader but the wrapper.
This will break all of our SOAP-Services which depends on cdi.
Any ideas how to circumvent this?

@NiasSt90
Copy link

@jimma @bmaxwell

Is this the only workaround with the new TCCL wrapper to savely access CDI/Deployment-Classloader Features inside of Interceptor implementations?

public class CDIInterceptor extends AbstractPhaseInterceptor<Message> {

	public CDIInterceptor() {
		super(Phase.RECEIVE);
	}


	@Override
	public void handleMessage(Message message) throws Fault {
		var tccl = Thread.currentThread().getContextClassLoader();
		try {
			Thread.currentThread().setContextClassLoader(CDIInterceptor.class.getClassLoader());
			System.out.println("Now it's save to access CDI:" + CDI.current().getBeanManager());
		}
		finally {
			Thread.currentThread().setContextClassLoader(tccl);
		}
	}
}

@jimma
Copy link
Member Author

jimma commented Jan 26, 2025

@NiasSt90 I fixed this issue with PR for https://issues.redhat.com/browse/JBWS-4430, and working for another fix : https://issues.redhat.com/browse/JBWS-4444 (#582)

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 this pull request may close these issues.

3 participants