You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ming Zhou <mi...@acs-inc.com> on 2003/04/18 17:46:41 UTC

[Classloader?] Executable jar classes not visible to jasper-compi ler

Sorry if you have received this message more than once. I just really want
to get some input from this list.

 

--------------------------

We are starting Tomcat4 as a thread within our app. If app specific jars are
set in the environment classpath, they are picked up properly.

 

After I made an executable jar, e.g. "java -jar myapp.jar", that includes
all the related jars in the manifest class-path, JSP pages can't be compiled
any more due to undefined app-specific classes. (I'm using executable jars
to simplify cross-platform deployment.)

 

Here is a snapshot to my directory structure:

/app_home (run "java -jar myapp.jar" in here)

  myapp.jar (using lib/*.jar and tomcat4/bin/bootstrap.jar in the manifest)

  /lib

    /*.jar

  /tomcat4

    /bin

      /bootstrap.jar

    /webapps

      /app1

      /app2

    /work

 

The interesting thing is that if I have JSP pages that had been compiled
before in the work directory, they can still be run without any problem
until I delete the classes and try reloading the pages. So it appears that
Jasper runtime can see classes referred in the executable jar, but Jasper
compiler can't.

 

Question #1: Can someone explain this difference to me?

 

Question #2: I'm aware of the classloader tree in tomcat. Since we use the
system classloader to run bootstrap, shouldn't the bootstrap classloader and
all of its descendants inherit the class-path defined in the manifest of the
executable jar?

 

I appreciate any insight into this issue.

 

-ming,

 


Re: [Classloader?] Executable jar classes not visible to jasper-compi ler

Posted by Tim Funk <fu...@joedog.org>.
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

[OT] I wish there were more indepth links/guides on embedding tomcat. Does 
anyone know of any?

-Tim

Ming Zhou wrote:
> Sorry if you have received this message more than once. I just really want
> to get some input from this list.
> 
>  
> 
> --------------------------
> 
> We are starting Tomcat4 as a thread within our app. If app specific jars are
> set in the environment classpath, they are picked up properly.
> 
>  
> 
> After I made an executable jar, e.g. "java -jar myapp.jar", that includes
> all the related jars in the manifest class-path, JSP pages can't be compiled
> any more due to undefined app-specific classes. (I'm using executable jars
> to simplify cross-platform deployment.)
> 
>  
> 
> Here is a snapshot to my directory structure:
> 
> /app_home (run "java -jar myapp.jar" in here)
> 
>   myapp.jar (using lib/*.jar and tomcat4/bin/bootstrap.jar in the manifest)
> 
>   /lib
> 
>     /*.jar
> 
>   /tomcat4
> 
>     /bin
> 
>       /bootstrap.jar
> 
>     /webapps
> 
>       /app1
> 
>       /app2
> 
>     /work
> 
>  
> 
> The interesting thing is that if I have JSP pages that had been compiled
> before in the work directory, they can still be run without any problem
> until I delete the classes and try reloading the pages. So it appears that
> Jasper runtime can see classes referred in the executable jar, but Jasper
> compiler can't.
> 
>  
> 
> Question #1: Can someone explain this difference to me?
> 
>  
> 
> Question #2: I'm aware of the classloader tree in tomcat. Since we use the
> system classloader to run bootstrap, shouldn't the bootstrap classloader and
> all of its descendants inherit the class-path defined in the manifest of the
> executable jar?
> 
>  
> 
> I appreciate any insight into this issue.
> 
>  
> 
> -ming,
> 
>  
> 
> 


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