Bugs item #599229, was opened at 2002-08-23 13:57
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=599229&group_id=22866

Category: None
Group: v3.0 Rabbit Hole
Status: Closed
Resolution: Works For Me
Priority: 5
Submitted By: Brian Johnson (johnsbrn)
Assigned to: Nobody/Anonymous (nobody)
Summary: comp/env not available from servlet

Initial Comment:
Using JBoss 3.0.1 (Jetty)  with JDK 1.4 on Windows, the
java:comp/env resources configured in web.xml and
jboss-web.xml (or jboss-web_3_0.xml) are not available
from servlets. Name Not Bound error is returned. I have
seen several postings on the forums related to this,
but no solutions. It also appears to affect other
version of JBoss and Tomcat.

----------------------------------------------------------------------

Comment By: Andrew (mr_dronski)
Date: 2002-09-29 18:27

Message:
Logged In: YES 
user_id=565729

well, guys, i'm not shouting at u. u did a great job. but the 
problem is there, not only me encountered it, and i reeaally 
want to have a solution 4 it, coz i like jboss ;). a bug persists 
with jboss4.0 alpha either.

to get a general idea of a related problem see plz:

http://www.jboss.org/forums/thread.jsp?
forum=50&thread=22026

the problem is the same with ejb-ref, ejb-local-ref, env-entry, 
resource-ref tags in web.xml

i'll try to find some time to create a testcase for you :)

----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2002-09-29 17:48

Message:
Logged In: YES 
user_id=175228

Well Andrew, either provide a testcase that demonstrates the 
problem or illustrate why this works in our testsuite and not 
your application.

----------------------------------------------------------------------

Comment By: Andrew (mr_dronski)
Date: 2002-09-29 16:50

Message:
Logged In: YES 
user_id=565729

it's really a huge problem. if jboss doesn't fix this problem, it 
can't be called even Servlet 2.3 compliant, not talking about 
J2EE 1.3 certification.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-08-27 12:48

Message:
Logged In: NO 

Ok, I was looking at the dtd in the appendix, which is the
2.2 dtd. However, under the deployment descriptor heading,
the spec also states

For backwards compatibility of applications written to the
2.2 version of the
API, web containers are also required to support the 2.2
version of the deployment
descriptor. The 2.2 version is described in Appendix SRV.A.

"support" can be somewhat ambiguous and I supppose doesn't
necessarily mean it should run without any config changes on
the server. Since I have no idea how to configure jboss to
use a different dtd, I don't know if this is still a bug or
not. Should I open a new bug related to the spec compliance?
Thanks.

----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2002-08-27 04:23

Message:
Logged In: YES 
user_id=175228

Jetty is a 2.3 servlet container and it is enforcing the 2.3 dtd 
in the example I gave. Try it with the 2.2 dtd and the latest 3.0 
branch code and see if it downgrades its checking. Else 
open about the real issue.

<!--
The res-auth element specifies whether the web application 
code signs
on programmatically to the resource manager, or whether 
the Container
will sign on to the resource manager on behalf of the web 
application. In the
latter case, the Container uses information that is supplied 
by the
Deployer.

The value of this element must be one of the two following:

   <res-auth>Application</res-auth>
   <res-auth>Container</res-auth>

Used in: resource-ref
-->
<!ELEMENT res-auth (#PCDATA)>


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-08-27 02:47

Message:
Logged In: NO 

I don't see that error message on 3.0.1 or 3.0.2, but it
does seem to work with 3.0.2 and "Container". "CONTAINER" is
automatically generated by JBuilder 6.0. Here is the
relevant portion of the spec:

<!--
The res-auth element indicates whether the application component
code performs resource signon programmatically or whether the
container signs onto the resource based on the principle mapping
information supplied by the deployer.
Must be CONTAINER or SERVLET
-->
<!ELEMENT res-auth (#PCDATA)>

It looks to me like it should be all caps, but I think it
would probably be best to ignore case to eliminate these
types of problems.

----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2002-08-27 01:21

Message:
Logged In: YES 
user_id=175228

You res-auth tag should be Container not CONTAINER. The 
3.0.2 release prints the following error when parsing such a 
web.xml descriptor:

17:19:23,281 ERROR [JettyService] Failed to parse WEB-
INF/web.xml
org.jboss.deployment.DeploymentException: res-auth tag 
should be 'Container' or
'Application'
        at 
org.jboss.metadata.ResourceRefMetaData.importEjbJarXml
(ResourceRefMet
aData.java:112)
        at org.jboss.metadata.WebMetaData.importWebXml
(WebMetaData.java:150)
        at org.jboss.metadata.WebMetaData.importXml
(WebMetaData.java:132)
        at 
org.jboss.web.AbstractWebContainer.parseMetaData
(AbstractWebContainer
.java:874)
        at org.jboss.web.AbstractWebContainer.start
(AbstractWebContainer.java:29
8)
        at org.jboss.deployment.MainDeployer.start
(MainDeployer.java:796)
        at org.jboss.deployment.MainDeployer.start
(MainDeployer.java:788)
        at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:616)
        at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:580)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke
(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:517)
        at org.jboss.util.jmx.MBeanProxy.invoke
(MBeanProxy.java:174)
        at $Proxy4.deploy(Unknown Source)
        at 
org.jboss.deployment.scanner.URLDeploymentScanner.depl
oy(URLDeploymen
tScanner.java:427)
        at 
org.jboss.deployment.scanner.URLDeploymentScanner.scan
Directory(URLDe
ploymentScanner.java:648)
        at 
org.jboss.deployment.scanner.URLDeploymentScanner.scan
(URLDeploymentS
canner.java:499)
        at 
org.jboss.deployment.scanner.AbstractDeploymentScanner.
startService(A
bstractDeploymentScanner.java:261)
        at org.jboss.system.ServiceMBeanSupport.start
(ServiceMBeanSupport.java:1
64)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke
(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:517)
        at 
org.jboss.system.ServiceController$ServiceProxy.invoke
(ServiceControl
ler.java:967)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start
(ServiceController.java:396)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke
(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:517)
        at org.jboss.util.jmx.MBeanProxy.invoke
(MBeanProxy.java:174)
        at $Proxy3.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start
(SARDeployer.java:249)
        at org.jboss.deployment.MainDeployer.start
(MainDeployer.java:796)
        at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:616)
        at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:580)
        at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:564)
        at java.lang.reflect.Method.invoke(Native Method)
        at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke
(ReflectedMBea
nDispatcher.java:284)
        at org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:517)
        at org.jboss.system.server.ServerImpl.doStart
(ServerImpl.java:324)
        at org.jboss.system.server.ServerImpl.start
(ServerImpl.java:221)
        at org.jboss.Main.boot(Main.java:142)
        at org.jboss.Main$1.run(Main.java:375)
        at java.lang.Thread.run(Thread.java:479)

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-08-27 00:54

Message:
Logged In: NO 

Here is the code for the web.xml and jboss-web.xml
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
<web-app>
  <display-name>Test</display-name>
  <description>Test</description>
  <servlet>
    <servlet-name>Test</servlet-name>
    <servlet-class>com.test.TestServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Test</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
  <mime-mapping>
    <extension>css</extension>
    <mime-type>text/css</mime-type>
  </mime-mapping>
  <resource-ref>
    <res-ref-name>jdbc/XAOracleDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>CONTAINER</res-auth>
  </resource-ref>
  <resource-ref>
    <res-ref-name>jdbc/FirebirdDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>CONTAINER</res-auth>
  </resource-ref>
</web-app>

jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application
2.3//EN"
                          
"http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd";>
<jboss-web>
<security-domain>java:/jaas/other</security-domain>
<resource-ref>
        <res-ref-name>jdbc/XAOracleDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <jndi-name>java:/XAOracleDS</jndi-name>
</resource-ref>
<resource-ref>
        <res-ref-name>jdbc/FirebirdDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <jndi-name>java:/FirebirdDS</jndi-name>
</resource-ref>
</jboss-web>

A call to ctx.lookup("java:/XAOracleDS") works, but a call
to ctx.lookup("java:comp/env/jdbc/XAOracleDS") throws
NameNotFoundException: jdbc not bound

----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2002-08-26 23:44

Message:
Logged In: YES 
user_id=175228

Provide an example that illustrates the problem as there are 
numerous testcases in the web integration unit tests that 
demonstrate this does work.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=599229&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to