-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Carles,

On 8/27/20 12:19, Carles Franquesa wrote:
> Hi Everybody!, Just got in the list :)
>
> I am developing a webapp with Netbeans 8.0.2, and deploying it as a
> WAR file with Apache 8.5.57 Tomcat Manager onto my VPS where a
> mydomain.com is publically mapped on the DNS.
>
> It works fine in localhost, and even at the VPS when the IP and
> path is set in the url browser: http://ip:port/myapp. Then, it
> works.
>
> When trying to connect via my registered domain in the browser
> url, astonishingly, the index.jsp is correctly shown, but none of
> its links to other JSPs are going on. The first one is called
> cursos.jsp.

Do you mean that the links don't work (the browser won't follow them),
or you get an error when you click on those links because of the JSP
compilation errors?

> The included file before the <head> tag is the same in index.jsp as
> in cursos.jsp, located in webapps/myapp/cursos/cursos.jsp which
> produces the error.

Your attachment was stripped from your message, but I don't think it
is really necessary to understand what's going on.

> The begining of both files is:
>
> ----------------------------------------------------------------------
- ---------------------------------
>
>
<%@page session="true" %>
> <%@page import="lib.Text"%>
> ----------------------------------------------------------------------
- --------------------------------
>
>
I also have been looking at stackoverflow, and found some amazing
> solutions, like ending the import with a semicolon. But it neither
> worked at all.
>
> My purpose is to make it work on mydomain.eu that I have already
> registered and mapped in the DNS.
>
> The error message given by any browser is printed next.
> ----------------------------------------------------------------------
- --------------------------------
>
>
Tipo Informe de Excepción
>
> mensaje Unable to compile class for JSP
>
> Descripción El servidor encontró un error interno que hizo que no
> pudiera rellenar este requerimiento.
>
> excepción
>
> org.apache.jasper.JasperException: Unable to compile class for
> JSP:
>
> An error occurred at line: [14] in the generated java file:
> [/opt/tomcat/work/Catalina/
> mydoamin.com/cursos/org/apache/jsp/cursos_jsp.java] Only a type can
> be imported. lib.Text resolves to a package
>
> ... and here, error is repeated for several classes
> ----------------------------------------------------------------------
- --------------------------------
>
>  So, it seems that the class loader does not find the classes
> located at its default repository.
>
> I have been looking for the way tomcat uses classpaths. In
> particular, the role of its class loaders. And specifically, the
> "shared.loader" class loader.
>
> I even tried to set the value "webapps/myapp/WEB-INF/classes" in
> the catalina.properties file (even though it is not supposed to be
> needed).
>
> I have been looking for this in
> http://tomcat.apache.org/tomcat-8.5-doc/class-loader-howto.html.
> There, learned about the four loaders of tomcat. And as long as I
> understood, the classes repository should be located at
> ${CATALINA_HOME}/webapps/myapp/WEB-INF/classes. The place where
> Tomcat Manager leaves it when the WAR is uploaded.
>
> Ultimately, the
> ${CATALINA_HOME}/webapps/myapp/WEB-INF/classes/lib/Text.class
> certainly exists!, so I am stuck in telling the loader where the
> classes are.

You shouldn't have to mess around with class loaders or anything,
though that was good information for you to read. And you have
understood it correctly!

Can you take the WAR file you have deployed on the server and run this
on it?

$ unzip -v my.war

Can you post the contents? It should contain, among other things:
WEB-INF/classes/lib/Text.class

I'm wondering if the WAR file isn't including something that is
present on your local system when you test (and where it works properly)
.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl9H8DcACgkQHPApP6U8
pFg2FA/9Hxn/yJOxRWch+8tAYZsLvcuCF+aynod0BdDso1wyhVWmv44JDNgwcDbA
Q6VQH0KclheiGlZmfH59y1RTxeNUUYOw22wbr7qyoKq/ShsDxvmEEiRdq1hDrqVS
v6gnb7XMrtYIhPhRJDnOhm+vD4KmK28szSvTFRXvTUaENjFBGVFHc8AkDldRy7Df
g9F/VUadiKuO2D/z7RxbiHzDYt3yCgGCAq9+6pch5LoUQ3W0Bmg6+NYXxdXylRQh
EDVd6vhxrc/kFqbTFcP7Wmc/HJ9Y3mYQ2AYANQRO/9tmSYjaXqNXrITczLsltbU5
Z6M/1pw3flTycGjEA6ycLBP3CNTKykB1Ygda3plf7Zsf+m3w/4Mt6RYbsGPzOis0
/E4o5QPpdnIfWcXjU6Ivgdtk6q1z5QFBNehsJscXtNK93Y5tEas5Z3ldLBRh1+ZK
Oe9mcyNY70rrtAvT+2/QVJoYV6Z0nZmEKti+wnDY2NCX7UoS72FqN1ENHhOM/uPj
2Gc9gY0t3tAxjWvKjhQi5b9LaqW6tSm3o3xhD109u2Fck9Gr5NOz6Lf9LHWkYxHn
fLPmzgic5vp6VyceWq/F+zwQElnHwELBz1LR1lrX3kCKmxsHqsqjvLp2HK7Wt4us
f67rukAYn1Gl4l3lCTorSpRXTKBXE8Wc9c4z02BftLAhWMpDQqA=
=nSg9
-----END PGP SIGNATURE-----

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

Reply via email to