You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aquatic Safaris Diver <di...@aquaticsafaris.com> on 2017/10/04 14:53:39 UTC

migration from tomcat 7.0 to 8.5

I've read the migration manuals and have tried to make the changes to
my configuration to work correctly in tomcat v8.5, but it's not.  I'm
not an experton XML files and JDK so please help me.   I'm sure this is crazy simple
for you experts.

The server.xml conf file is OK between the two versions.   But my
application's deployment is having problems.

In my tomcat v7 conf/Catalina/localhost directory, I have ed.xml file
for my application containing:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/home/httpd/ed" path="/ed">
<Parameter name="login" value="xxxxxxx/xxxxxxx"/>
<Parameter name="key_string" value="XxxxxxxxxxxXxxxxxxxx"/>
<Loader className="org.apache.catalina.loader.VirtualWebappLoader"
   virtualClasspath="/usr/local/calendar/libs/google-api-client-1.22.0.jar;/usr/local/calendar/google-api-services-calendar-v3-rev230-1.22.0.jar;/usr/local/calendar/libs/google-http-client-1.22.0.jar;/usr/local/calendar/libs/google-http-client-jackson2-1.22.0.jar;/usr/local/calendar/libs/google-oauth-client-1.22.0.jar;/usr/local/calendar/libs/jackson-core-2.1.3.jar"/>
</Context>

After spending about 6 hours and reading tons of other web posts from
others trying to do the same thing, I finally have
something working, kinda.  My web application at least deploys when
tomcat starts.  The Loader part in the .xml was replaced with:
<Resources className="org.apache.catalina.webresources.StandardRoot">
        <PostResources className="org.apache.catalina.webresources.JarResourceSet"
           base="/usr/local/calendar/libs/google-api-client-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
        <PostResources className="org.apache.catalina.webresources.JarResourceSet"
           base="/usr/local/calendar/google-api-services-calendar-v3-rev230-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
        <PostResources className="org.apache.catalina.webresources.JarResourceSet"
           base="/usr/local/calendar/libs/google-http-client-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
        <PostResources className="org.apache.catalina.webresources.JarResourceSet"
           base="/usr/local/calendar/libs/google-http-client-jackson2-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
        <PostResources className="org.apache.catalina.webresources.JarResourceSet"
           base="/usr/local/calendar/libs/google-oauth-client-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
        <PostResources className="org.apache.catalina.webresources.JarResourceSet"
           base="/usr/local/calendar/libs/jackson-core-2.1.3.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
</Resources>

However, when I access the JSP page that need to resolve classes in these .jar's, I get
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [20] in the generated java file: [/work/Catalina/localhost/ed/org/apache/jsp/charters_jsp.java]
Only a type can be imported. com.google.api.client.json.JsonFactory resolves to a package

Line 20 is:
import com.google.api.client.json.JsonFactory;

I think I'm up to 12 hours messing with this and reading everything I can get my hands on.
Something that was so simple in tomcat 7 has turned out to be a nightmare in tomcat 8.
I still don't have a good understanding of what webAppMount is or what I should set it to.
I changed PostResources to JarResources and nothing changed.   The jar files are not getting found
or the classes in the jar files are not getting found. 

There is no way this can be this hard and complicated in tomcat 8.

Please help.




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


Re: migration from tomcat 7.0 to 8.5

Posted by Mark Thomas <ma...@apache.org>.
On 04/10/2017 15:53, Aquatic Safaris Diver wrote:
> 
> I've read the migration manuals and have tried to make the changes to
> my configuration to work correctly in tomcat v8.5, but it's not.  I'm
> not an experton XML files and JDK so please help me.   I'm sure this is crazy simple
> for you experts.

Why make life difficult for yourself? Just package those libraries in
your web application's WEB-INF/lib directory.

Mark

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


Re: migration from tomcat 7.0 to 8.5

Posted by Konstantin Kolinko <kn...@gmail.com>.
2017-10-04 17:53 GMT+03:00 Aquatic Safaris Diver <di...@aquaticsafaris.com>:
>
> I've read the migration manuals and have tried to make the changes to
> my configuration to work correctly in tomcat v8.5, but it's not.  I'm
> not an experton XML files and JDK so please help me.   I'm sure this is crazy simple
> for you experts.
>
> The server.xml conf file is OK between the two versions.   But my
> application's deployment is having problems.
>
> In my tomcat v7 conf/Catalina/localhost directory, I have ed.xml file
> for my application containing:
>
> <?xml version='1.0' encoding='utf-8'?>
> <Context docBase="/home/httpd/ed" path="/ed">

"path" cannot be used here, ignored

docBase is rare to be seen here, but OK (it is outside of webapps)

> <Parameter name="login" value="xxxxxxx/xxxxxxx"/>
> <Parameter name="key_string" value="XxxxxxxxxxxXxxxxxxxx"/>
> <Loader className="org.apache.catalina.loader.VirtualWebappLoader"
>    virtualClasspath="/usr/local/calendar/libs/google-api-client-1.22.0.jar;/usr/local/calendar/google-api-services-calendar-v3-rev230-1.22.0.jar;/usr/local/calendar/libs/google-http-client-1.22.0.jar;/usr/local/calendar/libs/google-http-client-jackson2-1.22.0.jar;/usr/local/calendar/libs/google-oauth-client-1.22.0.jar;/usr/local/calendar/libs/jackson-core-2.1.3.jar"/>
> </Context>
>
> After spending about 6 hours and reading tons of other web posts from
> others trying to do the same thing, I finally have
> something working, kinda.  My web application at least deploys when
> tomcat starts.  The Loader part in the .xml was replaced with:
> <Resources className="org.apache.catalina.webresources.StandardRoot">
>         <PostResources className="org.apache.catalina.webresources.JarResourceSet"
>            base="/usr/local/calendar/libs/google-api-client-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
>         <PostResources className="org.apache.catalina.webresources.JarResourceSet"
>            base="/usr/local/calendar/google-api-services-calendar-v3-rev230-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
>         <PostResources className="org.apache.catalina.webresources.JarResourceSet"
>            base="/usr/local/calendar/libs/google-http-client-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
>         <PostResources className="org.apache.catalina.webresources.JarResourceSet"
>            base="/usr/local/calendar/libs/google-http-client-jackson2-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
>         <PostResources className="org.apache.catalina.webresources.JarResourceSet"
>            base="/usr/local/calendar/libs/google-oauth-client-1.22.0.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
>         <PostResources className="org.apache.catalina.webresources.JarResourceSet"
>            base="/usr/local/calendar/libs/jackson-core-2.1.3.jar" webAppMount="/WEB-INF/lib" internalPath="/."/>
> </Resources>

I'd use org.apache.catalina.webresources.FileResourceSet.  There is an
example in "Ordering" section here:
http://tomcat.apache.org/tomcat-8.5-doc/config/resources.html#Nested_Components

The docs could be better.

> However, when I access the JSP page that need to resolve classes in these .jar's, I get
> org.apache.jasper.JasperException: Unable to compile class for JSP:
>
> An error occurred at line: [20] in the generated java file: [/work/Catalina/localhost/ed/org/apache/jsp/charters_jsp.java]
> Only a type can be imported. com.google.api.client.json.JsonFactory resolves to a package
>
> Line 20 is:
> import com.google.api.client.json.JsonFactory;

It is odd.
Stacktrace?

In my experience I faced
https://bz.apache.org/bugzilla/show_bug.cgi?id=47323
but it is quite different from your case.

isPackage(className) check mentioned there tries to load (className +
".class") as a resource and reports "true, it is a package" if the
class resource is not found.

> I think I'm up to 12 hours messing with this and reading everything I can get my hands on.
> Something that was so simple in tomcat 7 has turned out to be a nightmare in tomcat 8.
> I still don't have a good understanding of what webAppMount is or what I should set it to.
> I changed PostResources to JarResources and nothing changed.   The jar files are not getting found
> or the classes in the jar files are not getting found.
>
> There is no way this can be this hard and complicated in tomcat 8.
>
> Please help.

Best regards,
Konstantin Kolinko

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