You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Cotton, Joseph B" <bc...@dpscs.state.md.us> on 2012/06/26 17:07:33 UTC

Wish to use an independent class module in Tomcat

My question may be covered by the Tomcat documentation and I am just
confused by all the new terminology.  I have spent hours in reading and
still I am looking to an answer. 

We wish to have a class running on Tomcat that contains system wide info
and multiple database connections into DB2 on the mainframe.   All other
apps runing on Tomcat will open an instance of this class to access the
static info and one of five open connections.  Opening and closing
database connections is very slow and we wish to leave open the
connections and just reuse them as needed. 

We wrote the class and it runs ok.  Yet to get it to run with an app, we
need to load the class jar file into the app and references in
context.xml and web.xml as listed in the documentation. But that defeats
the purpose of the global app because then there are multiple instances
of the class.  

We tried to insert a reference in <GlobalNamingResources> of server.xml.
It doesn't seem to work for us.

Or are we off base with this design?  Is app to app communication
allowed?  Can I call a class from one app to another without first
loading the called class into the calling class?

I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23
(build 1.6.0_23-b05).  Java 7 is not an option in our shop yet because
we are supporting a commercial package that breaks when run under Java
7.

I would appreciate if the group could point me to the correct
documentation to do what we are looking for, and perhaps a translation
of the Tomcat specific terminology and jargon.

Thanks

Joe

 


RE: Wish to use an independent class module in Tomcat

Posted by "Cotton, Joseph B" <bc...@dpscs.state.md.us>.
I found a really good explanation for what I want to do in "Java Servlet Programming", Jason Hunter et al, chapter 11 "Servlet Collaboration". 
Thanks to all.
Joe

-----Original Message-----
From: Cotton, Joseph B [mailto:bcotton@dpscs.state.md.us] 
Sent: Tuesday, June 26, 2012 2:14 PM
To: Tomcat Users List
Subject: RE: Wish to use an independent class module in Tomcat

Thanks, Konstantine, Cris and Mark.  I will be reading the docs.  
"... global objects should not retain references to objects loaded by your web application..."  We intend on only doing it the opposite direction, that is, loading global objects into web apps.  That is the whole point, we want some global objects to live on, after the web app is gone. 
"... allow each app to have one open..." - yes, and we have a load balancer/round robbin method of assigning one connection to one session.  It is very fast, obtain connection (which is already alive), query, get result set, release connection (back to the pool).  
Thanks for the pointers, I will be checking the class loader docs.  So far, I have used class loader for database connections.  
Thanks
joe

-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
Sent: Tuesday, June 26, 2012 12:16 PM
To: Tomcat Users List
Subject: Re: Wish to use an independent class module in Tomcat

2012/6/26 Cotton, Joseph B <bc...@dpscs.state.md.us>:
> My question may be covered by the Tomcat documentation and I am just 
> confused by all the new terminology.  I have spent hours in reading 
> and still I am looking to an answer.
>
> We wish to have a class running on Tomcat that contains system wide 
> info and multiple database connections into DB2 on the mainframe.
> All other apps runing on Tomcat will open an instance of this class to 
> access the static info and one of five open connections.  Opening and 
> closing database connections is very slow and we wish to leave open 
> the connections and just reuse them as needed.
>
> We wrote the class and it runs ok.  Yet to get it to run with an app, 
> we need to load the class jar file into the app and references in 
> context.xml and web.xml as listed in the documentation. But that 
> defeats the purpose of the global app because then there are multiple 
> instances of the class.
>
> We tried to insert a reference in <GlobalNamingResources> of server.xml.
> It doesn't seem to work for us.
>
> Or are we off base with this design?  Is app to app communication 
> allowed?  Can I call a class from one app to another without first 
> loading the called class into the calling class?
>
>(...)

The first thing you need to consider in your scenario is behaviour of classloaders.
This is documented here:

http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html

One caveat is that, for the reasons documented there, when you put some class into the Common classloader,  you must remove it from your webapp.

Other caveat is that such global objects should not retain references to objects loaded by your web application or to its classloader (which is Thread.getContextClassloader() aka TCCL).  The lifecycle of a webapplication is shorter than the one of Tomcat. A failure to prevent such references will prevent proper garbage collection of web application classes when the application is stopped.


As for GlobalNamingResources,  there are several ways to pass a reference to a global object into the web application.  Using JNDI (via GlobalNamingResources or directly) is one of them.

Best regards,
Konstantin Kolinko

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


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


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


RE: Wish to use an independent class module in Tomcat

Posted by "Cotton, Joseph B" <bc...@dpscs.state.md.us>.
Thanks, Konstantine, Cris and Mark.  I will be reading the docs.  
"... global objects should not retain references to objects loaded by your web application..."  We intend on only doing it the opposite direction, that is, loading global objects into web apps.  That is the whole point, we want some global objects to live on, after the web app is gone. 
"... allow each app to have one open..." - yes, and we have a load balancer/round robbin method of assigning one connection to one session.  It is very fast, obtain connection (which is already alive), query, get result set, release connection (back to the pool).  
Thanks for the pointers, I will be checking the class loader docs.  So far, I have used class loader for database connections.  
Thanks
joe

-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
Sent: Tuesday, June 26, 2012 12:16 PM
To: Tomcat Users List
Subject: Re: Wish to use an independent class module in Tomcat

2012/6/26 Cotton, Joseph B <bc...@dpscs.state.md.us>:
> My question may be covered by the Tomcat documentation and I am just 
> confused by all the new terminology.  I have spent hours in reading 
> and still I am looking to an answer.
>
> We wish to have a class running on Tomcat that contains system wide 
> info and multiple database connections into DB2 on the mainframe.   
> All other apps runing on Tomcat will open an instance of this class to 
> access the static info and one of five open connections.  Opening and 
> closing database connections is very slow and we wish to leave open 
> the connections and just reuse them as needed.
>
> We wrote the class and it runs ok.  Yet to get it to run with an app, 
> we need to load the class jar file into the app and references in 
> context.xml and web.xml as listed in the documentation. But that 
> defeats the purpose of the global app because then there are multiple 
> instances of the class.
>
> We tried to insert a reference in <GlobalNamingResources> of server.xml.
> It doesn't seem to work for us.
>
> Or are we off base with this design?  Is app to app communication 
> allowed?  Can I call a class from one app to another without first 
> loading the called class into the calling class?
>
>(...)

The first thing you need to consider in your scenario is behaviour of classloaders.
This is documented here:

http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html

One caveat is that, for the reasons documented there, when you put some class into the Common classloader,  you must remove it from your webapp.

Other caveat is that such global objects should not retain references to objects loaded by your web application or to its classloader (which is Thread.getContextClassloader() aka TCCL).  The lifecycle of a webapplication is shorter than the one of Tomcat. A failure to prevent such references will prevent proper garbage collection of web application classes when the application is stopped.


As for GlobalNamingResources,  there are several ways to pass a reference to a global object into the web application.  Using JNDI (via GlobalNamingResources or directly) is one of them.

Best regards,
Konstantin Kolinko

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


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


Re: Wish to use an independent class module in Tomcat

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/6/26 Cotton, Joseph B <bc...@dpscs.state.md.us>:
> My question may be covered by the Tomcat documentation and I am just
> confused by all the new terminology.  I have spent hours in reading and
> still I am looking to an answer.
>
> We wish to have a class running on Tomcat that contains system wide info
> and multiple database connections into DB2 on the mainframe.   All other
> apps runing on Tomcat will open an instance of this class to access the
> static info and one of five open connections.  Opening and closing
> database connections is very slow and we wish to leave open the
> connections and just reuse them as needed.
>
> We wrote the class and it runs ok.  Yet to get it to run with an app, we
> need to load the class jar file into the app and references in
> context.xml and web.xml as listed in the documentation. But that defeats
> the purpose of the global app because then there are multiple instances
> of the class.
>
> We tried to insert a reference in <GlobalNamingResources> of server.xml.
> It doesn't seem to work for us.
>
> Or are we off base with this design?  Is app to app communication
> allowed?  Can I call a class from one app to another without first
> loading the called class into the calling class?
>
>(...)

The first thing you need to consider in your scenario is behaviour of
classloaders.
This is documented here:

http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html

One caveat is that, for the reasons documented there, when you put
some class into the Common classloader,  you must remove it from your
webapp.

Other caveat is that such global objects should not retain references
to objects loaded by your web application or to its classloader (which
is Thread.getContextClassloader() aka TCCL).  The lifecycle of a
webapplication is shorter than the one of Tomcat. A failure to prevent
such references will prevent proper garbage collection of web
application classes when the application is stopped.


As for GlobalNamingResources,  there are several ways to pass a
reference to a global object into the web application.  Using JNDI
(via GlobalNamingResources or directly) is one of them.

Best regards,
Konstantin Kolinko

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


Re: Wish to use an independent class module in Tomcat

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
  On 1:59 PM, Cotton, Joseph B wrote:
> My question may be covered by the Tomcat documentation and I am just
> confused by all the new terminology.  I have spent hours in reading and
> still I am looking to an answer.
>
> We wish to have a class running on Tomcat that contains system wide info
> and multiple database connections into DB2 on the mainframe.   All other
> apps runing on Tomcat will open an instance of this class to access the
> static info and one of five open connections.  Opening and closing
> database connections is very slow and we wish to leave open the
> connections and just reuse them as needed.
>
> We wrote the class and it runs ok.  Yet to get it to run with an app, we
> need to load the class jar file into the app and references in
> context.xml and web.xml as listed in the documentation. But that defeats
> the purpose of the global app because then there are multiple instances
> of the class.
>
> We tried to insert a reference in<GlobalNamingResources>  of server.xml.
> It doesn't seem to work for us.
>
> Or are we off base with this design?  Is app to app communication
> allowed?  Can I call a class from one app to another without first
> loading the called class into the calling class?
>
> I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23
> (build 1.6.0_23-b05).  Java 7 is not an option in our shop yet because
> we are supporting a commercial package that breaks when run under Java
> 7.
>
> I would appreciate if the group could point me to the correct
> documentation to do what we are looking for, and perhaps a translation
> of the Tomcat specific terminology and jargon.
>
> Thanks
>
> Joe

Hi, Joe-

You might consider placing your connection manager in the Tomcat lib 
directory and implementing it a singleton.

-Terence Bandoian

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


RE: Project will not build

Posted by Tim Watts <ti...@cliftonfarm.org>.
On Tue, 2012-07-24 at 16:00 -0400, Cotton, Joseph B wrote:
> Actually, no.  But a little more poking around fixed it. 

Glad you worked it out.

> By the way, is there any really good reference for Tomcat?  I have
> three O'reiley books and they don’t seem to help much. I can read the
> How-To pages all day and nothing seems to stick.  I am looking for
> somehting that decribes what happens when .... And what  each of the
> xml files are for.  Is there a component list?  
> 

Well, as far as an actual *Reference* it's hard to get more
authoritative than the online docs.  Based on some of the traffic here,
there seem to be a number of dubious "tutorials" floating around the
'net but I'm sure there are quality ones as well.  Perhaps you would
find the wiki helpful:

http://wiki.apache.org/tomcat/FrontPage

It has a link for suggested books although some look pretty outdated.

HTH


> -----Original Message-----
> From: Tim Watts [mailto:tim@cliftonfarm.org] 
> Sent: Tuesday, July 24, 2012 3:36 PM
> To: Tomcat Users List
> Subject: Re: Project will not build
> 
> <hint> Are you asking here because you got no answers on the NetBeans list?  Nor the Ant list? </hint>
> 
> 
> On Tue, 2012-07-24 at 15:11 -0400, Cotton, Joseph B wrote:
> > This question concerns a Project that used to work nicely.  Now it 
> > will not build.
> > I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22 I left this 
> > project alone for a few months.
> > 
> > Now when I come back and try to build or run, it errors with this
> > message:
> > Copying 1 file to D:\Documents and Settings\cottonjb\My 
> > Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> > D:\Documents and Settings\cottonjb\My
> > Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> > Could not find file D:\Documents and Settings\cottonjb\My 
> > Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to 
> > copy.
> > BUILD FAILED (total time: 0 seconds)
> > 
> > It refers to this in build-impl.xml:
> >     <target depends="init" name="library-inclusion-in-archive"
> > unless="dist.ear.dir">
> >         <copyfiles files="${file.reference.winzipaes-20100321.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles files="${file.reference.jstl-1.2.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles files="${libs.JSP121.classpath}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >     </target>
> > 
> > 
> > I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to 
> > the NetBeans library and the Project library.
> > 
> > The winzip jar is found.  The jsp jars are not found.  Am I reading 
> > this correctly?
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


RE: Project will not build

Posted by "Cotton, Joseph B" <bc...@dpscs.state.md.us>.
Actually, no.  But a little more poking around fixed it. 
By the way, is there any really good reference for Tomcat?  I have three O'reiley books and they don’t seem to help much. I can read the How-To pages all day and nothing seems to stick.  I am looking for somehting that decribes what happens when .... And what  each of the xml files are for.  Is there a component list?  

-----Original Message-----
From: Tim Watts [mailto:tim@cliftonfarm.org] 
Sent: Tuesday, July 24, 2012 3:36 PM
To: Tomcat Users List
Subject: Re: Project will not build

<hint> Are you asking here because you got no answers on the NetBeans list?  Nor the Ant list? </hint>


On Tue, 2012-07-24 at 15:11 -0400, Cotton, Joseph B wrote:
> This question concerns a Project that used to work nicely.  Now it 
> will not build.
> I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22 I left this 
> project alone for a few months.
> 
> Now when I come back and try to build or run, it errors with this
> message:
> Copying 1 file to D:\Documents and Settings\cottonjb\My 
> Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> D:\Documents and Settings\cottonjb\My
> Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> Could not find file D:\Documents and Settings\cottonjb\My 
> Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to 
> copy.
> BUILD FAILED (total time: 0 seconds)
> 
> It refers to this in build-impl.xml:
>     <target depends="init" name="library-inclusion-in-archive"
> unless="dist.ear.dir">
>         <copyfiles files="${file.reference.winzipaes-20100321.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles files="${file.reference.jstl-1.2.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles files="${libs.JSP121.classpath}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>     </target>
> 
> 
> I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to 
> the NetBeans library and the Project library.
> 
> The winzip jar is found.  The jsp jars are not found.  Am I reading 
> this correctly?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


Re: Project will not build

Posted by Tim Watts <ti...@cliftonfarm.org>.
<hint> Are you asking here because you got no answers on the NetBeans
list?  Nor the Ant list? </hint>


On Tue, 2012-07-24 at 15:11 -0400, Cotton, Joseph B wrote:
> This question concerns a Project that used to work nicely.  Now it will
> not build.  
> I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22
> I left this project alone for a few months.  
> 
> Now when I come back and try to build or run, it errors with this
> message:
> Copying 1 file to D:\Documents and Settings\cottonjb\My
> Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> D:\Documents and Settings\cottonjb\My
> Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> Could not find file D:\Documents and Settings\cottonjb\My
> Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to
> copy.
> BUILD FAILED (total time: 0 seconds)
> 
> It refers to this in build-impl.xml:
>     <target depends="init" name="library-inclusion-in-archive"
> unless="dist.ear.dir">
>         <copyfiles files="${file.reference.winzipaes-20100321.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles files="${file.reference.jstl-1.2.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles files="${libs.JSP121.classpath}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>     </target>
> 
> 
> I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to the
> NetBeans library and the Project library. 
> 
> The winzip jar is found.  The jsp jars are not found.  Am I reading this
> correctly?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


Re: Project will not build

Posted by Mark Eggers <it...@yahoo.com>.
----- Original Message -----

> From: "Caldarale, Charles R" <Ch...@unisys.com>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Cc: 
> Sent: Tuesday, July 24, 2012 6:05 PM
> Subject: RE: Project will not build
> 
>>  From: Cotton, Joseph B [mailto:bcotton@dpscs.state.md.us] 
>>  Subject: RE: Project will not build
> 
>>  Isnt /WEB-INF/lib a Tomcat folder?
> 
> Not really.  It's usage is defined in the servlet spec; the Tomcat doc 
> avoids duplicating information from the spec, since that's required reading 
> before embarking on a servlet project.
> 
>>  Which leads to my other question, if I make a backup of the folders, 
>>  why didn't just copying the the folders back in  fix it?  There seems
>>  to be multiple places to configure...
> 
> Again, you're asking NetBeans questions, not Tomcat ones.  The IDEs often 
> have ideas of their own about how to set up and configure a project, to the 
> point that some of them completely ignore and override the configuration in the 
> Tomcat .xml files.
> 
> - Chuck


In my experience, NetBeans is really good about not doing the wrong thing.

1. You define a dependency in your project on the server you've registered with the IDE

NetBeans will then add all of the jars found in CATALINA_BASE. This includes not only the standard jars, but things like JDBC drivers that you've added in there.

2. Do NOT make a WEB-INF/lib in your project

NetBeans will create that in the war file. If you need to add third party jars in your project, put them somewhere else and add the jars in Project->Properties->Libraries.

Better yet, use Ivy or Maven . . . . NetBeans supports both.

You can also add libraries / jars solely for testing, as well as adding them solely for compilation (but not packaging in the war file).

3. Netbeans offers lots of standard jars as packages (the standards.jar and taglibs.jar is one)

Use those instead of copying your own around.

4. NetBeans uses startup.bat / startup.sh

This means it behaves and uses setenv.bat / setenv.bat if found. Basically it's just like running Tomcat from the batch files / shell files.

In short, I've found that NetBeans is quite amenable to running stock Tomcat installations. I just untar or unzip a distribution, add the appropriate manager roles and user names (NetBeans will complain if you do not), edit setenv.[bat/sh] to generate JMX, and register it with NetBeans.

Log files end up where you expect, with the exception of catalina.out / catalina.[date].out, which is scrolled in two separate output windows.

. . . . just my two cents.
/mde/

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


RE: Project will not build

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Cotton, Joseph B [mailto:bcotton@dpscs.state.md.us] 
> Subject: RE: Project will not build

> Isnt /WEB-INF/lib a Tomcat folder?

Not really.  It's usage is defined in the servlet spec; the Tomcat doc avoids duplicating information from the spec, since that's required reading before embarking on a servlet project.

> Which leads to my other question, if I make a backup of the folders, 
> why didn't just copying the the folders back in  fix it?  There seems
> to be multiple places to configure...

Again, you're asking NetBeans questions, not Tomcat ones.  The IDEs often have ideas of their own about how to set up and configure a project, to the point that some of them completely ignore and override the configuration in the Tomcat .xml files.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


RE: Project will not build

Posted by "Cotton, Joseph B" <bc...@dpscs.state.md.us>.
Thanks all - it is building now.  

Here is what I did:
Right click on the project
Select Properties
Select Libraries
Select compile tab
Removed the libraries that could not be found
Added the library to be found
OK

Question for the Tomcat list:  Isnt /WEB-INF/lib a Tomcat folder?  It is refered to in the Tomcat documentation, right? (confused look)

My question for the NetBeans list would be why didn’t it find my libraries after I added the libraries to the project under the Libraries folder?  But as Tim hinted, this question is off topic here.

Unfortunately, in my haste, I restored the code from a backup, which now needs to be updated...

Which leads to my other question, if I make a backup of the folders, why didn't just copying the the folders back in  fix it?  There seems to be multiple places to configure...

Thanks and regards
Joe


-----Original Message-----
From: Tim Watts [mailto:tim@cliftonfarm.org] 
Sent: Tuesday, July 24, 2012 4:04 PM
To: Tomcat Users List
Subject: RE: Project will not build

On Tue, 2012-07-24 at 15:46 -0400, Martin Gainty wrote:
> http://grepcode.com/snapshot/repo1.maven.org/maven2/javax.servlet.jsp.
> jstl/javax.servlet.jsp.jstl-api/1.2.1
> 
> This is what youre looking for ..if the ant guy is looking the other 
> way you can easily integrate this depdency with maven3 and insert this 
> dependency into your depdendency list:
> <dependencies>
>  <dependency>
>   <groupId>javax.servlet.jsp.jstl</groupId>
>   <artifactId>javax.servlet.jsp.jstl-api</artifactId>
>   <version>1.2.1</version>
>  </dependency>
> ...........................other dependencies..................
> </dependencies>
> 
1. I don't think he's using Maven.

> if the ant guy is on top of you or has sufficient power to stop the 
> project then copy the jar from the liunk above to the location pointed 
> by ${file.reference.winzipaes-20100321.jar}

2. Red Herring.  That could be an entirely different location.

> (you should see the exact location from the reference of 
> file.reference.winzipaes-20100321.jar located somewhere at the top of 
> the build.xml) then rerun the ant script and make sure the init target 
> is executed e.g.
> ant init
> 
> Martin Gainty
> ______________________________________________
> "I know a little about Orson's childhood and seriously doubt if he 
> ever was a child..." - Joseph Cotton
> 
3. That's Joseph Cotten

> 
> > Subject: Project will not build
> > Date: Tue, 24 Jul 2012 15:11:40 -0400
> > From: bcotton@dpscs.state.md.us
> > To: users@tomcat.apache.org
> > 
> > This question concerns a Project that used to work nicely.  Now it 
> > will not build.
> > I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22 I left this 
> > project alone for a few months.
> > 
> > Now when I come back and try to build or run, it errors with this
> > message:
> > Copying 1 file to D:\Documents and Settings\cottonjb\My 
> > Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> > D:\Documents and Settings\cottonjb\My
> > Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> > Could not find file D:\Documents and Settings\cottonjb\My 
> > Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to 
> > copy.
> > BUILD FAILED (total time: 0 seconds)
> > 
> > It refers to this in build-impl.xml:
> >     <target depends="init" name="library-inclusion-in-archive"
> > unless="dist.ear.dir">
> >         <copyfiles files="${file.reference.winzipaes-20100321.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles files="${file.reference.jstl-1.2.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles files="${libs.JSP121.classpath}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >     </target>
> > 
> > 
> > I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to 
> > the NetBeans library and the Project library.
> > 
> > The winzip jar is found.  The jsp jars are not found.  Am I reading 
> > this correctly?
> > 
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
>  		 	   		  


RE: Project will not build

Posted by Tim Watts <ti...@cliftonfarm.org>.
On Tue, 2012-07-24 at 15:46 -0400, Martin Gainty wrote:
> http://grepcode.com/snapshot/repo1.maven.org/maven2/javax.servlet.jsp.jstl/javax.servlet.jsp.jstl-api/1.2.1
> 
> This is what youre looking for ..if the ant guy is looking the other
> way you can easily integrate this depdency with maven3 and insert this
> dependency into your depdendency list:
> <dependencies>
>  <dependency>
>   <groupId>javax.servlet.jsp.jstl</groupId>
>   <artifactId>javax.servlet.jsp.jstl-api</artifactId>
>   <version>1.2.1</version>
>  </dependency>
> ...........................other dependencies..................
> </dependencies>
> 
1. I don't think he's using Maven.

> if the ant guy is on top of you or has sufficient power to stop the
> project then copy the jar from the liunk above to the location pointed
> by 
> ${file.reference.winzipaes-20100321.jar} 

2. Red Herring.  That could be an entirely different location.

> (you should see the exact location from the reference of
> file.reference.winzipaes-20100321.jar located somewhere at the top of
> the build.xml)
> then rerun the ant script and make sure the init target is executed
> e.g.
> ant init
> 
> Martin Gainty 
> ______________________________________________ 
> "I know a little about Orson's childhood and seriously doubt if he
> ever was a child..." - Joseph Cotton
> 
3. That's Joseph Cotten

> 
> > Subject: Project will not build
> > Date: Tue, 24 Jul 2012 15:11:40 -0400
> > From: bcotton@dpscs.state.md.us
> > To: users@tomcat.apache.org
> > 
> > This question concerns a Project that used to work nicely.  Now it will
> > not build.  
> > I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22
> > I left this project alone for a few months.  
> > 
> > Now when I come back and try to build or run, it errors with this
> > message:
> > Copying 1 file to D:\Documents and Settings\cottonjb\My
> > Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> > D:\Documents and Settings\cottonjb\My
> > Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> > Could not find file D:\Documents and Settings\cottonjb\My
> > Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to
> > copy.
> > BUILD FAILED (total time: 0 seconds)
> > 
> > It refers to this in build-impl.xml:
> >     <target depends="init" name="library-inclusion-in-archive"
> > unless="dist.ear.dir">
> >         <copyfiles files="${file.reference.winzipaes-20100321.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles
> > files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles files="${file.reference.jstl-1.2.jar}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >         <copyfiles files="${libs.JSP121.classpath}"
> > todir="${build.web.dir}/WEB-INF/lib"/>
> >     </target>
> > 
> > 
> > I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to the
> > NetBeans library and the Project library. 
> > 
> > The winzip jar is found.  The jsp jars are not found.  Am I reading this
> > correctly?
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
>  		 	   		  


RE: Project will not build

Posted by Martin Gainty <mg...@hotmail.com>.
http://grepcode.com/snapshot/repo1.maven.org/maven2/javax.servlet.jsp.jstl/javax.servlet.jsp.jstl-api/1.2.1

This is what youre looking for ..if the ant guy is looking the other way you can easily integrate this depdency with maven3 and insert this dependency into your depdendency list:
<dependencies>
 <dependency>
  <groupId>javax.servlet.jsp.jstl</groupId>
  <artifactId>javax.servlet.jsp.jstl-api</artifactId>
  <version>1.2.1</version>
 </dependency>
...........................other dependencies..................
</dependencies>

if the ant guy is on top of you or has sufficient power to stop the project then copy the jar from the liunk above to the location pointed by 
${file.reference.winzipaes-20100321.jar} 
(you should see the exact location from the reference of file.reference.winzipaes-20100321.jar located somewhere at the top of the build.xml)
then rerun the ant script and make sure the init target is executed e.g.
ant init

Martin Gainty 
______________________________________________ 
"I know a little about Orson's childhood and seriously doubt if he ever was a child..." - Joseph Cotton


> Subject: Project will not build
> Date: Tue, 24 Jul 2012 15:11:40 -0400
> From: bcotton@dpscs.state.md.us
> To: users@tomcat.apache.org
> 
> This question concerns a Project that used to work nicely.  Now it will
> not build.  
> I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22
> I left this project alone for a few months.  
> 
> Now when I come back and try to build or run, it errors with this
> message:
> Copying 1 file to D:\Documents and Settings\cottonjb\My
> Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
> D:\Documents and Settings\cottonjb\My
> Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
> Could not find file D:\Documents and Settings\cottonjb\My
> Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to
> copy.
> BUILD FAILED (total time: 0 seconds)
> 
> It refers to this in build-impl.xml:
>     <target depends="init" name="library-inclusion-in-archive"
> unless="dist.ear.dir">
>         <copyfiles files="${file.reference.winzipaes-20100321.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles
> files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles files="${file.reference.jstl-1.2.jar}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>         <copyfiles files="${libs.JSP121.classpath}"
> todir="${build.web.dir}/WEB-INF/lib"/>
>     </target>
> 
> 
> I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to the
> NetBeans library and the Project library. 
> 
> The winzip jar is found.  The jsp jars are not found.  Am I reading this
> correctly?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Project will not build

Posted by "Cotton, Joseph B" <bc...@dpscs.state.md.us>.
This question concerns a Project that used to work nicely.  Now it will
not build.  
I am using NetBeans IDE 7.1.1 with Apache Tomcat 7.0.22
I left this project alone for a few months.  

Now when I come back and try to build or run, it errors with this
message:
Copying 1 file to D:\Documents and Settings\cottonjb\My
Documents\NetBeansProjects\MAFSS2\build\web\WEB-INF\lib
D:\Documents and Settings\cottonjb\My
Documents\NetBeansProjects\MAFSS2\nbproject\build-impl.xml:687: Warning:
Could not find file D:\Documents and Settings\cottonjb\My
Documents\Downloads\javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to
copy.
BUILD FAILED (total time: 0 seconds)

It refers to this in build-impl.xml:
    <target depends="init" name="library-inclusion-in-archive"
unless="dist.ear.dir">
        <copyfiles files="${file.reference.winzipaes-20100321.jar}"
todir="${build.web.dir}/WEB-INF/lib"/>
        <copyfiles
files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar}"
todir="${build.web.dir}/WEB-INF/lib"/>
        <copyfiles
files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1-sources.jar}"
todir="${build.web.dir}/WEB-INF/lib"/>
        <copyfiles
files="${file.reference.javax.servlet.jsp.jstl-api-1.2.1.jar}"
todir="${build.web.dir}/WEB-INF/lib"/>
        <copyfiles files="${file.reference.jstl-1.2.jar}"
todir="${build.web.dir}/WEB-INF/lib"/>
        <copyfiles files="${libs.JSP121.classpath}"
todir="${build.web.dir}/WEB-INF/lib"/>
    </target>


I manually added the javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar to the
NetBeans library and the Project library. 

The winzip jar is found.  The jsp jars are not found.  Am I reading this
correctly?

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


RE: Wish to use an independent class module in Tomcat

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
  On 1:59 PM, Cotton, Joseph B wrote:
> A link to the Tomcat documentation:
>
> http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html#Shared_Li
> brary_Files
>
> -Terence Bandoian
>
>
> Thanks, Terence. Now I have a related question...
> This is perhaps more a Java question than a Tomcat question.  I have
> copied a jar file into the shared library of Tomcat.  But now, if I want
> to use a class (from the jar file in the Tomcat share lib) in my app, I
> get a compile error (class not found) unless I also copy the jar into my
> app library.  Is there any way to not have to copy the jar to my app
> library and still be able to use in my app the class from the Tomcat
> shared library?
> I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23
> (build 1.6.0_23-b05).
> Thanks
> Joe

Hi, Joe-

You have to ensure your jar file is included in the compile class path.  
Someone else on the list may be able to tell you how to do that in 
NetBeans.  Also, your JAR should not be placed in both the Tomcat lib 
directory and your web app's lib directory.

-Terence Bandoian


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


RE: Wish to use an independent class module in Tomcat

Posted by "Cotton, Joseph B" <bc...@dpscs.state.md.us>.
A link to the Tomcat documentation:

http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html#Shared_Li
brary_Files

-Terence Bandoian


Thanks, Terence. Now I have a related question...
This is perhaps more a Java question than a Tomcat question.  I have
copied a jar file into the shared library of Tomcat.  But now, if I want
to use a class (from the jar file in the Tomcat share lib) in my app, I
get a compile error (class not found) unless I also copy the jar into my
app library.  Is there any way to not have to copy the jar to my app
library and still be able to use in my app the class from the Tomcat
shared library?
I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23
(build 1.6.0_23-b05).
Thanks
Joe 

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


Re: Wish to use an independent class module in Tomcat

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
  On 1:59 PM, Cotton, Joseph B wrote:
> My question may be covered by the Tomcat documentation and I am just
> confused by all the new terminology.  I have spent hours in reading and
> still I am looking to an answer.
>
> We wish to have a class running on Tomcat that contains system wide info
> and multiple database connections into DB2 on the mainframe.   All other
> apps runing on Tomcat will open an instance of this class to access the
> static info and one of five open connections.  Opening and closing
> database connections is very slow and we wish to leave open the
> connections and just reuse them as needed.
>
> We wrote the class and it runs ok.  Yet to get it to run with an app, we
> need to load the class jar file into the app and references in
> context.xml and web.xml as listed in the documentation. But that defeats
> the purpose of the global app because then there are multiple instances
> of the class.
>
> We tried to insert a reference in<GlobalNamingResources>  of server.xml.
> It doesn't seem to work for us.
>
> Or are we off base with this design?  Is app to app communication
> allowed?  Can I call a class from one app to another without first
> loading the called class into the calling class?
>
> I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23
> (build 1.6.0_23-b05).  Java 7 is not an option in our shop yet because
> we are supporting a commercial package that breaks when run under Java
> 7.
>
> I would appreciate if the group could point me to the correct
> documentation to do what we are looking for, and perhaps a translation
> of the Tomcat specific terminology and jargon.
>
> Thanks
>
> Joe

A link to the Tomcat documentation:

http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html#Shared_Library_Files

-Terence Bandoian


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


Re: Wish to use an independent class module in Tomcat

Posted by Mark Thomas <ma...@apache.org>.
On 26/06/2012 17:16, chris derham wrote:
> On Tue, Jun 26, 2012 at 12:46 PM, Cotton, Joseph B <
> bcotton@dpscs.state.md.us> wrote:
> 
>> I looked at the Realm documentation for a few minutes, but it appears to
>> be intended for User ID and Password verification.
>>
>> Joseph,
> 
> Ignore Martin's JDBCRealm suggestion - his responses don't seem to relate
> to your concern

Better still ignore anything Martin ever says. His answers rarely - if
ever - relate to the problem at hand.

Mark

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


Re: Wish to use an independent class module in Tomcat

Posted by chris derham <ch...@derham.me.uk>.
On Tue, Jun 26, 2012 at 12:46 PM, Cotton, Joseph B <
bcotton@dpscs.state.md.us> wrote:

> I looked at the Realm documentation for a few minutes, but it appears to
> be intended for User ID and Password verification.
>
> Joseph,

Ignore Martin's JDBCRealm suggestion - his responses don't seem to relate
to your concern

> We wish to have a class running on Tomcat that contains system wide
info
> and multiple database connections into DB2 on the mainframe.   All
other
> apps runing on Tomcat will open an instance of this class to access
> the static info and one of five open connections.  Opening and closing

> database connections is very slow and we wish to leave open the
> connections and just reuse them as needed.

Each webapp exists in isolation - they are all inside the same JVM, so in
theory you could allow them to talk to a single instance. Perhaps it would
be clearer/cleaner to have the common code in a separate JVM, and then use
some kind of RMI to communicate to it? Or perhaps you could have a
background component that performs requests that are queued to
disk/memory/database/message queue?

Perhaps a dumb  question - if the connections are slow to open, that's fine
but just allow each app to have one open and then they can co-exist and you
don't need to worry about all of this?

HTH

Chris
>
> We wrote the class and it runs ok.  Yet to get it to run with an app,
> we need to load the class jar file into the app and references in
> context.xml and web.xml as listed in the documentation. But that
> defeats the purpose of the global app because then there are multiple
> instances of the class.
>
> We tried to insert a reference in <GlobalNamingResources> of
server.xml.
> It doesn't seem to work for us.
>
> Or are we off base with this design?  Is app to app communication
> allowed?  Can I call a class from one app to another without first
> loading the called class into the calling class?
>
> I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23
> (build 1.6.0_23-b05).  Java 7 is not an option in our shop yet because

> we are supporting a commercial package that breaks when run under Java

> 7.
>
> I would appreciate if the group could point me to the correct
> documentation to do what we are looking for, and perhaps a translation

> of the Tomcat specific terminology and jargon.
>
> Thanks
>
> Joe
>
>
>


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

RE: Wish to use an independent class module in Tomcat

Posted by "Cotton, Joseph B" <bc...@dpscs.state.md.us>.
I looked at the Realm documentation for a few minutes, but it appears to
be intended for User ID and Password verification.  



-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Tuesday, June 26, 2012 11:28 AM
To: Tomcat Users List
Subject: RE: Wish to use an independent class module in Tomcat


Joe 

did you get a chance to look at implementing
JDBCRealmhttp://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#JDBCRe
alm

Martin
______________________________________________
Place longwinded disclaimer here
 > Subject: Wish to use an independent class module in Tomcat
> Date: Tue, 26 Jun 2012 11:07:33 -0400
> From: bcotton@dpscs.state.md.us
> To: users@tomcat.apache.org
> 
> My question may be covered by the Tomcat documentation and I am just 
> confused by all the new terminology.  I have spent hours in reading 
> and still I am looking to an answer.
> 
> We wish to have a class running on Tomcat that contains system wide
info
> and multiple database connections into DB2 on the mainframe.   All
other
> apps runing on Tomcat will open an instance of this class to access 
> the static info and one of five open connections.  Opening and closing

> database connections is very slow and we wish to leave open the 
> connections and just reuse them as needed.
> 
> We wrote the class and it runs ok.  Yet to get it to run with an app, 
> we need to load the class jar file into the app and references in 
> context.xml and web.xml as listed in the documentation. But that 
> defeats the purpose of the global app because then there are multiple 
> instances of the class.
> 
> We tried to insert a reference in <GlobalNamingResources> of
server.xml.
> It doesn't seem to work for us.
> 
> Or are we off base with this design?  Is app to app communication 
> allowed?  Can I call a class from one app to another without first 
> loading the called class into the calling class?
> 
> I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23 
> (build 1.6.0_23-b05).  Java 7 is not an option in our shop yet because

> we are supporting a commercial package that breaks when run under Java

> 7.
> 
> I would appreciate if the group could point me to the correct 
> documentation to do what we are looking for, and perhaps a translation

> of the Tomcat specific terminology and jargon.
> 
> Thanks
> 
> Joe
> 
>  
> 
 		 	   		  

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


RE: Wish to use an independent class module in Tomcat

Posted by Martin Gainty <mg...@hotmail.com>.
Joe 

did you get a chance to look at implementing JDBCRealmhttp://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#JDBCRealm

Martin 
______________________________________________ 
Place longwinded disclaimer here
 > Subject: Wish to use an independent class module in Tomcat
> Date: Tue, 26 Jun 2012 11:07:33 -0400
> From: bcotton@dpscs.state.md.us
> To: users@tomcat.apache.org
> 
> My question may be covered by the Tomcat documentation and I am just
> confused by all the new terminology.  I have spent hours in reading and
> still I am looking to an answer. 
> 
> We wish to have a class running on Tomcat that contains system wide info
> and multiple database connections into DB2 on the mainframe.   All other
> apps runing on Tomcat will open an instance of this class to access the
> static info and one of five open connections.  Opening and closing
> database connections is very slow and we wish to leave open the
> connections and just reuse them as needed. 
> 
> We wrote the class and it runs ok.  Yet to get it to run with an app, we
> need to load the class jar file into the app and references in
> context.xml and web.xml as listed in the documentation. But that defeats
> the purpose of the global app because then there are multiple instances
> of the class.  
> 
> We tried to insert a reference in <GlobalNamingResources> of server.xml.
> It doesn't seem to work for us.
> 
> Or are we off base with this design?  Is app to app communication
> allowed?  Can I call a class from one app to another without first
> loading the called class into the calling class?
> 
> I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23
> (build 1.6.0_23-b05).  Java 7 is not an option in our shop yet because
> we are supporting a commercial package that breaks when run under Java
> 7.
> 
> I would appreciate if the group could point me to the correct
> documentation to do what we are looking for, and perhaps a translation
> of the Tomcat specific terminology and jargon.
> 
> Thanks
> 
> Joe
> 
>  
>