"Fatal Error: Unable to locate package java.lang in classpath or bootclasspath" when upgrading to Tomcat9

Modou DIA <[email protected]> Mon, 17 Jul 2023 13:28:41 +0200
Newsgroups gmane.text.xml.cocoon.user
Message-ID <CADYzun3Mkhkp-gkzxYR5KiqXmFo7=fyDxhNdMKiNzaAAwx1eoQ@mail.gmail.com>
--000000000000737efb0600ad1a2b
Content-Type: text/plain; charset="UTF-8"

Hello Cocoon community,

I am encountering an issue while migrating from Tomcat7 to Tomcat9. I am
working with Cocoon 2.1.13 and Java11.

During the deployment process I don't have any problems. However when I try
to access the application, I got a white page  and this StackTrace is
generated

org.apache.cocoon.components.language.LanguageException: Error compiling
userinfos_xsp:
Line 0, column 0:
Fatal Error: Unable to locate package java.lang in classpath or
bootclasspath

at
org.apache.cocoon.components.language.programming.java.JavaLanguage.compile(JavaLanguage.java:227)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:174)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loadProgram(ProgramGeneratorImpl.java:410)
at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:290)
at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java:170)
at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:386)
at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setupPipeline(AbstractCachingProcessingPipeline.java:717)
at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:511)
at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.prepareInternal(AbstractProcessingPipeline.java:525)
at
org.apache.cocoon.components.source.impl.SitemapSource.init(SitemapSource.java:342)
...


In the class
org.apache.cocoon.components.language.programming.java.JavaLangugae I have
checked the method compile and this error suggests a problem with the
classpath or bootclasspath configuration. I have tried the following steps
to address the issue without success:

- Checked and verified the Java installation and the "JAVA_HOME"
environment variable. It is important to note that the installation works
well with Tomcat7 and Java11
- Examined and updated the Cocoon configuration files, such as
"cocoon.xconf," to ensure proper classpath settings. The parameter compiler
is configured to work with
org.apache.cocoon.components.language.programming.java.Javac

Despite these efforts, the issue persists. I suspect there might be an
underlying compatibility issue or misconfiguration that I am overlooking.

If anyone has encountered a similar issue or has insights into resolving
this problem, I would greatly appreciate your guidance and suggestions.
Additionally, any general tips for configuring Cocoon with Apache Tomcat 9
would be highly appreciated.

Thank you in advance for your support and assistance.

Best regards,

-- 
----------
| Modou DIA
| E-mail: [email protected]
| Phone: +33 (0)6 31 69 52 63
| LinkedIN: https://fr.linkedin.com/pub/modou-dia/b6/864/342
----------

--000000000000737efb0600ad1a2b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hello Cocoon community,<br><br>I am encountering an i=
ssue while migrating from Tomcat7 to Tomcat9. I am working with Cocoon 2.1.=
13 and Java11.<br><br>During the deployment process I don&#39;t have any pr=
oblems. However when I try to access the application, I got a white page =
=C2=A0and this StackTrace is generated<br><br>org.apache.cocoon.components.=
language.LanguageException: Error compiling userinfos_xsp:<br>Line 0, colum=
n 0:<br>Fatal Error: Unable to locate package java.lang in classpath or boo=
tclasspath<br><br>at org.apache.cocoon.components.language.programming.java=
.JavaLanguage.compile(JavaLanguage.java:227)<br>at org.apache.cocoon.compon=
ents.language.programming.CompiledProgrammingLanguage.load(CompiledProgramm=
ingLanguage.java:174)<br>at org.apache.cocoon.components.language.generator=
.ProgramGeneratorImpl.loadProgram(ProgramGeneratorImpl.java:410)<br>at org.=
apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(Progr=
amGeneratorImpl.java:290)<br>at org.apache.cocoon.generation.ServerPagesGen=
erator.setup(ServerPagesGenerator.java:170)<br>at org.apache.cocoon.compone=
nts.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPip=
eline.java:386)<br>at org.apache.cocoon.components.pipeline.impl.AbstractCa=
chingProcessingPipeline.setupPipeline(AbstractCachingProcessingPipeline.jav=
a:717)<br>at org.apache.cocoon.components.pipeline.AbstractProcessingPipeli=
ne.preparePipeline(AbstractProcessingPipeline.java:511)<br>at org.apache.co=
coon.components.pipeline.AbstractProcessingPipeline.prepareInternal(Abstrac=
tProcessingPipeline.java:525)<br>at org.apache.cocoon.components.source.imp=
l.SitemapSource.init(SitemapSource.java:342)</div><div>...<br><br><br>In th=
e class org.apache.cocoon.components.language.programming.java.JavaLangugae=
 I have checked the method compile and this error suggests a problem with t=
he classpath or bootclasspath configuration. I have tried the following ste=
ps to address the issue without success:<br><br>- Checked and verified the =
Java installation and the &quot;JAVA_HOME&quot; environment variable. It is=
 important to note that the installation works well with Tomcat7 and Java11=
<br>- Examined and updated the Cocoon configuration files, such as &quot;co=
coon.xconf,&quot; to ensure proper classpath settings. The parameter compil=
er is configured to work with org.apache.cocoon.components.language.program=
ming.java.Javac<br><br>Despite these efforts, the issue persists. I suspect=
 there might be an underlying compatibility issue or misconfiguration that =
I am overlooking.<br><br>If anyone has encountered a similar issue or has i=
nsights into resolving this problem, I would greatly appreciate your guidan=
ce and suggestions. Additionally, any general tips for configuring Cocoon w=
ith Apache Tomcat 9 would be highly appreciated.<br><br>Thank you in advanc=
e for your support and assistance.<br><br>Best regards,</div><div><br></div=
><span class=3D"gmail_signature_prefix">-- </span><br><div dir=3D"ltr" clas=
s=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><=
div>----------<br>| Modou DIA<br>| E-mail: <a href=3D"mailto:modou33@gmail.=
com" target=3D"_blank">[email protected]</a><br></div><div>| Phone: +33 (0)=
6 31 69 52 63<br></div><div>| LinkedIN: <span><a href=3D"https://fr.linkedi=
n.com/pub/modou-" target=3D"_blank">https://fr.linkedin.com/pub/modou-</a><=
/span><span>dia/b6/864/342</span></div><div>----------</div></div></div></d=
iv>

--000000000000737efb0600ad1a2b--