Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I used xsp:include to import my classes, but it comes up with Package “mypackage” not found in import Why?

classes comes import Used XSP
0
Posted

I used xsp:include to import my classes, but it comes up with Package “mypackage” not found in import Why?

0

You need to tell Java where to find your classes, by putting the directory of your root package (if any, or just the directory of your classes, if not) in the CLASSPATH. This is not specific to Cocoon – it applies to many types of Java software. Cocoon does not see classes in special directories like WEB-INF/classes because (a) there is no standard way for a servlet engine to communicate its full CLASSPATH to its servlets (e.g. Cocoon) and (b) javac, jikes and/or Java’s Classloader API were not designed for this scenario. Cocoon 2 aims to solve this problem but it will probably require far-reaching and/or servlet-engine-specific changes. However, it is on the Todo list to add certain industry-standard directories like WEB-INF/classes to the Cocoon internal CLASSPATH. I get the exception java.lang.NoClassDefFoundError: sun/tools/javac/Main This happens because XSP requires the java compiler to be present in your classpath – so, if you have Java 1.2 or above, you have to put the tools.ja

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123