cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: Actions - Basics
Date Thu, 25 Jul 2002 03:55:22 GMT
> From: Richard [mailto:richard@voxsant.com]
> 
> Hi Guys
> 
> I am trying to compile the HelloWorldAction.java file under...
> 
> C:\Program Files\Apache Tomcat 4.0\webapps\cocoon\WEB-INF\lib\
> 
> the compiler gives me unresolve symbol errors for the
> org.apache.avalon.framework.*  and  org.apache.cocoon.*
classes/packages.
> 
> now what i did was look for these packages inside the
> 
> Apache Tomcat 4.0\webapps\cocoon\WEB-INF\lib\*.jar files,
> eventually I have found all the packages that i need. in the end i
have
> managed  to compile the HelloWorldAction. but what i got is an org
folder
> under the \WEB-INF\lib\ folder, containing packages for
org-apache-avalon,
> org-apache-cocoon and org-xml.
> 
> to illustrate...
> 
> WEB-INF\lib\ folder
>               |
>               |
>               | -----> org
>                              |
>                              |--> apache
>                              |          |--> avalon
>                              |          |--> cocoon
>                              |
>                              |---> xml folder
> 
> Is this alright?

No.


> ( I think there is something wrong with it )

Yes. Get and read "JavaTM Servlet 2.3 Specification"
(servlet-2_3-fcs-spec.pdf) from
http://www.jcp.org/aboutJava/communityprocess/final/jsr053/, page 61:
------------ 8< ------------
A special directory exists within the application hierarchy named
"WEB-INF".
...
. The /WEB-INF/classes/ directory for servlet and utility classes. The
classes
in this directory must be available to the application class loader.
. The /WEB-INF/lib/*.jar area for Java ARchive files. These files
contain
servlets, beans, and other utility classes useful to the web
application. The web application class loader must be able to load
classes from any of these archive files.
------------ 8< ------------

All other pages are helpful too.



> Why cant the javac see the packages inside the jar files?
> 
> I have also tried to use the javac -classpath C:\Program Files\Apache
Tomcat
> 4.0\webapps\cocoon\WEB-INF\lib HelloWorldAction.java command. It gives
the
> same error.

First read
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html:
------------ 8< ------------
Paths to the .jar, .zip or .class files. Each path should end with a
filename or directory depending on what you are setting the class path
to: 
For a .jar or .zip file that contains .class files, the path ends with
the name of the .zip or .jar file. 
For .class files in an unnamed package, the path ends with the directory
that contains the .class files. 
For .class files in a named package, the path ends with the directory
that contains the "root" package (the first package in the full package
name).
------------ 8< ------------

Then continue with
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/javac.html.


Vadim


> Notes:
> -I used the javac command in DOS mode to compile the java file.
> -JAVA_HOME = C:\jdk1.3.1_03
> -CATALINA_HOME = C:\Program Files\Apache Tomcat 4.0
> -CLASSPATH=C:\jdk1.3.1_03\lib;C:\Program Files\Apache Tomcat
> 4.0\webapps\cocoon\WEB-INF\lib
> -COCOON_HOME=C:\Program Files\Apache Tomcat 4.0\webapps\cocoon
> 
> PC Configuration
> --------------------------
> Windows 2000 Server Professional
> Java 2 SDK 1.3.01
> Jakarta Tomcat 4.0.4
> cocoon-2.0.2 dev
> 
> 
> Now I have add this line in the main sitemap file (C:\Program
Files\Apache
> Tomcat 4.0\webapps\cocoon\sitemap.xmap)
> 
> <map:action name="hello-world"
> src="org.apache.avalon.framework.test.HelloWorldAction"/>
> 
> is this correct?
> 
> Thanks in advance...


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message