JBoss-2.2.2/Tomcat-3.2.2 works with env-entry elements defined
in the web.xml descriptor. There does appear to be a bug in the handling
of env-entry elements with more than one intermediate context in
the env-entry-name.

There is no env-entry in jboss-web.dtd because they do not need a mapping to
an existing JNDI name.

The war ENC contents have not yet been integrated into the JNDIView of the
JNDI tree so that is why you cannot see them there.

----- Original Message -----
From: "J. King" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Joseph King" <[EMAIL PROTECTED]>; "Greg Hamel" <[EMAIL PROTECTED]>; "Tony 
Enerson" <[EMAIL PROTECTED]>; "Tony Enerson
(Office)" <[EMAIL PROTECTED]>; "Bernie Wieser (Office)" <[EMAIL PROTECTED]>; 
"Greg Hamel (Office)" <[EMAIL PROTECTED]>
Sent: Saturday, June 30, 2001 4:30 PM
Subject: RE: [JBoss-user] Possible naming bug JBoss 2.2.2 with Tomcat 3.2.2


>
> Ok. Let me explain this again because I am getting no love here.
>
> It seems to me that you cannot declare environment entries in 'web.xml' and
> have them used in JNDI by Tomcat applications (i.e. servlets, jsps, etc...).
> An environment entry in 'web.xml' looks something like this:
>
> <web-app>
> ...
> <env-entry>
> <env-entry-name>ejb/catalog/CatalogDAOClass</env-entry-name>
> <env-entry-value>com.sun....dao.CatalogDAOImpl</env-entry-value>
> <env-entry-type>java.lang.String</env-entry-type>
> <env-entry>
> ...
> </web-app>
>
> The result of this at deployment time is that your application server should
> create a JNDI entry scoped under, or local to,  a name relative to your
> resource. For example, the same environment entry in 'ejb-jar.xml' for a
> session bean produces the following output in the JNDI JMX console:
>
> ...
>
> java:comp namespace of the TheCatalog bean:
>   +- env (class: org.jnp.interfaces.NamingContext)
>   |   +- jdbc (class: org.jnp.interfaces.NamingContext)
>   |   |   +- EstoreDataSource[link -> java:/EstoreDB] (class:
> javax.naming.LinkRef)
>   |   +- ejb (class: org.jnp.interfaces.NamingContext)
>   |   |   +- catalog (class: org.jnp.interfaces.NamingContext)
>   |   |   |   +- CatalogDAOClass (class: java.lang.String)
>
> ...
>
> Something similar should normally be created for Tomcat.
>
> The result of this configuration is that one can do something portable
> inside your code like this:
>
> myInitialContext.lookup( "java:comp/env/ejb/catalog/CatalogDAOClass" );
>
> One does this because it is not portable across deployments to hard-code any
> server-wide JNDI names into your code. Therefore EJB 1.1 provides an
> environmental JNDI context that is local to each deployed EJB (one
> environment per home) and this also extends to servlet containers (or
> should). The prefix "java:comp/env" means the JNDI context local to the
> component you are trying to access.
>
> With me so far? Ok. Now the rub is that it appears JBoss2.2.2w/Tomcat3.2.2
> completely ignore environment entries in 'web.xml'. Other items like
> resource references or ejb-references must be specified in a file called
> 'jboss-web.xml'. The DTD for 'jboss-web.xml' looks like this (btw.. this DTD
> is hard to find, could someone put it in the Documentation Files link?):
>
> <?xml version='1.0' encoding='UTF-8' ?>
>
>   <!-- The JBoss specific elements used to integrate the servlet
>        web.xml elements into a JBoss deployment.
>   -->
>   <!-- The jboss-web element is the root element.
>   -->
>   <!ELEMENT jboss-web (resource-ref* , ejb-ref*)>
>
>   <!ELEMENT ejb-ref (ejb-ref-name , jndi-name)>
>
>   <!ELEMENT ejb-ref-name (#PCDATA)>
>
>   <!ELEMENT jndi-name (#PCDATA)>
>
>   <!ELEMENT resource-ref (res-ref-name , jndi-name)>
>
>   <!ELEMENT res-ref-name (#PCDATA)>
>
> Note that there is no provision for an environment entry (which would be
> something like '<!ELEMENT env-entry (env-entry-name, env-entry-value,
> env-entry-type)>'. Because environment entries are not resource references
> or ejb references you cannot kludge them into 'jboss-web.xml'. If you try,
> say, creating a resource reference in 'jboss-web.xml'to map to an
> environment entry you will be faced with two different problems:
>
> 1. Without an equivalent resource reference entry in 'web.xml' you will get
> a deployment error.
> 2. Trying to translate an environment entry into a resource reference won't
> work because they aren't the same thing.
>
> If I am correct in the above, you will have to rework applications like
> PetStore 1.1.2 to work with JBoss and not simply change a few deployment
> items.
>
> Some confirmation of this would be nice from anyone on the JBoss team
> reading this list. Any changes in this behavior in 2.4 would also be good to
> know.
>
> Thanks, very much, for your efforts. If I have the time I will rummage
> through the source code and see what I can implement on my own for JBoss
> (not Petstore).
>
> j.
>



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to