[jboss-jira] [JBoss JIRA] Resolved: (JBAS-3233) Web services debug logging is causing the classloader to be switched
Darran Lofthouse (JIRA)
jira-events at jboss.com
Fri Aug 25 09:50:47 EDT 2006
[ http://jira.jboss.com/jira/browse/JBAS-3233?page=all ]
Darran Lofthouse resolved JBAS-3233.
------------------------------------
Fix Version/s: (was: JBossAS-4.0.5.GA)
Resolution: Rejected
I have tracked down the cause of this problem, the class org.jboss.ws.soap.SOAPContentElement caches the XML after it has been generated.
If the debug logging is enabled the first time SOAPContentElement is called to generate the XML is when the classloader of the EJB is the current classloader, this means it has not problems generating the XML. When the response is generated SOAPContentElement is asked a second time for the XML, as it has already been generated once the cached value is returned.
When the debug logging is switched off SOAPContentElement is not called so the XML is not cached, then it is called to generate the response this is using the classloader of the web application and as there is no cached value it has to be generated. The web application classloader does not have visibility of the classloader used for the EJB which is why it can not load the class.
JBWS-941 Resolved this issue and the web application now makes use of the scoped classloader of the ear so if the XML is first requested in the web application or in the debug code the correct classloader will be used to load the classes.
> Web services debug logging is causing the classloader to be switched
> --------------------------------------------------------------------
>
> Key: JBAS-3233
> URL: http://jira.jboss.com/jira/browse/JBAS-3233
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: ClassLoading
> Affects Versions: JBossAS-4.0.4.GA
> Reporter: Darran Lofthouse
> Assigned To: Darran Lofthouse
> Attachments: ComplexReturnEJB_DocLit.ear
>
>
> Web services debug logging is causing the classloader to be switched.
> Currently the web services stack does not correctly set the classloader for web services deployments when deployed as part of an ear with an issolated classloader (see JBWS-941). However debug logging in the web services code is incorectly causing the deployment to work!
> In the class 'org.jboss.ws.server.ServiceEndpoint' there is a method called 'postProcessResponse', this method contains some logging wrapped with a 'log.isDebugEnabled': -
> // debug the outgoing message
> if(log.isDebugEnabled())
> {
> resMessage.saveChanges();
> SOAPEnvelope soapEnv = resMessage.getSOAPPart().getEnvelope();
> String envStr = DOMWriter.printNode(soapEnv, true);
> log.debug("Outgoing SOAPMessage\n" + envStr);
> }
> If this logging is remove the ClassNotFoundException is thrown regardless of the log4j configuration.
> The ClassNotFoundException is good and shows that the classloader has not been switched.
> I will attach a deployment that can be used to reproduce this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list