You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2006/11/22 16:48:59 UTC

DO NOT REPLY [Bug 41018] New: - Linking global resources using ResourceLink broken

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41018

           Summary: Linking global resources using ResourceLink broken
           Product: Tomcat 5
           Version: Unknown
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: major
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: n.beekman@wis.nl


It seems that including a global defined resource using ResourceLink is broken.
The link gets bound in JNDI, but retrieving it results in null being returned.

This was the case in Tomcat versions 5.5.12 and higher, I believe it is still
broken in Tomcat 6. See attached patch for a fix.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41018] - Linking global resources using ResourceLink broken

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41018


markt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




------- Additional Comments From markt@apache.org  2006-11-23 15:14 -------
ResourceLink works for me. If you have a test case (simplest possible jsp /
servlet / war + source where appropriate) that demonstrates this issue please
re-open this report and attach your test case.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41018] - Linking global resources using ResourceLink broken

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41018





------- Additional Comments From n.beekman@wis.nl  2006-11-25 06:43 -------
(In reply to comment #5)
> ResourceLink works for me. If you have a test case (simplest possible jsp /
> servlet / war + source where appropriate) that demonstrates this issue please
> re-open this report and attach your test case.

I found the problem: since Tomcat 5.5 you can use the Transaction-element
instead of the Resource-element, however this is unsupported/broken when used
inside GlobalNamingResources-element. Hence I got null as result of the lookup.
Should I file a new bug for this problem? The problem goes away when using the
old-school Resource.

You are right about the patch, it does not solve this problem, I think I changed
two things at once (applying the patch and using Resource instead of Transaction).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41018] - Linking global resources using ResourceLink broken

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41018





------- Additional Comments From markt@apache.org  2006-11-25 06:56 -------
I suggest you post to the users list to confirm that what you are trying to do
is valid and that you have indeed found a bug. If the discussion on the users
lists suggest that a bug does exist then please open a new issue.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41018] - Linking global resources using ResourceLink broken

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41018





------- Additional Comments From remm@apache.org  2006-11-22 13:51 -------
Obviously because there's no reason to set Context.OBJECT_FACTORIES, so people
don't do it, and they don't run into the unimplemented code.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41018] - Linking global resources using ResourceLink broken

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41018


remm@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |minor




------- Additional Comments From remm@apache.org  2006-11-22 08:45 -------
-1 for the patch. It's simply that Context.OBJECT_FACTORIES usage is not
supported at the moment (same for all the other reference types).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41018] - Linking global resources using ResourceLink broken

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41018





------- Additional Comments From n.beekman@wis.nl  2006-11-22 09:50 -------
(In reply to comment #2)
> -1 for the patch. It's simply that Context.OBJECT_FACTORIES usage is not
> supported at the moment (same for all the other reference types).

I think it's rather strange to program a bug in getFactoryClassName() because of
Context.OBJECT_FACTORIES being unsupported.

How about changing it into:

public String getFactoryClassName() {
  String factory = super.getFactoryClassName();
  if (factory != null) {
    return factory;
  } else {
    return DEFAULT_FACTORY;
  }
}

That would work well in case a custom factory is passed to the constructor, and
in case no factory (or null) is specified.

On a side note: I'm curious why this issue was never encountered, the
documentation contains plenty of documentation about the global resources
feature, is it not recommended some way, or is it simply because no one uses it?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41018] - Linking global resources using ResourceLink broken

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41018>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41018





------- Additional Comments From n.beekman@wis.nl  2006-11-22 07:52 -------
Created an attachment (id=19159)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19159&action=view)
Patch which fixes described problem.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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