Re: Is resource-ref really needed?

2009-09-03 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Robert,

On 9/2/2009 6:15 AM, Robert Whane wrote:
 The way I now understand this
 element to work is that it's some sort of hint to the container
 processing the deployment descriptor that it should go looking for a
 magical (vendor specific) mapping of the resource name declared by the
 resource-ref element to some global resource somewhere.

What it should do is only allow the webapp to access resources
referred-to in the resource-ref elements.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqgLu8ACgkQ9CaO5/Lv0PAKwQCfZ7gfoso9kF1nKvRcC9KGawWd
xJUAoId9r3rG3Mr2oh4i8BzCQxZm5zYX
=he8Y
-END PGP SIGNATURE-

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



Re: Is resource-ref really needed?

2009-09-02 Thread Robert Whane
On Wed, Sep 2, 2009 at 1:22 AM, Martin Gaintymgai...@hotmail.com wrote:

 the fellow who wrote it was writing code for at least 2 other projects
 it may have been a case of where he accomplished 75% of what was needed then
 some other task got moved to his front burner

I hear you, we've all been there a couple of times I think ;)

 still it is *unusual* that web.xml resource-ref is'nt read

I remember digging up some more of that unusual stuff in the Tomcat
source, like the null java:comp/UserTransaction that's inserted by
Tomcat into JNDI (might have some use, but the code wasn't clear about
this) and several of the Java EE injection annotations that were
handled in code but all different ones ended up doing exactly the same
thing.

Anyway, I have to say that the entire resource-ref element in web.xml
has been poorly understood and documented anyway. Just by itself the
element doesn't really do anything. The way I now understand this
element to work is that it's some sort of hint to the container
processing the deployment descriptor that it should go looking for a
magical (vendor specific) mapping of the resource name declared by the
resource-ref element to some global resource somewhere.

E.g.

web.xml
resource-ref
res-ref-namejdbc/myDs/res-ref-name

Container now goes looking for a vendor specific mapping file, that
resides within the web module (.war) or is at least directly
associated with the web module, that contains a mapping of what
jdbc/myDs should resolve to.

So, there might be a separate file myvendor.xml containing:

Resource-mapping res-ref-name=jdbc/myDs maps-to-name=java:somectx/someDS /

The effect of this line would be that java:comp/jdbc/myDs becomes a
link to java:somectx/someDS. Of course, you still have to define
java:somectx/someDS somewhere, which happens in yet another vendor
specific file, say resources.xml:

Resource name=somectx/someDS url=... etc/

To me this seems overly silly. If the myvendor.xml file is local to
the web module anyway, then the container implementation can just read
and process this directly without needing the hint in web.xml that it
should process this. In the end, all we want is an entry in JDNI. It's
interesting to note that there's an element with the same name
(resource-ref) and mostly same attributes in the EJB deployment
descriptor. Only there it does make sense, since it has this little
extra attribute that the web version lacks: mappedName. mappedName
does exactly what this intermediate mapping file in the web container
does; linking a local JDNI name to a global JNDI name.

The entire idea of declaring a dependency, which the vendor should
then magically resolve to a specific intermediate mapping file is just
vague and confusing. Maybe I misunderstood, but I think I have spent
more time in trying to understand this element than the average
programmer does, so I wonder whether this average programmer has any
idea of the exact use of this element.

As in EJB3, resource-ref should be truly optional; if you want your
code to use the global names, don't use it. If you want an extra
indirection mechanism for the JNDI names, use it. If you use it, let
the mapping of local to global names be specified directly in the
resource-ref element and don't require some awkward vendor specific
mapping file.

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



Re: Is resource-ref really needed?

2009-09-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Robert,

On 8/31/2009 6:19 PM, Robert Whane wrote:
 Okay, it's optional, so I don't HAVE to use, but if I DO use it, what
 possible advantage does it have?

Adherence to the Servlet Specification?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqdQLAACgkQ9CaO5/Lv0PBPPwCdEa4oLk+mOOpbhDUS6h+/L+EI
sT8An0PJastgfArpxoqTP6leVGVf/TbY
=TnHf
-END PGP SIGNATURE-

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



Re: Is resource-ref really needed?

2009-09-01 Thread Robert Whane
On Tue, Sep 1, 2009 at 5:41 PM, Christopher
Schultzch...@christopherschultz.net wrote:
On 8/31/2009 6:19 PM, Robert Whane wrote:
 Okay, it's optional, so I don't HAVE to use, but if I DO use it, what
 possible advantage does it have?

 Adherence to the Servlet Specification?

Which is what I indeed suspected what might be a possible function,
but as Martin Gainty has found in Tomcat's source, Tomcat absolutely
does not look at the resource-ref element. There's a digester rule
defined for it, but that's it. So even if you make a typo in any of
the data provided in the resource-ref element, Tomcat won't warn you
about it.

Maybe the documentation should very clearly state this, i.e.

Note: the resource-ref element is totally ignored by Tomcat. You can
provide this element to be compatible with other servlet containers
that adhere strictly to the Servlet spec(*) Also note that because
Tomcat totally and utterly ignores the element, any faulty data
provided by you won't be detected by Tomcat. In other words, your
application may run perfectly on Tomcat, but fail on this other
servlet container since the errors you made were never detected by
Tomcat.

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



Re: Is resource-ref really needed?

2009-09-01 Thread Robert Whane
On Tue, Sep 1, 2009 at 5:07 AM, Martin Gaintymgai...@hotmail.com wrote:
 both the entries ContextResource and web.xml resource-ref reference
 ContextResource

 //WebAnnotationSet.java
     protected static void addResource(Context context, Resource annotation)
 {

 //if the annotation is
 DataSource,ConnectionFactory,QueueConnectionFactory,TopicConnectionFactory,Session,URL
 // then reference ContextResource from applicationContext
  if
 (annotation.type().getCanonicalName().equals(javax.sql.DataSource) ||

 annotation.type().getCanonicalName().equals(javax.jms.ConnectionFactory)
 ||
     annotation.type().getCanonicalName()
     .equals(javax.jms.QueueConnectionFactory) ||
     annotation.type().getCanonicalName()
     .equals(javax.jms.TopicConnectionFactory) ||

 annotation.type().getCanonicalName().equals(javax.mail.Session) ||
     annotation.type().getCanonicalName().equals(java.net.URL)
 ||
     annotation.type().getCanonicalName()
     .equals(javax.resource.cci.ConnectionFactory) ||

 annotation.type().getCanonicalName().equals(org.omg.CORBA_2_3.ORB) ||

 annotation.type().getCanonicalName().endsWith(ConnectionFactory)) {

     //Construct  ContextResource from annotation input
     ContextResource resource = new ContextResource();

 /*The input annotation is used to populate the  ContextResource
 parameters */

     resource.setName(annotation.name());
     resource.setType(annotation.type().getCanonicalName());

     if (annotation.authenticationType()
     == Resource.AuthenticationType.CONTAINER) {
     resource.setAuth(Container);
     }
     else if (annotation.authenticationType()
     == Resource.AuthenticationType.APPLICATION) {
     resource.setAuth(Application);
     }
     resource.setScope(annotation.shareable() ? Shareable :
 Unshareable);
     resource.setProperty(mappedName, annotation.mappedName());
     resource.setDescription(annotation.description());

 //finally add it to ApplicationContext.xml here
     context.getNamingResources().addResource(resource);

 ///web.xml
 resource-ref///
 web.xml resource-ref is created here on config init()
 called in ContextConfiguration init()
     protected void init() {
     // Called from StandardContext.init()

     if (webDigester == null){
     webDigester = createWebDigester();
     webDigester.getParser();
     }

     if (contextDigester == null){
     contextDigester = createContextDigester();
     contextDigester.getParser();
     }

     if (log.isDebugEnabled())
     log.debug(sm.getString(contextConfig.init));
     context.setConfigured(false);
     ok = true;

     contextConfig();

     try {
     fixDocBase();
     } catch (IOException e) {
     log.error(sm.getString(contextConfig.fixDocBase), e);
     }

     }

 Digester.java calls CreateContextDigester
     /**
  * Create (if necessary) and return a Digester configured to process the
  * context configuration descriptor for an application.
  */
     protected Digester createContextDigester() {
     Digester digester = new Digester();
     digester.setValidating(false);
     RuleSet contextRuleSet = new ContextRuleSet(, false);
     digester.addRuleSet(contextRuleSet);
     RuleSet namingRuleSet = new NamingRuleSet(Context/);
     digester.addRuleSet(namingRuleSet);
     return digester;
     }

 called in Digester calls addRuleSet
     public void addRuleSet(RuleSet ruleSet) {

     String oldNamespaceURI = getRuleNamespaceURI();
     String newNamespaceURI = ruleSet.getNamespaceURI();
     if (log.isDebugEnabled()) {
     if (newNamespaceURI == null) {
     log.debug(addRuleSet() with no namespace URI);
     } else {
     log.debug(addRuleSet() with namespace URI  +
 newNamespaceURI);
     }
     }
     setRuleNamespaceURI(newNamespaceURI);
     ruleSet.addRuleInstances(this);
     setRuleNamespaceURI(oldNamespaceURI);
     }

 org.apache.catalina.startup.WebRuleSet.java
     public void addRuleInstances(Digester digester) {
 
     digester.addObjectCreate(prefix + web-app/resource-ref,

 org.apache.catalina.deploy.ContextResource);
     digester.addRule(prefix + web-app/resource-ref,
     new SetNextNamingRule(addResource,
     org.apache.catalina.deploy.ContextResource));

     digester.addCallMethod(prefix + web-app/resource-ref/description,
    setDescription, 0);
     digester.addCallMethod(prefix + web-app/resource-ref/res-auth,
 

RE: Is resource-ref really needed?

2009-09-01 Thread Martin Gainty

the fellow who wrote it was writing code for at least 2 other projects
it may have been a case of where he accomplished 75% of what was needed then
some other task got moved to his front burner

still it is *unusual* that web.xml resource-ref is'nt read
Martin Gainty 
__ 
Note de déni et de confidentialité
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Wed, 2 Sep 2009 01:11:41 +0200
 Subject: Re: Is resource-ref really needed?
 From: robert.wh...@gmail.com
 To: mgai...@hotmail.com; users@tomcat.apache.org
 
 On Tue, Sep 1, 2009 at 5:07 AM, Martin Gaintymgai...@hotmail.com wrote:
  both the entries ContextResource and web.xml resource-ref reference
  ContextResource
 
  //WebAnnotationSet.java
  protected static void addResource(Context context, Resource annotation)
  {
 
  //if the annotation is
  DataSource,ConnectionFactory,QueueConnectionFactory,TopicConnectionFactory,Session,URL
  // then reference ContextResource from applicationContext
   if
  (annotation.type().getCanonicalName().equals(javax.sql.DataSource) ||
 
  annotation.type().getCanonicalName().equals(javax.jms.ConnectionFactory)
  ||
  annotation.type().getCanonicalName()
  .equals(javax.jms.QueueConnectionFactory) ||
  annotation.type().getCanonicalName()
  .equals(javax.jms.TopicConnectionFactory) ||
 
  annotation.type().getCanonicalName().equals(javax.mail.Session) ||
  annotation.type().getCanonicalName().equals(java.net.URL)
  ||
  annotation.type().getCanonicalName()
  .equals(javax.resource.cci.ConnectionFactory) ||
 
  annotation.type().getCanonicalName().equals(org.omg.CORBA_2_3.ORB) ||
 
  annotation.type().getCanonicalName().endsWith(ConnectionFactory)) {
 
  //Construct  ContextResource from annotation input
  ContextResource resource = new ContextResource();
 
  /*The input annotation is used to populate the  ContextResource
  parameters */
 
  resource.setName(annotation.name());
  resource.setType(annotation.type().getCanonicalName());
 
  if (annotation.authenticationType()
  == Resource.AuthenticationType.CONTAINER) {
  resource.setAuth(Container);
  }
  else if (annotation.authenticationType()
  == Resource.AuthenticationType.APPLICATION) {
  resource.setAuth(Application);
  }
  resource.setScope(annotation.shareable() ? Shareable :
  Unshareable);
  resource.setProperty(mappedName, annotation.mappedName());
  resource.setDescription(annotation.description());
 
  //finally add it to ApplicationContext.xml here
  context.getNamingResources().addResource(resource);
 
  ///web.xml
  resource-ref///
  web.xml resource-ref is created here on config init()
  called in ContextConfiguration init()
  protected void init() {
  // Called from StandardContext.init()
 
  if (webDigester == null){
  webDigester = createWebDigester();
  webDigester.getParser();
  }
 
  if (contextDigester == null){
  contextDigester = createContextDigester();
  contextDigester.getParser();
  }
 
  if (log.isDebugEnabled())
  log.debug(sm.getString(contextConfig.init));
  context.setConfigured(false);
  ok = true;
 
  contextConfig();
 
  try {
  fixDocBase();
  } catch (IOException e) {
  log.error(sm.getString(contextConfig.fixDocBase), e);
  }
 
  }
 
  Digester.java calls CreateContextDigester
  /**
   * Create (if necessary) and return a Digester configured to process the
   * context configuration descriptor for an application.
   */
  protected Digester createContextDigester() {
  Digester digester = new Digester();
  digester.setValidating(false);
  RuleSet contextRuleSet = new ContextRuleSet(, false);
  digester.addRuleSet(contextRuleSet);
  RuleSet namingRuleSet = new NamingRuleSet(Context/);
  digester.addRuleSet(namingRuleSet);
  return digester;
  }
 
  called in Digester calls addRuleSet
  public void addRuleSet(RuleSet ruleSet) {
 
  String

Re: Is resource-ref really needed?

2009-08-31 Thread Robert Whane
On Mon, Aug 31, 2009 at 2:27 AM, Martin Gaintymgai...@hotmail.com wrote:
 you can enter a documentation change to correct either
 1)duplicate behaviour of ApplicationContext.xml Resource by web.xml 
 resource-ref
 2)or make the documentation a bit clearer on what is required and what is 
 optional

That's not a bad idea really, but before I feel qualified to make such
a proposal I first need to understand it myself ;)

 mgi interpret this as ContextResource parameter is mandatory

Hmmm, now you're talking. IF those attributes on ContextResource
are mandatory, then what on earth is the use of resource-ref? Does
Tomcat even look at that element? I guess so, but if resource-ref is
completely optional and contains no new information in no possible
use-cases, then you could just as well be instructed to put a file
called nobody-reads-this.txt in your root and enter those values
there in free-format, couldn't you?

There has to be some use of that resource-ref element. All the Tomcat
examples and tutorials instruct you to create this element. Someone
really badly wants you to use it, yet it seemingly has not function
whatsoever. Something just doesn't add up, or maybe it's just me...

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



Re: Is resource-ref really needed?

2009-08-31 Thread Michael Ludwig

Robert Whane schrieb:


There has to be some use of that resource-ref element. All the Tomcat
examples and tutorials instruct you to create this element. Someone
really badly wants you to use it, yet it seemingly has not function
whatsoever. Something just doesn't add up, or maybe it's just me...


It's not just you. I've also been wondering why you should need it when
obviously you don't as your Resource works without a resource-ref.

--
Michael Ludwig

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



RE: Is resource-ref really needed?

2009-08-31 Thread Martin Gainty

https://issues.apache.org/bugzilla/show_bug.cgi?id=47769

Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Mon, 31 Aug 2009 12:45:28 +0200
 From: m...@as-guides.com
 To: users@tomcat.apache.org
 Subject: Re: Is resource-ref really needed?
 
 Robert Whane schrieb:
 
  There has to be some use of that resource-ref element. All the Tomcat
  examples and tutorials instruct you to create this element. Someone
  really badly wants you to use it, yet it seemingly has not function
  whatsoever. Something just doesn't add up, or maybe it's just me...
 
 It's not just you. I've also been wondering why you should need it when
 obviously you don't as your Resource works without a resource-ref.
 
 -- 
 Michael Ludwig
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Windows Live: Make it easier for your friends to see what you’re up to on 
Facebook.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_facebook:082009

Re: Is resource-ref really needed?

2009-08-31 Thread Robert Whane
On Mon, Aug 31, 2009 at 1:50 PM, Martin Gaintymgai...@hotmail.com wrote:

 https://issues.apache.org/bugzilla/show_bug.cgi?id=47769

That's a very good start. Thanks!

There is however still one vital piece of information missing in the
proposed documentation update. It now clearly states that resource-ref
in the web.xml deployment descriptor is optional, but it still doesn't
explain what exactly it is that using resource-ref buys me.

Okay, it's optional, so I don't HAVE to use, but if I DO use it, what
possible advantage does it have?

Don't get me wrong, I'm not trying to be clever, just honestly
wondering about this. But consider the following analogy. Putting a
file called 'nobody-reads-this.txt' in your root directory is
obviously optional too. I mean, you -can- put this file there, but if
you do that nothing happens. It's a filename I just made up and of
course Tomcat doesn't know about it. To me, using resource-ref feels
exactly like this. You -can- put this in your web.xml, but as far as I
can see nothing changes.

Now, maybe, just maybe, it has something to do with compatibility with
other servlet containers? I have tried war archives with Jboss, and at
least on Jboss resource-ref isn't needed either. DataSources appear in
the java: JNDI space, just as in Tomcat. Only the exact location is
different, but resource-ref does not seem capable of doing any name
aliasing and thus can't be used for that purpose either.

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



Is resource-ref really needed?

2009-08-30 Thread Robert Whane
Hi,
I'm using Tomcat 6.20 and have configured a datasource in
META-INF/context.xml, which looks basically like this:

?xml version=1.0?
Context reloadable=false
   Resource
  name=jdbc/mydb
  factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
  type=javax.sql.DataSource
  scope=Shareable
  auth=Container
   /
/Context

For brevity I have removed some attributes, but this is basically my
definition.

I can now just directly look up this DataSource using JDNI under the
java:comp/env/jdbc/mydb name. However according to
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
I need to add a resource-ref element to my web.xml. I didn't do that
and it still works. Am I missing something? What's the purpose of
resource-ref anyway?

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



RE: Is resource-ref really needed?

2009-08-30 Thread Martin Gainty

mandatory: define the attributes in ContextResource in 
applicationContext.xml 
OR
optionally define the resource attributes resource-env-ref or resource-ref 
in web.xml

http://proteinbank.vbi.vt.edu/tomcat-docs/config/context.html#Resource%20Definitions
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Mon, 31 Aug 2009 00:42:15 +0200
 Subject: Is resource-ref really needed?
 From: robert.wh...@gmail.com
 To: users@tomcat.apache.org
 
 Hi,
 I'm using Tomcat 6.20 and have configured a datasource in
 META-INF/context.xml, which looks basically like this:
 
 ?xml version=1.0?
 Context reloadable=false
Resource
   name=jdbc/mydb
   factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
   type=javax.sql.DataSource
   scope=Shareable
   auth=Container
/
 /Context
 
 For brevity I have removed some attributes, but this is basically my
 definition.
 
 I can now just directly look up this DataSource using JDNI under the
 java:comp/env/jdbc/mydb name. However according to
 http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
 I need to add a resource-ref element to my web.xml. I didn't do that
 and it still works. Am I missing something? What's the purpose of
 resource-ref anyway?
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009

Re: Is resource-ref really needed?

2009-08-30 Thread Robert Whane
Hi,

On Mon, Aug 31, 2009 at 1:12 AM, Martin Gaintymgai...@hotmail.com wrote:

 mandatory: define the attributes in ContextResource in 
 applicationContext.xml
 OR
 optionally define the resource attributes resource-env-ref or 
 resource-ref in web.xml

 http://proteinbank.vbi.vt.edu/tomcat-docs/config/context.html#Resource%20Definitions

Thanks for the reply, I was just looking at the same information here:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Resource%20Definitions

But aren't all examples uhm, a bit wrong then? Since they all define
those attributes in ContextResource in context.xml
(applicationContext.xml?) as well as in resource-ref in web.xml. But
if I understand correctly you can leave out the attributes auth,
description and type from ContextResource and put just these 3 in
resource-ref in web.xml? If you put all of those in
ContextResource in context.xml then indeed no resource-ref is
needed?

I still find this a little awkward, even 'authoritative' documentation
like this one: http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
uses both resource-ref or resource-env-ref in web.xml but uses the
attributes auth and type anyway in context.xml. Only description is
consistently only used in web.xml for all examples, but it seems a bit
silly to teach developers to create and maintain those entries in
web.xml, only for this description element that 99% of the actual code
doesn't see nor uses.

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



RE: Is resource-ref really needed?

2009-08-30 Thread Martin Gainty

you can enter a documentation change to correct either
1)duplicate behaviour of ApplicationContext.xml Resource by web.xml 
resource-ref 
2)or make the documentation a bit clearer on what is required and what is 
optional

the doc states:
You CAN declare the characteristics of the resource
to be returned for JNDI lookups of resource-ref and
resource-env-ref elements in the web application
deployment descriptor. 
mginterpreted as web.xml resource-ref is optional, resource-env-ref is 
optional

You MUST also define
the needed resource parameters as attributes of the Resource 
element, to configure the object factory to be used (if not known to Tomcat 
already), and the properties used to configure that object factory.


mgi interpret this as ContextResource parameter is mandatory

https://issues.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%206

thanks,
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Mon, 31 Aug 2009 01:36:47 +0200
 Subject: Re: Is resource-ref really needed?
 From: robert.wh...@gmail.com
 To: users@tomcat.apache.org
 
 Hi,
 
 On Mon, Aug 31, 2009 at 1:12 AM, Martin Gaintymgai...@hotmail.com wrote:
 
  mandatory: define the attributes in ContextResource in 
  applicationContext.xml
  OR
  optionally define the resource attributes resource-env-ref or 
  resource-ref in web.xml
 
  http://proteinbank.vbi.vt.edu/tomcat-docs/config/context.html#Resource%20Definitions
 
 Thanks for the reply, I was just looking at the same information here:
 http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Resource%20Definitions
 
 But aren't all examples uhm, a bit wrong then? Since they all define
 those attributes in ContextResource in context.xml
 (applicationContext.xml?) as well as in resource-ref in web.xml. But
 if I understand correctly you can leave out the attributes auth,
 description and type from ContextResource and put just these 3 in
 resource-ref in web.xml? If you put all of those in
 ContextResource in context.xml then indeed no resource-ref is
 needed?
 
 I still find this a little awkward, even 'authoritative' documentation
 like this one: 
 http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
 uses both resource-ref or resource-env-ref in web.xml but uses the
 attributes auth and type anyway in context.xml. Only description is
 consistently only used in web.xml for all examples, but it seems a bit
 silly to teach developers to create and maintain those entries in
 web.xml, only for this description element that 99% of the actual code
 doesn't see nor uses.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Get back to school stuff for them and cashback for you.
http://www.bing.com/cashback?form=MSHYCBpubl=WLHMTAGcrea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1