Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » shared lib
shared lib [message #187683] Wed, 07 February 2007 14:44 Go to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
Where should I place jar files that I usually place in Tomcat's shared lib
when using WTP?
Re: shared lib [message #187700 is a reply to message #187683] Wed, 07 February 2007 15:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kosta.bea.com

What I typically do in this situation is to create a plain non-java
project to hold the libraries in your workspace. Then you can use Java
Build Path from your web app to reference these jars.

- Konstantin
Re: shared lib [message #187769 is a reply to message #187700] Thu, 08 February 2007 06:48 Go to previous messageGo to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
I don't think I understand - why a non-java project? how?

"Konstantin Komissarchik" <kosta@bea.com> wrote in message
news:eqcsiu$uki$1@utils.eclipse.org...
> What I typically do in this situation is to create a plain non-java
> project to hold the libraries in your workspace. Then you can use Java
> Build Path from your web app to reference these jars.
>
> - Konstantin
Re: shared lib [message #187777 is a reply to message #187769] Thu, 08 February 2007 13:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kosta.bea.com

Basically you want a container to hold jars in the workspace so that you
can refer to them easily from other projects. This way you avoid
absolute paths which don't work in a team environment and you can
source-control this project with the rest of your projects. Since the
project is just a container for jars, it doesn't need to have any
special functionality (such as java compiler) enabled on it. In the
version of Eclipse that I am using, you can create such plain project by
selecting "General -> Project" in the new project wizard.

Hope this helps,

- Konstantin
Re: shared lib [message #187785 is a reply to message #187777] Thu, 08 February 2007 13:36 Go to previous messageGo to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
the jars you are referring to are my JNI wrappers? If so - is it OK for them
to load a dll, because then there might be a problem loading the same dll
for different servlets (that's why tomcat has the shared lib dir).
I may be totally off here, so please put me in the right direction, it's my
first experience with JNI and servlets...

"Konstantin Komissarchik" <kosta@bea.com> wrote in message
news:eqf7p9$60j$1@utils.eclipse.org...
> Basically you want a container to hold jars in the workspace so that you
> can refer to them easily from other projects. This way you avoid absolute
> paths which don't work in a team environment and you can source-control
> this project with the rest of your projects. Since the project is just a
> container for jars, it doesn't need to have any special functionality
> (such as java compiler) enabled on it. In the version of Eclipse that I am
> using, you can create such plain project by selecting "General -> Project"
> in the new project wizard.
>
> Hope this helps,
>
> - Konstantin
Re: shared lib [message #187793 is a reply to message #187683] Thu, 08 February 2007 14:23 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
Are you asking "How do I setup the classpath of my project to use jars
that will be in the shared lib?" or "How do I set up my Tomcat server to
provide shared lib jars that are in my installation?" The earlier
portion of the thread suggests that the first question may not be it.
Is it the second question or something different?

Cheers,
Larry

Zohar wrote:
> Where should I place jar files that I usually place in Tomcat's shared
> lib when using WTP?
Re: shared lib [message #187801 is a reply to message #187793] Thu, 08 February 2007 16:02 Go to previous messageGo to next message
Zohar Amir is currently offline Zohar AmirFriend
Messages: 419
Registered: July 2009
Senior Member
Hi Larry,
The thing is this (which means I'm not sure what I want ;)): I have a few
servlets that use JNI. I created a java project for the JNI wrapper class.
In a tomcat installation I'd put the JNI's dll in the java.library.path and
the wrapper (jared) in $CATALINA_HOME/shared/lib .
When using WTP where do I put these?

"Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
news:eqfbot$eob$1@utils.eclipse.org...
> Are you asking "How do I setup the classpath of my project to use jars
> that will be in the shared lib?" or "How do I set up my Tomcat server to
> provide shared lib jars that are in my installation?" The earlier portion
> of the thread suggests that the first question may not be it. Is it the
> second question or something different?
>
> Cheers,
> Larry
>
> Zohar wrote:
>> Where should I place jar files that I usually place in Tomcat's shared
>> lib when using WTP?
Re: shared lib [message #187810 is a reply to message #187801] Thu, 08 February 2007 16:26 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
The dll would still go into some directory on the java.library.path. If
necessary, you could set this property in the launch configuration for
the server including an extra directory that contains the desired dll.
I have also used the trick of setting a PATH environment variable in the
launch configuration, which will get added to java.library.path, if you
don't set the java.library.path property directly.

For the jar(s), it's more accurately $CATALINA_BASE/shared/lib. This
means you could create a "shared/lib" folder under
".metadata\.plugins\org.eclipse.wst.server.core\tmp?" directory and put
your jar(s) there. If you are using Tomcat 5.0.x or later, you can
import the catalina.properties file into the appropriate subfolder of
the Servers project in your workspace. It will be included when the
configuration is published to the server for running. You could update
the "shared.loader" property in there to accomplish what you want.

Cheers,
Larry

Zohar wrote:
> Hi Larry,
> The thing is this (which means I'm not sure what I want ;)): I have a
> few servlets that use JNI. I created a java project for the JNI wrapper
> class. In a tomcat installation I'd put the JNI's dll in the
> java.library.path and the wrapper (jared) in $CATALINA_HOME/shared/lib .
> When using WTP where do I put these?
>
> "Larry Isaacs" <Larry.Isaacs@sas.com> wrote in message
> news:eqfbot$eob$1@utils.eclipse.org...
>> Are you asking "How do I setup the classpath of my project to use jars
>> that will be in the shared lib?" or "How do I set up my Tomcat server
>> to provide shared lib jars that are in my installation?" The earlier
>> portion of the thread suggests that the first question may not be it.
>> Is it the second question or something different?
>>
>> Cheers,
>> Larry
>>
>> Zohar wrote:
>>> Where should I place jar files that I usually place in Tomcat's
>>> shared lib when using WTP?
>
Re: shared lib [message #187817 is a reply to message #187785] Thu, 08 February 2007 17:27 Go to previous message
Eclipse UserFriend
Originally posted by: kosta.bea.com

This shouldn't be a problem for JNI. At runtime you will be using common
instance in the Tomcat's shared lib directory so there is only one
instance. If you put the jars in a shared directory like I suggested,
they will only be used to compile against. The DLLs are not necessary
and will not be loaded.

- Konstantin
Previous Topic:problem in running my first JSP in eclipse
Next Topic:Dependent server launching?
Goto Forum:
  


Current Time: Thu Nov 27 11:13:47 GMT 2014

Powered by FUDForum. Page generated in 0.02082 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software