Magnus Warker schrieb:
> Hi,
>
[quoted text clipped - 12 lines]
> Thank you,
> Magnus
Hi Magnus,
I think you just added the jar file to the eclipse classpath, right? You
should put in the WEB-INF/lib directory so that it's deployed to tomcat
too. That should solve you problem, if I got you right. In Eclipse you
can reference the file from the WEB-INF/lib folder as well.
Cheers,
Axel
..
>there is a Tomcat application which uses another library, provided as a
>JAR-file.
..
>But the integrated Tomcat (Sysdeo) throws a NoClassDefFoundError
...
>I already defined the classpath.
What or whose classpath?
>...Why is this not propagated to Tomcat? How
>is this done the standard way?
The standard way to make archives od classes available
to a web-app, is to place the archive in WEB-INF/lib and
perhaps restart the server.

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Hi Andrew and Axel,
thank you for your hints! I added the JAR as a symlink to the WEB-INF/lib
folder, and it worked.
But let me ask two questions about that:
1. Why do I need to specify this twice?
Once for Eclipse to treat my code as "known code" (syntax highlighting and
son on), and once for Tomcat to work? This is somewhat doubled
configuration, isn't it?
2. What about many projects using one library?
Assume many web projects using a single JAR library. Copying JAR files all
the time does not seem conventional for me. What I did in this case was
creating a symbolic link. Is this the normal way?
Thanks a lot!
Magnus
Axel Seinsche - 09 Apr 2007 19:19 GMT
Hi Magnus,
> thank you for your hints! I added the JAR as a symlink to the WEB-INF/lib
> folder, and it worked.
That's fine. ;-)
> But let me ask two questions about that:
>
> 1. Why do I need to specify this twice?
> Once for Eclipse to treat my code as "known code" (syntax highlighting and
> son on), and once for Tomcat to work? This is somewhat doubled
> configuration, isn't it?
You don't need to specify it twice. Answer see question 2.
> 2. What about many projects using one library?
> Assume many web projects using a single JAR library. Copying JAR files all
> the time does not seem conventional for me. What I did in this case was
> creating a symbolic link. Is this the normal way?
Of course you can do it with a symbolic link. This works for Linux/Unix
systems. But the normal way would be to copy the jar file in the
WEB-INF/lib folder in your eclipse project. When eclipse creates a WAR
or whatever archive you need, the lib will be automatically be deployed
with your project. Inside eclipse you can add jar files from your
WEB-INF/lib folder to be able to compile.
> Thanks a lot!
> Magnus
Hope this helps and answers your questions.
Cheers,
Axel
Arne Vajhøj - 10 Apr 2007 00:34 GMT
> But let me ask two questions about that:
>
> 1. Why do I need to specify this twice?
> Once for Eclipse to treat my code as "known code" (syntax highlighting and
> son on), and once for Tomcat to work? This is somewhat doubled
> configuration, isn't it?
You could view it that way, but consider that
you used Eclipse to develop an web
app with version N of the jar and NetBeans to develop another
web app with version N+1 of the jar and both got deployed to
the same Tomcat residing on a web hotel that you have only
HTTP and FTP access to.
They way it is makes that no problem. So consider it a feature.
You may not need it now. But you may need it some day.
> 2. What about many projects using one library?
> Assume many web projects using a single JAR library. Copying JAR files all
> the time does not seem conventional for me. What I did in this case was
> creating a symbolic link. Is this the normal way?
shared/lib exist for that purpose, but be really sure that you want
that jar used by all web apps before putting something there.
Arne
Magnus Warker - 10 Apr 2007 06:22 GMT
Hi Andrew and Axel,
thank you very much!
Magnus