Re: Upgrade from Tomcat 7 to Tomcat 9.0.17

2019-04-21 Thread Akram Hussain
Hi Mark,

Actually, I am declaring a Loader in tomcat\conf\context.xml file as




in its startInternal() method, we are creating SharedClassLoader as like
this.

Field field = WebappLoader.class.getDeclaredField("parentClassLoader");
field.setAccessible(true);
field.set(this, SharedClassLoader.getInstance());

The SharedClassLoader returns its instance, through this code.

sharedClassLoader = new
SharedClassLoader(WebappLoader.class.getClassLoader());

Its constructor is like this

public SharedClassLoader(ClassLoader parent) throws Exception
{
super(parent);
this.parentClassLoader = parent;
for (URL url : parseClassPath(SHARED_LOCATION))
{
addURL(url);
}
start();
}

for Tomcat 7.0.68, It was working fine.
---

After upgrade to tomcat 9.0.17.

The start method of SharedClassLoader.java is expecting resources variable
needs to be populated.

How can I pass the Resources to above SharedClassLoader?

Any idea?

Regards,
Akram.






On Fri, Apr 19, 2019 at 4:09 AM Mark Thomas  wrote:

> On 16/04/2019 20:32, Christopher Schultz wrote:
> > Akram,
> >
> > On 4/16/19 12:41, Akram Hussain wrote:
> >> I have gone through it, But it was not clear to me.
> >
> >> If an example is provided, how to pass resources to
> >> SharedClassLoader, it could be helpful.
> >
> > If you configure something like this in your META-INF/context.xml:
> >
> > 
> >> base="/path/to/your/shared/libraries"
> > className="org.apache.catalina.webresources.DirResourceSet" />
> > 
> >
> > That should allow your application to load JAR files from your
> > /path/to/your/shared/libraries directory.
>
> The OP is trying to load JARs so the /path/to/your/shared/libraries
> directory needs to be mounted at WEB-INF/lib, not WEB-INF/classes.
>
> We (OK I since I wrote this stuff) should probably have better
> documented which implementation to pick.
>
> You pick the implementation based on where the files you want to insert
> are located.
>
> If you want to insert a single file, use FileResourceSet
> If you want to insert a directory tree, use DirResourceSet
> If you want to insert files from inside an archive (JAR) then use a
> JarResourceSet.
>
> Note: Using a JarResourceSet effectively unpacks the archive as far as
> Tomcat is concerned so Tomcat sees directories and files, not a single
> JAR file.
>
> In this case you have a directory of JAR files so you want a
> DirResourceSet.
>
> Assuming you want those JAR files to be treated as if they were placed
> in WEB-INF/lib then you want:
>
> 
>  webAppMount="/WEB-INF/lib"
>   base="/path/to/your/shared/libraries"
>   className="org.apache.catalina.webresources.DirResourceSet"
>   />
> 
>
> That has the same effect as copying the entire contents of
> /path/to/your/shared/libraries to WEB-INF/lib.
>
> If you want this to apply to every web application you deploy then add
> the above to global context.xml in CATALINA_BASE/conf/context.xml
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: OS

2019-04-21 Thread George Stanchev
FWIW someone is submitting the same identical question (with only the project 
name different) in the dozen or so Apache projects I am on mailing list of...

Just google "Hello, I am doing an investigation. Does Windows Server 2019 
support" and see for yourself

It looks like a troll


-Original Message-
From: Mark Thomas  
Sent: Friday, April 19, 2019 4:02 AM
To: Tomcat Users List 
Subject: Re: OS

On April 18, 2019 6:54:37 PM UTC, Christopher Schultz 
 wrote:
>-BEGIN PGP SIGNED MESSAGE-
>Hash: SHA256
>
>
>
>On 4/18/19 01:06, liname...@outlook.com wrote:
>> Hello, I am doing an investigation. Does Windows Server 2019 support 
>> the following products:
>> 
>> Apache Tomcat   6.0.35 Tomcat Connectors (mod_jk)   1.2.35-m1.0
>> 
>> Is the other version supported? Can you tell me, thank you very much.
>
>Tomcat requires a JVM of a certain version in order to run. Tomcat 6 
>requires Java 5 or later, but is no longer supported by this community. 
>Tomcat 6.0.35 is, in fact, *dangerously* out of date.

As is mod_jk 1.2.35. You should use the latest available mod_jk version.

Mark


>
>You should look at running Tomcat 7.0, 8.5, or 9.0 at this point.
>
>- -chris
>-BEGIN PGP SIGNATURE-
>Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
>iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAly4x+0ACgkQHPApP6U8
>pFjoNhAAkf6jkOOgqm1XwCQM0ioIa9Ab9jji45S2fPX0CFs5pMZ/MRtbT0XBrzQ1
>lFbzF1wZBWkBCpHCL/KWGnpEo3TVYHRIz4e6wTU4zVsChl9D10bcQEpV2RMnL6D3
>mUP2OY9vwrQszaNEtbWsVjnm6XrqyGolGqpl0qBqoasqgn1b/jSX/WITnnmXatK4
>JM/3ouNamnbFzZkfaSQPP8dR3GoIz7PwzrfMbX1aGEsUFPe5bYDtjCuFfLlLaYCj
>HYkICLnZewtnGL5/FuxjWYFqLep/6k9P4lbBGvnAQwLqvGtbdpqfm44iuAUuBvWB
>R+lbKbvpORwxvRMc9ncqrm1fveWPLR5Wqt6bJH/eGGpPyurr95fiG6w8BtgFUMeL
>Rad8p+CZjPxDDJ0ZBSy2//VQchpVtdSolaBcEpb3+F2YJB/W0hBSKS2qSS/Pebz9
>2nnK1CRhSJ8pzqAVnPANXjAAWj7LqVt2zs6eA+G4ku2ISV3Gxfgvm//V67YOFjt6
>HcFOX9+wZlHiMcMtn0eCxIKT8CWTotftBEQpX//RwOlohZML9uUGfhP7/Y/R8raM
>BBzsqqWpUPZk8oujMxTHocibUF0QOh9427+8JjKRRuUgOmIoUo1iUcSu2UoEY8S1
>d4C6ba8ScfN8m+cF9kohLVCSjsrZsbDDCkMEZnkoiDGByDR4n6A=
>=RBTT
>-END PGP SIGNATURE-
>
>-
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



no temp directory creation wanted when embedding Tomcat

2019-04-21 Thread Garret Wilson
As I mentioned in other emails, I am embedding Tomcat 9 (with OpenJDK 11 
on Windows 10) to serve static files from `/foo/bar`. Currently I'm not 
supporting Java webapps. I'm not supporting JSP. I just want to serve 
static files.


From your help in another thread, I called the magic 
"gets-but-really-creates-a-connection" method and got it working.


But now I realize Tomcat is creating this directory structur inside the 
"base dir" I specified:


tomcat.8080/work/Tomcat/localhost/ROOT

I don't need this directory. I don't want this directory created. How do 
I tell Tomcat not to create no danged directories?


Garret


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org