Re: [Tomcat] -Classpath ordering issue

2020-01-29 Thread Dev WO via Webobjects-dev
So far not good,

I’m trying to use the VirtualWebappLoader as below, but I’m not even sure my 
syntax is ok (and can’t find anything in the log relevant to this).
I “know” it doesn’t work as even with JavaWebObjects lib as the first one, the 
app still work on machine #2 (I would have expected a NoSuchMethodError 
exception)

I’ve also found jarjar (https://code.google.com/archive/p/jarjar/ 
) maybe creating a single jar with 
all of them inside might work, but I’m not sure how to use and to set an order 
for the jar…

Any pointer or sample code related to this lib ordering problem?

Thanks,

Xavier

> On 29 Jan 2020, at 09:50, Dev WO  wrote:
> 
> Hi Konrad,
> 
> Thanks for the description of the issue.
> I’m looking into it right now.
> 
> It looks like there’s a VirtualWebappLoader already included in Tomcat, so do 
> I need to build my own or can I just declare it in the context.xml file in 
> my_app/WEB-INF/?
> I’m surprised building the app doesn’t generate that context.xml file at the 
> same time, it would make sense.
> 
> I’m pretty confuse with the context.xml file, should it be something like 
> 
> 
>
>ERCoolComponents
>AjaxLook
>...
> 
> 
> Just to be precise, there’s only one app deployed on this Tomcat instance.
> 
> Thanks and have a nice day,
> 
> Xavier
> 
>> On 29 Jan 2020, at 08:44, Konrad Kubacki via Webobjects-dev 
>> mailto:webobjects-dev@lists.apple.com>> 
>> wrote:
>> 
>> Problem You are facing is probably caused by order of jars loading. 
>> Tomcat >= 8 does it in random way (up to version 7.5.x it was alphabetical).
>> It is important, that classloader loads wonder "redefined" classes for some 
>> of WO, instead of original.
>> 
>> Solution:
>> You may want to write your own tomcat class loader, basing on WO classpath 
>> file, or just loading jars in alphabetical order.
>> Then You can activate it on tomcat's level in 
>> ${CATALINA_BASE}/conf/context.xml or for your app only in 
>> webapp/META-INF/context.xml. For details see tomcat's documentation.
>> 
>> If it's not the case, You may also check if on this beta-test tomcat(#4) 
>> there is not other WO app deployed, which loads original WO classess, before 
>> Your's app start. And/or check if they fully restart it between deployments 
>> o new version.
>> 
>> 
>> 
>> W dniu 28.01.2020 o 19:35, Dev WO via Webobjects-dev pisze:
>>> Hi WOers,
>>> 
>>> I’m starting to lost my mind with a Tomcat deployment (not my choice)
>>> 
>>> I have 4 machines:
>>> 1-Dev machine running through Eclipse and Apache (OS X) => Everything works
>>> 2-Test Tomcat deployment machine (OS X / Tomcat 9.0.29) => Everything works
>>> 3-Another test Tomcat deployment (Debian / Tomcat 9.0.20) => Everything 
>>> works
>>> 4-Customer “beta test" machine (Debian / Tomcat 9.0.20) => Some part of the 
>>> app doesn’t work
>>> 
>>> Of course machine #4 is the one I have the least access…
>>> 
>>> By "Some part of the app doesn’t work” I mean that I have some asynchronous 
>>> thread that do their job, I have some HTML interfaces that works, but other 
>>> don’t...
>>> After way too much trial, I was able to get basically the same errors on my 
>>> dev machine by changing the class path (moving down ERExtensions frameworks 
>>> in the classpath). Finally getting errors like:
>>> 
>>> NoSuchMethodError: 
>>> com.webobjects.foundation.NSArray.(Ljava/lang/Object;[Ljava/lang/Object;)V
>>> and
>>> NoSuchMethodError: 
>>> com.webobjects.appserver.WOCookie.(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)V
>>> 
>>> After reading every thread about Tomcat from the mailing list from 2004 up 
>>> to today, I still don’t get the issue.
>>> I’m using the exact same .war file on all machines, with the web.xml 
>>> relevant part (when framework order is correct) at the end of the message.
>>> 
>>> I have no clue and no idea regarding how to find the issue on this machine 
>>> #4.
>>> 
>>> I’m using Wonder7 and WO5.4, the Application class extends ERXApplication 
>>> (having JavaWOJSPServlet in the build path or not doesn’t change the fact 
>>> it works on machine 1,2 and 3 but not 4)
>>> 
>>> Thanks for your help,
>>> 
>>> Xavier
>>> 
>>> 
>>> 
>>>   
>>> WOClasspath
>>> 
>>> WEBINFROOT/Resources/Java/
>>> WEBINFROOT/CloudManager.woa/Contents/Resources/Java/cloudmanager.jar
>>> WEBINFROOT/Resources/Java/gson-2.5.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/ERCoolComponents.framework/Resources/Java/ERCoolComponents.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/AjaxLook.framework/Resources/Java/AjaxLook.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/Ajax.framework/Resources/Java/Ajax.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/Ajax.framework/Resources/Java/jabsorb-1.2.2.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/CloudManagerDataModel.framework/Resources/Java/cloudmanagerdatamodel.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Fram

Fwd: [Tomcat] -Classpath ordering issue

2020-01-29 Thread Dev WO via Webobjects-dev
Forgot to send to the list

> Begin forwarded message:
> 
> From: Dev WO 
> Subject: Re: [Tomcat] -Classpath ordering issue
> Date: 29 January 2020 at 09:50:13 CET
> To: Konrad Kubacki 
> 
> Hi Konrad,
> 
> Thanks for the description of the issue.
> I’m looking into it right now.
> 
> It looks like there’s a VirtualWebappLoader already included in Tomcat, so do 
> I need to build my own or can I just declare it in the context.xml file in 
> my_app/WEB-INF/?
> I’m surprised building the app doesn’t generate that context.xml file at the 
> same time, it would make sense.
> 
> I’m pretty confuse with the context.xml file, should it be something like 
> 
> 
>
>ERCoolComponents
>AjaxLook
>...
> 
> 
> Just to be precise, there’s only one app deployed on this Tomcat instance.
> 
> Thanks and have a nice day,
> 
> Xavier
> 
>> On 29 Jan 2020, at 08:44, Konrad Kubacki via Webobjects-dev 
>> mailto:webobjects-dev@lists.apple.com>> 
>> wrote:
>> 
>> Problem You are facing is probably caused by order of jars loading. 
>> Tomcat >= 8 does it in random way (up to version 7.5.x it was alphabetical).
>> It is important, that classloader loads wonder "redefined" classes for some 
>> of WO, instead of original.
>> 
>> Solution:
>> You may want to write your own tomcat class loader, basing on WO classpath 
>> file, or just loading jars in alphabetical order.
>> Then You can activate it on tomcat's level in 
>> ${CATALINA_BASE}/conf/context.xml or for your app only in 
>> webapp/META-INF/context.xml. For details see tomcat's documentation.
>> 
>> If it's not the case, You may also check if on this beta-test tomcat(#4) 
>> there is not other WO app deployed, which loads original WO classess, before 
>> Your's app start. And/or check if they fully restart it between deployments 
>> o new version.
>> 
>> 
>> 
>> W dniu 28.01.2020 o 19:35, Dev WO via Webobjects-dev pisze:
>>> Hi WOers,
>>> 
>>> I’m starting to lost my mind with a Tomcat deployment (not my choice)
>>> 
>>> I have 4 machines:
>>> 1-Dev machine running through Eclipse and Apache (OS X) => Everything works
>>> 2-Test Tomcat deployment machine (OS X / Tomcat 9.0.29) => Everything works
>>> 3-Another test Tomcat deployment (Debian / Tomcat 9.0.20) => Everything 
>>> works
>>> 4-Customer “beta test" machine (Debian / Tomcat 9.0.20) => Some part of the 
>>> app doesn’t work
>>> 
>>> Of course machine #4 is the one I have the least access…
>>> 
>>> By "Some part of the app doesn’t work” I mean that I have some asynchronous 
>>> thread that do their job, I have some HTML interfaces that works, but other 
>>> don’t...
>>> After way too much trial, I was able to get basically the same errors on my 
>>> dev machine by changing the class path (moving down ERExtensions frameworks 
>>> in the classpath). Finally getting errors like:
>>> 
>>> NoSuchMethodError: 
>>> com.webobjects.foundation.NSArray.(Ljava/lang/Object;[Ljava/lang/Object;)V
>>> and
>>> NoSuchMethodError: 
>>> com.webobjects.appserver.WOCookie.(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)V
>>> 
>>> After reading every thread about Tomcat from the mailing list from 2004 up 
>>> to today, I still don’t get the issue.
>>> I’m using the exact same .war file on all machines, with the web.xml 
>>> relevant part (when framework order is correct) at the end of the message.
>>> 
>>> I have no clue and no idea regarding how to find the issue on this machine 
>>> #4.
>>> 
>>> I’m using Wonder7 and WO5.4, the Application class extends ERXApplication 
>>> (having JavaWOJSPServlet in the build path or not doesn’t change the fact 
>>> it works on machine 1,2 and 3 but not 4)
>>> 
>>> Thanks for your help,
>>> 
>>> Xavier
>>> 
>>> 
>>> 
>>>   
>>> WOClasspath
>>> 
>>> WEBINFROOT/Resources/Java/
>>> WEBINFROOT/CloudManager.woa/Contents/Resources/Java/cloudmanager.jar
>>> WEBINFROOT/Resources/Java/gson-2.5.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/ERCoolComponents.framework/Resources/Java/ERCoolComponents.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/AjaxLook.framework/Resources/Java/AjaxLook.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/Ajax.framework/Resources/Java/Ajax.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/Ajax.framework/Resources/Java/jabsorb-1.2.2.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/CloudManagerDataModel.framework/Resources/Java/cloudmanagerdatamodel.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/CloudManagerDataModel.framework/Resources/Java/postgresql-8.3-603.jdbc3.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/ERExtensions.framework/Resources/Java/ERExtensions.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/ERJars.framework/Resources/Java/ERJars.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/ERJars.framework/Resources/Java/ERFoundation.jar
>>> WEBINFROOT/CloudManager.woa/Contents/Frameworks/ERJars.framework/Resources/Java/ERWebObjects.jar
>>> WEBINFROOT/CloudMa