Hello Romain, Unfortunately openejb.cxf.CxfContainerClassLoader=false does not change anything (still the same class loader, still the same issue)
1) and 2) do work but are not affordable in our app. Threads are required for a/ lengthy scripts, b/ controlling the executor pool size (number of scripts run in parallel), c/ having less DB privileges than the main WS thread. EJB is just not our current design. Please tell me when the flag is added so that the 1.5.2 behavior is back. In the meantime we stick to 1.5.2. Many thanks > From: [email protected] > To: [email protected] > Subject: RE: TomEE+ 1.7.1 Classloader gets replaced by > CxfContainerClassLoader which causes ClassNotFoundException in Rhino/Nashorn > ScriptEngine > Date: Wed, 26 Nov 2014 23:24:28 +0100 > > Thank you RomainWe will consider 1) and 2) however we need the additional > thread mainly to prevent WS timeout for lengthy scripts but out of curiosity > we will try to reproduce on the sample without the threadBut first time in > the morning we will try openejb.cxf.CxfContainerClassLoader=false which > sounds great > Will let you knowRegards > >> From: [email protected] >> Date: Wed, 26 Nov 2014 19:48:18 +0100 >> Subject: Re: TomEE+ 1.7.1 Classloader gets replaced by >> CxfContainerClassLoader which causes ClassNotFoundException in Rhino/Nashorn >> ScriptEngine >> To: [email protected] >> >> PS: did you try openejb.cxf.CxfContainerClassLoader=false in >> conf/system.properties? >> >> >> Romain Manni-Bucau >> @rmannibucau >> http://www.tomitribe.com >> http://rmannibucau.wordpress.com >> https://github.com/rmannibucau >> >> >> 2014-11-26 17:45 GMT+01:00 Romain Manni-Bucau : >>> we'll add a flag to switch it off but there is no issue on our side. >>> You can solve it: >>> 1) not using a new thread >>> 2) using an EJB to execute the js >>> >>> >>> Romain Manni-Bucau >>> @rmannibucau >>> http://www.tomitribe.com >>> http://rmannibucau.wordpress.com >>> https://github.com/rmannibucau >>> >>> >>> 2014-11-26 17:34 GMT+01:00 Alex A : >>>> So? it worked in 1.5.2 and does not work anymore in 1.7.1.Even before >>>> starting the new thread the classloader is already this new >>>> CxfContainerClassLoader (see server trace) which seems unable to load >>>> CloudUtils from same webapp. >>>> thank you >>>> >>>> >>>> >>>>> From: [email protected] >>>>> Date: Wed, 26 Nov 2014 14:23:00 +0100 >>>>> Subject: Re: TomEE+ 1.7.1 Classloader gets replaced by >>>>> CxfContainerClassLoader which causes ClassNotFoundException in >>>>> Rhino/Nashorn ScriptEngine >>>>> To: [email protected] >>>>> >>>>> Hi >>>>> >>>>> com.mycompany.bl.MyInstance#executeJavaScript starts a new thread and >>>>> then look the classloader which is bound to the request thread >>>>> >>>>> >>>>> Romain Manni-Bucau >>>>> @rmannibucau >>>>> http://www.tomitribe.com >>>>> http://rmannibucau.wordpress.com >>>>> https://github.com/rmannibucau >>>>> >>>>> >>>>> 2014-11-26 13:27 GMT+01:00 Alex A : >>>>>> Bonjour Romain, >>>>>> >>>>>> Many thanks for your reply. >>>>>> We have been able to shrink down our app into the attached sample.zip >>>>>> and it >>>>>> does reproduce the issue! >>>>>> The sample comprises a JAX-WS client and a webapp implementing the WS and >>>>>> evaluating the input script. >>>>>> >>>>>> >>>>>> TomEE+ 1.7.1: >>>>>> >>>>>> >>>>>> >>>>>> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- >>>>>> >>>>>> *-*-*- ExecuteJavaScript Issue *-*-* >>>>>> >>>>>> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- >>>>>> >>>>>> Connecting to WebServices at >>>>>> http://localhost:8080/WebServiceProject/MyWebServiceWS >>>>>> >>>>>> >>>>>> >>>>>> *- Main menu -* >>>>>> >>>>>> 1. ExecuteJavaScript >>>>>> >>>>>> 2. Exit >>>>>> >>>>>> Your choice [Exit]? 1 >>>>>> >>>>>> >>>>>> >>>>>> ExecuteJavaScript: >>>>>> >>>>>>> Entering console mode. Type in your script, then "run" to finish typing. >>>>>> >>>>>> com.mycompany.cloudutils.CloudUtils.nowStr() >>>>>> >>>>>> run >>>>>> >>>>>> >>>>>> >>>>>> ScriptException around line [ >>>>>> com.mycompany.cloudutils.CloudUtils.nowStr() ] >>>>>> >>>>>>>>> sun.org.mozilla.javascript.internal.EcmaError: TypeError: Cannot call >>>>>>>>> property nowStr in object [JavaPackage >>>>>>>>> com.mycompany.cloudutils.CloudUtils]. >>>>>>>>> It is not a function, it is "object". (#1) in >>>>>>>> source> at >>>>>>>>> line number 1 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> SERVER TRACE (showing the classloader is indeed CxfContainerClassLoader >>>>>> as >>>>>> soon as we enter the @WebMethod): >>>>>> >>>>>> CLASSLOADER_FROMSTART: >>>>>> org.apache.openejb.server.cxf.transport.util.CxfContainerClassLoader@7bb42c30 >>>>>> // when WS is called >>>>>> >>>>>> CLASSLOADER_EXECUTION: >>>>>> org.apache.openejb.server.cxf.transport.util.CxfContainerClassLoader@7bb42c30 >>>>>> // at javascript execution >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> TomEE+ 1.5.2: >>>>>> >>>>>> >>>>>> >>>>>> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- >>>>>> >>>>>> *-*-*- ExecuteJavaScript Issue *-*-* >>>>>> >>>>>> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- >>>>>> >>>>>> Connecting to WebServices at >>>>>> http://localhost:8080/WebServiceProject/MyWebServiceWS >>>>>> >>>>>> >>>>>> >>>>>> *- Main menu -* >>>>>> >>>>>> 1. ExecuteJavaScript >>>>>> >>>>>> 2. Exit >>>>>> >>>>>> Your choice [Exit]? 1 >>>>>> >>>>>> >>>>>> >>>>>> ExecuteJavaScript: >>>>>> >>>>>>> Entering console mode. Type in your script, then "run" to finish typing. >>>>>> >>>>>> com.mycompany.cloudutils.CloudUtils.nowStr() >>>>>> >>>>>> run >>>>>> >>>>>> >>>>>> >>>>>> 2014/11/26 12:24:48.332 +0100 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> SERVER TRACE (showing we keep the StandardClassLoader all along): >>>>>> >>>>>> CLASSLOADER_FROMSTART: LazyStopWebappClassLoader >>>>>> >>>>>> context: /WebServiceProject >>>>>> >>>>>> delegate: false >>>>>> >>>>>> repositories: >>>>>> >>>>>> /WEB-INF/classes/ >>>>>> >>>>>> ----------> Parent Classloader: >>>>>> >>>>>> org.apache.catalina.loader.StandardClassLoader@771c7eb2 >>>>>> >>>>>> >>>>>> >>>>>> CLASSLOADER_EXECUTION: LazyStopWebappClassLoader >>>>>> >>>>>> context: /WebServiceProject >>>>>> >>>>>> delegate: false >>>>>> >>>>>> repositories: >>>>>> >>>>>> /WEB-INF/classes/ >>>>>> >>>>>> ----------> Parent Classloader: >>>>>> >>>>>> org.apache.catalina.loader.StandardClassLoader@771c7eb2 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Thank you for your precious help >>>>>> >>>>>> Alexandre >>>>>> >>>>>> >>>>>> >>>> >
